Changeset 41049 in vbox
- Timestamp:
- Apr 25, 2012 7:19:53 AM (12 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 7 edited
-
Frontends/VirtualBox/src/runtime/UIMachineView.cpp (modified) (2 diffs)
-
Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp (modified) (1 diff)
-
Main/idl/VirtualBox.xidl (modified) (4 diffs)
-
Main/include/DisplayUtils.h (modified) (1 diff)
-
Main/include/MachineImpl.h (modified) (1 diff)
-
Main/src-all/DisplayUtils.cpp (modified) (5 diffs)
-
Main/src-server/MachineImpl.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r39451 r41049 438 438 size = QSize(width, height); 439 439 /* Try to get the real guest dimensions from the save state */ 440 ULONG guestWidth = 0, guestHeight = 0; 441 machine.QuerySavedGuestSize(0, guestWidth, guestHeight); 440 ULONG guestOriginX = 0, guestOriginY = 0, guestWidth = 0, guestHeight = 0; 441 BOOL fEnabled = true; 442 machine.QuerySavedGuestScreenInfo(0, guestOriginX, guestOriginY, guestWidth, guestHeight, fEnabled); 442 443 if ( guestWidth > 0 443 444 && guestHeight > 0) … … 724 725 if (screenData.size() != 0) 725 726 { 726 ULONG guestWidth = 0, guestHeight = 0; 727 machine.QuerySavedGuestSize(0, guestWidth, guestHeight); 727 ULONG guestOriginX = 0, guestOriginY = 0, guestWidth = 0, guestHeight = 0; 728 BOOL fEnabled = true; 729 machine.QuerySavedGuestScreenInfo(0, guestOriginX, guestOriginY, guestWidth, guestHeight, fEnabled); 728 730 QImage shot = QImage::fromData(screenData.data(), screenData.size(), "PNG").scaled(guestWidth > 0 ? QSize(guestWidth, guestHeight) : guestSizeHint()); 729 731 dimImage(shot); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.cpp
r39110 r41049 102 102 if (screenData.size() != 0) 103 103 { 104 ULONG guestWidth = 0, guestHeight = 0; 105 machine.QuerySavedGuestSize(0, guestWidth, guestHeight); 104 ULONG guestOriginX = 0, guestOriginY = 0, guestWidth = 0, guestHeight = 0; 105 BOOL fEnabled = true; 106 machine.QuerySavedGuestScreenInfo(0, guestOriginX, guestOriginY, guestWidth, guestHeight, fEnabled); 106 107 QImage shot = QImage::fromData(screenData.data(), screenData.size(), "PNG").scaled(guestWidth > 0 ? QSize(guestWidth, guestHeight) : guestSizeHint()); 107 108 m_pPauseImage = new QImage(shot); -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r40539 r41049 3700 3700 <interface 3701 3701 name="IMachine" extends="$unknown" 3702 uuid=" b0ce140d-02b6-469a-80f5-412ef8e1318e"3702 uuid="e7c78fee-f20d-4b4f-ac28-37af30d79ddf" 3703 3703 wsmap="managed" 3704 3704 > … … 6051 6051 </method> 6052 6052 6053 <method name="querySavedGuestS ize" const="yes">6053 <method name="querySavedGuestScreenInfo" const="yes"> 6054 6054 <desc> 6055 6055 Returns the guest dimensions from the saved state. … … 6060 6060 </desc> 6061 6061 </param> 6062 <param name="originX" type="unsigned long" dir="out"> 6063 <desc> 6064 The X position of the guest monitor top left corner. 6065 </desc> 6066 </param> 6067 <param name="originY" type="unsigned long" dir="out"> 6068 <desc> 6069 The Y position of the guest monitor top left corner. 6070 </desc> 6071 </param> 6062 6072 <param name="width" type="unsigned long" dir="out"> 6063 6073 <desc> … … 6068 6078 <desc> 6069 6079 Guest height at the time of the saved state was taken. 6080 </desc> 6081 </param> 6082 <param name="enabled" type="boolean" dir="out"> 6083 <desc> 6084 Whether the monitor is enabled in the guest. 6070 6085 </desc> 6071 6086 </param> -
trunk/src/VBox/Main/include/DisplayUtils.h
r35576 r41049 24 24 #define sSSMDisplayVer3 0x00010003 25 25 26 int readSavedGuestSize(const Utf8Str &strStateFilePath, uint32_t u32ScreenId, uint32_t *pu32Width, uint32_t *pu32Height); 26 int readSavedGuestScreenInfo(const Utf8Str &strStateFilePath, uint32_t u32ScreenId, 27 uint32_t *pu32OriginX, uint32_t *pu32OriginY, 28 uint32_t *pu32Width, uint32_t *pu32Height, uint16_t *pu16Flags); 27 29 28 30 int readSavedDisplayScreenshot(const Utf8Str &strStateFilePath, uint32_t u32Type, uint8_t **ppu8Data, uint32_t *pcbData, uint32_t *pu32Width, uint32_t *pu32Height); -
trunk/src/VBox/Main/include/MachineImpl.h
r40633 r41049 534 534 STDMETHOD(GetStorageControllerByInstance(ULONG aInstance, IStorageController **storageController)); 535 535 STDMETHOD(SetStorageControllerBootable)(IN_BSTR aName, BOOL fBootable); 536 STDMETHOD(QuerySavedGuestS ize)(ULONG aScreenId, ULONG *puWidth, ULONG *puHeight);536 STDMETHOD(QuerySavedGuestScreenInfo)(ULONG uScreenId, ULONG *puOriginX, ULONG *puOriginY, ULONG *puWidth, ULONG *puHeight, BOOL *pfEnabled); 537 537 STDMETHOD(QuerySavedThumbnailSize)(ULONG aScreenId, ULONG *aSize, ULONG *aWidth, ULONG *aHeight); 538 538 STDMETHOD(ReadSavedThumbnailToArray)(ULONG aScreenId, BOOL aBGR, ULONG *aWidth, ULONG *aHeight, ComSafeArrayOut(BYTE, aData)); -
trunk/src/VBox/Main/src-all/DisplayUtils.cpp
r35576 r41049 21 21 #include <VBox/err.h> 22 22 #include <VBox/vmm/ssm.h> 23 #include <VBox/VBoxVideo.h> 23 24 24 25 int readSavedDisplayScreenshot(const Utf8Str &strStateFilePath, uint32_t u32Type, uint8_t **ppu8Data, uint32_t *pcbData, uint32_t *pu32Width, uint32_t *pu32Height) … … 141 142 } 142 143 143 int readSavedGuestSize(const Utf8Str &strStateFilePath, uint32_t u32ScreenId, uint32_t *pu32Width, uint32_t *pu32Height) 144 int readSavedGuestScreenInfo(const Utf8Str &strStateFilePath, uint32_t u32ScreenId, 145 uint32_t *pu32OriginX, uint32_t *pu32OriginY, 146 uint32_t *pu32Width, uint32_t *pu32Height, uint16_t *pu16Flags) 144 147 { 145 148 LogFlowFunc(("u32ScreenId = %d [%s]\n", u32ScreenId, strStateFilePath.c_str())); … … 151 154 return VERR_NOT_SUPPORTED; 152 155 } 153 154 uint32_t u32Width = 0;155 uint32_t u32Height = 0;156 156 157 157 PSSMHANDLE pSSM; … … 163 163 if (RT_SUCCESS(vrc)) 164 164 { 165 /* Only the second version is supported. */166 165 if ( uVersion == sSSMDisplayVer2 167 166 || uVersion == sSSMDisplayVer3) … … 170 169 SSMR3GetU32(pSSM, &cMonitors); 171 170 if (u32ScreenId > cMonitors) 172 vrc = -2; 171 { 172 vrc = VERR_INVALID_PARAMETER; 173 } 173 174 else 174 175 { 175 /* Skip all previous monitors and the first 3 entries. */ 176 SSMR3Skip(pSSM, u32ScreenId * 5 * sizeof(uint32_t) + 3 * sizeof(uint32_t)); 177 SSMR3GetU32(pSSM, &u32Width); 178 SSMR3GetU32(pSSM, &u32Height); 176 if (uVersion == sSSMDisplayVer2) 177 { 178 /* Skip all previous monitors, each 5 uint32_t, and the first 3 uint32_t entries. */ 179 SSMR3Skip(pSSM, u32ScreenId * 5 * sizeof(uint32_t) + 3 * sizeof(uint32_t)); 180 SSMR3GetU32(pSSM, pu32Width); 181 SSMR3GetU32(pSSM, pu32Height); 182 *pu32OriginX = 0; 183 *pu32OriginY = 0; 184 *pu16Flags = VBVA_SCREEN_F_ACTIVE; 185 } 186 else 187 { 188 Assert(uVersion == sSSMDisplayVer3); 189 /* Skip all previous monitors, each 8 uint32_t, and the first 3 uint32_t entries. */ 190 SSMR3Skip(pSSM, u32ScreenId * 8 * sizeof(uint32_t) + 3 * sizeof(uint32_t)); 191 SSMR3GetU32(pSSM, pu32Width); 192 SSMR3GetU32(pSSM, pu32Height); 193 SSMR3GetU32(pSSM, pu32OriginX); 194 SSMR3GetU32(pSSM, pu32OriginY); 195 uint32_t u32Flags = 0; 196 SSMR3GetU32(pSSM, &u32Flags); 197 *pu16Flags = (uint16_t)u32Flags; 198 } 179 199 } 180 200 } 201 else 202 { 203 vrc = VERR_NOT_SUPPORTED; 204 } 181 205 } 182 206 183 207 SSMR3Close(pSSM); 184 }185 186 if (RT_SUCCESS(vrc))187 {188 *pu32Width = u32Width;189 *pu32Height = u32Height;190 208 } 191 209 -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r40538 r41049 5816 5816 } 5817 5817 5818 STDMETHODIMP Machine::QuerySavedGuestSize(ULONG uScreenId, ULONG *puWidth, ULONG *puHeight) 5818 STDMETHODIMP Machine::QuerySavedGuestScreenInfo(ULONG uScreenId, 5819 ULONG *puOriginX, 5820 ULONG *puOriginY, 5821 ULONG *puWidth, 5822 ULONG *puHeight, 5823 BOOL *pfEnabled) 5819 5824 { 5820 5825 LogFlowThisFunc(("\n")); 5821 5826 5827 CheckComArgNotNull(puOriginX); 5828 CheckComArgNotNull(puOriginY); 5822 5829 CheckComArgNotNull(puWidth); 5823 5830 CheckComArgNotNull(puHeight); 5824 5831 CheckComArgNotNull(pfEnabled); 5832 5833 uint32_t u32OriginX= 0; 5834 uint32_t u32OriginY= 0; 5825 5835 uint32_t u32Width = 0; 5826 5836 uint32_t u32Height = 0; 5827 5828 int vrc = readSavedGuestSize(mSSData->strStateFilePath, uScreenId, &u32Width, &u32Height); 5837 uint16_t u16Flags = 0; 5838 5839 int vrc = readSavedGuestScreenInfo(mSSData->strStateFilePath, uScreenId, 5840 &u32OriginX, &u32OriginY, &u32Width, &u32Height, &u16Flags); 5829 5841 if (RT_FAILURE(vrc)) 5830 5842 return setError(VBOX_E_IPRT_ERROR, … … 5832 5844 vrc); 5833 5845 5846 *puOriginX = u32OriginX; 5847 *puOriginY = u32OriginY; 5834 5848 *puWidth = u32Width; 5835 5849 *puHeight = u32Height; 5850 *pfEnabled = (u16Flags & VBVA_SCREEN_F_DISABLED) == 0; 5836 5851 5837 5852 return S_OK;
Note:
See TracChangeset
for help on using the changeset viewer.

