Move setting of LD_LIBRARY_PATH closer to invocation of cppunittester
[LibreOffice.git] / canvas / source / directx / dx_config.hxx
blob14a77d19da78ba4d0201a51b4820f7049b7b7ff1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #pragma once
22 #include <unotools/configitem.hxx>
23 #include <optional>
24 #include <set>
26 namespace basegfx { class B2IVector; }
28 namespace dxcanvas
30 /** Provide DX canvas config data
32 class DXCanvasItem : public ::utl::ConfigItem
34 public:
35 DXCanvasItem();
37 struct DeviceInfo
39 sal_Int32 nVendorId;
40 sal_Int32 nDeviceId;
41 sal_Int32 nDeviceSubSysId;
42 sal_Int32 nDeviceRevision;
44 sal_Int32 nDriverId;
45 sal_Int32 nDriverVersion;
46 sal_Int32 nDriverSubVersion;
47 sal_Int32 nDriverBuildId;
49 bool operator<( const DeviceInfo& rRHS ) const
51 return nVendorId != rRHS.nVendorId ? nVendorId < rRHS.nVendorId :
52 (nDeviceId != rRHS.nDeviceId ? nDeviceId < rRHS.nDeviceId :
53 (nDeviceSubSysId != rRHS.nDeviceSubSysId ? nDeviceSubSysId < rRHS.nDeviceSubSysId :
54 (nDeviceRevision != rRHS.nDeviceRevision ? nDeviceRevision < rRHS.nDeviceRevision :
55 (nDriverId != rRHS.nDriverId ? nDriverId < rRHS.nDriverId :
56 (nDriverVersion != rRHS.nDriverVersion ? nDriverVersion < rRHS.nDriverVersion :
57 (nDriverSubVersion != rRHS.nDriverSubVersion ? nDriverSubVersion < rRHS.nDriverSubVersion :
58 (nDriverBuildId != rRHS.nDriverBuildId && nDriverBuildId < rRHS.nDriverBuildId)))))));
62 ~DXCanvasItem() override;
64 bool isDeviceUsable( const DeviceInfo& rDeviceInfo ) const;
65 bool isDenylistCurrentDevice() const;
66 void denylistDevice( const DeviceInfo& rDeviceInfo );
67 void adaptMaxTextureSize( basegfx::B2IVector& io_maxTextureSize ) const;
68 virtual void Notify( const css::uno::Sequence<OUString>& aPropertyNames) override;
70 private:
71 virtual void ImplCommit() override;
72 typedef std::set< DeviceInfo > ValueSet;
73 ValueSet maValues;
74 std::optional<sal_Int32> maMaxTextureSize;
75 bool mbDenylistCurrentDevice;
76 bool mbValuesDirty;
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */