From c841a4c82601d795e75dfec0007eb9e0e3580f53 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Sun, 9 Jan 2005 23:11:36 +0000 Subject: A lib/ephy-dbus.c: A lib/ephy-dbus.h: 2005-01-10 Christian Persch * configure.ac: * lib/Makefile.am: A lib/ephy-dbus.c: A lib/ephy-dbus.h: * lib/ephy-marshal.list: * src/Makefile.am: * src/ephy-shell.c: (ephy_shell_finalize), (ephy_shell_get_dbus_service): * src/ephy-shell.h: Add experimental dbus service, disabled by default. Configure with --enable-dbus to enable. --- src/Makefile.am | 8 ++++++++ src/ephy-shell.c | 29 +++++++++++++++++++++++++++++ src/ephy-shell.h | 2 ++ 3 files changed, 39 insertions(+) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 1d6f3c65d..d865eec3d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -106,6 +106,10 @@ libephymain_la_CFLAGS = \ $(EPIPHANY_DEPENDENCY_CFLAGS) \ $(AM_CFLAGS) +if ENABLE_DBUS +libephymain_la_CFLAGS += $(DBUS_CFLAGS) +endif + epiphany_SOURCES = ephy-main.c epiphany_CPPFLAGS = \ @@ -135,6 +139,10 @@ epiphany_LDADD = \ $(EPIPHANY_DEPENDENCY_LIBS) \ $(INTLLIBS) +if ENABLE_DBUS +epiphany_LDADD += $(DBUS_LIBS) +endif + BUILT_SOURCES = \ $(CORBA_SOURCE) \ $(TYPES_SOURCE) diff --git a/src/ephy-shell.c b/src/ephy-shell.c index 3ff22355d..333213721 100644 --- a/src/ephy-shell.c +++ b/src/ephy-shell.c @@ -44,6 +44,10 @@ #include "ephy-automation.h" #include "print-dialog.h" +#ifdef ENABLE_DBUS +#include "ephy-dbus.h" +#endif + #include #include #include @@ -67,6 +71,7 @@ struct _EphyShellPrivate EggToolbarsModel *toolbars_model; EggToolbarsModel *fs_toolbars_model; EphyExtensionsManager *extensions_manager; + GObject *dbus_service; GtkWidget *bme; GtkWidget *history_window; GObject *pdm_dialog; @@ -413,6 +418,14 @@ ephy_shell_finalize (GObject *object) g_object_unref (shell->priv->extensions_manager); } +#ifdef ENABLE_DBUS + LOG ("Shutting down DBUS service") + if (shell->priv->dbus_service) + { + g_object_unref (shell->priv->dbus_service); + } +#endif + LOG ("Unref session manager") if (shell->priv->session) { @@ -805,3 +818,19 @@ ephy_shell_get_print_setup_dialog (EphyShell *shell) return shell->priv->print_setup_dialog; } + +#ifdef ENABLE_DBUS +GObject * +ephy_shell_get_dbus_service (EphyShell *shell) +{ + g_return_val_if_fail (EPHY_IS_SHELL (shell), NULL); + + if (shell->priv->dbus_service == NULL) + { + shell->priv->dbus_service = g_object_new (EPHY_TYPE_DBUS, NULL); + ephy_dbus_startup (EPHY_DBUS (shell->priv->dbus_service)); + } + + return G_OBJECT (shell->priv->dbus_service); +} +#endif diff --git a/src/ephy-shell.h b/src/ephy-shell.h index d807cd139..a9867fe97 100644 --- a/src/ephy-shell.h +++ b/src/ephy-shell.h @@ -139,6 +139,8 @@ GObject *ephy_shell_get_prefs_dialog (EphyShell *shell); GObject *ephy_shell_get_print_setup_dialog (EphyShell *shell); +GObject *ephy_shell_get_dbus_service (EphyShell *shell); + G_END_DECLS #endif -- cgit v1.2.3