bump product version to 7.2.5.1
[LibreOffice.git] / vcl / inc / win / salvd.h
blob7a776056c3a21b1e163e80d867960279f48acf89
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 #ifndef INCLUDED_VCL_INC_WIN_SALVD_H
21 #define INCLUDED_VCL_INC_WIN_SALVD_H
23 #include <sal/config.h>
24 #include <win/scoped_gdi.hxx>
26 #include <memory>
28 #include <salvd.hxx>
30 class WinSalGraphics;
33 class WinSalVirtualDevice : public SalVirtualDevice
35 private:
36 HDC mhLocalDC; // HDC or 0 for Cache Device
37 ScopedHBITMAP mhBmp; // Memory Bitmap
38 HBITMAP mhDefBmp; // Default Bitmap
39 std::unique_ptr<WinSalGraphics> mpGraphics; // current VirDev graphics
40 WinSalVirtualDevice* mpNext; // next VirDev
41 sal_uInt16 mnBitCount; // BitCount (0 or 1)
42 bool mbGraphics; // is Graphics used
43 bool mbForeignDC; // uses a foreign DC instead of a bitmap
44 tools::Long mnWidth;
45 tools::Long mnHeight;
47 public:
48 HDC getHDC() const { return mhLocalDC; }
49 WinSalGraphics* getGraphics() const { return mpGraphics.get(); }
50 void setGraphics(WinSalGraphics* pVirGraphics) { mpGraphics.reset(pVirGraphics); }
51 WinSalVirtualDevice* getNext() const { return mpNext; }
53 WinSalVirtualDevice(HDC hDC = nullptr, HBITMAP hBMP = nullptr, sal_uInt16 nBitCount = 0, bool bForeignDC = false, tools::Long nWidth = 0, tools::Long nHeight = 0);
54 virtual ~WinSalVirtualDevice() override;
56 virtual SalGraphics* AcquireGraphics() override;
57 virtual void ReleaseGraphics( SalGraphics* pGraphics ) override;
58 virtual bool SetSize( tools::Long nNewDX, tools::Long nNewDY ) override;
60 static HBITMAP ImplCreateVirDevBitmap(HDC hDC, tools::Long nDX, tools::Long nDY, sal_uInt16 nBitCount, void **ppDummy);
62 // SalGeometryProvider
63 virtual tools::Long GetWidth() const override { return mnWidth; }
64 virtual tools::Long GetHeight() const override { return mnHeight; }
68 #endif // INCLUDED_VCL_INC_WIN_SALVD_H
70 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */