Changeset 46020 in vbox
- Timestamp:
- May 13, 2013 3:09:16 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 85687
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 2 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h
r46017 r46020 60 60 InvalidRenderMode 61 61 , QImageMode 62 , SDLMode63 62 , Quartz2DMode 64 63 }; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r46016 r46020 200 200 #elif (defined (Q_WS_WIN32) || defined (Q_WS_PM) || defined (Q_WS_X11)) && defined (VBOX_GUI_USE_QIMAGE) 201 201 mode = QImageMode; 202 #elif defined (Q_WS_X11) && defined (VBOX_GUI_USE_SDL)203 mode = SDLMode;204 202 #elif defined (VBOX_GUI_USE_QIMAGE) 205 203 mode = QImageMode; … … 211 209 { 212 210 if (0) ; 213 #if defined (VBOX_GUI_USE_QIMAGE)211 #ifdef VBOX_GUI_USE_QIMAGE 214 212 else if (::strcmp (aModeStr, "image") == 0) 215 213 mode = QImageMode; 216 #endif 217 #if defined (VBOX_GUI_USE_SDL) 218 else if (::strcmp (aModeStr, "sdl") == 0) 219 mode = SDLMode; 220 #endif 221 #if defined (VBOX_GUI_USE_QUARTZ2D) 214 #endif /* VBOX_GUI_USE_QIMAGE */ 215 #ifdef VBOX_GUI_USE_QUARTZ2D 222 216 else if (::strcmp (aModeStr, "quartz2d") == 0) 223 217 mode = Quartz2DMode; 224 #endif 218 #endif /* VBOX_GUI_USE_QUARTZ2D */ 225 219 } 226 220 -
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r46005 r46020 223 223 { 224 224 QString mode = "", dflt = ""; 225 #ifdef VBOX_GUI_USE_SDL226 mode += "sdl";227 #endif228 225 #ifdef VBOX_GUI_USE_QIMAGE 229 226 if (!mode.isEmpty()) 230 227 mode += "|"; 231 228 mode += "image"; 232 #endif 229 #endif /* VBOX_GUI_USE_QIMAGE */ 233 230 #ifdef VBOX_GUI_USE_QUARTZ2D 234 231 if (!mode.isEmpty()) 235 232 mode += "|"; 236 233 mode += "quartz2d"; 237 #endif 234 #endif /* VBOX_GUI_USE_QUARTZ2D */ 238 235 #if defined (Q_WS_MAC) && defined (VBOX_GUI_USE_QUARTZ2D) 239 236 dflt = "quartz2d"; 240 #elif (defined (Q_WS_WIN 32) || defined (Q_WS_PM) || defined(Q_WS_X11)) && defined (VBOX_GUI_USE_QIMAGE)237 #elif (defined (Q_WS_WIN) || defined(Q_WS_X11)) && defined (VBOX_GUI_USE_QIMAGE) 241 238 dflt = "image"; 242 #elif defined (Q_WS_X11) && defined (VBOX_GUI_USE_SDL)243 dflt = "sdl";244 239 #else 245 240 dflt = "image"; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.cpp
r46017 r46020 37 37 #include "UIFrameBufferQImage.h" 38 38 #include "UIFrameBufferQuartz2D.h" 39 #include "UIFrameBufferSDL.h"40 39 #include "VBoxFBOverlay.h" 41 40 #include "UISession.h" … … 333 332 } 334 333 #endif /* VBOX_GUI_USE_QIMAGE */ 335 336 #ifdef VBOX_GUI_USE_SDL337 case SDLMode:338 {339 /* Indicate that we are doing all drawing stuff ourself: */340 // TODO_NEW_CORE341 viewport()->setAttribute(Qt::WA_PaintOnScreen);342 # ifdef Q_WS_X11343 /* This is somehow necessary to prevent strange X11 warnings on i386 and segfaults on x86_64: */344 XFlush(QX11Info::display());345 # endif /* Q_WS_X11 */346 UIFrameBuffer* pFrameBuffer = uisession()->frameBuffer(screenId());347 if (pFrameBuffer)348 pFrameBuffer->setView(this);349 else350 {351 # if defined(VBOX_WITH_VIDEOHWACCEL) && defined(DEBUG_misha) /* not tested yet */352 if (m_fAccelerate2DVideo)353 {354 /** these two additional template args is a workaround to355 * this [VBox|UI] duplication356 * @todo: they are to be removed once VBox stuff is gone */357 pFrameBuffer = new VBoxOverlayFrameBuffer<UIFrameBufferSDL, UIMachineView, UIResizeEvent>(this, &session(), (uint32_t)screenId());358 }359 else360 pFrameBuffer = new UIFrameBufferSDL(this);361 # else /* VBOX_WITH_VIDEOHWACCEL */362 pFrameBuffer = new UIFrameBufferSDL(this);363 # endif /* !VBOX_WITH_VIDEOHWACCEL */364 uisession()->setFrameBuffer(screenId(), pFrameBuffer);365 }366 m_pFrameBuffer = pFrameBuffer;367 /* Disable scrollbars because we cannot correctly draw in a scrolled window using SDL: */368 horizontalScrollBar()->setEnabled(false);369 verticalScrollBar()->setEnabled(false);370 break;371 }372 #endif /* VBOX_GUI_USE_SDL */373 334 374 335 #ifdef VBOX_GUI_USE_QUARTZ2D … … 401 362 } 402 363 #endif /* VBOX_GUI_USE_QUARTZ2D */ 364 403 365 default: 404 366 AssertReleaseMsgFailed(("Render mode must be valid: %d\n", vboxGlobal().vmRenderMode())); … … 536 498 #ifdef VBOX_GUI_USE_QIMAGE 537 499 || vboxGlobal().vmRenderMode() == QImageMode 538 #endif 539 #ifdef VBOX_GUI_USE_SDL 540 || vboxGlobal().vmRenderMode() == SDLMode 541 #endif 500 #endif /* VBOX_GUI_USE_QIMAGE */ 542 501 #ifdef VBOX_GUI_USE_QUARTZ2D 543 502 || vboxGlobal().vmRenderMode() == Quartz2DMode 544 #endif 503 #endif /* VBOX_GUI_USE_QUARTZ2D */ 545 504 #ifdef VBOX_WITH_VIDEOHWACCEL 546 505 || m_fAccelerate2DVideo 547 #endif 506 #endif /* VBOX_WITH_VIDEOHWACCEL */ 548 507 ) 549 508 { … … 908 867 /* Perform machine-view resize: */ 909 868 resize(pResizeEvent->width(), pResizeEvent->height()); 910 911 /* May be we have to restrict minimum size? */912 maybeRestrictMinimumSize();913 869 914 870 /* Let our toplevel widget calculate its sizeHint properly: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineView.h
r46016 r46020 170 170 * host screen. */ 171 171 virtual QSize calculateMaxGuestSize() const = 0; 172 virtual void maybeRestrictMinimumSize() = 0;173 172 virtual void updateSliders(); 174 173 QPoint viewportToContents(const QPoint &vp) const; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMouseHandler.cpp
r45333 r46020 775 775 else /* !uisession()->isMouseCaptured() */ 776 776 { 777 #if 0 // TODO: Move that to fullscreen event-handler:778 if (vboxGlobal().vmRenderMode() != SDLMode)779 {780 /* try to automatically scroll the guest canvas if the781 * mouse is on the screen border */782 /// @todo (r=dmik) better use a timer for autoscroll783 QRect scrGeo = QApplication::desktop()->screenGeometry (this);784 int iDx = 0, iDy = 0;785 if (scrGeo.width() < contentsWidth())786 {787 if (scrGeo.left() == globalPos.x()) iDx = -1;788 if (scrGeo.right() == globalPos.x()) iDx = +1;789 }790 if (scrGeo.height() < contentsHeight())791 {792 if (scrGeo.top() == globalPos.y()) iDy = -1;793 if (scrGeo.bottom() == globalPos.y()) iDy = +1;794 }795 if (iDx || iDy)796 scrollBy(iDx, iDy);797 }798 #endif799 800 777 if (uisession()->isMouseSupportsAbsolute() && uisession()->isMouseIntegrated()) 801 778 { … … 803 780 int iVw = m_views[uScreenId]->visibleWidth(), iVh = m_views[uScreenId]->visibleHeight(); 804 781 805 if (vboxGlobal().vmRenderMode() != SDLMode) 806 { 807 /* Try to automatically scroll the guest canvas if the 808 * mouse goes outside its visible part: */ 809 int iDx = 0; 810 if (relativePos.x() > iVw) iDx = relativePos.x() - iVw; 811 else if (relativePos.x() < 0) iDx = relativePos.x(); 812 int iDy = 0; 813 if (relativePos.y() > iVh) iDy = relativePos.y() - iVh; 814 else if (relativePos.y() < 0) iDy = relativePos.y(); 815 if (iDx != 0 || iDy != 0) m_views[uScreenId]->scrollBy(iDx, iDy); 816 } 782 /* Try to automatically scroll the guest canvas if the 783 * mouse goes outside its visible part: */ 784 int iDx = 0; 785 if (relativePos.x() > iVw) iDx = relativePos.x() - iVw; 786 else if (relativePos.x() < 0) iDx = relativePos.x(); 787 int iDy = 0; 788 if (relativePos.y() > iVh) iDy = relativePos.y() - iVh; 789 else if (relativePos.y() < 0) iDy = relativePos.y(); 790 if (iDx != 0 || iDy != 0) m_views[uScreenId]->scrollBy(iDx, iDy); 817 791 818 792 /* Get mouse-pointer location: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.cpp
r44952 r46020 63 63 void UIMachineViewFullscreen::sltAdditionsStateChanged() 64 64 { 65 /* Check if we should restrict minimum size: */66 maybeRestrictMinimumSize();67 68 65 /* Check if we should resize guest to fullscreen */ 69 66 if ((int)frameBuffer()->width() != workingArea().size().width() || … … 150 147 m_bIsGuestAutoresizeEnabled = fEnabled; 151 148 152 maybeRestrictMinimumSize();153 154 149 if (uisession()->isGuestSupportsGraphics()) 155 150 sltPerformGuestResize(); … … 175 170 } 176 171 177 void UIMachineViewFullscreen::maybeRestrictMinimumSize()178 {179 /* Sets the minimum size restriction depending on the auto-resize feature state and the current rendering mode.180 * Currently, the restriction is set only in SDL mode and only when the auto-resize feature is inactive.181 * We need to do that because we cannot correctly draw in a scrolled window in SDL mode.182 * In all other modes, or when auto-resize is in force, this function does nothing. */183 if (vboxGlobal().vmRenderMode() == SDLMode)184 {185 if (!uisession()->isGuestSupportsGraphics() || !m_bIsGuestAutoresizeEnabled)186 setMinimumSize(sizeHint());187 else188 setMinimumSize(0, 0);189 }190 }191 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/fullscreen/UIMachineViewFullscreen.h
r44529 r46020 68 68 QRect workingArea() const; 69 69 QSize calculateMaxGuestSize() const; 70 void maybeRestrictMinimumSize();71 70 72 71 /* Private variables: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.cpp
r46005 r46020 65 65 void UIMachineViewNormal::sltAdditionsStateChanged() 66 66 { 67 /* Check if we should restrict minimum size: */68 maybeRestrictMinimumSize();69 70 67 /* Resend the last resize hint if there was a fullscreen or 71 68 * seamless transition previously. If we were not in graphical … … 205 202 m_bIsGuestAutoresizeEnabled = fEnabled; 206 203 207 maybeRestrictMinimumSize();208 209 204 if (m_bIsGuestAutoresizeEnabled && uisession()->isGuestSupportsGraphics()) 210 205 sltPerformGuestResize(); … … 245 240 availableGeo = dwt->availableGeometry(pTopLevelWidget->pos()); 246 241 247 frameGeo = VBoxGlobal::normalizeGeometry(frameGeo, availableGeo , vboxGlobal().vmRenderMode() != SDLMode /* can resize? */);242 frameGeo = VBoxGlobal::normalizeGeometry(frameGeo, availableGeo); 248 243 } 249 244 … … 286 281 } 287 282 288 void UIMachineViewNormal::maybeRestrictMinimumSize()289 {290 /* Sets the minimum size restriction depending on the auto-resize feature state and the current rendering mode.291 * Currently, the restriction is set only in SDL mode and only when the auto-resize feature is inactive.292 * We need to do that because we cannot correctly draw in a scrolled window in SDL mode.293 * In all other modes, or when auto-resize is in force, this function does nothing. */294 if (vboxGlobal().vmRenderMode() == SDLMode)295 {296 if (!uisession()->isGuestSupportsGraphics() || !m_bIsGuestAutoresizeEnabled)297 setMinimumSize(sizeHint());298 else299 setMinimumSize(0, 0);300 }301 }302 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/normal/UIMachineViewNormal.h
r44529 r46020 80 80 QRect workingArea() const; 81 81 QSize calculateMaxGuestSize() const; 82 void maybeRestrictMinimumSize();83 82 84 83 /* Private members: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/scale/UIMachineViewScale.h
r44529 r46020 69 69 QRect workingArea() const; 70 70 QSize calculateMaxGuestSize() const; 71 void maybeRestrictMinimumSize() {}72 71 void updateSliders(); 73 72 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/seamless/UIMachineViewSeamless.h
r44529 r46020 71 71 QRect workingArea() const; 72 72 QSize calculateMaxGuestSize() const; 73 void maybeRestrictMinimumSize() {}74 73 75 74 /* Private variables: */
Note:
See TracChangeset
for help on using the changeset viewer.