LibreOffice Module canvas (master) 1
dx_config.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
23#include <optional>
24#include <set>
25
26namespace basegfx { class B2IVector; }
27
28namespace dxcanvas
29{
33 {
34 public:
36
38 {
39 sal_Int32 nVendorId;
40 sal_Int32 nDeviceId;
41 sal_Int32 nDeviceSubSysId;
42 sal_Int32 nDeviceRevision;
43
44 sal_Int32 nDriverId;
45 sal_Int32 nDriverVersion;
47 sal_Int32 nDriverBuildId;
48
49 bool operator<( const DeviceInfo& rRHS ) const
50 {
51 return nVendorId != rRHS.nVendorId ? nVendorId < rRHS.nVendorId :
52 (nDeviceId != rRHS.nDeviceId ? nDeviceId < rRHS.nDeviceId :
55 (nDriverId != rRHS.nDriverId ? nDriverId < rRHS.nDriverId :
59 }
60 };
61
62 ~DXCanvasItem() override;
63
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;
69
70 private:
71 virtual void ImplCommit() override;
72 typedef std::set< DeviceInfo > ValueSet;
74 std::optional<sal_Int32> maMaxTextureSize;
77 };
78}
79
80/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Provide DX canvas config data.
Definition: dx_config.hxx:33
bool isDeviceUsable(const DeviceInfo &rDeviceInfo) const
Definition: dx_config.cxx:121
~DXCanvasItem() override
Definition: dx_config.cxx:87
void adaptMaxTextureSize(basegfx::B2IVector &io_maxTextureSize) const
Definition: dx_config.cxx:137
std::set< DeviceInfo > ValueSet
Definition: dx_config.hxx:72
std::optional< sal_Int32 > maMaxTextureSize
Definition: dx_config.hxx:74
bool isDenylistCurrentDevice() const
Definition: dx_config.cxx:126
virtual void ImplCommit() override
Definition: dx_config.cxx:119
void denylistDevice(const DeviceInfo &rDeviceInfo)
Definition: dx_config.cxx:131
virtual void Notify(const css::uno::Sequence< OUString > &aPropertyNames) override
Definition: dx_config.cxx:118
bool operator<(const DeviceInfo &rRHS) const
Definition: dx_config.hxx:49