1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt GUI ("VirtualBox"):
|
---|
4 | * UIFrameBufferQImage class declarations
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2010 Oracle Corporation
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License (GPL) as published by the Free Software
|
---|
14 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | */
|
---|
18 |
|
---|
19 | #ifndef ___UIFrameBufferQImage_h___
|
---|
20 | #define ___UIFrameBufferQImage_h___
|
---|
21 |
|
---|
22 | #ifdef VBOX_GUI_USE_QIMAGE
|
---|
23 |
|
---|
24 | /* Local includes */
|
---|
25 | #include "UIFrameBuffer.h"
|
---|
26 |
|
---|
27 | /* Global includes */
|
---|
28 | #include <QImage>
|
---|
29 | #include <QPixmap>
|
---|
30 |
|
---|
31 | class UIFrameBufferQImage : public UIFrameBuffer
|
---|
32 | {
|
---|
33 | public:
|
---|
34 |
|
---|
35 | UIFrameBufferQImage(UIMachineView *pMachineView);
|
---|
36 |
|
---|
37 | STDMETHOD(NotifyUpdate) (ULONG uX, ULONG uY, ULONG uW, ULONG uH);
|
---|
38 |
|
---|
39 | ulong pixelFormat() { return m_uPixelFormat; }
|
---|
40 | bool usesGuestVRAM() { return m_bUsesGuestVRAM; }
|
---|
41 |
|
---|
42 | uchar *address() { return m_img.bits(); }
|
---|
43 | ulong bitsPerPixel() { return m_img.depth(); }
|
---|
44 | ulong bytesPerLine() { return m_img.bytesPerLine(); }
|
---|
45 |
|
---|
46 | void paintEvent(QPaintEvent *pEvent);
|
---|
47 | void resizeEvent(UIResizeEvent *pEvent);
|
---|
48 |
|
---|
49 | private:
|
---|
50 |
|
---|
51 | QPixmap m_PM;
|
---|
52 | QImage m_img;
|
---|
53 | ulong m_uPixelFormat;
|
---|
54 | bool m_bUsesGuestVRAM;
|
---|
55 | };
|
---|
56 |
|
---|
57 | #endif /* VBOX_GUI_USE_QIMAGE */
|
---|
58 |
|
---|
59 | #endif /* !___UIFrameBufferQImage_h___ */
|
---|
60 |
|
---|