VirtualBox

source: vbox/trunk/src/VBox/Main/include/DisplayImpl.h@ 81667

最後變更 在這個檔案從81667是 80872,由 vboxsync 提交於 6 年 前

Devices/Graphics,Main,include: remove obsolete Chromium code. bugref:9529

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Author Date Id Revision
檔案大小: 22.5 KB
 
1/* $Id: DisplayImpl.h 80872 2019-09-17 20:54:03Z vboxsync $ */
2/** @file
3 * VirtualBox COM class implementation
4 */
5
6/*
7 * Copyright (C) 2006-2019 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.alldomusa.eu.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef MAIN_INCLUDED_DisplayImpl_h
19#define MAIN_INCLUDED_DisplayImpl_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24#include "SchemaDefs.h"
25
26#include <iprt/semaphore.h>
27#include <VBox/vmm/pdmdrv.h>
28#include <VBoxVideo.h>
29#include <VBox/vmm/pdmifs.h>
30#include <VBox/VMMDev.h> /* For struct VMMDevDisplayDef - why is it in that file? */
31#include "DisplayWrap.h"
32
33#include "DisplaySourceBitmapWrap.h"
34#include "GuestScreenInfoWrap.h"
35
36
37class Console;
38
39typedef struct _DISPLAYFBINFO
40{
41 /* The following 3 fields (u32Offset, u32MaxFramebufferSize and u32InformationSize)
42 * are not used by the current HGSMI. They are needed for backward compatibility with
43 * pre-HGSMI additions.
44 */
45 uint32_t u32Offset;
46 uint32_t u32MaxFramebufferSize;
47 uint32_t u32InformationSize;
48
49 ComPtr<IFramebuffer> pFramebuffer;
50 com::Guid framebufferId;
51 ComPtr<IDisplaySourceBitmap> pSourceBitmap;
52 bool fDisabled;
53
54 uint32_t u32Caps;
55
56 struct
57 {
58 ComPtr<IDisplaySourceBitmap> pSourceBitmap;
59 uint8_t *pu8Address;
60 uint32_t cbLine;
61 } updateImage;
62
63 LONG xOrigin;
64 LONG yOrigin;
65
66 ULONG w;
67 ULONG h;
68
69 uint16_t u16BitsPerPixel;
70 uint8_t *pu8FramebufferVRAM;
71 uint32_t u32LineSize;
72
73 uint16_t flags;
74
75 VBOXVIDEOINFOHOSTEVENTS *pHostEvents;
76
77 /** The framebuffer has default format and must be updates immediately. */
78 bool fDefaultFormat;
79
80#ifdef VBOX_WITH_HGSMI
81 bool fVBVAEnabled;
82 bool fVBVAForceResize;
83 VBVAHOSTFLAGS RT_UNTRUSTED_VOLATILE_GUEST *pVBVAHostFlags;
84#endif /* VBOX_WITH_HGSMI */
85
86#ifdef VBOX_WITH_RECORDING
87 struct
88 {
89 ComPtr<IDisplaySourceBitmap> pSourceBitmap;
90 } Recording;
91#endif /* VBOX_WITH_RECORDING */
92
93 /** Description of the currently plugged monitor with preferred mode,
94 * a.k.a the last mode hint sent. */
95 struct VMMDevDisplayDef monitorDesc;
96} DISPLAYFBINFO;
97
98/* The legacy VBVA (VideoAccel) data.
99 *
100 * Backward compatibility with the guest additions 3.x or older.
101 */
102typedef struct VIDEOACCEL
103{
104 VBVAMEMORY *pVbvaMemory;
105 bool fVideoAccelEnabled;
106
107 uint8_t *pu8VbvaPartial;
108 uint32_t cbVbvaPartial;
109
110 /* Old guest additions (3.x and older) use both VMMDev and DevVGA refresh timer
111 * to process the VBVABUFFER memory. Therefore the legacy VBVA (VideoAccel) host
112 * code can be executed concurrently by VGA refresh timer and the guest VMMDev
113 * request in SMP VMs. The semaphore serialized this.
114 */
115 RTSEMXROADS hXRoadsVideoAccel;
116
117} VIDEOACCEL;
118
119class DisplayMouseInterface
120{
121public:
122 virtual HRESULT i_getScreenResolution(ULONG cScreen, ULONG *pcx,
123 ULONG *pcy, ULONG *pcBPP, LONG *pXOrigin, LONG *pYOrigin) = 0;
124 virtual void i_getFramebufferDimensions(int32_t *px1, int32_t *py1,
125 int32_t *px2, int32_t *py2) = 0;
126 virtual HRESULT i_reportHostCursorCapabilities(uint32_t fCapabilitiesAdded, uint32_t fCapabilitiesRemoved) = 0;
127 virtual HRESULT i_reportHostCursorPosition(int32_t x, int32_t y, bool fOutOfRange) = 0;
128 virtual bool i_isInputMappingSet(void) = 0;
129};
130
131class VMMDev;
132
133class ATL_NO_VTABLE Display :
134 public DisplayWrap,
135 public DisplayMouseInterface
136{
137public:
138
139 DECLARE_EMPTY_CTOR_DTOR(Display)
140
141 HRESULT FinalConstruct();
142 void FinalRelease();
143
144 // public initializer/uninitializer for internal purposes only
145 HRESULT init(Console *aParent);
146 void uninit();
147 int i_registerSSM(PUVM pUVM);
148
149 // public methods only for internal purposes
150 int i_handleDisplayResize(unsigned uScreenId, uint32_t bpp, void *pvVRAM,
151 uint32_t cbLine, uint32_t w, uint32_t h, uint16_t flags,
152 int32_t xOrigin, int32_t yOrigin, bool fVGAResize);
153 void i_handleDisplayUpdate(unsigned uScreenId, int x, int y, int w, int h);
154 void i_handleUpdateVMMDevSupportsGraphics(bool fSupportsGraphics);
155 void i_handleUpdateGuestVBVACapabilities(uint32_t fNewCapabilities);
156 void i_handleUpdateVBVAInputMapping(int32_t xOrigin, int32_t yOrigin, uint32_t cx, uint32_t cy);
157#ifdef VBOX_WITH_VIDEOHWACCEL
158 int i_handleVHWACommandProcess(int enmCmd, bool fGuestCmd, VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCommand);
159#endif
160
161 int i_saveVisibleRegion(uint32_t cRect, PRTRECT pRect);
162 int i_handleSetVisibleRegion(uint32_t cRect, PRTRECT pRect);
163 int i_handleQueryVisibleRegion(uint32_t *pcRects, PRTRECT paRects);
164
165 void i_VRDPConnectionEvent(bool fConnect);
166 void i_VideoAccelVRDP(bool fEnable, int c);
167
168 /* Legacy video acceleration requests coming from the VGA refresh timer. */
169 int VideoAccelEnableVGA(bool fEnable, VBVAMEMORY *pVbvaMemory);
170
171 /* Legacy video acceleration requests coming from VMMDev. */
172 int VideoAccelEnableVMMDev(bool fEnable, VBVAMEMORY *pVbvaMemory);
173 void VideoAccelFlushVMMDev(void);
174
175 void i_UpdateDeviceCursorCapabilities(void);
176
177#ifdef VBOX_WITH_RECORDING
178 int i_recordingInvalidate(void);
179 void i_recordingScreenChanged(unsigned uScreenId);
180#endif
181
182 void i_notifyPowerDown(void);
183
184 // DisplayMouseInterface methods
185 virtual HRESULT i_getScreenResolution(ULONG cScreen, ULONG *pcx,
186 ULONG *pcy, ULONG *pcBPP, LONG *pXOrigin, LONG *pYOrigin)
187 {
188 return getScreenResolution(cScreen, pcx, pcy, pcBPP, pXOrigin, pYOrigin, NULL);
189 }
190 virtual void i_getFramebufferDimensions(int32_t *px1, int32_t *py1,
191 int32_t *px2, int32_t *py2);
192 virtual HRESULT i_reportHostCursorCapabilities(uint32_t fCapabilitiesAdded, uint32_t fCapabilitiesRemoved);
193 virtual HRESULT i_reportHostCursorPosition(int32_t x, int32_t y, bool fOutOfRange);
194 virtual bool i_isInputMappingSet(void)
195 {
196 return cxInputMapping != 0 && cyInputMapping != 0;
197 }
198
199 static const PDMDRVREG DrvReg;
200
201private:
202 // Wrapped IDisplay properties
203 virtual HRESULT getGuestScreenLayout(std::vector<ComPtr<IGuestScreenInfo> > &aGuestScreenLayout);
204
205 // Wrapped IDisplay methods
206 virtual HRESULT getScreenResolution(ULONG aScreenId,
207 ULONG *aWidth,
208 ULONG *aHeight,
209 ULONG *aBitsPerPixel,
210 LONG *aXOrigin,
211 LONG *aYOrigin,
212 GuestMonitorStatus_T *aGuestMonitorStatus);
213 virtual HRESULT attachFramebuffer(ULONG aScreenId,
214 const ComPtr<IFramebuffer> &aFramebuffer,
215 com::Guid &aId);
216 virtual HRESULT detachFramebuffer(ULONG aScreenId,
217 const com::Guid &aId);
218 virtual HRESULT queryFramebuffer(ULONG aScreenId,
219 ComPtr<IFramebuffer> &aFramebuffer);
220 virtual HRESULT setVideoModeHint(ULONG aDisplay,
221 BOOL aEnabled,
222 BOOL aChangeOrigin,
223 LONG aOriginX,
224 LONG aOriginY,
225 ULONG aWidth,
226 ULONG aHeight,
227 ULONG aBitsPerPixel,
228 BOOL aNotify);
229 virtual HRESULT getVideoModeHint(ULONG aDisplay,
230 BOOL *aEnabled,
231 BOOL *aChangeOrigin,
232 LONG *aOriginX,
233 LONG *aOriginY,
234 ULONG *aWidth,
235 ULONG *aHeight,
236 ULONG *aBitsPerPixel);
237 virtual HRESULT setSeamlessMode(BOOL aEnabled);
238 virtual HRESULT takeScreenShot(ULONG aScreenId,
239 BYTE *aAddress,
240 ULONG aWidth,
241 ULONG aHeight,
242 BitmapFormat_T aBitmapFormat);
243 virtual HRESULT takeScreenShotToArray(ULONG aScreenId,
244 ULONG aWidth,
245 ULONG aHeight,
246 BitmapFormat_T aBitmapFormat,
247 std::vector<BYTE> &aScreenData);
248 virtual HRESULT drawToScreen(ULONG aScreenId,
249 BYTE *aAddress,
250 ULONG aX,
251 ULONG aY,
252 ULONG aWidth,
253 ULONG aHeight);
254 virtual HRESULT invalidateAndUpdate();
255 virtual HRESULT invalidateAndUpdateScreen(ULONG aScreenId);
256 virtual HRESULT completeVHWACommand(BYTE *aCommand);
257 virtual HRESULT viewportChanged(ULONG aScreenId,
258 ULONG aX,
259 ULONG aY,
260 ULONG aWidth,
261 ULONG aHeight);
262 virtual HRESULT querySourceBitmap(ULONG aScreenId,
263 ComPtr<IDisplaySourceBitmap> &aDisplaySourceBitmap);
264 virtual HRESULT notifyScaleFactorChange(ULONG aScreenId,
265 ULONG aScaleFactorWMultiplied,
266 ULONG aScaleFactorHMultiplied);
267 virtual HRESULT notifyHiDPIOutputPolicyChange(BOOL fUnscaledHiDPI);
268 virtual HRESULT setScreenLayout(ScreenLayoutMode_T aScreenLayoutMode,
269 const std::vector<ComPtr<IGuestScreenInfo> > &aGuestScreenInfo);
270 virtual HRESULT detachScreens(const std::vector<LONG> &aScreenIds);
271 virtual HRESULT createGuestScreenInfo(ULONG aDisplay,
272 GuestMonitorStatus_T aStatus,
273 BOOL aPrimary,
274 BOOL aChangeOrigin,
275 LONG aOriginX,
276 LONG aOriginY,
277 ULONG aWidth,
278 ULONG aHeight,
279 ULONG aBitsPerPixel,
280 ComPtr<IGuestScreenInfo> &aGuestScreenInfo);
281
282 // Wrapped IEventListener properties
283
284 // Wrapped IEventListener methods
285 virtual HRESULT handleEvent(const ComPtr<IEvent> &aEvent);
286
287 // other internal methods
288 HRESULT takeScreenShotWorker(ULONG aScreenId,
289 BYTE *aAddress,
290 ULONG aWidth,
291 ULONG aHeight,
292 BitmapFormat_T aBitmapFormat,
293 ULONG *pcbOut);
294 int processVBVAResize(PCVBVAINFOVIEW pView, PCVBVAINFOSCREEN pScreen, void *pvVRAM, bool fResetInputMapping);
295
296 static DECLCALLBACK(void*) i_drvQueryInterface(PPDMIBASE pInterface, const char *pszIID);
297 static DECLCALLBACK(int) i_drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags);
298 static DECLCALLBACK(void) i_drvDestruct(PPDMDRVINS pDrvIns);
299 static DECLCALLBACK(void) i_drvPowerOff(PPDMDRVINS pDrvIns);
300 static DECLCALLBACK(int) i_displayResizeCallback(PPDMIDISPLAYCONNECTOR pInterface, uint32_t bpp, void *pvVRAM,
301 uint32_t cbLine, uint32_t cx, uint32_t cy);
302 static DECLCALLBACK(void) i_displayUpdateCallback(PPDMIDISPLAYCONNECTOR pInterface,
303 uint32_t x, uint32_t y, uint32_t cx, uint32_t cy);
304 static DECLCALLBACK(void) i_displayRefreshCallback(PPDMIDISPLAYCONNECTOR pInterface);
305 static DECLCALLBACK(void) i_displayResetCallback(PPDMIDISPLAYCONNECTOR pInterface);
306 static DECLCALLBACK(void) i_displayLFBModeChangeCallback(PPDMIDISPLAYCONNECTOR pInterface, bool fEnabled);
307 static DECLCALLBACK(void) i_displayProcessAdapterDataCallback(PPDMIDISPLAYCONNECTOR pInterface,
308 void *pvVRAM, uint32_t u32VRAMSize);
309 static DECLCALLBACK(void) i_displayProcessDisplayDataCallback(PPDMIDISPLAYCONNECTOR pInterface,
310 void *pvVRAM, unsigned uScreenId);
311
312#ifdef VBOX_WITH_VIDEOHWACCEL
313 static DECLCALLBACK(int) i_displayVHWACommandProcess(PPDMIDISPLAYCONNECTOR pInterface, int enmCmd, bool fGuestCmd,
314 VBOXVHWACMD RT_UNTRUSTED_VOLATILE_GUEST *pCommand);
315#endif
316
317#ifdef VBOX_WITH_HGSMI
318 static DECLCALLBACK(int) i_displayVBVAEnable(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId,
319 VBVAHOSTFLAGS RT_UNTRUSTED_VOLATILE_GUEST *pHostFlags);
320 static DECLCALLBACK(void) i_displayVBVADisable(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId);
321 static DECLCALLBACK(void) i_displayVBVAUpdateBegin(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId);
322 static DECLCALLBACK(void) i_displayVBVAUpdateProcess(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId,
323 struct VBVACMDHDR const RT_UNTRUSTED_VOLATILE_GUEST *pCmd, size_t cbCmd);
324 static DECLCALLBACK(void) i_displayVBVAUpdateEnd(PPDMIDISPLAYCONNECTOR pInterface, unsigned uScreenId, int32_t x, int32_t y,
325 uint32_t cx, uint32_t cy);
326 static DECLCALLBACK(int) i_displayVBVAResize(PPDMIDISPLAYCONNECTOR pInterface, PCVBVAINFOVIEW pView,
327 PCVBVAINFOSCREEN pScreen, void *pvVRAM,
328 bool fResetInputMapping);
329 static DECLCALLBACK(int) i_displayVBVAMousePointerShape(PPDMIDISPLAYCONNECTOR pInterface, bool fVisible, bool fAlpha,
330 uint32_t xHot, uint32_t yHot, uint32_t cx, uint32_t cy,
331 const void *pvShape);
332 static DECLCALLBACK(void) i_displayVBVAGuestCapabilityUpdate(PPDMIDISPLAYCONNECTOR pInterface, uint32_t fCapabilities);
333
334 static DECLCALLBACK(void) i_displayVBVAInputMappingUpdate(PPDMIDISPLAYCONNECTOR pInterface, int32_t xOrigin, int32_t yOrigin,
335 uint32_t cx, uint32_t cy);
336 static DECLCALLBACK(void) i_displayVBVAReportCursorPosition(PPDMIDISPLAYCONNECTOR pInterface, uint32_t fFlags, uint32_t uScreen, uint32_t x, uint32_t y);
337#endif
338
339 static DECLCALLBACK(void) i_displaySSMSaveScreenshot(PSSMHANDLE pSSM, void *pvUser);
340 static DECLCALLBACK(int) i_displaySSMLoadScreenshot(PSSMHANDLE pSSM, void *pvUser, uint32_t uVersion, uint32_t uPass);
341 static DECLCALLBACK(void) i_displaySSMSave(PSSMHANDLE pSSM, void *pvUser);
342 static DECLCALLBACK(int) i_displaySSMLoad(PSSMHANDLE pSSM, void *pvUser, uint32_t uVersion, uint32_t uPass);
343
344 Console * const mParent;
345 /** Pointer to the associated display driver. */
346 struct DRVMAINDISPLAY *mpDrv;
347
348 unsigned mcMonitors;
349 /** Input mapping rectangle top left X relative to the first screen. */
350 int32_t xInputMappingOrigin;
351 /** Input mapping rectangle top left Y relative to the first screen. */
352 int32_t yInputMappingOrigin;
353 uint32_t cxInputMapping; /**< Input mapping rectangle width. */
354 uint32_t cyInputMapping; /**< Input mapping rectangle height. */
355 DISPLAYFBINFO maFramebuffers[SchemaDefs::MaxGuestMonitors];
356 /** Does the VMM device have the "supports graphics" capability set?
357 * Does not go into the saved state as it is refreshed on restore. */
358 bool mfVMMDevSupportsGraphics;
359 /** Mirror of the current guest VBVA capabilities. */
360 uint32_t mfGuestVBVACapabilities;
361 /** Mirror of the current host cursor capabilities. */
362 uint32_t mfHostCursorCapabilities;
363
364 bool mfSourceBitmapEnabled;
365 bool volatile fVGAResizing;
366
367 /** Are we in seamless mode? Not saved, as we exit seamless on saving. */
368 bool mfSeamlessEnabled;
369 /** Last set seamless visible region, number of rectangles. */
370 uint32_t mcRectVisibleRegion;
371 /** Last set seamless visible region, data. Freed on final clean-up. */
372 PRTRECT mpRectVisibleRegion;
373
374 bool mfVideoAccelVRDP;
375 uint32_t mfu32SupportedOrders;
376 /** Number of currently connected VRDP clients. */
377 int32_t volatile mcVRDPRefs;
378
379 /* The legacy VBVA data and methods. */
380 VIDEOACCEL mVideoAccelLegacy;
381
382 int i_VideoAccelEnable(bool fEnable, VBVAMEMORY *pVbvaMemory, PPDMIDISPLAYPORT pUpPort);
383 void i_VideoAccelFlush(PPDMIDISPLAYPORT pUpPort);
384 bool i_VideoAccelAllowed(void);
385
386 int i_videoAccelRefreshProcess(PPDMIDISPLAYPORT pUpPort);
387 int i_videoAccelEnable(bool fEnable, VBVAMEMORY *pVbvaMemory, PPDMIDISPLAYPORT pUpPort);
388 int i_videoAccelFlush(PPDMIDISPLAYPORT pUpPort);
389
390 /* Legacy pre-HGSMI handlers. */
391 void processAdapterData(void *pvVRAM, uint32_t u32VRAMSize);
392 void processDisplayData(void *pvVRAM, unsigned uScreenId);
393
394 /** Serializes access to mVideoAccelLegacy and mfVideoAccelVRDP, etc between VRDP and Display. */
395 RTCRITSECT mVideoAccelLock;
396
397#ifdef VBOX_WITH_RECORDING
398 /* Serializes access to video recording source bitmaps. */
399 RTCRITSECT mVideoRecLock;
400 /** Array which defines which screens are being enabled for recording. */
401 bool maRecordingEnabled[SchemaDefs::MaxGuestMonitors];
402#endif
403
404public:
405
406 static int i_displayTakeScreenshotEMT(Display *pDisplay, ULONG aScreenId, uint8_t **ppbData, size_t *pcbData,
407 uint32_t *pcx, uint32_t *pcy, bool *pfMemFree);
408
409private:
410 static int i_InvalidateAndUpdateEMT(Display *pDisplay, unsigned uId, bool fUpdateAll);
411 static int i_drawToScreenEMT(Display *pDisplay, ULONG aScreenId, BYTE *address, ULONG x, ULONG y, ULONG width, ULONG height);
412
413 void i_updateGuestGraphicsFacility(void);
414
415#ifdef VBOX_WITH_HGSMI
416 volatile uint32_t mu32UpdateVBVAFlags;
417#endif
418
419private:
420 DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(Display); /* Shuts up MSC warning C4625. */
421};
422
423/* The legacy VBVA helpers. */
424int videoAccelConstruct(VIDEOACCEL *pVideoAccel);
425void videoAccelDestroy(VIDEOACCEL *pVideoAccel);
426void i_vbvaSetMemoryFlags(VBVAMEMORY *pVbvaMemory,
427 bool fVideoAccelEnabled,
428 bool fVideoAccelVRDP,
429 uint32_t fu32SupportedOrders,
430 DISPLAYFBINFO *paFBInfos,
431 unsigned cFBInfos);
432int videoAccelEnterVGA(VIDEOACCEL *pVideoAccel);
433void videoAccelLeaveVGA(VIDEOACCEL *pVideoAccel);
434int videoAccelEnterVMMDev(VIDEOACCEL *pVideoAccel);
435void videoAccelLeaveVMMDev(VIDEOACCEL *pVideoAccel);
436
437
438/* helper function, code in DisplayResampleImage.cpp */
439void BitmapScale32(uint8_t *dst, int dstW, int dstH,
440 const uint8_t *src, int iDeltaLine, int srcW, int srcH);
441
442/* helper function, code in DisplayPNGUtul.cpp */
443int DisplayMakePNG(uint8_t *pbData, uint32_t cx, uint32_t cy,
444 uint8_t **ppu8PNG, uint32_t *pcbPNG, uint32_t *pcxPNG, uint32_t *pcyPNG,
445 uint8_t fLimitSize);
446
447class ATL_NO_VTABLE DisplaySourceBitmap:
448 public DisplaySourceBitmapWrap
449{
450public:
451
452 DECLARE_EMPTY_CTOR_DTOR(DisplaySourceBitmap)
453
454 HRESULT FinalConstruct();
455 void FinalRelease();
456
457 /* Public initializer/uninitializer for internal purposes only. */
458 HRESULT init(ComObjPtr<Display> pDisplay, unsigned uScreenId, DISPLAYFBINFO *pFBInfo);
459 void uninit();
460
461 bool i_usesVRAM(void) { return m.pu8Allocated == NULL; }
462
463private:
464 // wrapped IDisplaySourceBitmap properties
465 virtual HRESULT getScreenId(ULONG *aScreenId);
466
467 // wrapped IDisplaySourceBitmap methods
468 virtual HRESULT queryBitmapInfo(BYTE **aAddress,
469 ULONG *aWidth,
470 ULONG *aHeight,
471 ULONG *aBitsPerPixel,
472 ULONG *aBytesPerLine,
473 BitmapFormat_T *aBitmapFormat);
474
475 int initSourceBitmap(unsigned aScreenId, DISPLAYFBINFO *pFBInfo);
476
477 struct Data
478 {
479 ComObjPtr<Display> pDisplay;
480 unsigned uScreenId;
481 DISPLAYFBINFO *pFBInfo;
482
483 uint8_t *pu8Allocated;
484
485 uint8_t *pu8Address;
486 ULONG ulWidth;
487 ULONG ulHeight;
488 ULONG ulBitsPerPixel;
489 ULONG ulBytesPerLine;
490 BitmapFormat_T bitmapFormat;
491 };
492
493 Data m;
494};
495
496class ATL_NO_VTABLE GuestScreenInfo:
497 public GuestScreenInfoWrap
498{
499public:
500
501 DECLARE_EMPTY_CTOR_DTOR(GuestScreenInfo)
502
503 HRESULT FinalConstruct();
504 void FinalRelease();
505
506 /* Public initializer/uninitializer for internal purposes only. */
507 HRESULT init(ULONG aDisplay,
508 GuestMonitorStatus_T aGuestMonitorStatus,
509 BOOL aPrimary,
510 BOOL aChangeOrigin,
511 LONG aOriginX,
512 LONG aOriginY,
513 ULONG aWidth,
514 ULONG aHeight,
515 ULONG aBitsPerPixel);
516 void uninit();
517
518private:
519 // wrapped IGuestScreenInfo properties
520 virtual HRESULT getScreenId(ULONG *aScreenId);
521 virtual HRESULT getGuestMonitorStatus(GuestMonitorStatus_T *aGuestMonitorStatus);
522 virtual HRESULT getPrimary(BOOL *aPrimary);
523 virtual HRESULT getOrigin(BOOL *aOrigin);
524 virtual HRESULT getOriginX(LONG *aOriginX);
525 virtual HRESULT getOriginY(LONG *aOriginY);
526 virtual HRESULT getWidth(ULONG *aWidth);
527 virtual HRESULT getHeight(ULONG *aHeight);
528 virtual HRESULT getBitsPerPixel(ULONG *aBitsPerPixel);
529 virtual HRESULT getExtendedInfo(com::Utf8Str &aExtendedInfo);
530
531 ULONG mScreenId;
532 GuestMonitorStatus_T mGuestMonitorStatus;
533 BOOL mPrimary;
534 BOOL mOrigin;
535 LONG mOriginX;
536 LONG mOriginY;
537 ULONG mWidth;
538 ULONG mHeight;
539 ULONG mBitsPerPixel;
540};
541
542#endif /* !MAIN_INCLUDED_DisplayImpl_h */
543/* vi: set tabstop=4 shiftwidth=4 expandtab: */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette