diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-07-05 11:45:45 +0200 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-07-09 15:33:18 +0200 |
commit | 1bb7761b0aa0c7c62806ccf8a8fde365d640cb37 (patch) | |
tree | bf8dc375cc3981429a223f9de4ecffabb5f83159 | |
parent | 5f33fa5ded2bb168a51f2b6f8e42a1373d15a0ac (diff) |
Basic Qt5 system display data
copied from dummy headless implementation
Change-Id: I1b184745627acd065b4c0cc54f044c47ec980c93
-rw-r--r-- | vcl/Library_vclplug_qt5.mk | 1 | ||||
-rw-r--r-- | vcl/inc/qt5/Qt5System.hxx | 27 | ||||
-rw-r--r-- | vcl/qt5/Qt5Instance.cxx | 4 | ||||
-rw-r--r-- | vcl/qt5/Qt5System.cxx | 32 |
4 files changed, 62 insertions, 2 deletions
diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index 4fcd649e1777..1ad01555ed3a 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -96,6 +96,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ vcl/qt5/Qt5Object \ vcl/qt5/Qt5Painter \ vcl/qt5/Qt5Printer \ + vcl/qt5/Qt5System \ vcl/qt5/Qt5Timer \ vcl/qt5/Qt5Tools \ vcl/qt5/Qt5VirtualDevice \ diff --git a/vcl/inc/qt5/Qt5System.hxx b/vcl/inc/qt5/Qt5System.hxx new file mode 100644 index 000000000000..fbc753757b36 --- /dev/null +++ b/vcl/inc/qt5/Qt5System.hxx @@ -0,0 +1,27 @@ +/* -*- 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/. + */ + +#pragma once + +#include <vcl/sysdata.hxx> +#include <unx/gensys.h> + +class Qt5System : public SalGenericSystem +{ +public: + Qt5System(); + virtual ~Qt5System() override; + + virtual unsigned int GetDisplayScreenCount() override; + virtual tools::Rectangle GetDisplayScreenPosSizePixel(unsigned int nScreen) override; + virtual int ShowNativeDialog(const OUString& rTitle, const OUString& rMessage, + const std::vector<OUString>& rButtons) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index 6ea2610e03f7..fc06d47d317b 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -26,6 +26,7 @@ #include <Qt5Frame.hxx> #include <Qt5Menu.hxx> #include <Qt5Object.hxx> +#include <Qt5System.hxx> #include <Qt5Timer.hxx> #include <Qt5VirtualDevice.hxx> @@ -40,7 +41,6 @@ #include <sal/log.hxx> #include <osl/process.h> -#include <headless/svpdummies.hxx> #include <headless/svpbmp.hxx> Qt5Instance::Qt5Instance(SalYieldMutex* pMutex, bool bUseCairo) @@ -128,7 +128,7 @@ std::unique_ptr<SalMenuItem> Qt5Instance::CreateMenuItem(const SalItemParams& rI SalTimer* Qt5Instance::CreateSalTimer() { return new Qt5Timer(); } -SalSystem* Qt5Instance::CreateSalSystem() { return new SvpSalSystem(); } +SalSystem* Qt5Instance::CreateSalSystem() { return new Qt5System(); } std::shared_ptr<SalBitmap> Qt5Instance::CreateSalBitmap() { diff --git a/vcl/qt5/Qt5System.cxx b/vcl/qt5/Qt5System.cxx new file mode 100644 index 000000000000..0de1940d9eff --- /dev/null +++ b/vcl/qt5/Qt5System.cxx @@ -0,0 +1,32 @@ +/* -*- 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/. + */ + +#include <string.h> +#include <tools/gen.hxx> +#include <Qt5System.hxx> + +Qt5System::Qt5System() {} +Qt5System::~Qt5System() {} + +unsigned int Qt5System::GetDisplayScreenCount() { return 1; } + +tools::Rectangle Qt5System::GetDisplayScreenPosSizePixel(unsigned int nScreen) +{ + tools::Rectangle aRect; + if (nScreen == 0) + aRect = tools::Rectangle(Point(0, 0), Size(1024, 768)); + return aRect; +} + +int Qt5System::ShowNativeDialog(const OUString&, const OUString&, const std::vector<OUString>&) +{ + return 0; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |