LibreOffice Module vcl (master) 1
win/salvd.h
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#ifndef INCLUDED_VCL_INC_WIN_SALVD_H
21#define INCLUDED_VCL_INC_WIN_SALVD_H
22
23#include <sal/config.h>
24#include <win/scoped_gdi.hxx>
25
26#include <memory>
27
28#include <salvd.hxx>
29
30class WinSalGraphics;
31
32
34{
35private:
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
46
47public:
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; }
52
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;
55
56 virtual SalGraphics* AcquireGraphics() override;
57 virtual void ReleaseGraphics( SalGraphics* pGraphics ) override;
58 virtual bool SetSize( tools::Long nNewDX, tools::Long nNewDY ) override;
59
60 static HBITMAP ImplCreateVirDevBitmap(HDC hDC, tools::Long nDX, tools::Long nDY, sal_uInt16 nBitCount, void **ppDummy);
61
62 // SalGeometryProvider
63 virtual tools::Long GetWidth() const override { return mnWidth; }
64 virtual tools::Long GetHeight() const override { return mnHeight; }
65};
66
67
68#endif // INCLUDED_VCL_INC_WIN_SALVD_H
69
70/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
A non-visible drawable/buffer (e.g. an X11 Pixmap).
Definition: salvd.hxx:30
WinSalGraphics never owns the HDC it uses to draw, because the HDC can have various origins with diff...
Definition: win/salgdi.h:141
WinSalVirtualDevice * getNext() const
Definition: win/salvd.h:51
sal_uInt16 mnBitCount
Definition: win/salvd.h:41
WinSalVirtualDevice * mpNext
Definition: win/salvd.h:40
virtual void ReleaseGraphics(SalGraphics *pGraphics) override
tools::Long mnWidth
Definition: win/salvd.h:44
tools::Long mnHeight
Definition: win/salvd.h:45
WinSalVirtualDevice(HDC hDC=nullptr, HBITMAP hBMP=nullptr, sal_uInt16 nBitCount=0, bool bForeignDC=false, tools::Long nWidth=0, tools::Long nHeight=0)
void setGraphics(WinSalGraphics *pVirGraphics)
Definition: win/salvd.h:50
static HBITMAP ImplCreateVirDevBitmap(HDC hDC, tools::Long nDX, tools::Long nDY, sal_uInt16 nBitCount, void **ppDummy)
virtual tools::Long GetHeight() const override
Definition: win/salvd.h:64
WinSalGraphics * getGraphics() const
Definition: win/salvd.h:49
virtual tools::Long GetWidth() const override
Definition: win/salvd.h:63
ScopedHBITMAP mhBmp
Definition: win/salvd.h:37
virtual ~WinSalVirtualDevice() override
HDC getHDC() const
Definition: win/salvd.h:48
std::unique_ptr< WinSalGraphics > mpGraphics
Definition: win/salvd.h:39
virtual SalGraphics * AcquireGraphics() override
virtual bool SetSize(tools::Long nNewDX, tools::Long nNewDY) override
short nBitCount
Definition: ipict.cxx:80
long Long
ScopedGDI< HBITMAP, DeleteBitmap > ScopedHBITMAP
Definition: scoped_gdi.hxx:32