diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-05-14 20:09:41 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-05-14 20:09:41 -0500 |
commit | 07b3d083b49b4cbb248b5ba0aeba2bbdd3cc487d (patch) | |
tree | 5f80a6862e44b938c4e7f62f457d1b48f5a0195b /vcl | |
parent | 007f16ef7ad40ae932df884ba04f0de71928b852 (diff) |
TDE integration
Change-Id: I6f468005c8d8d99d9251a9c4fe4629b98bc4aa5e
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/CustomTarget_tde_moc.mk | 39 | ||||
-rw-r--r-- | vcl/Executable_tdefilepicker.mk | 71 | ||||
-rw-r--r-- | vcl/Library_vclplug_tde.mk | 107 | ||||
-rw-r--r-- | vcl/Module_vcl.mk | 7 | ||||
-rw-r--r-- | vcl/inc/generic/gendata.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/unx/desktops.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/unx/kde/kde_headers.h | 98 | ||||
-rw-r--r-- | vcl/inc/unx/tde/tdedata.hxx | 114 | ||||
-rw-r--r-- | vcl/inc/vclpluginapi.h | 6 | ||||
-rw-r--r-- | vcl/prj/build.lst | 2 | ||||
-rw-r--r-- | vcl/source/app/settings.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/desktopdetect/desktopdetector.cxx | 60 | ||||
-rw-r--r-- | vcl/unx/generic/plugadapt/salplug.cxx | 16 | ||||
-rw-r--r-- | vcl/unx/kde/FPServiceInfo.hxx | 21 | ||||
-rw-r--r-- | vcl/unx/kde/fpicker/kdecommandthread.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/kde/fpicker/kdecommandthread.hxx | 10 | ||||
-rw-r--r-- | vcl/unx/kde/fpicker/kdefilepicker.cxx | 30 | ||||
-rw-r--r-- | vcl/unx/kde/fpicker/kdefilepicker.hxx | 8 | ||||
-rw-r--r-- | vcl/unx/kde/fpicker/kdefpmain.cxx | 14 | ||||
-rw-r--r-- | vcl/unx/kde/fpicker/kdemodalityfilter.hxx | 8 | ||||
-rw-r--r-- | vcl/unx/kde/kdedata.cxx | 13 | ||||
-rw-r--r-- | vcl/unx/kde/salnativewidgets-kde.cxx | 4 |
22 files changed, 524 insertions, 113 deletions
diff --git a/vcl/CustomTarget_tde_moc.mk b/vcl/CustomTarget_tde_moc.mk new file mode 100644 index 000000000000..d0c26e2e6858 --- /dev/null +++ b/vcl/CustomTarget_tde_moc.mk @@ -0,0 +1,39 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# Major Contributor(s): +# Copyright (C) 2010 Red Hat, Inc., David Tardon <dtardon@redhat.com> +# (initial developer) +# +# All Rights Reserved. +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. + +$(eval $(call gb_CustomTarget_CustomTarget,vcl/unx/kde/fpicker)) + +$(call gb_CustomTarget_get_target,vcl/unx/kde/fpicker) : \ + $(call gb_CustomTarget_get_workdir,vcl/unx/kde/fpicker)/kdefilepicker.moc.cxx + +$(call gb_CustomTarget_get_workdir,vcl/unx/kde/fpicker)/kdefilepicker.moc.cxx :\ + $(SRCDIR)/vcl/unx/kde/fpicker/kdefilepicker.hxx \ + | $(call gb_CustomTarget_get_workdir,vcl/unx/kde/fpicker)/.dir + $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),MOC,1) + $(MOC) -o $@ $< + +# vim:set shiftwidth=4 tabstop=4 noexpandtab: diff --git a/vcl/Executable_tdefilepicker.mk b/vcl/Executable_tdefilepicker.mk new file mode 100644 index 000000000000..a92bb5ede1cb --- /dev/null +++ b/vcl/Executable_tdefilepicker.mk @@ -0,0 +1,71 @@ +# -*- Mode: makefile; tab-width: 4; indent-tabs-mode: t -*- +# +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# Major Contributor(s): +# Copyright (C) 2011 Matúš Kukan <matus.kukan@gmail.com> (initial developer) +# Copyright (C) 2012 Timothy Pearson (TDE) +# +# All Rights Reserved. +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. + +$(eval $(call gb_Executable_Executable,tdefilepicker)) + +$(eval $(call gb_Executable_add_defs,tdefilepicker,\ + $(TDE_CFLAGS) \ + -DENABLE_TDE \ +)) + +$(eval $(call gb_Executable_set_include,tdefilepicker,\ + $$(INCLUDE) \ + -I$(SRCDIR)/vcl/inc \ + -I$(SRCDIR)/solenv/inc \ + -I$(SRCDIR)/vcl/inc/unx/tde \ +)) + +$(eval $(call gb_Executable_use_libraries,tdefilepicker,\ + sal \ + $(gb_STDLIBS) \ +)) + +$(eval $(call gb_Executable_add_libs,tdefilepicker,\ + $(TDE_LIBS) \ + -lkio -lX11 \ +)) + +$(eval $(call gb_Executable_add_exception_objects,tdefilepicker,\ + vcl/unx/kde/fpicker/kdecommandthread \ + vcl/unx/kde/fpicker/kdefilepicker \ + vcl/unx/kde/fpicker/kdefpmain \ + vcl/unx/kde/fpicker/kdemodalityfilter \ +)) + +$(eval $(call gb_Executable_add_generated_cxxobjects,tdefilepicker,\ + CustomTarget/vcl/unx/kde/fpicker/kdefilepicker.moc \ +)) + +$(eval $(call gb_Executable_set_warnings_not_errors,tdefilepicker)) + +# TDE/TQt consider -Wshadow more trouble than benefit +$(eval $(call gb_Executable_add_cxxflags,kdefilepicker,\ + -Wno-shadow \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/vcl/Library_vclplug_tde.mk b/vcl/Library_vclplug_tde.mk new file mode 100644 index 000000000000..2e3a8c659024 --- /dev/null +++ b/vcl/Library_vclplug_tde.mk @@ -0,0 +1,107 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +#************************************************************************* +# +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Initial Developer of the Original Code is +# Timothy Pearson <kb9vqf@pearsoncomputing.net> (C) 2012, All Rights Reserved. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. +# +#************************************************************************* + +$(eval $(call gb_Library_Library,vclplug_tde)) + +$(eval $(call gb_Library_use_packages,vclplug_tde,\ + fpicker_inc \ +)) + +$(eval $(call gb_Library_set_include,vclplug_tde,\ + $$(INCLUDE) \ + -I$(SRCDIR)/vcl/inc \ + -I$(SRCDIR)/solenv/inc \ + -I$(SRCDIR)/vcl/inc/unx/tde \ +)) + +$(eval $(call gb_Library_set_include,vclplug_tde,\ + $$(INCLUDE) \ + $$(TDE_CFLAGS) \ +)) + +$(eval $(call gb_Library_add_defs,vclplug_tde,\ + -DVCLPLUG_TDE_IMPLEMENTATION \ +)) + +$(eval $(call gb_Library_use_api,vclplug_tde,\ + offapi \ + udkapi \ +)) + +$(eval $(call gb_Library_add_libs,vclplug_tde,\ + $$(TDE_LIBS) \ +)) + +$(eval $(call gb_Library_use_libraries,vclplug_tde,\ + vclplug_gen \ + vcl \ + tl \ + utl \ + sot \ + ucbhelper \ + basegfx \ + comphelper \ + cppuhelper \ + i18nisolang1 \ + i18nutil \ + jvmaccess \ + cppu \ + sal \ + X11 \ + Xext \ + SM \ + ICE \ + $(gb_STDLIBS) \ +)) + +$(eval $(call gb_Library_use_externals,vclplug_tde,\ + icule \ + icuuc \ +)) + +$(eval $(call gb_Library_add_exception_objects,vclplug_tde,\ + vcl/unx/kde/kdedata \ + vcl/unx/kde/salnativewidgets-kde \ + vcl/unx/kde/UnxCommandThread \ + vcl/unx/kde/UnxFilePicker \ + vcl/unx/kde/UnxNotifyThread \ +)) + +# TDE/TQt consider -Wshadow more trouble than benefit +$(eval $(call gb_Library_add_cxxflags,vclplug_tde,\ + -Wno-shadow \ +)) + +$(eval $(call gb_Library_set_warnings_not_errors,vclplug_tde)) + +ifeq ($(OS),LINUX) +$(eval $(call gb_Library_use_libraries,vclplug_tde,\ + dl \ + m \ + pthread \ +)) +endif +# vim: set noet sw=4 ts=4: diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk index 2cd2bf5d667b..441ec37646f1 100644 --- a/vcl/Module_vcl.mk +++ b/vcl/Module_vcl.mk @@ -55,6 +55,13 @@ $(eval $(call gb_Module_add_targets,vcl,\ Library_vclplug_gtk3 \ )) endif +ifneq ($(ENABLE_TDE),) +$(eval $(call gb_Module_add_targets,vcl,\ + CustomTarget_tde_moc \ + Executable_tdefilepicker \ + Library_vclplug_tde \ +)) +endif ifneq ($(ENABLE_KDE),) $(eval $(call gb_Module_add_targets,vcl,\ CustomTarget_kde_moc \ diff --git a/vcl/inc/generic/gendata.hxx b/vcl/inc/generic/gendata.hxx index f6e2668a261c..67226b0a5239 100644 --- a/vcl/inc/generic/gendata.hxx +++ b/vcl/inc/generic/gendata.hxx @@ -38,7 +38,7 @@ class SalGenericDisplay; class SalDisplay; class GtkSalDisplay; enum SalGenericDataType { SAL_DATA_GTK, SAL_DATA_GTK3, - SAL_DATA_KDE3, SAL_DATA_KDE4, + SAL_DATA_TDE3, SAL_DATA_KDE3, SAL_DATA_KDE4, SAL_DATA_UNX, SAL_DATA_SVP, SAL_DATA_ANDROID, SAL_DATA_IOS, SAL_DATA_HEADLESS }; diff --git a/vcl/inc/unx/desktops.hxx b/vcl/inc/unx/desktops.hxx index de4ebb8eab01..4ec9d7bd7a90 100644 --- a/vcl/inc/unx/desktops.hxx +++ b/vcl/inc/unx/desktops.hxx @@ -33,6 +33,7 @@ enum DesktopType { DESKTOP_NONE, // headless, i.e. no X connection at all DESKTOP_UNKNOWN, // unknown desktop, simple WM, etc. DESKTOP_GNOME, + DESKTOP_TDE, DESKTOP_KDE, DESKTOP_KDE4, DESKTOP_CDE diff --git a/vcl/inc/unx/kde/kde_headers.h b/vcl/inc/unx/kde/kde_headers.h deleted file mode 100644 index 7ec45fdc383d..000000000000 --- a/vcl/inc/unx/kde/kde_headers.h +++ /dev/null @@ -1,98 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef INCLUDED_VCL_KDE_HEADERS_H -#define INCLUDED_VCL_KDE_HEADERS_H - -/* ********* Suppress warnings if needed */ -#include "sal/config.h" - -#include <cstddef> - -#if defined __GNUC__ -#pragma GCC system_header -#endif - - -/* ********* Hack, but needed because of conflicting types... */ -#define Region QtXRegion - - -/* ********* Qt headers */ -#include <qaccessible.h> -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qfont.h> -#include <qframe.h> -#include <qlineedit.h> -#include <qlistview.h> -#include <qmainwindow.h> -#include <qmenudata.h> -#include <qpaintdevice.h> -#include <qpainter.h> -#include <qpushbutton.h> -#include <qradiobutton.h> -#include <qrangecontrol.h> -#include <qstring.h> -#include <qtabbar.h> -#include <qtabwidget.h> -#include <qtoolbar.h> -#include <qtoolbutton.h> -#include <qwidget.h> -#include <qprogressbar.h> - -/* ********* See hack on top of this file */ -#undef Region - - -/* ********* KDE base headers */ -#include <kaboutdata.h> -#include <kapplication.h> -#include <kcmdlineargs.h> -#include <kconfig.h> -#include <kdeversion.h> -#include <kemailsettings.h> -#include <kglobal.h> -#include <kglobalsettings.h> -#include <klocale.h> -#include <kmainwindow.h> -#include <kmenubar.h> -#include <kprotocolmanager.h> -#include <kstartupinfo.h> -#include <kstyle.h> - - -/* ********* KDE address book connectivity headers */ -#include <kabc/addressbook.h> -#include <kabc/addressee.h> -#include <kabc/field.h> -#include <kabc/stdaddressbook.h> - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/unx/tde/tdedata.hxx b/vcl/inc/unx/tde/tdedata.hxx new file mode 100644 index 000000000000..c6b8dac18d4e --- /dev/null +++ b/vcl/inc/unx/tde/tdedata.hxx @@ -0,0 +1,114 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2012 Timothy Pearson + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _VCL_TDEDATA_HXX +#define _VCL_TDEDATA_HXX + +#include <unx/saldisp.hxx> +#include <unx/saldata.hxx> +#include <unx/salframe.h> + +class TDEData : public X11SalData +{ +public: + TDEData( SalInstance *pInstance ) : X11SalData( SAL_DATA_TDE, pInstance ) {} + virtual ~TDEData(); + + virtual void Init(); + virtual void initNWF(); + virtual void deInitNWF(); +}; + +class SalTDEDisplay : public SalX11Display +{ +public: + SalTDEDisplay( Display* pDisp ); + virtual ~SalTDEDisplay(); +}; + +class TDESalFrame : public X11SalFrame +{ + static const int nMaxGraphics = 2; + + struct GraphicsHolder + { + X11SalGraphics* pGraphics; + bool bInUse; + GraphicsHolder() + : pGraphics( NULL ), + bInUse( false ) + {} + ~GraphicsHolder(); + }; + GraphicsHolder m_aGraphics[ nMaxGraphics ]; + +public: + TDESalFrame( SalFrame* pParent, sal_uLong ); + virtual ~TDESalFrame(); + + virtual SalGraphics* GetGraphics(); + virtual void ReleaseGraphics( SalGraphics *pGraphics ); + virtual void updateGraphics( bool bClear ); + virtual void UpdateSettings( AllSettings& rSettings ); + virtual void Show( sal_Bool bVisible, sal_Bool bNoActivate ); +}; + +class TDESalInstance : public X11SalInstance +{ +public: + TDESalInstance( SalYieldMutex* pMutex ) + : X11SalInstance( pMutex ) {} + virtual ~TDESalInstance() {} + virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uLong nStyle ); +}; + +class TDEXLib : public SalXLib +{ + bool m_bStartupDone; + void* m_pApplication; + char** m_pFreeCmdLineArgs; + char** m_pAppCmdLineArgs; + int m_nFakeCmdLineArgs; +public: + TDEXLib() : SalXLib(), + m_bStartupDone( false ), + m_pApplication( NULL ), + m_pFreeCmdLineArgs( NULL ), + m_pAppCmdLineArgs( NULL ), + m_nFakeCmdLineArgs( 0 ) + {} + virtual ~TDEXLib(); + virtual void Init(); + + void doStartup(); +}; + +#endif // _VCL_TDEDATA_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/vclpluginapi.h b/vcl/inc/vclpluginapi.h index 462943b95401..ec4a1c28169f 100644 --- a/vcl/inc/vclpluginapi.h +++ b/vcl/inc/vclpluginapi.h @@ -44,6 +44,12 @@ #define VCLPLUG_GTK_PUBLIC SAL_DLLPUBLIC_IMPORT #endif +#if defined VCLPLUG_TDE_IMPLEMENTATION +#define VCLPLUG_TDE_PUBLIC SAL_DLLPUBLIC_EXPORT +#else +#define VCLPLUG_TDE_PUBLIC SAL_DLLPUBLIC_IMPORT +#endif + #if defined VCLPLUG_KDE_IMPLEMENTATION #define VCLPLUG_KDE_PUBLIC SAL_DLLPUBLIC_EXPORT #else diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst index a44d6df4306b..9b51836f052f 100644 --- a/vcl/prj/build.lst +++ b/vcl/prj/build.lst @@ -1,4 +1,4 @@ -vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost officecfg DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offapi basegfx basebmp tools DESKTOP:l10ntools icc cpputools svl LIBXSLT:libxslt CAIRO:cairo FREETYPE:freetype FONTCONFIG:fontconfig fpicker NULL +vc vcl : TRANSLATIONS:translations apple_remote BOOST:boost officecfg DESKTOP:rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offapi basegfx basebmp tools DESKTOP:l10ntools icc cpputools svl LIBXSLT:libxslt CAIRO:cairo FREETYPE:freetype FONTCONFIG:fontconfig fpicker shell NULL vc vcl usr1 - all vc_mkout NULL vc vcl\prj nmake - all vc_prj NULL diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 35ed7a818a1b..651fbdb30636 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -616,6 +616,8 @@ sal_uLong StyleSettings::GetAutoSymbolsStyle() const ( env.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("gnome")) || env.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("windows")) ) ? STYLE_SYMBOLS_TANGO + : env.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("tde")) + ? STYLE_SYMBOLS_CRYSTAL : env.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("kde")) ? STYLE_SYMBOLS_CRYSTAL : env.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("kde4")) diff --git a/vcl/unx/generic/desktopdetect/desktopdetector.cxx b/vcl/unx/generic/desktopdetect/desktopdetector.cxx index f69f2dee6491..68b3b711dd82 100644 --- a/vcl/unx/generic/desktopdetect/desktopdetector.cxx +++ b/vcl/unx/generic/desktopdetect/desktopdetector.cxx @@ -145,6 +145,47 @@ extern "C" typedef int(* XErrorHandler)(Display*,XErrorEvent*); } +static int TDEVersion( Display* pDisplay ) +{ + int nRet = 0; + + Atom nFullSession = XInternAtom( pDisplay, "TDE_FULL_SESSION", True ); + Atom nTDEVersion = XInternAtom( pDisplay, "TDE_SESSION_VERSION", True ); + + if( nFullSession ) + { + if( !nTDEVersion ) + return 14; + + Atom aRealType = None; + int nFormat = 8; + unsigned long nItems = 0; + unsigned long nBytesLeft = 0; + unsigned char* pProperty = NULL; + XGetWindowProperty( pDisplay, + DefaultRootWindow( pDisplay ), + nTDEVersion, + 0, 1, + False, + AnyPropertyType, + &aRealType, + &nFormat, + &nItems, + &nBytesLeft, + &pProperty ); + if( !WasXError() && nItems != 0 && pProperty ) + { + nRet = *reinterpret_cast< sal_Int32* >( pProperty ); + } + if( pProperty ) + { + XFree( pProperty ); + pProperty = NULL; + } + } + return nRet; +} + static int KDEVersion( Display* pDisplay ) { int nRet = 0; @@ -186,6 +227,19 @@ static int KDEVersion( Display* pDisplay ) return nRet; } +static bool is_tde_desktop( Display* pDisplay ) +{ + if ( NULL != getenv( "TDE_FULL_SESSION" ) ) + { + return true; // TDE + } + + if ( TDEVersion( pDisplay ) >= 14 ) + return true; + + return false; +} + static bool is_kde_desktop( Display* pDisplay ) { if ( NULL != getenv( "KDE_FULL_SESSION" ) ) @@ -237,6 +291,8 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment() { OString aOver( pOverride ); + if ( aOver.equalsIgnoreAsciiCase( "tde" ) ) + return DESKTOP_TDE; if ( aOver.equalsIgnoreAsciiCase( "kde4" ) ) return DESKTOP_KDE4; if ( aOver.equalsIgnoreAsciiCase( "gnome" ) ) @@ -295,7 +351,9 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment() XErrorHandler pOldHdl = XSetErrorHandler( autodect_error_handler ); - if ( is_kde4_desktop( pDisplay ) ) + if ( is_tde_desktop( pDisplay ) ) + ret = DESKTOP_TDE; + else if ( is_kde4_desktop( pDisplay ) ) ret = DESKTOP_KDE4; else if ( is_gnome_desktop( pDisplay ) ) ret = DESKTOP_GNOME; diff --git a/vcl/unx/generic/plugadapt/salplug.cxx b/vcl/unx/generic/plugadapt/salplug.cxx index d2400d7f857b..ab19d345251f 100644 --- a/vcl/unx/generic/plugadapt/salplug.cxx +++ b/vcl/unx/generic/plugadapt/salplug.cxx @@ -98,7 +98,7 @@ static SalInstance* tryInstance( const OUString& rModuleBase, bool bForce = fals * #i109007# KDE3 seems to have the same problem. * And same applies for KDE4. */ - if( rModuleBase == "gtk" || rModuleBase == "gtk3" || rModuleBase == "kde" || rModuleBase == "kde4" ) + if( rModuleBase == "gtk" || rModuleBase == "gtk3" || rModuleBase == "tde" || rModuleBase == "kde" || rModuleBase == "kde4" ) { pCloseModule = NULL; } @@ -159,6 +159,11 @@ static DesktopType get_desktop_environment() static SalInstance* autodetect_plugin() { + static const char* pTDEFallbackList[] = + { + "tde", "kde4", "kde", "gtk3", "gtk", "gen", 0 + }; + static const char* pKDEFallbackList[] = { "kde4", "kde", "gtk3", "gtk", "gen", 0 @@ -183,6 +188,11 @@ static SalInstance* autodetect_plugin() pList = pHeadlessFallbackList; else if ( desktop == DESKTOP_GNOME ) pList = pStandardFallbackList; + else if( desktop == DESKTOP_TDE ) + { + pList = pTDEFallbackList; + nListEntry = 1; + } else if( desktop == DESKTOP_KDE ) { pList = pKDEFallbackList; @@ -236,7 +246,7 @@ SalInstance *CreateSalInstance() pInst = autodetect_plugin(); // fallback, try everything - const char* pPlugin[] = { "gtk3", "gtk", "kde4", "kde", "gen", 0 }; + const char* pPlugin[] = { "gtk3", "gtk", "tde", "kde4", "kde", "gen", 0 }; for ( int i = 0; !pInst && pPlugin[ i ]; ++i ) pInst = tryInstance( OUString::createFromAscii( pPlugin[ i ] ) ); @@ -291,7 +301,7 @@ void SalAbort( const rtl::OUString& rErrorText, bool bDumpCore ) _exit(1); } -static const char * desktop_strings[] = { "none", "unknown", "GNOME", "KDE", "KDE4" }; +static const char * desktop_strings[] = { "none", "unknown", "GNOME", "TDE", "KDE", "KDE4" }; const OUString& SalGetDesktopEnvironment() { diff --git a/vcl/unx/kde/FPServiceInfo.hxx b/vcl/unx/kde/FPServiceInfo.hxx index 9e4cbf1ac44d..17d2dd64cee7 100644 --- a/vcl/unx/kde/FPServiceInfo.hxx +++ b/vcl/unx/kde/FPServiceInfo.hxx @@ -30,11 +30,21 @@ #ifndef _FPSERVICEINFO_HXX_ #define _FPSERVICEINFO_HXX_ +#ifdef ENABLE_TDE + // the service names -#define FILE_PICKER_SERVICE_NAME "com.sun.star.ui.dialogs.KDEFilePicker" +#define FILE_PICKER_SERVICE_NAME "com.sun.star.ui.dialogs.TDEFilePicker" -// the implementation names -#define FILE_PICKER_IMPL_NAME "com.sun.star.ui.dialogs.UnxFilePicker" +// the registry key names +// a key under which this service will be registered, +// Format: -> "/ImplName/UNO/SERVICES/ServiceName" +// <Implementation-Name></UNO/SERVICES/><Service-Name> +#define FILE_PICKER_REGKEY_NAME "/com.sun.star.ui.dialogs.UnxFilePicker/UNO/SERVICES/com.sun.star.ui.dialogs.TDEFilePicker" + +#else // ENABLE_TDE + +// the service names +#define FILE_PICKER_SERVICE_NAME "com.sun.star.ui.dialogs.KDEFilePicker" // the registry key names // a key under which this service will be registered, @@ -42,6 +52,11 @@ // <Implementation-Name></UNO/SERVICES/><Service-Name> #define FILE_PICKER_REGKEY_NAME "/com.sun.star.ui.dialogs.UnxFilePicker/UNO/SERVICES/com.sun.star.ui.dialogs.KDEFilePicker" +#endif // ENABLE_TDE + +// the implementation names +#define FILE_PICKER_IMPL_NAME "com.sun.star.ui.dialogs.UnxFilePicker" + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde/fpicker/kdecommandthread.cxx b/vcl/unx/kde/fpicker/kdecommandthread.cxx index b68ddb0030c4..6aeea9bfbca6 100644 --- a/vcl/unx/kde/fpicker/kdecommandthread.cxx +++ b/vcl/unx/kde/fpicker/kdecommandthread.cxx @@ -30,7 +30,11 @@ #include <kdecommandthread.hxx> +#ifdef ENABLE_TDE +#include <tqstringlist.h> +#else // ENABLE_TDE #include <qstringlist.h> +#endif // ENABLE_TDE #include <kapplication.h> diff --git a/vcl/unx/kde/fpicker/kdecommandthread.hxx b/vcl/unx/kde/fpicker/kdecommandthread.hxx index 7486bf9192f6..07b81f8b7835 100644 --- a/vcl/unx/kde/fpicker/kdecommandthread.hxx +++ b/vcl/unx/kde/fpicker/kdecommandthread.hxx @@ -29,9 +29,19 @@ #ifndef _KDECOMMANDTHREAD_HXX_ #define _KDECOMMANDTHREAD_HXX_ +#ifdef ENABLE_TDE +#include <shell/tde_defines.h> +#endif // ENABLE_TDE + +#ifdef ENABLE_TDE +#include <tqevent.h> +#include <tqmutex.h> +#include <tqthread.h> +#else // ENABLE_TDE #include <qevent.h> #include <qmutex.h> #include <qthread.h> +#endif // ENABLE_TDE class KDECommandEvent : public QCustomEvent { diff --git a/vcl/unx/kde/fpicker/kdefilepicker.cxx b/vcl/unx/kde/fpicker/kdefilepicker.cxx index 779a34d894d0..d52a6a772b0a 100644 --- a/vcl/unx/kde/fpicker/kdefilepicker.cxx +++ b/vcl/unx/kde/fpicker/kdefilepicker.cxx @@ -31,6 +31,34 @@ #include <kdecommandthread.hxx> #include <kdefilepicker.hxx> +#ifdef ENABLE_TDE + +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqgrid.h> +#include <tqhbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqobjectlist.h> +#include <tqpushbutton.h> +#include <tqregexp.h> +#include <tqvbox.h> + +#ifdef TQT_NO_EMIT +#define emit +#endif + +#include <tdeversion.h> +#include <kdiroperator.h> +#include <kfiledialog.h> +#include <kfilefiltercombo.h> +#include <kio/netaccess.h> +#include <klocale.h> +#include <kmessagebox.h> +#include <ktempfile.h> + +#else // ENABLE_TDE + #include <qcheckbox.h> #include <qcombobox.h> #include <qgrid.h> @@ -55,6 +83,8 @@ #include <kmessagebox.h> #include <ktempfile.h> +#endif // ENABLE_TDE + #include <algorithm> #include <iostream> diff --git a/vcl/unx/kde/fpicker/kdefilepicker.hxx b/vcl/unx/kde/fpicker/kdefilepicker.hxx index 4d545ebc76ca..058d6f6da34d 100644 --- a/vcl/unx/kde/fpicker/kdefilepicker.hxx +++ b/vcl/unx/kde/fpicker/kdefilepicker.hxx @@ -29,6 +29,10 @@ #ifndef _KDEFILEPICKER_HXX_ #define _KDEFILEPICKER_HXX_ +#ifdef ENABLE_TDE +#include <shell/tde_defines.h> +#endif // ENABLE_TDE + #include <cstddef> #include <kfiledialog.h> @@ -40,7 +44,11 @@ class QVBox; class KDEFileDialog : public KFileDialog { +#ifdef ENABLE_TDE + TQ_OBJECT +#else // ENABLE_TDE Q_OBJECT +#endif // ENABLE_TDE protected: typedef QPair< QString, QString > FilterEntry; diff --git a/vcl/unx/kde/fpicker/kdefpmain.cxx b/vcl/unx/kde/fpicker/kdefpmain.cxx index be4022664014..558c01ba0e55 100644 --- a/vcl/unx/kde/fpicker/kdefpmain.cxx +++ b/vcl/unx/kde/fpicker/kdefpmain.cxx @@ -39,6 +39,14 @@ #include <iostream> #include <stdlib.h> +#ifdef ENABLE_TDE +#define THIS_DESKENV_NAME_CAP "TDE" +#define THIS_DESKENV_NAME_LOW "tde" +#else // ENABLE_TDE +#define THIS_DESKENV_NAME_CAP "KDE" +#define THIS_DESKENV_NAME_LOW "kde" +#endif // ENABLE_TDE + ////////////////////////////////////////////////////////////////////////// // Main ////////////////////////////////////////////////////////////////////////// @@ -54,13 +62,13 @@ int main( int argc, char* argv[] ) // we fake the name of the application to have "LibreOffice" in the // title KAboutData qAboutData( "kdefilepicker", I18N_NOOP( "LibreOffice" ), - "0.1", I18N_NOOP( "kdefilepicker is an implementation of the KDE file dialog for LibreOffice." ), + "0.1", I18N_NOOP( "kdefilepicker is an implementation of the " THIS_DESKENV_NAME_CAP " file dialog for LibreOffice." ), KAboutData::License_LGPL, "(c) 2004, Jan Holesovsky" ); qAboutData.addAuthor( "Jan Holesovsky", I18N_NOOP("Original author and current maintainer"), "kendy@openoffice.org" ); // Let the user see that this does something... - ::std::cerr << "kdefilepicker, an implementation of KDE file dialog for OOo." << ::std::endl + ::std::cerr << "kdefilepicker, an implementation of a " THIS_DESKENV_NAME_CAP " file dialog for OOo." << ::std::endl << "Type 'exit' and press Enter to finish." << ::std::endl; KCmdLineArgs::addCmdLineOptions( sOptions ); @@ -77,7 +85,7 @@ int main( int argc, char* argv[] ) KDEModalityFilter qModalityFilter( nWinId ); - KDEFileDialog aFileDialog( NULL, QString(), NULL, "kdefiledialog" ); + KDEFileDialog aFileDialog( NULL, QString(), NULL, THIS_DESKENV_NAME_LOW "filedialog" ); KDECommandThread qCommandThread( &aFileDialog ); qCommandThread.start(); diff --git a/vcl/unx/kde/fpicker/kdemodalityfilter.hxx b/vcl/unx/kde/fpicker/kdemodalityfilter.hxx index 8635694a39e1..e2296ab36651 100644 --- a/vcl/unx/kde/fpicker/kdemodalityfilter.hxx +++ b/vcl/unx/kde/fpicker/kdemodalityfilter.hxx @@ -29,7 +29,15 @@ #ifndef _KDEMODALITYFILTER_HXX_ #define _KDEMODALITYFILTER_HXX_ +#ifdef ENABLE_TDE +#include <shell/tde_defines.h> +#endif // ENABLE_TDE + +#ifdef ENABLE_TDE +#include <tqobject.h> +#else // ENABLE_TDE #include <qobject.h> +#endif // ENABLE_TDE class KDEModalityFilter : public QObject { diff --git a/vcl/unx/kde/kdedata.cxx b/vcl/unx/kde/kdedata.cxx index d66e22719784..195915bc6e39 100644 --- a/vcl/unx/kde/kdedata.cxx +++ b/vcl/unx/kde/kdedata.cxx @@ -28,7 +28,8 @@ #define _SV_SALDATA_CXX -#include <unx/kde/kde_headers.h> + +#include <shell/kde_headers.h> #include <unistd.h> #include <fcntl.h> @@ -56,6 +57,14 @@ #include "vclpluginapi.h" +#ifdef ENABLE_TDE +#define THIS_DESKENV_NAME_CAP "TDE" +#define THIS_DESKENV_NAME_LOW "tde" +#else // ENABLE_TDE +#define THIS_DESKENV_NAME_CAP "KDE" +#define THIS_DESKENV_NAME_LOW "kde" +#endif // ENABLE_TDE + /* #i59042# override KApplications method for session management * since it will interfere badly with our own. */ @@ -123,7 +132,7 @@ void KDEXLib::Init() KAboutData *kAboutData = new KAboutData( "LibreOffice", I18N_NOOP( "LibreOffice" ), "1.1.0", - I18N_NOOP( "LibreOffice with KDE Native Widget Support." ), + I18N_NOOP( "LibreOffice with " THIS_DESKENV_NAME_CAP " Native Widget Support." ), KAboutData::License_LGPL, "(c) 2003, 2004 Novell, Inc", I18N_NOOP( "LibreOffice is an office suite.\n" ), diff --git a/vcl/unx/kde/salnativewidgets-kde.cxx b/vcl/unx/kde/salnativewidgets-kde.cxx index 0376e94a8ab4..0a5f79f5282d 100644 --- a/vcl/unx/kde/salnativewidgets-kde.cxx +++ b/vcl/unx/kde/salnativewidgets-kde.cxx @@ -28,7 +28,9 @@ #define _SV_SALNATIVEWIDGETS_KDE_CXX -#include <unx/kde/kde_headers.h> + +#include <shell/kde_headers.h> + #include "UnxFilePicker.hxx" #include <unx/salunx.h> |