move dbus config into its own config header
Change-Id: I5b0734a30dee323d41270de06f6a02fd676155c9 Reviewed-on: https://gerrit.libreoffice.org/22502 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
@@ -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 \
|
||||
|
||||
@@ -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: */
|
||||
@@ -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: */
|
||||
|
||||
@@ -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])
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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))\" \
|
||||
|
||||
@@ -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 \
|
||||
))
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user