1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
22 #include <sal/config.h>
23 #include <win/scoped_gdi.hxx>
32 class WinSalVirtualDevice
: public SalVirtualDevice
35 HDC mhLocalDC
; // HDC or 0 for Cache Device
36 ScopedHBITMAP mhBmp
; // Memory Bitmap
37 HBITMAP mhDefBmp
; // Default Bitmap
38 std::unique_ptr
<WinSalGraphics
> mpGraphics
; // current VirDev graphics
39 WinSalVirtualDevice
* mpNext
; // next VirDev
40 sal_uInt16 mnBitCount
; // BitCount (0 or 1)
41 bool mbGraphics
; // is Graphics used
42 bool mbForeignDC
; // uses a foreign DC instead of a bitmap
47 HDC
getHDC() const { return mhLocalDC
; }
48 WinSalGraphics
* getGraphics() const { return mpGraphics
.get(); }
49 void setGraphics(WinSalGraphics
* pVirGraphics
) { mpGraphics
.reset(pVirGraphics
); }
50 WinSalVirtualDevice
* getNext() const { return mpNext
; }
52 WinSalVirtualDevice(HDC hDC
= nullptr, HBITMAP hBMP
= nullptr, sal_uInt16 nBitCount
= 0, bool bForeignDC
= false, tools::Long nWidth
= 0, tools::Long nHeight
= 0);
53 virtual ~WinSalVirtualDevice() override
;
55 virtual SalGraphics
* AcquireGraphics() override
;
56 virtual void ReleaseGraphics( SalGraphics
* pGraphics
) override
;
57 virtual bool SetSize( tools::Long nNewDX
, tools::Long nNewDY
) override
;
59 static HBITMAP
ImplCreateVirDevBitmap(HDC hDC
, tools::Long nDX
, tools::Long nDY
, sal_uInt16 nBitCount
, void **ppDummy
);
61 // SalGeometryProvider
62 virtual tools::Long
GetWidth() const override
{ return mnWidth
; }
63 virtual tools::Long
GetHeight() const override
{ return mnHeight
; }
66 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */