summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2011-12-13 17:52:01 +0000
committerMichael Meeks <michael.meeks@suse.com>2011-12-14 10:45:11 +0000
commitbe72ad3676d0aee677567f0ccc2e6b404a59fa5a (patch)
tree180a46c6443267a69c414f241c5a1665407d1893 /vcl
parentc5f868147909111ad235e433d6f8368294080b35 (diff)
Disable gtk3 at run-time, unless in experimental mode.
Diffstat (limited to 'vcl')
-rw-r--r--vcl/generic/app/gensys.cxx70
-rw-r--r--vcl/inc/generic/gensys.h1
-rw-r--r--vcl/unx/generic/plugadapt/salplug.cxx6
-rw-r--r--vcl/unx/gtk/gdi/salprn-gtk.cxx67
-rw-r--r--vcl/unx/gtk/window/gtkframe.cxx2
5 files changed, 79 insertions, 67 deletions
diff --git a/vcl/generic/app/gensys.cxx b/vcl/generic/app/gensys.cxx
index 2fae4840bbd2..f7d3f0a8b43a 100644
--- a/vcl/generic/app/gensys.cxx
+++ b/vcl/generic/app/gensys.cxx
@@ -40,6 +40,13 @@
#include <osl/process.h>
#include <osl/thread.h>
+#include "vcl/unohelp.hxx"
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+
+using namespace com::sun::star;
+
SalGenericSystem::SalGenericSystem()
{
}
@@ -174,4 +181,67 @@ rtl::OString SalGenericSystem::getFrameResName( SalExtStyle nStyle )
return aBuf.makeStringAndClear();
}
+bool
+SalGenericSystem::enableExperimentalFeatures()
+{
+ bool bEnable = true;
+ try
+ {
+ // get service provider
+ uno::Reference<lang::XMultiServiceFactory> const xSMgr(vcl::unohelper::GetMultiServiceFactory());
+ // create configuration hierachical access name
+ if (xSMgr.is())
+ {
+ try
+ {
+ uno::Reference<lang::XMultiServiceFactory> const xConfigProvider(
+ uno::Reference<lang::XMultiServiceFactory>(
+ xSMgr->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider"))),
+ uno::UNO_QUERY))
+ ;
+ if (xConfigProvider.is())
+ {
+ uno::Sequence<uno::Any> aArgs(1);
+ beans::PropertyValue aVal;
+ aVal.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath"));
+ aVal.Value <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.Common/Misc"));
+ aArgs.getArray()[0] <<= aVal;
+ uno::Reference<container::XNameAccess> const xConfigAccess(
+ uno::Reference<container::XNameAccess>(
+ xConfigProvider->createInstanceWithArguments(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess")),
+ aArgs),
+ uno::UNO_QUERY))
+ ;
+ if (xConfigAccess.is())
+ {
+ try
+ {
+ sal_Bool bValue = sal_False;
+ uno::Any const aAny(xConfigAccess->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ExperimentalMode"))));
+ if (aAny >>= bValue)
+ bEnable = bValue;
+ }
+ catch (container::NoSuchElementException const&)
+ {
+ }
+ catch (lang::WrappedTargetException const&)
+ {
+ }
+ }
+ }
+ }
+ catch (uno::Exception const&)
+ {
+ }
+ }
+ }
+ catch (lang::WrappedTargetException const&)
+ {
+ }
+
+ return bEnable;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/generic/gensys.h b/vcl/inc/generic/gensys.h
index e485cc50f215..fd21110a4f97 100644
--- a/vcl/inc/generic/gensys.h
+++ b/vcl/inc/generic/gensys.h
@@ -57,6 +57,7 @@ class VCL_DLLPUBLIC SalGenericSystem : public SalSystem
static const char *getFrameResName();
static const char *getFrameClassName();
static rtl::OString getFrameResName( SalExtStyle nStyle );
+ static bool enableExperimentalFeatures();
};
#endif // _SV_GENSYS_H
diff --git a/vcl/unx/generic/plugadapt/salplug.cxx b/vcl/unx/generic/plugadapt/salplug.cxx
index a496b7cbda5d..72d236fab4fc 100644
--- a/vcl/unx/generic/plugadapt/salplug.cxx
+++ b/vcl/unx/generic/plugadapt/salplug.cxx
@@ -33,6 +33,7 @@
#include "rtl/ustrbuf.hxx"
#include "salinst.hxx"
+#include "generic/gensys.h"
#include "generic/gendata.hxx"
#include "unx/desktops.hxx"
#include "vcl/printerinfomanager.hxx"
@@ -52,6 +53,11 @@ static SalInstance* tryInstance( const OUString& rModuleBase )
{
SalInstance* pInst = NULL;
+ // Disable gtk3 plugin load except in experimental mode for now.
+ if( rModuleBase.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "gtk3" ) ) &&
+ !SalGenericSystem::enableExperimentalFeatures() )
+ return NULL;
+
OUStringBuffer aModName( 128 );
aModName.appendAscii( SAL_DLLPREFIX"vclplug_" );
aModName.append( rModuleBase );
diff --git a/vcl/unx/gtk/gdi/salprn-gtk.cxx b/vcl/unx/gtk/gdi/salprn-gtk.cxx
index 3db1dfe4ebea..fb25aeca8e65 100644
--- a/vcl/unx/gtk/gdi/salprn-gtk.cxx
+++ b/vcl/unx/gtk/gdi/salprn-gtk.cxx
@@ -39,7 +39,6 @@
#include "vcl/help.hxx"
#include "vcl/print.hxx"
#include "vcl/svapp.hxx"
-#include "vcl/unohelp.hxx"
#include "vcl/window.hxx"
#include <gtk/gtk.h>
@@ -53,7 +52,6 @@
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/sheet/XSpreadsheetView.hpp>
@@ -181,72 +179,9 @@ lcl_getGtkSalInstance()
}
bool
-lcl_enableExperimentalFeatures()
-{
- bool bEnable = true;
- try
- {
- // get service provider
- uno::Reference<lang::XMultiServiceFactory> const xSMgr(vcl::unohelper::GetMultiServiceFactory());
- // create configuration hierachical access name
- if (xSMgr.is())
- {
- try
- {
- uno::Reference<lang::XMultiServiceFactory> const xConfigProvider(
- uno::Reference<lang::XMultiServiceFactory>(
- xSMgr->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationProvider"))),
- UNO_QUERY))
- ;
- if (xConfigProvider.is())
- {
- uno::Sequence<uno::Any> aArgs(1);
- beans::PropertyValue aVal;
- aVal.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath"));
- aVal.Value <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.Common/Misc"));
- aArgs.getArray()[0] <<= aVal;
- uno::Reference<container::XNameAccess> const xConfigAccess(
- uno::Reference<container::XNameAccess>(
- xConfigProvider->createInstanceWithArguments(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess")),
- aArgs),
- UNO_QUERY))
- ;
- if (xConfigAccess.is())
- {
- try
- {
- sal_Bool bValue = sal_False;
- uno::Any const aAny(xConfigAccess->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ExperimentalMode"))));
- if (aAny >>= bValue)
- bEnable = bValue;
- }
- catch (container::NoSuchElementException const&)
- {
- }
- catch (lang::WrappedTargetException const&)
- {
- }
- }
- }
- }
- catch (uno::Exception const&)
- {
- }
- }
- }
- catch (lang::WrappedTargetException const&)
- {
- }
-
- return bEnable;
-}
-
-bool
lcl_useSystemPrintDialog()
{
- return vcl::useSystemPrintDialog() && lcl_enableExperimentalFeatures()
+ return vcl::useSystemPrintDialog() && SalGenericSystem::enableExperimentalFeatures()
&& lcl_getGtkSalInstance().getPrintWrapper()->supportsPrinting();
}
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 2e1c1068c890..0c195d339de6 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -3285,7 +3285,7 @@ gboolean GtkSalFrame::signalMap( GtkWidget *pWidget, GdkEvent*, gpointer frame )
RevertToParent, CurrentTime );
}
#else
- (void)pWidget;
+ (void)pWidget; (void)bSetFocus;
# warning FIXME no set input focus ...
#endif