update dev300-m58
[ooovba.git] / canvas / source / directx / dx_config.hxx
blobdb617209d6431f2c8e39d8a0283c1e2bdf619552
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dx_config.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _DXCANVAS_DXCONFIG_HXX
32 #define _DXCANVAS_DXCONFIG_HXX
34 #include <unotools/configitem.hxx>
35 #include <boost/optional.hpp>
36 #include <set>
38 namespace basegfx { class B2IVector; }
40 namespace dxcanvas
42 /** Provide DX canvas config data
44 class DXCanvasItem : public ::utl::ConfigItem
46 public:
47 DXCanvasItem();
49 struct DeviceInfo
51 sal_Int32 nVendorId;
52 sal_Int32 nDeviceId;
53 sal_Int32 nDeviceSubSysId;
54 sal_Int32 nDeviceRevision;
56 sal_Int32 nDriverId;
57 sal_Int32 nDriverVersion;
58 sal_Int32 nDriverSubVersion;
59 sal_Int32 nDriverBuildId;
61 bool operator<( const DeviceInfo& rRHS ) const
63 return nVendorId != rRHS.nVendorId ? nVendorId < rRHS.nVendorId :
64 (nDeviceId != rRHS.nDeviceId ? nDeviceId < rRHS.nDeviceId :
65 (nDeviceSubSysId != rRHS.nDeviceSubSysId ? nDeviceSubSysId < rRHS.nDeviceSubSysId :
66 (nDeviceRevision != rRHS.nDeviceRevision ? nDeviceRevision < rRHS.nDeviceRevision :
67 (nDriverId != rRHS.nDriverId ? nDriverId < rRHS.nDriverId :
68 (nDriverVersion != rRHS.nDriverVersion ? nDriverVersion < rRHS.nDriverVersion :
69 (nDriverSubVersion != rRHS.nDriverSubVersion ? nDriverSubVersion < rRHS.nDriverSubVersion :
70 (nDriverBuildId != rRHS.nDriverBuildId ? nDriverBuildId < rRHS.nDriverBuildId : false)))))));
74 ~DXCanvasItem();
76 bool isDeviceUsable( const DeviceInfo& rDeviceInfo ) const;
77 bool isBlacklistCurrentDevice() const;
78 void blacklistDevice( const DeviceInfo& rDeviceInfo );
79 void adaptMaxTextureSize( basegfx::B2IVector& io_maxTextureSize ) const;
81 private:
82 typedef std::set< DeviceInfo > ValueSet;
83 ValueSet maValues;
84 boost::optional<sal_Int32> maMaxTextureSize;
85 bool mbBlacklistCurrentDevice;
86 bool mbValuesDirty;
90 #endif /* #ifndef _DXCANVAS_DXCONFIG_HXX */