diff options
Diffstat (limited to 'src')
70 files changed, 396 insertions, 417 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index b52e9ad8f..db30af3f2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -3,7 +3,11 @@ include $(top_srcdir)/tools/flymake.mk CPPFLAGS_COMMON = \ $(EMPATHY_CFLAGS) \ $(ERROR_CFLAGS) \ - -I$(top_srcdir) \ + -I$(top_srcdir)/libempathy-gtk \ + -I$(top_srcdir)/libempathy \ + -I$(top_srcdir)/extensions \ + -I$(top_builddir)/libempathy-gtk \ + -I$(top_builddir)/libempathy \ -DG_LOG_DOMAIN=\"empathy\" \ -DBIN_DIR=\"$(bindir)\" \ $(DISABLE_DEPRECATED) \ @@ -203,14 +207,10 @@ BUILT_SOURCES = \ CLEANFILES = $(BUILT_SOURCES) -empathy-chat-resources.c: empathy-chat.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies $(srcdir)/empathy-chat.gresource.xml) - $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ \ - --sourcedir=$(srcdir) \ - --generate-source \ - $< - -empathy-chat-resources.h: empathy-chat.gresource.xml $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies $(srcdir)/empathy-chat.gresource.xml) - $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ \ - --sourcedir=$(srcdir) \ - --generate-header \ - $< +chat_resource_files: $(shell $(GLIB_COMPILE_RESOURCES) --generate-dependencies --sourcedir=$(srcdir) $(srcdir)/empathy-chat.gresource.xml) + +empathy-chat-resources.c: empathy-chat.gresource.xml $(chat_resource_files) + $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-source $< + +empathy-chat-resources.h: empathy-chat.gresource.xml $(chat_resource_files) + $(AM_V_GEN)$(GLIB_COMPILE_RESOURCES) --target=$@ --sourcedir=$(srcdir) --generate-header $< diff --git a/src/empathy-about-dialog.c b/src/empathy-about-dialog.c index 2480d7569..bd6b2f866 100644 --- a/src/empathy-about-dialog.c +++ b/src/empathy-about-dialog.c @@ -23,11 +23,10 @@ */ #include "config.h" +#include "empathy-about-dialog.h" #include <glib/gi18n.h> -#include "empathy-about-dialog.h" - #define WEB_SITE "http://live.gnome.org/Empathy" static const char *authors[] = { diff --git a/src/empathy-accounts-common.c b/src/empathy-accounts-common.c index 537b43e3d..772e6868e 100644 --- a/src/empathy-accounts-common.c +++ b/src/empathy-accounts-common.c @@ -25,14 +25,12 @@ */ #include "config.h" - -#include <libempathy-gtk/empathy-ui-utils.h> - #include "empathy-accounts-common.h" + #include "empathy-accounts-dialog.h" #define DEBUG_FLAG EMPATHY_DEBUG_ACCOUNT -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" gboolean empathy_accounts_has_non_salut_accounts (TpAccountManager *manager) diff --git a/src/empathy-accounts-common.h b/src/empathy-accounts-common.h index 39d094d22..1cb24d7dd 100644 --- a/src/empathy-accounts-common.h +++ b/src/empathy-accounts-common.h @@ -22,6 +22,10 @@ #ifndef __EMPATHY_ACCOUNTS_COMMON_H__ #define __EMPATHY_ACCOUNTS_COMMON_H__ +#include <telepathy-glib/telepathy-glib.h> + +G_BEGIN_DECLS + gboolean empathy_accounts_has_non_salut_accounts (TpAccountManager *manager); gboolean empathy_accounts_has_accounts (TpAccountManager *manager); @@ -30,4 +34,6 @@ void empathy_accounts_show_accounts_ui (TpAccountManager *manager, TpAccount *account, GApplication *app); +G_END_DECLS + #endif /* __EMPATHY_ACCOUNTS_COMMON_H__ */ diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index f0a2db9a2..27f41d37b 100644 --- a/src/empathy-accounts-dialog.c +++ b/src/empathy-accounts-dialog.c @@ -25,25 +25,23 @@ */ #include "config.h" +#include "empathy-accounts-dialog.h" #include <glib/gi18n-lib.h> -#include <libempathy/empathy-utils.h> -#include <libempathy/empathy-pkg-kit.h> - -#include <libempathy-gtk/empathy-ui-utils.h> -#include <libempathy-gtk/empathy-account-widget-sip.h> -#include <libempathy-gtk/empathy-user-info.h> -#include <libempathy-gtk/empathy-local-xmpp-assistant-widget.h> -#include <libempathy-gtk/empathy-new-account-dialog.h> - #include "empathy-accounts-common.h" -#include "empathy-accounts-dialog.h" +#include "empathy-account-widget-sip.h" #include "empathy-import-dialog.h" #include "empathy-import-utils.h" +#include "empathy-local-xmpp-assistant-widget.h" +#include "empathy-new-account-dialog.h" +#include "empathy-pkg-kit.h" +#include "empathy-ui-utils.h" +#include "empathy-user-info.h" +#include "empathy-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_ACCOUNT -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" /* Flashing delay for icons (milliseconds). */ #define FLASH_TIMEOUT 500 diff --git a/src/empathy-accounts-dialog.h b/src/empathy-accounts-dialog.h index d436fed04..070cd02e9 100644 --- a/src/empathy-accounts-dialog.h +++ b/src/empathy-accounts-dialog.h @@ -25,7 +25,6 @@ #define __EMPATHY_ACCOUNTS_DIALOG_H__ #include <gtk/gtk.h> - #include <telepathy-glib/telepathy-glib.h> G_BEGIN_DECLS diff --git a/src/empathy-accounts.c b/src/empathy-accounts.c index 90d7947e9..88923681b 100644 --- a/src/empathy-accounts.c +++ b/src/empathy-accounts.c @@ -25,6 +25,7 @@ */ #include "config.h" +#include "empathy-accounts.h" #include <glib/gi18n.h> @@ -32,13 +33,12 @@ #include <cheese-gtk.h> #endif -#include <libempathy/empathy-utils.h> -#include <libempathy-gtk/empathy-ui-utils.h> - #include "empathy-accounts-common.h" +#include "empathy-ui-utils.h" +#include "empathy-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_ACCOUNT -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" #define EMPATHY_ACCOUNTS_DBUS_NAME "org.gnome.EmpathyAccounts" @@ -136,12 +136,12 @@ out: g_application_release (app); } -static int -app_command_line_cb (GApplication *app, - GApplicationCommandLine *cmdline) +static void +app_activate (GApplication *app) { TpAccountManager *account_manager; + empathy_gtk_init (); account_manager = tp_account_manager_dup (); /* Hold the application while preparing the AM */ @@ -151,8 +151,6 @@ app_command_line_cb (GApplication *app, account_manager_ready_for_accounts_cb, app); g_object_unref (account_manager); - - return 0; } static gboolean @@ -163,7 +161,7 @@ local_cmdline (GApplication *app, gint i; gchar **argv; gint argc = 0; - gboolean retval = FALSE; + gboolean retval = TRUE; GError *error = NULL; GOptionContext *optcontext; @@ -186,7 +184,7 @@ local_cmdline (GApplication *app, }; optcontext = g_option_context_new (N_("- Empathy Accounts")); - g_option_context_add_group (optcontext, gtk_get_option_group (TRUE)); + g_option_context_add_group (optcontext, gtk_get_option_group (FALSE)); g_option_context_add_main_entries (optcontext, options, GETTEXT_PACKAGE); g_option_context_set_translation_domain (optcontext, GETTEXT_PACKAGE); @@ -199,9 +197,22 @@ local_cmdline (GApplication *app, g_print ("%s\nRun '%s --help' to see a full list of available command line options.\n", error->message, argv[0]); g_warning ("Error in empathy init: %s", error->message); + g_clear_error (&error); *exit_status = EXIT_FAILURE; - retval = TRUE; + } + else + { + if (g_application_register (app, NULL, &error)) + { + g_application_activate (app); + } + else + { + g_warning("Impossible to register empathy-application: %s", error->message); + g_clear_error (&error); + *exit_status = EXIT_FAILURE; + } } g_option_context_free (optcontext); @@ -225,22 +236,16 @@ main (int argc, char *argv[]) empathy_init (); - gtk_init (&argc, &argv); - empathy_gtk_init (); - g_set_application_name (_("Empathy Accounts")); /* Make empathy and empathy-accounts appear as the same app in gnome-shell */ gdk_set_program_class ("Empathy"); gtk_window_set_default_icon_name ("empathy"); - app = gtk_application_new (EMPATHY_ACCOUNTS_DBUS_NAME, - G_APPLICATION_HANDLES_COMMAND_LINE); + app = gtk_application_new (EMPATHY_ACCOUNTS_DBUS_NAME, G_APPLICATION_FLAGS_NONE); app_class = G_OBJECT_GET_CLASS (app); G_APPLICATION_CLASS (app_class)->local_command_line = local_cmdline; - - g_signal_connect (app, "command-line", G_CALLBACK (app_command_line_cb), - NULL); + G_APPLICATION_CLASS (app_class)->activate = app_activate; retval = g_application_run (G_APPLICATION (app), argc, argv); diff --git a/src/empathy-audio-sink.c b/src/empathy-audio-sink.c index 0c3693b6f..985a1fa36 100644 --- a/src/empathy-audio-sink.c +++ b/src/empathy-audio-sink.c @@ -19,6 +19,7 @@ */ #include "config.h" +#include "empathy-audio-sink.h" #ifdef HAVE_GST1 #include <gst/audio/streamvolume.h> @@ -27,10 +28,9 @@ #endif #include "empathy-audio-utils.h" -#include "empathy-audio-sink.h" #define DEBUG_FLAG EMPATHY_DEBUG_VOIP -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" G_DEFINE_TYPE(EmpathyGstAudioSink, empathy_audio_sink, GST_TYPE_BIN) diff --git a/src/empathy-audio-sink.h b/src/empathy-audio-sink.h index ceb0bbe36..85b576c42 100644 --- a/src/empathy-audio-sink.h +++ b/src/empathy-audio-sink.h @@ -21,7 +21,6 @@ #ifndef __EMPATHY_GST_AUDIO_SINK_H__ #define __EMPATHY_GST_AUDIO_SINK_H__ -#include <glib-object.h> #include <gst/gst.h> G_BEGIN_DECLS diff --git a/src/empathy-audio-src.c b/src/empathy-audio-src.c index fe62a6c4b..bc3aa50cd 100644 --- a/src/empathy-audio-src.c +++ b/src/empathy-audio-src.c @@ -19,6 +19,7 @@ */ #include "config.h" +#include "empathy-audio-src.h" #ifdef HAVE_GST1 #include <gst/audio/streamvolume.h> @@ -26,14 +27,12 @@ #include <gst/interfaces/streamvolume.h> #endif -#include <libempathy/empathy-utils.h> #include "empathy-audio-utils.h" - -#include "empathy-audio-src.h" #include "empathy-mic-monitor.h" +#include "empathy-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_VOIP -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" G_DEFINE_TYPE(EmpathyGstAudioSrc, empathy_audio_src, GST_TYPE_BIN) diff --git a/src/empathy-audio-src.h b/src/empathy-audio-src.h index ef87c44c4..2d1a6960d 100644 --- a/src/empathy-audio-src.h +++ b/src/empathy-audio-src.h @@ -21,7 +21,6 @@ #ifndef __EMPATHY_GST_AUDIO_SRC_H__ #define __EMPATHY_GST_AUDIO_SRC_H__ -#include <glib-object.h> #include <gst/gst.h> #include <gio/gio.h> diff --git a/src/empathy-audio-utils.c b/src/empathy-audio-utils.c index 323ef8edf..f7a00378f 100644 --- a/src/empathy-audio-utils.c +++ b/src/empathy-audio-utils.c @@ -19,15 +19,14 @@ */ #include "config.h" +#include "empathy-audio-utils.h" #include <pulse/pulseaudio.h> -#include "empathy-audio-utils.h" - -#include <libempathy/empathy-gsettings.h> +#include "empathy-gsettings.h" #define DEBUG_FLAG EMPATHY_DEBUG_OTHER -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" void empathy_audio_set_stream_properties (GstElement *element, diff --git a/src/empathy-auth-client.c b/src/empathy-auth-client.c index f1d42b74c..be5b13a0b 100644 --- a/src/empathy-auth-client.c +++ b/src/empathy-auth-client.c @@ -22,21 +22,19 @@ #include "config.h" #include <glib/gi18n.h> +#include <gnutls/gnutls.h> -#define DEBUG_FLAG EMPATHY_DEBUG_TLS -#include <libempathy/empathy-debug.h> -#include <libempathy/empathy-auth-factory.h> -#include <libempathy/empathy-server-tls-handler.h> -#include <libempathy/empathy-tls-verifier.h> - -#include <libempathy-gtk/empathy-bad-password-dialog.h> -#include <libempathy-gtk/empathy-password-dialog.h> -#include <libempathy-gtk/empathy-tls-dialog.h> -#include <libempathy-gtk/empathy-ui-utils.h> - +#include "empathy-auth-factory.h" +#include "empathy-bad-password-dialog.h" +#include "empathy-password-dialog.h" #include "empathy-sanity-cleaning.h" +#include "empathy-server-tls-handler.h" +#include "empathy-tls-dialog.h" +#include "empathy-tls-verifier.h" +#include "empathy-ui-utils.h" -#include <gnutls/gnutls.h> +#define DEBUG_FLAG EMPATHY_DEBUG_TLS +#include "empathy-debug.h" #define TIMEOUT 60 diff --git a/src/empathy-call-factory.c b/src/empathy-call-factory.c index dbd5ecf77..60700ac0f 100644 --- a/src/empathy-call-factory.c +++ b/src/empathy-call-factory.c @@ -19,15 +19,14 @@ */ #include "config.h" - -#include <libempathy/empathy-client-factory.h> -#include <libempathy/empathy-request-util.h> +#include "empathy-client-factory.h" #include "empathy-call-factory.h" #include "empathy-call-handler.h" +#include "empathy-request-util.h" #define DEBUG_FLAG EMPATHY_DEBUG_VOIP -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" G_DEFINE_TYPE(EmpathyCallFactory, empathy_call_factory, TP_TYPE_BASE_CLIENT) diff --git a/src/empathy-call-factory.h b/src/empathy-call-factory.h index 174fbf4bd..b913d8e57 100644 --- a/src/empathy-call-factory.h +++ b/src/empathy-call-factory.h @@ -21,7 +21,7 @@ #ifndef __EMPATHY_CALL_FACTORY_H__ #define __EMPATHY_CALL_FACTORY_H__ -#include <glib-object.h> +#include <telepathy-glib/telepathy-glib.h> G_BEGIN_DECLS diff --git a/src/empathy-call-handler.c b/src/empathy-call-handler.c index b1d4f2977..1c4939af1 100644 --- a/src/empathy-call-handler.c +++ b/src/empathy-call-handler.c @@ -19,17 +19,15 @@ */ #include "config.h" +#include "empathy-call-handler.h" #include <telepathy-farstream/telepathy-farstream.h> -#include <libempathy/empathy-utils.h> - -#include <libempathy-gtk/empathy-call-utils.h> - -#include "empathy-call-handler.h" +#include "empathy-call-utils.h" +#include "empathy-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_VOIP -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" G_DEFINE_TYPE(EmpathyCallHandler, empathy_call_handler, G_TYPE_OBJECT) diff --git a/src/empathy-call-handler.h b/src/empathy-call-handler.h index 36c6cfdc2..5050d801e 100644 --- a/src/empathy-call-handler.h +++ b/src/empathy-call-handler.h @@ -21,14 +21,10 @@ #ifndef __EMPATHY_CALL_HANDLER_H__ #define __EMPATHY_CALL_HANDLER_H__ -#include <glib-object.h> - -#include <gst/gst.h> #include <farstream/fs-conference.h> - #include <telepathy-glib/telepathy-glib.h> -#include <libempathy/empathy-contact.h> +#include "empathy-contact.h" G_BEGIN_DECLS diff --git a/src/empathy-call-observer.c b/src/empathy-call-observer.c index bf42b055a..41e9bdfc1 100644 --- a/src/empathy-call-observer.c +++ b/src/empathy-call-observer.c @@ -19,16 +19,15 @@ */ #include "config.h" +#include "empathy-call-observer.h" #include <glib/gi18n-lib.h> -#include <libempathy-gtk/empathy-images.h> -#include <libempathy-gtk/empathy-notify-manager.h> - -#include "empathy-call-observer.h" +#include "empathy-images.h" +#include "empathy-notify-manager.h" #define DEBUG_FLAG EMPATHY_DEBUG_VOIP -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" struct _EmpathyCallObserverPriv { EmpathyNotifyManager *notify_mgr; diff --git a/src/empathy-call-observer.h b/src/empathy-call-observer.h index 1d5a58b57..3fdb6b797 100644 --- a/src/empathy-call-observer.h +++ b/src/empathy-call-observer.h @@ -21,7 +21,6 @@ #ifndef __EMPATHY_CALL_OBSERVER_H__ #define __EMPATHY_CALL_OBSERVER_H__ -#include <glib.h> #include <glib-object.h> G_BEGIN_DECLS diff --git a/src/empathy-call-window-fullscreen.c b/src/empathy-call-window-fullscreen.c index ca2914724..e6dca4868 100644 --- a/src/empathy-call-window-fullscreen.c +++ b/src/empathy-call-window-fullscreen.c @@ -22,10 +22,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "config.h" #include "empathy-call-window-fullscreen.h" -#include <libempathy/empathy-utils.h> -#include <libempathy-gtk/empathy-ui-utils.h> +#include "empathy-ui-utils.h" +#include "empathy-utils.h" /* The number of seconds for which the "leave fullscreen" popup should be shown */ diff --git a/src/empathy-call-window-fullscreen.h b/src/empathy-call-window-fullscreen.h index 7e9bd63e5..56ddf99b8 100644 --- a/src/empathy-call-window-fullscreen.h +++ b/src/empathy-call-window-fullscreen.h @@ -20,8 +20,6 @@ #ifndef __EMPATHY_CALL_WINDOW_FULLSCREEN_H__ #define __EMPATHY_CALL_WINDOW_FULLSCREEN_H__ -#include <glib-object.h> -#include <gtk/gtk.h> #include "empathy-call-window.h" diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c index 77722f1a6..eb39855ba 100644 --- a/src/empathy-call-window.c +++ b/src/empathy-call-window.c @@ -19,38 +19,35 @@ */ #include "config.h" +#include "empathy-call-window.h" #include <glib/gi18n.h> - #include <telepathy-farstream/telepathy-farstream.h> - #include <farstream/fs-element-added-notifier.h> #include <farstream/fs-utils.h> -#include <libempathy/empathy-camera-monitor.h> -#include <libempathy/empathy-gsettings.h> -#include <libempathy/empathy-request-util.h> -#include <libempathy/empathy-utils.h> - -#include <libempathy-gtk/empathy-dialpad-widget.h> -#include <libempathy-gtk/empathy-ui-utils.h> -#include <libempathy-gtk/empathy-sound-manager.h> -#include <libempathy-gtk/empathy-geometry.h> -#include <libempathy-gtk/empathy-images.h> -#include <libempathy-gtk/empathy-call-utils.h> - -#define DEBUG_FLAG EMPATHY_DEBUG_VOIP -#include <libempathy/empathy-debug.h> - -#include "empathy-call-window-fullscreen.h" #include "empathy-about-dialog.h" #include "empathy-audio-sink.h" +#include "empathy-call-utils.h" +#include "empathy-call-window-fullscreen.h" +#include "empathy-camera-menu.h" +#include "empathy-camera-monitor.h" +#include "empathy-dialpad-widget.h" +#include "empathy-geometry.h" +#include "empathy-gsettings.h" +#include "empathy-images.h" #include "empathy-mic-menu.h" #include "empathy-preferences.h" +#include "empathy-request-util.h" #include "empathy-rounded-actor.h" #include "empathy-rounded-rectangle.h" #include "empathy-rounded-texture.h" -#include "empathy-camera-menu.h" +#include "empathy-sound-manager.h" +#include "empathy-ui-utils.h" +#include "empathy-utils.h" + +#define DEBUG_FLAG EMPATHY_DEBUG_VOIP +#include "empathy-debug.h" #define CONTENT_HBOX_SPACING 3 #define CONTENT_HBOX_CHILDREN_PACKING_PADDING 0 @@ -4018,7 +4015,7 @@ empathy_call_window_state_event_cb (GtkWidget *widget, show_controls (window, set_fullscreen); show_borders (window, set_fullscreen); gtk_action_set_stock_id (priv->menu_fullscreen, - (set_fullscreen ? "gtk-leave-fullscreen" : "gtk-fullscreen")); + (set_fullscreen ? "view-restore" : "view-fullscreen")); priv->is_fullscreen = set_fullscreen; } diff --git a/src/empathy-call-window.h b/src/empathy-call-window.h index a5df2dac4..2090b1beb 100644 --- a/src/empathy-call-window.h +++ b/src/empathy-call-window.h @@ -21,11 +21,10 @@ #ifndef __EMPATHY_CALL_WINDOW_H__ #define __EMPATHY_CALL_WINDOW_H__ -#include <glib-object.h> #include <gtk/gtk.h> -#include "empathy-call-handler.h" #include "empathy-audio-src.h" +#include "empathy-call-handler.h" #include "empathy-video-src.h" G_BEGIN_DECLS diff --git a/src/empathy-call-window.ui b/src/empathy-call-window.ui index f26f33b49..133f4ca4f 100644 --- a/src/empathy-call-window.ui +++ b/src/empathy-call-window.ui @@ -39,7 +39,7 @@ </child> <child> <object class="GtkAction" id="menusettings"> - <property name="stock_id">gtk-preferences</property> + <property name="stock_id">preferences-desktop</property> <property name="name">menusettings</property> <property name="label" translatable="yes">_Settings</property> </object> diff --git a/src/empathy-call.c b/src/empathy-call.c index 9d5ab8a83..8a5549694 100644 --- a/src/empathy-call.c +++ b/src/empathy-call.c @@ -23,7 +23,6 @@ #include "config.h" #include <glib/gi18n.h> - #include <clutter-gtk/clutter-gtk.h> #include <clutter-gst/clutter-gst.h> @@ -31,13 +30,12 @@ #include <X11/Xlib.h> #endif -#include <libempathy-gtk/empathy-ui-utils.h> - -#include "empathy-call-window.h" #include "empathy-call-factory.h" +#include "empathy-call-window.h" +#include "empathy-ui-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_VOIP -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" /* Exit after $TIMEOUT seconds if not displaying any call window */ #define TIMEOUT 60 diff --git a/src/empathy-camera-menu.c b/src/empathy-camera-menu.c index a6f8d3d12..8dc037bdb 100644 --- a/src/empathy-camera-menu.c +++ b/src/empathy-camera-menu.c @@ -20,14 +20,13 @@ */ #include "config.h" - -#include <libempathy/empathy-camera-monitor.h> -#include <libempathy/empathy-gsettings.h> - #include "empathy-camera-menu.h" +#include "empathy-camera-monitor.h" +#include "empathy-gsettings.h" + #define DEBUG_FLAG EMPATHY_DEBUG_VOIP -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" struct _EmpathyCameraMenuPrivate { diff --git a/src/empathy-camera-menu.h b/src/empathy-camera-menu.h index 92760f67d..b55726bed 100644 --- a/src/empathy-camera-menu.h +++ b/src/empathy-camera-menu.h @@ -19,7 +19,6 @@ #ifndef __EMPATHY_CAMERA_MENU_H__ #define __EMPATHY_CAMERA_MENU_H__ -#include <glib-object.h> #include "empathy-call-window.h" diff --git a/src/empathy-chat-manager.c b/src/empathy-chat-manager.c index 15a4e7a4f..02ed0d949 100644 --- a/src/empathy-chat-manager.c +++ b/src/empathy-chat-manager.c @@ -18,23 +18,18 @@ */ #include "config.h" +#include "empathy-chat-manager.h" #include <telepathy-glib/proxy-subclass.h> -#include <libempathy/empathy-chatroom-manager.h> -#include <libempathy/empathy-request-util.h> -#include <libempathy/empathy-individual-manager.h> - -#include <libempathy-gtk/empathy-ui-utils.h> - +#include "empathy-chatroom-manager.h" #include "empathy-chat-window.h" +#include "empathy-request-util.h" +#include "empathy-ui-utils.h" +#include "extensions.h" #define DEBUG_FLAG EMPATHY_DEBUG_OTHER -#include <libempathy/empathy-debug.h> - -#include "empathy-chat-manager.h" - -#include <extensions/extensions.h> +#include "empathy-debug.h" enum { CLOSED_CHATS_CHANGED, diff --git a/src/empathy-chat-manager.h b/src/empathy-chat-manager.h index 7dfd53480..b5516c33d 100644 --- a/src/empathy-chat-manager.h +++ b/src/empathy-chat-manager.h @@ -20,9 +20,8 @@ #ifndef __EMPATHY_CHAT_MANAGER_H__ #define __EMPATHY_CHAT_MANAGER_H__ -#include <glib-object.h> -#include <libempathy-gtk/empathy-chat.h> +#include "empathy-chat.h" G_BEGIN_DECLS diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c index 292c1a9a7..480570d0b 100644 --- a/src/empathy-chat-window.c +++ b/src/empathy-chat-window.c @@ -26,31 +26,27 @@ */ #include "config.h" +#include "empathy-chat-window.h" -#include <gtk/gtk.h> #include <glib/gi18n.h> -#include <libempathy/empathy-client-factory.h> -#include <libempathy/empathy-chatroom-manager.h> -#include <libempathy/empathy-gsettings.h> -#include <libempathy/empathy-utils.h> -#include <libempathy/empathy-request-util.h> -#include <libempathy/empathy-individual-manager.h> - -#include <libempathy-gtk/empathy-images.h> -#include <libempathy-gtk/empathy-geometry.h> -#include <libempathy-gtk/empathy-smiley-manager.h> -#include <libempathy-gtk/empathy-sound-manager.h> -#include <libempathy-gtk/empathy-ui-utils.h> -#include <libempathy-gtk/empathy-notify-manager.h> - -#include "empathy-chat-manager.h" -#include "empathy-chat-window.h" #include "empathy-about-dialog.h" +#include "empathy-chat-manager.h" +#include "empathy-chatroom-manager.h" +#include "empathy-client-factory.h" +#include "empathy-geometry.h" +#include "empathy-gsettings.h" +#include "empathy-images.h" #include "empathy-invite-participant-dialog.h" +#include "empathy-notify-manager.h" +#include "empathy-request-util.h" +#include "empathy-smiley-manager.h" +#include "empathy-sound-manager.h" +#include "empathy-ui-utils.h" +#include "empathy-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_CHAT -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" /* Macro to compare guint32 X timestamps, while accounting for wrapping around */ diff --git a/src/empathy-chat-window.h b/src/empathy-chat-window.h index 2041634aa..ae986cc7f 100644 --- a/src/empathy-chat-window.h +++ b/src/empathy-chat-window.h @@ -27,12 +27,11 @@ #ifndef __EMPATHY_CHAT_WINDOW_H__ #define __EMPATHY_CHAT_WINDOW_H__ -#include <glib-object.h> #include <gtk/gtk.h> - #include <telepathy-glib/telepathy-glib.h> -#include <libempathy-gtk/empathy-chat.h> +#include "empathy-chat.h" +#include "empathy-individual-manager.h" G_BEGIN_DECLS diff --git a/src/empathy-chat.c b/src/empathy-chat.c index 0e70885d7..1c4c57d25 100644 --- a/src/empathy-chat.c +++ b/src/empathy-chat.c @@ -23,19 +23,17 @@ #include "config.h" #include <glib/gi18n.h> - #include <libnotify/notify.h> -#include <libempathy/empathy-presence-manager.h> - -#include <libempathy-gtk/empathy-theme-manager.h> -#include <libempathy-gtk/empathy-ui-utils.h> - #include "empathy-chat-manager.h" #include "empathy-chat-resources.h" +#include "empathy-presence-manager.h" +#include "empathy-theme-manager.h" +#include "empathy-ui-utils.h" +#include "empathy-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_CHAT -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" /* Exit after $TIMEOUT seconds if not displaying any call window */ #define TIMEOUT 60 @@ -68,6 +66,7 @@ activate_cb (GApplication *application) return; activated = TRUE; + empathy_gtk_init (); if (!use_timer) { @@ -100,7 +99,7 @@ main (int argc, gint retval; optcontext = g_option_context_new (N_("- Empathy Chat Client")); - g_option_context_add_group (optcontext, gtk_get_option_group (TRUE)); + g_option_context_add_group (optcontext, gtk_get_option_group (FALSE)); g_option_context_add_main_entries (optcontext, options, GETTEXT_PACKAGE); g_option_context_set_translation_domain (optcontext, GETTEXT_PACKAGE); @@ -115,7 +114,7 @@ main (int argc, g_option_context_free (optcontext); - empathy_gtk_init (); + empathy_init (); /* Make empathy and empathy-chat appear as the same app in gnome-shell */ gdk_set_program_class ("Empathy"); diff --git a/src/empathy-chatrooms-window.c b/src/empathy-chatrooms-window.c index a18cccb1f..553c91290 100644 --- a/src/empathy-chatrooms-window.c +++ b/src/empathy-chatrooms-window.c @@ -24,16 +24,14 @@ */ #include "config.h" +#include "empathy-chatrooms-window.h" #include <glib/gi18n.h> -#include <libempathy/empathy-chatroom-manager.h> -#include <libempathy/empathy-utils.h> - -#include <libempathy-gtk/empathy-account-chooser.h> -#include <libempathy-gtk/empathy-ui-utils.h> - -#include "empathy-chatrooms-window.h" +#include "empathy-account-chooser.h" +#include "empathy-chatroom-manager.h" +#include "empathy-ui-utils.h" +#include "empathy-utils.h" typedef struct { EmpathyChatroomManager *manager; diff --git a/src/empathy-debug-window.c b/src/empathy-debug-window.c index 0a1d7f786..4522c6a02 100644 --- a/src/empathy-debug-window.c +++ b/src/empathy-debug-window.c @@ -20,18 +20,17 @@ */ #include "config.h" +#include "empathy-debug-window.h" #include <glib/gi18n.h> #include <libsoup/soup.h> -#define DEBUG_FLAG EMPATHY_DEBUG_OTHER -#include <libempathy/empathy-debug.h> -#include <libempathy/empathy-utils.h> - -#include <libempathy-gtk/empathy-geometry.h> -#include <libempathy-gtk/empathy-ui-utils.h> +#include "empathy-geometry.h" +#include "empathy-ui-utils.h" +#include "empathy-utils.h" -#include "empathy-debug-window.h" +#define DEBUG_FLAG EMPATHY_DEBUG_OTHER +#include "empathy-debug.h" G_DEFINE_TYPE (EmpathyDebugWindow, empathy_debug_window, GTK_TYPE_WINDOW) diff --git a/src/empathy-debug-window.h b/src/empathy-debug-window.h index 42bb43ef7..c8944bf03 100644 --- a/src/empathy-debug-window.h +++ b/src/empathy-debug-window.h @@ -21,11 +21,10 @@ #ifndef __EMPATHY_DEBUG_WINDOW_H__ #define __EMPATHY_DEBUG_WINDOW_H__ -G_BEGIN_DECLS - -#include <glib-object.h> #include <gtk/gtk.h> +G_BEGIN_DECLS + #define EMPATHY_TYPE_DEBUG_WINDOW (empathy_debug_window_get_type ()) #define EMPATHY_DEBUG_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST \ ((object), EMPATHY_TYPE_DEBUG_WINDOW, EmpathyDebugWindow)) diff --git a/src/empathy-debugger.c b/src/empathy-debugger.c index 00dc98c8d..fb4ef1e4c 100644 --- a/src/empathy-debugger.c +++ b/src/empathy-debugger.c @@ -21,9 +21,8 @@ #include <glib/gi18n.h> -#include <libempathy-gtk/empathy-ui-utils.h> - #include "empathy-debug-window.h" +#include "empathy-ui-utils.h" #define EMPATHY_DEBUGGER_DBUS_NAME "org.gnome.Empathy.Debugger" @@ -31,7 +30,7 @@ static GtkWidget *window = NULL; static gchar *service = NULL; static void -activate_cb (GApplication *app) +app_activate (GApplication *app) { if (window == NULL) { @@ -45,20 +44,31 @@ activate_cb (GApplication *app) gtk_window_present (GTK_WINDOW (window)); } - if (service != NULL) + if (!tp_str_empty (service)) empathy_debug_window_show (EMPATHY_DEBUG_WINDOW (window), service); } -static gint -command_line_cb (GApplication *application, - GApplicationCommandLine *command_line, - gpointer user_data) +static void +on_show_service_cb (GAction *action, + GVariant *parameter, + gpointer data) +{ + g_free (service); + service = g_variant_dup_string (parameter, NULL); +} + +static gboolean +local_cmdline (GApplication *app, + gchar ***arguments, + gint *exit_status) { GError *error = NULL; + GSimpleAction *action; gchar **argv; gint argc; - gint retval = 0; + gint i; + gboolean retval = TRUE; GOptionContext *optcontext; GOptionEntry options[] = { @@ -70,10 +80,18 @@ command_line_cb (GApplication *application, }; optcontext = g_option_context_new (N_("- Empathy Debugger")); - g_option_context_add_group (optcontext, gtk_get_option_group (TRUE)); + g_option_context_add_group (optcontext, gtk_get_option_group (FALSE)); g_option_context_add_main_entries (optcontext, options, GETTEXT_PACKAGE); g_option_context_set_translation_domain (optcontext, GETTEXT_PACKAGE); - argv = g_application_command_line_get_arguments (command_line, &argc); + + action = g_simple_action_new ("show-service", G_VARIANT_TYPE_STRING); + g_signal_connect (action, "activate", G_CALLBACK (on_show_service_cb), app); + g_action_map_add_action (G_ACTION_MAP (app), G_ACTION (action)); + g_object_unref (action); + + argv = *arguments; + for (i = 0; argv[i] != NULL; i++) + argc++; if (!g_option_context_parse (optcontext, &argc, &argv, &error)) { @@ -81,13 +99,27 @@ command_line_cb (GApplication *application, "line options.\n", error->message, argv[0]); - retval = 1; + g_clear_error (&error); + *exit_status = EXIT_FAILURE; + } + else + { + if (g_application_register (app, NULL, &error)) + { + GVariant *parameter = g_variant_new_string (service ? service : ""); + g_action_group_activate_action (G_ACTION_GROUP (app), "show-service", parameter); + + g_application_activate (app); + } + else + { + g_warning("Impossible to register empathy-debugger: %s", error->message); + g_clear_error (&error); + *exit_status = EXIT_FAILURE; + } } g_option_context_free (optcontext); - g_strfreev (argv); - - g_application_activate (application); return retval; } @@ -97,16 +129,15 @@ main (int argc, char **argv) { GtkApplication *app; + GApplicationClass *app_class; gint retval; - gtk_init (&argc, &argv); - empathy_gtk_init (); textdomain (GETTEXT_PACKAGE); - app = gtk_application_new (EMPATHY_DEBUGGER_DBUS_NAME, - G_APPLICATION_HANDLES_COMMAND_LINE); - g_signal_connect (app, "activate", G_CALLBACK (activate_cb), NULL); - g_signal_connect (app, "command-line", G_CALLBACK (command_line_cb), NULL); + app = gtk_application_new (EMPATHY_DEBUGGER_DBUS_NAME, G_APPLICATION_FLAGS_NONE); + app_class = G_APPLICATION_CLASS (G_OBJECT_GET_CLASS (app)); + app_class->local_command_line = local_cmdline; + app_class->activate = app_activate; g_set_application_name (_("Empathy Debugger")); diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c index f652c2164..a0171858a 100644 --- a/src/empathy-event-manager.c +++ b/src/empathy-event-manager.c @@ -20,26 +20,24 @@ */ #include "config.h" +#include "empathy-event-manager.h" #include <glib/gi18n.h> -#include <libempathy/empathy-presence-manager.h> -#include <libempathy/empathy-connection-aggregator.h> -#include <libempathy/empathy-tp-chat.h> -#include <libempathy/empathy-utils.h> -#include <libempathy/empathy-gsettings.h> -#include <libempathy/empathy-sasl-mechanisms.h> - -#include <libempathy-gtk/empathy-images.h> -#include <libempathy-gtk/empathy-sound-manager.h> -#include <libempathy-gtk/empathy-ui-utils.h> -#include <libempathy-gtk/empathy-call-utils.h> -#include <libempathy-gtk/empathy-subscription-dialog.h> - -#include "empathy-event-manager.h" +#include "empathy-call-utils.h" +#include "empathy-connection-aggregator.h" +#include "empathy-gsettings.h" +#include "empathy-images.h" +#include "empathy-presence-manager.h" +#include "empathy-sasl-mechanisms.h" +#include "empathy-sound-manager.h" +#include "empathy-subscription-dialog.h" +#include "empathy-tp-chat.h" +#include "empathy-ui-utils.h" +#include "empathy-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_DISPATCHER -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyEventManager) diff --git a/src/empathy-event-manager.h b/src/empathy-event-manager.h index 70af9a1c2..f2878c7ca 100644 --- a/src/empathy-event-manager.h +++ b/src/empathy-event-manager.h @@ -22,10 +22,9 @@ #ifndef __EMPATHY_EVENT_MANAGER_H__ #define __EMPATHY_EVENT_MANAGER_H__ -#include <glib.h> #include <glib-object.h> -#include <libempathy/empathy-contact.h> +#include "empathy-contact.h" G_BEGIN_DECLS diff --git a/src/empathy-ft-manager.c b/src/empathy-ft-manager.c index f89004f32..18e05dc19 100644 --- a/src/empathy-ft-manager.c +++ b/src/empathy-ft-manager.c @@ -28,17 +28,16 @@ /* The original file transfer manager code was copied from Epiphany */ #include "config.h" +#include "empathy-ft-manager.h" #include <glib/gi18n.h> -#define DEBUG_FLAG EMPATHY_DEBUG_FT -#include <libempathy/empathy-debug.h> -#include <libempathy/empathy-utils.h> - -#include <libempathy-gtk/empathy-ui-utils.h> -#include <libempathy-gtk/empathy-geometry.h> +#include "empathy-geometry.h" +#include "empathy-ui-utils.h" +#include "empathy-utils.h" -#include "empathy-ft-manager.h" +#define DEBUG_FLAG EMPATHY_DEBUG_FT +#include "empathy-debug.h" enum { diff --git a/src/empathy-ft-manager.h b/src/empathy-ft-manager.h index 0ff820f06..be41730eb 100644 --- a/src/empathy-ft-manager.h +++ b/src/empathy-ft-manager.h @@ -25,11 +25,9 @@ #ifndef __EMPATHY_FT_MANAGER_H__ #define __EMPATHY_FT_MANAGER_H__ -#include <gtk/gtk.h> #include <glib-object.h> -#include <glib.h> -#include <libempathy/empathy-ft-handler.h> +#include "empathy-ft-handler.h" G_BEGIN_DECLS diff --git a/src/empathy-import-dialog.c b/src/empathy-import-dialog.c index d4dd70d01..5e6fa8d55 100644 --- a/src/empathy-import-dialog.c +++ b/src/empathy-import-dialog.c @@ -21,15 +21,15 @@ */ #include "config.h" +#include "empathy-import-dialog.h" #include <glib/gi18n-lib.h> -#include "empathy-import-dialog.h" #include "empathy-import-widget.h" +#include "empathy-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_OTHER -#include <libempathy/empathy-debug.h> -#include <libempathy/empathy-utils.h> +#include "empathy-debug.h" enum { PROP_PARENT = 1, diff --git a/src/empathy-import-dialog.h b/src/empathy-import-dialog.h index a412037d1..87f1198f1 100644 --- a/src/empathy-import-dialog.h +++ b/src/empathy-import-dialog.h @@ -25,7 +25,7 @@ #ifndef __EMPATHY_IMPORT_DIALOG_H__ #define __EMPATHY_IMPORT_DIALOG_H__ -#include <libempathy/empathy-connection-managers.h> +#include "empathy-connection-managers.h" G_BEGIN_DECLS diff --git a/src/empathy-import-pidgin.c b/src/empathy-import-pidgin.c index 8fd7eaef4..92adb861e 100644 --- a/src/empathy-import-pidgin.c +++ b/src/empathy-import-pidgin.c @@ -20,16 +20,16 @@ * */ #include "config.h" +#include "empathy-import-pidgin.h" #include <glib/gstdio.h> #include <dbus/dbus-protocol.h> #include "empathy-import-utils.h" -#include "empathy-import-pidgin.h" +#include "empathy-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_OTHER -#include <libempathy/empathy-debug.h> -#include <libempathy/empathy-utils.h> +#include "empathy-debug.h" /* Pidgin to CM map */ typedef struct diff --git a/src/empathy-import-utils.c b/src/empathy-import-utils.c index 7007dee57..c38233647 100644 --- a/src/empathy-import-utils.c +++ b/src/empathy-import-utils.c @@ -19,11 +19,12 @@ * Cosimo Cecchi <cosimo.cecchi@collabora.co.uk> */ -#include <libempathy/empathy-connection-managers.h> -#include <libempathy/empathy-utils.h> - +#include "config.h" #include "empathy-import-utils.h" + +#include "empathy-connection-managers.h" #include "empathy-import-pidgin.h" +#include "empathy-utils.h" EmpathyImportAccountData * empathy_import_account_data_new (const gchar *source) diff --git a/src/empathy-import-utils.h b/src/empathy-import-utils.h index 59e1cb4d4..d860c4ee8 100644 --- a/src/empathy-import-utils.h +++ b/src/empathy-import-utils.h @@ -23,7 +23,6 @@ #define __EMPATHY_IMPORT_UTILS_H__ #include <telepathy-glib/telepathy-glib.h> -#include <glib.h> G_BEGIN_DECLS diff --git a/src/empathy-import-widget.c b/src/empathy-import-widget.c index 77048a4b7..86dc95150 100644 --- a/src/empathy-import-widget.c +++ b/src/empathy-import-widget.c @@ -23,17 +23,15 @@ /* empathy-import-widget.c */ #include "config.h" - -#include "empathy-import-dialog.h" #include "empathy-import-widget.h" -#define DEBUG_FLAG EMPATHY_DEBUG_OTHER -#include <libempathy/empathy-debug.h> -#include <libempathy/empathy-utils.h> +#include <glib/gi18n-lib.h> -#include <libempathy-gtk/empathy-ui-utils.h> +#include "empathy-ui-utils.h" +#include "empathy-utils.h" -#include <glib/gi18n-lib.h> +#define DEBUG_FLAG EMPATHY_DEBUG_OTHER +#include "empathy-debug.h" G_DEFINE_TYPE (EmpathyImportWidget, empathy_import_widget, G_TYPE_OBJECT) diff --git a/src/empathy-import-widget.h b/src/empathy-import-widget.h index 14a01d79d..8e9f32f5a 100644 --- a/src/empathy-import-widget.h +++ b/src/empathy-import-widget.h @@ -25,10 +25,9 @@ #ifndef __EMPATHY_IMPORT_WIDGET_H__ #define __EMPATHY_IMPORT_WIDGET_H__ -#include <glib-object.h> - -#include <libempathy/empathy-connection-managers.h> +#include <gtk/gtk.h> +#include "empathy-connection-managers.h" #include "empathy-import-utils.h" G_BEGIN_DECLS diff --git a/src/empathy-invite-participant-dialog.c b/src/empathy-invite-participant-dialog.c index 0b42ab4a7..e562dc564 100644 --- a/src/empathy-invite-participant-dialog.c +++ b/src/empathy-invite-participant-dialog.c @@ -10,14 +10,12 @@ */ #include "config.h" - -#include <glib/gi18n.h> - #include "empathy-invite-participant-dialog.h" -#include <libempathy/empathy-utils.h> +#include <glib/gi18n.h> -#include <libempathy-gtk/empathy-contact-chooser.h> +#include "empathy-contact-chooser.h" +#include "empathy-utils.h" G_DEFINE_TYPE (EmpathyInviteParticipantDialog, empathy_invite_participant_dialog, GTK_TYPE_DIALOG); diff --git a/src/empathy-invite-participant-dialog.h b/src/empathy-invite-participant-dialog.h index 7946fa001..daa3448d2 100644 --- a/src/empathy-invite-participant-dialog.h +++ b/src/empathy-invite-participant-dialog.h @@ -13,10 +13,9 @@ #define __EMPATHY_INVITE_PARTICIPANT_DIALOG_H__ #include <gtk/gtk.h> - #include <telepathy-glib/telepathy-glib.h> -#include "libempathy/empathy-tp-chat.h" +#include "empathy-tp-chat.h" G_BEGIN_DECLS diff --git a/src/empathy-mic-menu.c b/src/empathy-mic-menu.c index b86aec4be..612ff34be 100644 --- a/src/empathy-mic-menu.c +++ b/src/empathy-mic-menu.c @@ -20,12 +20,12 @@ */ #include "config.h" - #include "empathy-mic-menu.h" + #include "empathy-mic-monitor.h" #define DEBUG_FLAG EMPATHY_DEBUG_VOIP -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" struct _EmpathyMicMenuPrivate { diff --git a/src/empathy-mic-monitor.c b/src/empathy-mic-monitor.c index c06e786ed..ae2b0c071 100644 --- a/src/empathy-mic-monitor.c +++ b/src/empathy-mic-monitor.c @@ -18,16 +18,14 @@ */ #include "config.h" +#include "empathy-mic-monitor.h" -#include <gtk/gtk.h> #include <pulse/glib-mainloop.h> -#include "empathy-mic-monitor.h" - -#include <libempathy/empathy-utils.h> +#include "empathy-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_VOIP -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" enum { diff --git a/src/empathy-mic-monitor.h b/src/empathy-mic-monitor.h index 4ad4a28fa..73771681a 100644 --- a/src/empathy-mic-monitor.h +++ b/src/empathy-mic-monitor.h @@ -19,8 +19,7 @@ #ifndef __EMPATHY_MIC_MONITOR_H__ #define __EMPATHY_MIC_MONITOR_H__ -#include <glib-object.h> - +#include <gio/gio.h> #include <pulse/pulseaudio.h> G_BEGIN_DECLS diff --git a/src/empathy-new-chatroom-dialog.c b/src/empathy-new-chatroom-dialog.c index cb8f2a1fb..5edf45a5a 100644 --- a/src/empathy-new-chatroom-dialog.c +++ b/src/empathy-new-chatroom-dialog.c @@ -22,20 +22,18 @@ */ #include "config.h" +#include "empathy-new-chatroom-dialog.h" #include <glib/gi18n.h> -#include <libempathy/empathy-utils.h> -#include <libempathy/empathy-request-util.h> -#include <libempathy/empathy-gsettings.h> - -#include <libempathy-gtk/empathy-account-chooser.h> -#include <libempathy-gtk/empathy-ui-utils.h> - -#include "empathy-new-chatroom-dialog.h" +#include "empathy-account-chooser.h" +#include "empathy-gsettings.h" +#include "empathy-request-util.h" +#include "empathy-ui-utils.h" +#include "empathy-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_OTHER -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" G_DEFINE_TYPE (EmpathyNewChatroomDialog, empathy_new_chatroom_dialog, GTK_TYPE_DIALOG) diff --git a/src/empathy-new-chatroom-dialog.h b/src/empathy-new-chatroom-dialog.h index 02bf3b2a0..31212cb56 100644 --- a/src/empathy-new-chatroom-dialog.h +++ b/src/empathy-new-chatroom-dialog.h @@ -24,7 +24,7 @@ #ifndef __EMPATHY_NEW_CHATROOM_DIALOG_H__ #define __EMPATHY_NEW_CHATROOM_DIALOG_H__ -#include <glib-object.h> +#include <gtk/gtk.h> G_BEGIN_DECLS diff --git a/src/empathy-notifications-approver.c b/src/empathy-notifications-approver.c index c3c996bd6..fb36f2ac3 100644 --- a/src/empathy-notifications-approver.c +++ b/src/empathy-notifications-approver.c @@ -18,18 +18,16 @@ */ #include "config.h" +#include "empathy-notifications-approver.h" #include <glib/gi18n.h> -#include <libempathy-gtk/empathy-notify-manager.h> -#include <libempathy-gtk/empathy-call-utils.h> - +#include "empathy-call-utils.h" #include "empathy-event-manager.h" +#include "empathy-notify-manager.h" #define DEBUG_FLAG EMPATHY_DEBUG_OTHER -#include <libempathy/empathy-debug.h> - -#include "empathy-notifications-approver.h" +#include "empathy-debug.h" struct _EmpathyNotificationsApproverPrivate { diff --git a/src/empathy-preferences.c b/src/empathy-preferences.c index bfeef61b6..6901aa9c8 100644 --- a/src/empathy-preferences.c +++ b/src/empathy-preferences.c @@ -24,21 +24,19 @@ */ #include "config.h" +#include "empathy-preferences.h" #include <glib/gi18n.h> -#include <libempathy/empathy-client-factory.h> -#include <libempathy/empathy-gsettings.h> -#include <libempathy/empathy-utils.h> - -#include <libempathy-gtk/empathy-ui-utils.h> -#include <libempathy-gtk/empathy-theme-manager.h> -#include <libempathy-gtk/empathy-spell.h> - -#include "empathy-preferences.h" +#include "empathy-client-factory.h" +#include "empathy-gsettings.h" +#include "empathy-spell.h" +#include "empathy-theme-manager.h" +#include "empathy-ui-utils.h" +#include "empathy-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_OTHER -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" G_DEFINE_TYPE (EmpathyPreferences, empathy_preferences, GTK_TYPE_DIALOG); @@ -1026,7 +1024,7 @@ empathy_preferences_init (EmpathyPreferences *preferences) gtk_window_set_role (GTK_WINDOW (preferences), "preferences"); gtk_window_set_position (GTK_WINDOW (preferences), GTK_WIN_POS_CENTER_ON_PARENT); - gtk_window_set_icon_name (GTK_WINDOW (preferences), "gtk-preferences"); + gtk_window_set_icon_name (GTK_WINDOW (preferences), "preferences-desktop"); filename = empathy_file_lookup ("empathy-preferences.ui", "src"); gui = empathy_builder_get_file (filename, diff --git a/src/empathy-roster-window.c b/src/empathy-roster-window.c index 05d2a1fba..93001d8d4 100644 --- a/src/empathy-roster-window.c +++ b/src/empathy-roster-window.c @@ -22,44 +22,42 @@ */ #include "config.h" +#include "empathy-roster-window.h" #include <sys/stat.h> #include <glib/gi18n.h> -#include <libempathy/empathy-utils.h> -#include <libempathy/empathy-request-util.h> -#include <libempathy/empathy-chatroom-manager.h> -#include <libempathy/empathy-gsettings.h> -#include <libempathy/empathy-gsettings.h> -#include <libempathy/empathy-status-presets.h> -#include <libempathy/empathy-presence-manager.h> - -#include <libempathy-gtk/empathy-contact-blocking-dialog.h> -#include <libempathy-gtk/empathy-contact-search-dialog.h> -#include <libempathy-gtk/empathy-geometry.h> -#include <libempathy-gtk/empathy-gtk-enum-types.h> -#include <libempathy-gtk/empathy-individual-dialogs.h> -#include <libempathy-gtk/empathy-roster-model-manager.h> -#include <libempathy-gtk/empathy-roster-view.h> -#include <libempathy-gtk/empathy-new-message-dialog.h> -#include <libempathy-gtk/empathy-new-call-dialog.h> -#include <libempathy-gtk/empathy-log-window.h> -#include <libempathy-gtk/empathy-presence-chooser.h> -#include <libempathy-gtk/empathy-ui-utils.h> - +#include "empathy-about-dialog.h" #include "empathy-accounts-dialog.h" #include "empathy-call-observer.h" #include "empathy-chat-manager.h" -#include "empathy-roster-window.h" -#include "empathy-preferences.h" -#include "empathy-about-dialog.h" -#include "empathy-new-chatroom-dialog.h" +#include "empathy-chatroom-manager.h" #include "empathy-chatrooms-window.h" +#include "empathy-contact-blocking-dialog.h" +#include "empathy-contact-search-dialog.h" #include "empathy-event-manager.h" #include "empathy-ft-manager.h" +#include "empathy-geometry.h" +#include "empathy-gsettings.h" +#include "empathy-gsettings.h" +#include "empathy-gtk-enum-types.h" +#include "empathy-individual-dialogs.h" +#include "empathy-log-window.h" +#include "empathy-new-call-dialog.h" +#include "empathy-new-chatroom-dialog.h" +#include "empathy-new-message-dialog.h" +#include "empathy-preferences.h" +#include "empathy-presence-chooser.h" +#include "empathy-presence-manager.h" +#include "empathy-request-util.h" +#include "empathy-roster-model-manager.h" +#include "empathy-roster-view.h" +#include "empathy-status-presets.h" +#include "empathy-ui-utils.h" +#include "empathy-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_OTHER -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" /* Flashing delay for icons (milliseconds). */ #define FLASH_TIMEOUT 500 @@ -477,7 +475,7 @@ static void display_page_no_account (EmpathyRosterWindow *self) { display_page_message (self, - _("You need to setup an account to see contacts here."), + _("You need to set up an account to see contacts here."), PAGE_MESSAGE_FLAG_ACCOUNTS); } diff --git a/src/empathy-rounded-actor.c b/src/empathy-rounded-actor.c index 038cb4955..89e3144cc 100644 --- a/src/empathy-rounded-actor.c +++ b/src/empathy-rounded-actor.c @@ -19,7 +19,6 @@ */ #include "config.h" - #include "empathy-rounded-actor.h" G_DEFINE_TYPE(EmpathyRoundedActor, empathy_rounded_actor, GTK_CLUTTER_TYPE_ACTOR) diff --git a/src/empathy-rounded-actor.h b/src/empathy-rounded-actor.h index 49fc03fd3..29a7797a6 100644 --- a/src/empathy-rounded-actor.h +++ b/src/empathy-rounded-actor.h @@ -21,7 +21,6 @@ #ifndef __EMPATHY_ROUNDED_ACTOR_H__ #define __EMPATHY_ROUNDED_ACTOR_H__ -#include <glib-object.h> #include <clutter-gtk/clutter-gtk.h> G_BEGIN_DECLS diff --git a/src/empathy-rounded-rectangle.c b/src/empathy-rounded-rectangle.c index 67c0e27c0..810fa0df7 100644 --- a/src/empathy-rounded-rectangle.c +++ b/src/empathy-rounded-rectangle.c @@ -19,11 +19,10 @@ */ #include "config.h" +#include "empathy-rounded-rectangle.h" #include <math.h> -#include "empathy-rounded-rectangle.h" - G_DEFINE_TYPE (EmpathyRoundedRectangle, empathy_rounded_rectangle, CLUTTER_TYPE_CAIRO_TEXTURE) diff --git a/src/empathy-rounded-rectangle.h b/src/empathy-rounded-rectangle.h index e4bf72c6e..b9988d53c 100644 --- a/src/empathy-rounded-rectangle.h +++ b/src/empathy-rounded-rectangle.h @@ -21,7 +21,6 @@ #ifndef __EMPATHY_ROUNDED_RECTANGLE_H__ #define __EMPATHY_ROUNDED_RECTANGLE_H__ -#include <glib-object.h> #include <clutter/clutter.h> G_BEGIN_DECLS diff --git a/src/empathy-rounded-texture.c b/src/empathy-rounded-texture.c index 7ac7d040d..46c0b2135 100644 --- a/src/empathy-rounded-texture.c +++ b/src/empathy-rounded-texture.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "config.h" #include "empathy-rounded-texture.h" G_DEFINE_TYPE (EmpathyRoundedTexture, diff --git a/src/empathy-rounded-texture.h b/src/empathy-rounded-texture.h index ab75757dd..c5d870d03 100644 --- a/src/empathy-rounded-texture.h +++ b/src/empathy-rounded-texture.h @@ -21,7 +21,6 @@ #ifndef __EMPATHY_ROUNDED_TEXTURE_H__ #define __EMPATHY_ROUNDED_TEXTURE_H__ -#include <glib-object.h> #include <clutter/clutter.h> G_BEGIN_DECLS diff --git a/src/empathy-sanity-cleaning.c b/src/empathy-sanity-cleaning.c index f7ac7d996..827a34eba 100644 --- a/src/empathy-sanity-cleaning.c +++ b/src/empathy-sanity-cleaning.c @@ -22,24 +22,23 @@ */ #include "config.h" - #include "empathy-sanity-cleaning.h" -#include <libempathy/empathy-gsettings.h> - -#include <libempathy-gtk/empathy-theme-manager.h> - #ifdef HAVE_UOA -#include <libempathy/empathy-pkg-kit.h> -#include <libempathy/empathy-uoa-utils.h> - #include <libaccounts-glib/ag-account-service.h> #include <libaccounts-glib/ag-manager.h> #include <libaccounts-glib/ag-service.h> + +#include "empathy-keyring.h" +#include "empathy-pkg-kit.h" +#include "empathy-uoa-utils.h" #endif +#include "empathy-gsettings.h" +#include "empathy-theme-manager.h" + #define DEBUG_FLAG EMPATHY_DEBUG_OTHER -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" /* * This number has to be increased each time a new task is added or modified. diff --git a/src/empathy-sanity-cleaning.h b/src/empathy-sanity-cleaning.h index 32000163f..f72993257 100644 --- a/src/empathy-sanity-cleaning.h +++ b/src/empathy-sanity-cleaning.h @@ -24,10 +24,14 @@ #include <gio/gio.h> +G_BEGIN_DECLS + void empathy_sanity_checking_run_async (GAsyncReadyCallback callback, gpointer user_data); gboolean empathy_sanity_checking_run_finish (GAsyncResult *result, GError **error); +G_END_DECLS + #endif diff --git a/src/empathy-status-icon.c b/src/empathy-status-icon.c index 54e49a30e..917fab383 100644 --- a/src/empathy-status-icon.c +++ b/src/empathy-status-icon.c @@ -20,20 +20,18 @@ */ #include "config.h" - -#include <libempathy/empathy-gsettings.h> -#include <libempathy/empathy-utils.h> - -#include <libempathy-gtk/empathy-presence-chooser.h> -#include <libempathy-gtk/empathy-ui-utils.h> -#include <libempathy-gtk/empathy-new-message-dialog.h> -#include <libempathy-gtk/empathy-new-call-dialog.h> - #include "empathy-status-icon.h" + #include "empathy-event-manager.h" +#include "empathy-gsettings.h" +#include "empathy-new-call-dialog.h" +#include "empathy-new-message-dialog.h" +#include "empathy-presence-chooser.h" +#include "empathy-ui-utils.h" +#include "empathy-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_DISPATCHER -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" /* Number of ms to wait when blinking */ #define BLINK_TIMEOUT 500 diff --git a/src/empathy-status-icon.h b/src/empathy-status-icon.h index ca21af833..586e651e2 100644 --- a/src/empathy-status-icon.h +++ b/src/empathy-status-icon.h @@ -22,7 +22,7 @@ #ifndef __EMPATHY_STATUS_ICON_H__ #define __EMPATHY_STATUS_ICON_H__ -#include <glib.h> +#include <gtk/gtk.h> G_BEGIN_DECLS diff --git a/src/empathy-video-src.c b/src/empathy-video-src.c index 12f8d6b47..9856efed9 100644 --- a/src/empathy-video-src.c +++ b/src/empathy-video-src.c @@ -19,6 +19,7 @@ */ #include "config.h" +#include "empathy-video-src.h" #ifdef HAVE_GST1 #include <gst/video/colorbalance.h> @@ -27,9 +28,7 @@ #endif #define DEBUG_FLAG EMPATHY_DEBUG_VOIP -#include <libempathy/empathy-debug.h> - -#include "empathy-video-src.h" +#include "empathy-debug.h" G_DEFINE_TYPE(EmpathyGstVideoSrc, empathy_video_src, GST_TYPE_BIN) diff --git a/src/empathy-video-src.h b/src/empathy-video-src.h index e49c79a00..60127ba2d 100644 --- a/src/empathy-video-src.h +++ b/src/empathy-video-src.h @@ -21,7 +21,6 @@ #ifndef __EMPATHY_GST_VIDEO_SRC_H__ #define __EMPATHY_GST_VIDEO_SRC_H__ -#include <glib-object.h> #include <gst/gst.h> G_BEGIN_DECLS diff --git a/src/empathy.c b/src/empathy.c index c36f2a2d7..5cfe9f38b 100644 --- a/src/empathy.c +++ b/src/empathy.c @@ -23,34 +23,31 @@ #include <glib/gstdio.h> #include <glib/gi18n.h> +#include <libnotify/notify.h> #ifdef HAVE_LIBCHAMPLAIN #include <clutter-gtk/clutter-gtk.h> #endif -#include <libnotify/notify.h> - -#include <libempathy/empathy-client-factory.h> -#include <libempathy/empathy-connection-aggregator.h> -#include <libempathy/empathy-presence-manager.h> -#include <libempathy/empathy-utils.h> -#include <libempathy/empathy-chatroom-manager.h> -#include <libempathy/empathy-request-util.h> -#include <libempathy/empathy-ft-factory.h> -#include <libempathy/empathy-gsettings.h> - -#include <libempathy-gtk/empathy-ui-utils.h> -#include <libempathy-gtk/empathy-location-manager.h> - -#include "empathy-roster-window.h" #include "empathy-accounts-common.h" #include "empathy-accounts-dialog.h" -#include "empathy-status-icon.h" +#include "empathy-chatroom-manager.h" +#include "empathy-client-factory.h" +#include "empathy-connection-aggregator.h" +#include "empathy-ft-factory.h" #include "empathy-ft-manager.h" +#include "empathy-gsettings.h" +#include "empathy-location-manager.h" #include "empathy-notifications-approver.h" +#include "empathy-presence-manager.h" +#include "empathy-request-util.h" +#include "empathy-roster-window.h" +#include "empathy-status-icon.h" +#include "empathy-ui-utils.h" +#include "empathy-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_OTHER -#include <libempathy/empathy-debug.h> +#include "empathy-debug.h" #define EMPATHY_DBUS_NAME "org.gnome.Empathy" @@ -214,11 +211,6 @@ new_ft_handler_cb (EmpathyFTFactory *factory, g_object_unref (handler); } -static gboolean -empathy_app_local_command_line (GApplication *app, - gchar ***arguments, - gint *exit_status); - static void empathy_presence_manager_set_auto_away_cb (GSettings *gsettings, const gchar *key, @@ -285,32 +277,18 @@ out: } } -static int -empathy_app_command_line (GApplication *app, - GApplicationCommandLine *cmdline) +static void +empathy_app_activate (GApplication *app) { EmpathyApp *self = (EmpathyApp *) app; - gchar **args, **argv; - gint argc, exit_status, i; - - args = g_application_command_line_get_arguments (cmdline, &argc); - /* We have to make an extra copy of the array, since g_option_context_parse() - * assumes that it can remove strings from the array without freeing them. */ - argv = g_new (gchar*, argc + 1); - for (i = 0; i <= argc; i++) - argv[i] = args[i]; - - if (empathy_app_local_command_line (app, &argv, &exit_status)) - DEBUG ("failed to parse command line!"); - - g_free (argv); - g_strfreev (args); if (!self->activated) { GError *error = NULL; TpDBusDaemon *dbus; + empathy_gtk_init (); + /* Create the FT factory */ self->ft_factory = empathy_ft_factory_dup_singleton (); g_signal_connect (self->ft_factory, "new-ft-handler", @@ -356,7 +334,8 @@ empathy_app_command_line (GApplication *app, if (self->show_preferences) { empathy_roster_window_show_preferences ( - EMPATHY_ROSTER_WINDOW (self->window), self->preferences_tab); + EMPATHY_ROSTER_WINDOW (self->window), + tp_str_empty (self->preferences_tab) ? NULL : self->preferences_tab); self->show_preferences = FALSE; } @@ -369,8 +348,6 @@ empathy_app_command_line (GApplication *app, /* Display the accounts dialog if needed */ tp_proxy_prepare_async (self->account_manager, NULL, account_manager_ready_cb, self); - - return 0; } static gboolean @@ -395,16 +372,30 @@ show_version_cb (const char *option_name, gpointer data, GError **error); +static void +open_preference_action_cb (GAction *action, + GVariant *parameter, + gpointer data) +{ + EmpathyApp *self = EMPATHY_APP (data); + + self->show_preferences = TRUE; + + g_free (self->preferences_tab); + self->preferences_tab = g_variant_dup_string (parameter, NULL); +} + static gboolean empathy_app_local_command_line (GApplication *app, gchar ***arguments, gint *exit_status) { EmpathyApp *self = (EmpathyApp *) app; + GSimpleAction *action; gint i; gchar **argv; gint argc = 0; - gboolean retval = FALSE; + gboolean retval = TRUE; GError *error = NULL; gboolean no_connect = FALSE, start_hidden = FALSE; @@ -428,13 +419,26 @@ empathy_app_local_command_line (GApplication *app, { NULL } }; + if (!g_application_register (app, NULL, &error)) + { + g_warning("Impossible to register empathy: %s", error->message); + g_clear_error (&error); + *exit_status = EXIT_FAILURE; + return retval; + } + + action = g_simple_action_new ("open-preferences", G_VARIANT_TYPE_STRING); + g_signal_connect (action, "activate", G_CALLBACK (open_preference_action_cb), app); + g_action_map_add_action (G_ACTION_MAP (app), G_ACTION (action)); + g_object_unref (action); + /* We create a group so that GOptionArgFuncs get the user data */ group = g_option_group_new ("empathy", NULL, NULL, app, NULL); g_option_group_set_translation_domain (group, GETTEXT_PACKAGE); g_option_group_add_entries (group, options); optcontext = g_option_context_new (N_("- Empathy IM Client")); - g_option_context_add_group (optcontext, gtk_get_option_group (TRUE)); + g_option_context_add_group (optcontext, gtk_get_option_group (FALSE)); g_option_context_set_main_group (optcontext, group); g_option_context_set_translation_domain (optcontext, GETTEXT_PACKAGE); @@ -453,17 +457,27 @@ empathy_app_local_command_line (GApplication *app, "line options.\n", error->message, argv[0]); g_warning ("Error in empathy init: %s", error->message); + g_clear_error (&error); *exit_status = EXIT_FAILURE; - retval = TRUE; } + else + { + self->no_connect = no_connect; + self->start_hidden = start_hidden; - g_free (argv); + if (self->show_preferences) + { + GVariant *parameter; + parameter = g_variant_new_string (self->preferences_tab ? self->preferences_tab : ""); + g_action_group_activate_action (G_ACTION_GROUP (app), "open-preferences", parameter); + } - g_option_context_free (optcontext); + g_application_activate (app); + } - self->no_connect = no_connect; - self->start_hidden = start_hidden; + g_free (argv); + g_option_context_free (optcontext); return retval; } @@ -482,8 +496,8 @@ empathy_app_class_init (EmpathyAppClass *klass) gobject_class->dispose = empathy_app_dispose; gobject_class->finalize = empathy_app_finalize; - g_app_class->command_line = empathy_app_command_line; g_app_class->local_command_line = empathy_app_local_command_line; + g_app_class->activate = empathy_app_activate; spec = g_param_spec_boolean ("no-connect", "no connect", "Don't connect on startup", @@ -818,14 +832,11 @@ main (int argc, char *argv[]) g_type_init (); empathy_init (); - gtk_init (&argc, &argv); - empathy_gtk_init (); add_empathy_features (); app = g_object_new (EMPATHY_TYPE_APP, "application-id", EMPATHY_DBUS_NAME, - "flags", G_APPLICATION_HANDLES_COMMAND_LINE, NULL); retval = g_application_run (G_APPLICATION (app), argc, argv); |