Changeset 22822 in vbox
- Timestamp:
- Sep 7, 2009 7:33:48 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxFBOverlay.h
r22817 r22822 1257 1257 1258 1258 1259 template <class T> 1260 class VBoxOverlayFrameBuffer : public T 1261 { 1262 public: 1263 VBoxOverlayFrameBuffer (class VBoxConsoleView *aView) 1264 : T(aView), 1265 mOverlay(aView, this) 1266 {} 1267 1268 1269 STDMETHOD(ProcessVHWACommand)(BYTE *pCommand) 1270 { 1271 return mOverlay.onVHWACommand((VBOXVHWACMD*)pCommand); 1272 } 1273 1274 void doProcessVHWACommand(QEvent * pEvent) 1275 { 1276 mOverlay.onVHWACommandEvent(pEvent); 1277 } 1278 1279 STDMETHOD(NotifyUpdate) (ULONG aX, ULONG aY, 1280 ULONG aW, ULONG aH) 1281 { 1282 if(mOverlay.onNotifyUpdate(aX, aY, aW, aH)) 1283 return S_OK; 1284 return T::NotifyUpdate(aX, aY, aW, aH); 1285 } 1286 1287 void paintEvent (QPaintEvent *pe) 1288 { 1289 QRect rect; 1290 VBOXFBOVERLAY_RESUT res = mOverlay.onPaintEvent(pe, &rect); 1291 switch(res) 1292 { 1293 case VBOXFBOVERLAY_MODIFIED: 1294 { 1295 QPaintEvent modified(rect); 1296 T::paintEvent(&modified); 1297 } break; 1298 case VBOXFBOVERLAY_UNTOUCHED: 1299 T::paintEvent(pe); 1300 break; 1301 } 1302 } 1303 1304 void resizeEvent (VBoxResizeEvent *re) 1305 { 1306 mOverlay.onResizeEvent(re); 1307 T::resizeEvent(re); 1308 mOverlay.onResizeEventPostprocess(re); 1309 } 1310 private: 1311 VBoxQGLOverlay mOverlay; 1312 }; 1313 1259 1314 #endif 1260 1315 -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxFrameBuffer.h
r22818 r22822 333 333 }; 334 334 335 # ifdef VBOX_WITH_VIDEOHWACCEL336 # ifdef VBOX_GUI_USE_QIMAGE337 class VBoxQImageOverlayFrameBuffer : public VBoxQImageFrameBuffer338 {339 public:340 VBoxQImageOverlayFrameBuffer (VBoxConsoleView *aView);341 342 343 STDMETHOD(ProcessVHWACommand)(BYTE *pCommand);344 345 void doProcessVHWACommand(QEvent * pEvent);346 347 STDMETHOD(NotifyUpdate) (ULONG aX, ULONG aY,348 ULONG aW, ULONG aH);349 350 void paintEvent (QPaintEvent *pe);351 void resizeEvent (VBoxResizeEvent *re);352 private:353 VBoxQGLOverlay mOverlay;354 };355 # endif /* # ifdef VBOX_GUI_USE_QIMAGE */356 # endif /* # ifdef VBOX_WITH_VIDEOHWACCEL */357 358 335 #endif 359 336 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r22816 r22822 840 840 mFrameBuf = 841 841 #ifdef VBOX_WITH_VIDEOHWACCEL 842 mAccelerate2DVideo ? new VBox QImageOverlayFrameBuffer(this) :842 mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxQImageFrameBuffer>(this) : 843 843 #endif 844 844 new VBoxQImageFrameBuffer (this); … … 855 855 XFlush(QX11Info::display()); 856 856 # endif 857 mFrameBuf = new VBoxSDLFrameBuffer (this); 857 mFrameBuf = 858 #if defined(VBOX_WITH_VIDEOHWACCEL) && defined(DEBUG_misha) /* not tested yet */ 859 mAccelerate2DVideo ? new VBoxOverlayFrameBuffer<VBoxSDLFrameBuffer>(this) : 860 #endif 861 new VBoxSDLFrameBuffer (this); 858 862 /* 859 863 * disable scrollbars because we cannot correctly draw in a -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBOverlay.cpp
r22816 r22822 5711 5711 } 5712 5712 } 5713 #endif 5713 5714 #endif -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxFBQGL.cpp
r22816 r22822 164 164 } 165 165 166 167 VBoxQImageOverlayFrameBuffer::VBoxQImageOverlayFrameBuffer (VBoxConsoleView *aView)168 : VBoxQImageFrameBuffer(aView),169 mOverlay(aView, this)170 {}171 172 173 STDMETHODIMP VBoxQImageOverlayFrameBuffer::ProcessVHWACommand(BYTE *pCommand)174 {175 return mOverlay.onVHWACommand((VBOXVHWACMD*)pCommand);176 }177 178 void VBoxQImageOverlayFrameBuffer::doProcessVHWACommand(QEvent * pEvent)179 {180 mOverlay.onVHWACommandEvent(pEvent);181 }182 183 STDMETHODIMP VBoxQImageOverlayFrameBuffer::NotifyUpdate (ULONG aX, ULONG aY,184 ULONG aW, ULONG aH)185 {186 if(mOverlay.onNotifyUpdate(aX, aY, aW, aH))187 return S_OK;188 return VBoxQImageFrameBuffer::NotifyUpdate(aX, aY, aW, aH);189 }190 191 void VBoxQImageOverlayFrameBuffer::paintEvent (QPaintEvent *pe)192 {193 QRect rect;194 VBOXFBOVERLAY_RESUT res = mOverlay.onPaintEvent(pe, &rect);195 switch(res)196 {197 case VBOXFBOVERLAY_MODIFIED:198 {199 QPaintEvent modified(rect);200 VBoxQImageFrameBuffer::paintEvent(&modified);201 } break;202 case VBOXFBOVERLAY_UNTOUCHED:203 VBoxQImageFrameBuffer::paintEvent(pe);204 break;205 }206 }207 208 void VBoxQImageOverlayFrameBuffer::resizeEvent (VBoxResizeEvent *re)209 {210 mOverlay.onResizeEvent(re);211 VBoxQImageFrameBuffer::resizeEvent(re);212 mOverlay.onResizeEventPostprocess(re);213 }214 215 166 #endif 216 167
Note:
See TracChangeset
for help on using the changeset viewer.