CWS-TOOLING: integrate CWS os146
[LibreOffice.git] / canvas / source / directx / dx_config.hxx
bloba1499a64f44f8ceae9889335b4438c78171da2fd
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef _DXCANVAS_DXCONFIG_HXX
29 #define _DXCANVAS_DXCONFIG_HXX
31 #include <unotools/configitem.hxx>
32 #include <boost/optional.hpp>
33 #include <set>
35 namespace basegfx { class B2IVector; }
37 namespace dxcanvas
39 /** Provide DX canvas config data
41 class DXCanvasItem : public ::utl::ConfigItem
43 public:
44 DXCanvasItem();
46 struct DeviceInfo
48 sal_Int32 nVendorId;
49 sal_Int32 nDeviceId;
50 sal_Int32 nDeviceSubSysId;
51 sal_Int32 nDeviceRevision;
53 sal_Int32 nDriverId;
54 sal_Int32 nDriverVersion;
55 sal_Int32 nDriverSubVersion;
56 sal_Int32 nDriverBuildId;
58 bool operator<( const DeviceInfo& rRHS ) const
60 return nVendorId != rRHS.nVendorId ? nVendorId < rRHS.nVendorId :
61 (nDeviceId != rRHS.nDeviceId ? nDeviceId < rRHS.nDeviceId :
62 (nDeviceSubSysId != rRHS.nDeviceSubSysId ? nDeviceSubSysId < rRHS.nDeviceSubSysId :
63 (nDeviceRevision != rRHS.nDeviceRevision ? nDeviceRevision < rRHS.nDeviceRevision :
64 (nDriverId != rRHS.nDriverId ? nDriverId < rRHS.nDriverId :
65 (nDriverVersion != rRHS.nDriverVersion ? nDriverVersion < rRHS.nDriverVersion :
66 (nDriverSubVersion != rRHS.nDriverSubVersion ? nDriverSubVersion < rRHS.nDriverSubVersion :
67 (nDriverBuildId != rRHS.nDriverBuildId ? nDriverBuildId < rRHS.nDriverBuildId : false)))))));
71 ~DXCanvasItem();
73 bool isDeviceUsable( const DeviceInfo& rDeviceInfo ) const;
74 bool isBlacklistCurrentDevice() const;
75 void blacklistDevice( const DeviceInfo& rDeviceInfo );
76 void adaptMaxTextureSize( basegfx::B2IVector& io_maxTextureSize ) const;
77 virtual void Notify( const com::sun::star::uno::Sequence<rtl::OUString>& aPropertyNames);
78 virtual void Commit();
80 private:
81 typedef std::set< DeviceInfo > ValueSet;
82 ValueSet maValues;
83 boost::optional<sal_Int32> maMaxTextureSize;
84 bool mbBlacklistCurrentDevice;
85 bool mbValuesDirty;
89 #endif /* #ifndef _DXCANVAS_DXCONFIG_HXX */