summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--RepositoryExternal.mk4
-rw-r--r--config_host/config_dbus.h.in17
-rw-r--r--config_host/config_gio.h.in17
-rw-r--r--configure.ac2
-rw-r--r--sd/source/ui/remotecontrol/BluetoothServer.hxx4
-rw-r--r--vcl/Library_vcl.mk6
-rw-r--r--vcl/Library_vclplug_gtk.mk6
-rw-r--r--vcl/inc/unx/fontmanager.hxx6
-rw-r--r--vcl/inc/unx/gtk/gtkframe.hxx3
-rw-r--r--vcl/inc/unx/gtk/gtksalmenu.hxx3
-rw-r--r--vcl/unx/generic/fontmanager/fontconfig.cxx8
-rw-r--r--vcl/unx/generic/fontmanager/fontmanager.cxx2
-rw-r--r--vcl/unx/generic/window/screensaverinhibitor.cxx14
-rw-r--r--vcl/unx/gtk/gtksalframe.cxx8
-rw-r--r--vcl/unx/gtk3/gtk3gtkframe.cxx8
15 files changed, 62 insertions, 46 deletions
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index b3b06db5d933..fd20bfd26dc7 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -2537,10 +2537,6 @@ $(call gb_LinkTarget_set_include,$(1),\
$(DBUS_CFLAGS) \
)
-$(call gb_LinkTarget_add_defs,$(1),\
- -DENABLE_DBUS \
-)
-
ifeq ($(ENABLE_PACKAGEKIT),TRUE)
$(call gb_LinkTarget_add_defs,$(1),\
-DENABLE_PACKAGEKIT \
diff --git a/config_host/config_dbus.h.in b/config_host/config_dbus.h.in
new file mode 100644
index 000000000000..44cbf8a63919
--- /dev/null
+++ b/config_host/config_dbus.h.in
@@ -0,0 +1,17 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_CONFIG_DBUS_H
+#define INCLUDED_CONFIG_DBUS_H
+
+#define ENABLE_DBUS 0
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/config_host/config_gio.h.in b/config_host/config_gio.h.in
index 1c0c440b57c2..a2d880ed8e08 100644
--- a/config_host/config_gio.h.in
+++ b/config_host/config_gio.h.in
@@ -1,12 +1,17 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
-Settings for gio header file dection
-
-*/
-
-#ifndef CONFIG_GIO_H
-#define CONFIG_GIO_H
+#ifndef INCLUDED_CONFIG_GIO_H
+#define INCLUDED_CONFIG_GIO_H
#define ENABLE_GIO 0
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/configure.ac b/configure.ac
index 5993c11df91e..c6a9b7d83dba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10040,6 +10040,7 @@ if test "$test_dbus" = "yes"; then
ENABLE_DBUS="TRUE"
AC_MSG_RESULT([yes])
PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= 0.70)
+ AC_DEFINE(ENABLE_DBUS)
DBUS_CFLAGS=$(printf '%s' "$DBUS_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
FilterLibs "${DBUS_LIBS}"
DBUS_LIBS="${filteredlibs}"
@@ -12849,6 +12850,7 @@ AC_CONFIG_HEADERS([config_host/config_eot.h])
AC_CONFIG_HEADERS([config_host/config_extension_update.h])
AC_CONFIG_HEADERS([config_host/config_cairo_canvas.h])
AC_CONFIG_HEADERS([config_host/config_cups.h])
+AC_CONFIG_HEADERS([config_host/config_dbus.h])
AC_CONFIG_HEADERS([config_host/config_features.h])
AC_CONFIG_HEADERS([config_host/config_folders.h])
AC_CONFIG_HEADERS([config_host/config_gcc.h])
diff --git a/sd/source/ui/remotecontrol/BluetoothServer.hxx b/sd/source/ui/remotecontrol/BluetoothServer.hxx
index ac0fe3c8e665..8ec485de92d4 100644
--- a/sd/source/ui/remotecontrol/BluetoothServer.hxx
+++ b/sd/source/ui/remotecontrol/BluetoothServer.hxx
@@ -13,7 +13,9 @@
#include <memory>
#include <vector>
-#if (defined(LINUX) && !defined(__FreeBSD_kernel__)) && defined(ENABLE_DBUS)
+#include <config_dbus.h>
+
+#if (defined(LINUX) && !defined(__FreeBSD_kernel__)) && ENABLE_DBUS
# define LINUX_BLUETOOTH
#endif
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 3270175f5deb..2c0db54011c3 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -44,12 +44,6 @@ $(eval $(call gb_Library_set_include,vcl,\
$(if $(filter WNT,$(OS)),-I$(SRCDIR)/vcl/inc/glyphy/demo) \
))
-ifeq ($(ENABLE_DBUS),TRUE)
-$(eval $(call gb_Library_add_defs,vclplug_gen,\
- -DENABLE_DBUS \
-))
-endif
-
$(eval $(call gb_Library_add_defs,vcl,\
-DVCL_DLLIMPLEMENTATION \
-DCUI_DLL_NAME=\"$(call gb_Library_get_runtime_filename,$(call gb_Library__get_name,cui))\" \
diff --git a/vcl/Library_vclplug_gtk.mk b/vcl/Library_vclplug_gtk.mk
index 8a611315187c..c32a127e6b17 100644
--- a/vcl/Library_vclplug_gtk.mk
+++ b/vcl/Library_vclplug_gtk.mk
@@ -30,12 +30,6 @@ $(eval $(call gb_Library_add_defs,vclplug_gtk,\
-DVCLPLUG_GTK_IMPLEMENTATION \
))
-ifeq ($(ENABLE_DBUS),TRUE)
-$(eval $(call gb_Library_add_defs,vclplug_gtk,\
- -DENABLE_DBUS \
-))
-endif
-
$(eval $(call gb_Library_use_custom_headers,vclplug_gtk,\
officecfg/registry \
))
diff --git a/vcl/inc/unx/fontmanager.hxx b/vcl/inc/unx/fontmanager.hxx
index 1fdf273700e3..d3658005a385 100644
--- a/vcl/inc/unx/fontmanager.hxx
+++ b/vcl/inc/unx/fontmanager.hxx
@@ -35,6 +35,8 @@
#include <vector>
+#include "config_dbus.h"
+
#define ATOM_FAMILYNAME 2
#define ATOM_PSNAME 3
@@ -315,12 +317,12 @@ class VCL_PLUGIN_PUBLIC PrintFontManager
static bool addFontconfigDir(const OString& rDirectory);
std::set<OString> m_aPreviousLangSupportRequests;
-#if defined(ENABLE_DBUS) && defined(ENABLE_PACKAGEKIT)
+#if ENABLE_DBUS && defined(ENABLE_PACKAGEKIT)
std::vector<OString> m_aCurrentRequests;
#endif
Timer m_aFontInstallerTimer;
-#if defined(ENABLE_DBUS) && defined(ENABLE_PACKAGEKIT)
+#if ENABLE_DBUS && defined(ENABLE_PACKAGEKIT)
DECL_LINK_TYPED( autoInstallFontLangSupport, Timer*, void );
#endif
PrintFontManager();
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 93aac14f7d29..ed34e3edca18 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -47,6 +47,7 @@
#include <list>
#include <vector>
+#include <config_dbus.h>
#include <config_gio.h>
#include "headless/svpgdi.hxx"
@@ -224,7 +225,7 @@ class GtkSalFrame : public SalFrame
SalMenu* m_pSalMenu;
-#if defined(ENABLE_DBUS) && ENABLE_GIO
+#if ENABLE_DBUS && ENABLE_GIO
public:
void EnsureDbusMenuSynced();
private:
diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx
index 3e827ff2b75c..405c635bdb83 100644
--- a/vcl/inc/unx/gtk/gtksalmenu.hxx
+++ b/vcl/inc/unx/gtk/gtksalmenu.hxx
@@ -10,6 +10,7 @@
#ifndef INCLUDED_VCL_INC_UNX_GTK_GTKSALMENU_HXX
#define INCLUDED_VCL_INC_UNX_GTK_GTKSALMENU_HXX
+#include <config_dbus.h>
#include <config_gio.h>
#include <vector>
@@ -20,7 +21,7 @@
#include <unx/salmenu.h>
#include <unx/gtk/gtkframe.hxx>
-#if defined(ENABLE_DBUS) && ENABLE_GIO && \
+#if ENABLE_DBUS && ENABLE_GIO && \
(GLIB_MAJOR_VERSION > 2 || GLIB_MINOR_VERSION >= 36)
# define ENABLE_GMENU_INTEGRATION
# include <unx/gtk/glomenu.h>
diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx
index edd303cebad2..8def3626be10 100644
--- a/vcl/unx/generic/fontmanager/fontconfig.cxx
+++ b/vcl/unx/generic/fontmanager/fontconfig.cxx
@@ -37,7 +37,7 @@ using namespace psp;
#include <ft2build.h>
#include <fontconfig/fcfreetype.h>
-#if defined(ENABLE_DBUS) && defined(ENABLE_PACKAGEKIT)
+#if ENABLE_DBUS && defined(ENABLE_PACKAGEKIT)
#include <dbus/dbus-glib.h>
#endif
@@ -877,7 +877,7 @@ namespace
return LanguageTag(OStringToOUString(aBuf.makeStringAndClear(), RTL_TEXTENCODING_UTF8));
}
-#if defined(ENABLE_DBUS) && defined(ENABLE_PACKAGEKIT)
+#if ENABLE_DBUS && defined(ENABLE_PACKAGEKIT)
guint get_xid_for_dbus()
{
const vcl::Window *pTopWindow = Application::IsHeadlessModeEnabled() ? nullptr : Application::GetActiveTopWindow();
@@ -887,7 +887,7 @@ namespace
#endif
}
-#if defined(ENABLE_DBUS) && defined(ENABLE_PACKAGEKIT)
+#if ENABLE_DBUS && defined(ENABLE_PACKAGEKIT)
IMPL_LINK_NOARG_TYPED(PrintFontManager, autoInstallFontLangSupport, Timer *, void)
{
guint xid = get_xid_for_dbus();
@@ -1098,7 +1098,7 @@ void PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissi
}
}
OUString sStillMissing(pRemainingCodes.get(), nRemainingLen);
-#if defined(ENABLE_DBUS) && defined(ENABLE_PACKAGEKIT)
+#if ENABLE_DBUS && defined(ENABLE_PACKAGEKIT)
if (get_xid_for_dbus())
{
if (sStillMissing == rMissingCodes) //replaced nothing
diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx
index d8863a4cb114..b2525ac232a3 100644
--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
+++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
@@ -674,7 +674,7 @@ PrintFontManager::PrintFontManager()
}
}
-#if defined(ENABLE_DBUS) && defined(ENABLE_PACKAGEKIT)
+#if ENABLE_DBUS && defined(ENABLE_PACKAGEKIT)
m_aFontInstallerTimer.SetTimeoutHdl(LINK(this, PrintFontManager, autoInstallFontLangSupport));
m_aFontInstallerTimer.SetTimeout(5000);
#endif
diff --git a/vcl/unx/generic/window/screensaverinhibitor.cxx b/vcl/unx/generic/window/screensaverinhibitor.cxx
index ca4cecc160b6..3c2032334872 100644
--- a/vcl/unx/generic/window/screensaverinhibitor.cxx
+++ b/vcl/unx/generic/window/screensaverinhibitor.cxx
@@ -15,7 +15,9 @@
#include <X11/Xlib.h>
#include <postx.h>
-#ifdef ENABLE_DBUS
+#include <config_dbus.h>
+
+#if ENABLE_DBUS
#include <dbus/dbus-glib.h>
#define FDO_DBUS_SERVICE "org.freedesktop.ScreenSaver"
@@ -64,7 +66,7 @@ void ScreenSaverInhibitor::inhibit( bool bInhibit, const OUString& sReason,
}
}
-#ifdef ENABLE_DBUS
+#if ENABLE_DBUS
void dbusInhibit( bool bInhibit,
const gchar* service, const gchar* path, const gchar* interface,
std::function<bool( DBusGProxy*, guint&, GError*& )> fInhibit,
@@ -135,7 +137,7 @@ void dbusInhibit( bool bInhibit,
void ScreenSaverInhibitor::inhibitFDO( bool bInhibit, const char* appname, const char* reason )
{
-#ifdef ENABLE_DBUS
+#if ENABLE_DBUS
dbusInhibit( bInhibit,
FDO_DBUS_SERVICE, FDO_DBUS_PATH, FDO_DBUS_INTERFACE,
[appname, reason] ( DBusGProxy *proxy, guint& nCookie, GError*& error ) -> bool {
@@ -165,7 +167,7 @@ void ScreenSaverInhibitor::inhibitFDO( bool bInhibit, const char* appname, const
void ScreenSaverInhibitor::inhibitFDOPM( bool bInhibit, const char* appname, const char* reason )
{
-#ifdef ENABLE_DBUS
+#if ENABLE_DBUS
dbusInhibit( bInhibit,
FDOPM_DBUS_SERVICE, FDOPM_DBUS_PATH, FDOPM_DBUS_INTERFACE,
[appname, reason] ( DBusGProxy *proxy, guint& nCookie, GError*& error ) -> bool {
@@ -195,7 +197,7 @@ void ScreenSaverInhibitor::inhibitFDOPM( bool bInhibit, const char* appname, con
void ScreenSaverInhibitor::inhibitGSM( bool bInhibit, const char* appname, const char* reason, const unsigned int xid )
{
-#ifdef ENABLE_DBUS
+#if ENABLE_DBUS
dbusInhibit( bInhibit,
GSM_DBUS_SERVICE, GSM_DBUS_PATH, GSM_DBUS_INTERFACE,
[appname, reason, xid] ( DBusGProxy *proxy, guint& nCookie, GError*& error ) -> bool {
@@ -228,7 +230,7 @@ void ScreenSaverInhibitor::inhibitGSM( bool bInhibit, const char* appname, const
void ScreenSaverInhibitor::inhibitMSM( bool bInhibit, const char* appname, const char* reason, const unsigned int xid )
{
-#ifdef ENABLE_DBUS
+#if ENABLE_DBUS
dbusInhibit( bInhibit,
MSM_DBUS_SERVICE, MSM_DBUS_PATH, MSM_DBUS_INTERFACE,
[appname, reason, xid] ( DBusGProxy *proxy, guint& nCookie, GError*& error ) -> bool {
diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx
index fcd05b0d758d..3c16a96c59c3 100644
--- a/vcl/unx/gtk/gtksalframe.cxx
+++ b/vcl/unx/gtk/gtksalframe.cxx
@@ -42,7 +42,7 @@
#include <config_gio.h>
#include <unx/x11/xlimits.hxx>
-#if defined(ENABLE_DBUS) && ENABLE_GIO
+#if ENABLE_DBUS && ENABLE_GIO
# include <unx/gtk/gtksalmenu.hxx>
#endif
#if defined ENABLE_GMENU_INTEGRATION // defined in gtksalmenu.hxx above
@@ -437,7 +437,7 @@ GtkSalFrame::GtkSalFrame( SalFrame* pParent, SalFrameStyleFlags nStyle )
m_bDefaultPos = true;
m_bDefaultSize = ( (nStyle & SalFrameStyleFlags::SIZEABLE) && ! pParent );
m_bWindowIsGtkPlug = false;
-#if defined(ENABLE_DBUS) && ENABLE_GIO
+#if ENABLE_DBUS && ENABLE_GIO
m_pLastSyncedDbusMenu = nullptr;
#endif
Init( pParent, nStyle );
@@ -453,7 +453,7 @@ GtkSalFrame::GtkSalFrame( SystemParentData* pSysData )
GetGenericData()->ErrorTrapPush();
m_bDefaultPos = true;
m_bDefaultSize = true;
-#if defined(ENABLE_DBUS) && ENABLE_GIO
+#if ENABLE_DBUS && ENABLE_GIO
m_pLastSyncedDbusMenu = nullptr;
#endif
Init( pSysData );
@@ -493,7 +493,7 @@ static void ObjectDestroyedNotify( gpointer data )
}
}
-#if defined(ENABLE_DBUS) && ENABLE_GIO
+#if ENABLE_DBUS && ENABLE_GIO
void GtkSalFrame::EnsureDbusMenuSynced()
{
GtkSalMenu* pSalMenu = static_cast<GtkSalMenu*>(GetMenu());
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 6d02b81f511e..c125ec552b69 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -40,7 +40,7 @@
#include <config_gio.h>
-#if defined(ENABLE_DBUS) && ENABLE_GIO
+#if ENABLE_DBUS && ENABLE_GIO
# include <unx/gtk/gtksalmenu.hxx>
#endif
#if defined ENABLE_GMENU_INTEGRATION // defined in gtksalmenu.hxx above
@@ -463,7 +463,7 @@ GtkSalFrame::GtkSalFrame( SalFrame* pParent, SalFrameStyleFlags nStyle )
m_bDefaultPos = true;
m_bDefaultSize = ( (nStyle & SalFrameStyleFlags::SIZEABLE) && ! pParent );
m_bWindowIsGtkPlug = false;
-#if defined(ENABLE_DBUS) && ENABLE_GIO
+#if ENABLE_DBUS && ENABLE_GIO
m_pLastSyncedDbusMenu = nullptr;
#endif
Init( pParent, nStyle );
@@ -479,7 +479,7 @@ GtkSalFrame::GtkSalFrame( SystemParentData* pSysData )
GetGenericData()->ErrorTrapPush();
m_bDefaultPos = true;
m_bDefaultSize = true;
-#if defined(ENABLE_DBUS) && ENABLE_GIO
+#if ENABLE_DBUS && ENABLE_GIO
m_pLastSyncedDbusMenu = nullptr;
#endif
Init( pSysData );
@@ -496,7 +496,7 @@ static void ObjectDestroyedNotify( gpointer data )
}
}
-#if defined(ENABLE_DBUS) && ENABLE_GIO
+#if ENABLE_DBUS && ENABLE_GIO
void GtkSalFrame::EnsureDbusMenuSynced()
{
GtkSalMenu* pSalMenu = static_cast<GtkSalMenu*>(GetMenu());