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 
30 class WinSalGraphics;
31 
32 
34 {
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  long mnWidth;
45  long mnHeight;
46 
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; }
52 
53  WinSalVirtualDevice(HDC hDC = nullptr, HBITMAP hBMP = nullptr, sal_uInt16 nBitCount = 0, bool bForeignDC = false, long nWidth = 0, long nHeight = 0);
54  virtual ~WinSalVirtualDevice() override;
55 
56  virtual SalGraphics* AcquireGraphics() override;
57  virtual void ReleaseGraphics( SalGraphics* pGraphics ) override;
58  virtual bool SetSize( long nNewDX, long nNewDY ) override;
59 
60  static HBITMAP ImplCreateVirDevBitmap(HDC hDC, long nDX, long nDY, sal_uInt16 nBitCount, void **ppDummy);
61 
62  // SalGeometryProvider
63  virtual long GetWidth() const override { return mnWidth; }
64  virtual 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: */
virtual long GetWidth() const override
Definition: win/salvd.h:63
ScopedHBITMAP mhBmp
Definition: win/salvd.h:37
ScopedGDI< HBITMAP, DeleteBitmap > ScopedHBITMAP
Definition: scoped_gdi.hxx:33
static HBITMAP ImplCreateVirDevBitmap(HDC hDC, long nDX, long nDY, sal_uInt16 nBitCount, void **ppDummy)
virtual SalGraphics * AcquireGraphics() override
virtual ~WinSalVirtualDevice() override
virtual bool SetSize(long nNewDX, long nNewDY) override
WinSalVirtualDevice(HDC hDC=nullptr, HBITMAP hBMP=nullptr, sal_uInt16 nBitCount=0, bool bForeignDC=false, long nWidth=0, long nHeight=0)
WinSalVirtualDevice * mpNext
Definition: win/salvd.h:40
void setGraphics(WinSalGraphics *pVirGraphics)
Definition: win/salvd.h:50
std::unique_ptr< WinSalGraphics > mpGraphics
Definition: win/salvd.h:39
sal_uInt16 mnBitCount
Definition: win/salvd.h:41
WinSalVirtualDevice * getNext() const
Definition: win/salvd.h:51
WinSalGraphics * getGraphics() const
Definition: win/salvd.h:49
virtual long GetHeight() const override
Definition: win/salvd.h:64
A non-visible drawable/buffer (e.g. an X11 Pixmap).
Definition: salvd.hxx:28
virtual void ReleaseGraphics(SalGraphics *pGraphics) override
HDC getHDC() const
Definition: win/salvd.h:48