Changeset 7610 in vbox for trunk/src/VBox/Frontends/VirtualBox4/include
- Timestamp:
- Mar 27, 2008 10:48:00 PM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4/include
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleView.h
r7590 r7610 105 105 int visibleWidth() const { return horizontalScrollBar()->pageStep(); } 106 106 int visibleHeight() const { return verticalScrollBar()->pageStep(); } 107 void scrollBy (int dx, int dy) 108 { 107 void scrollBy (int dx, int dy) 108 { 109 109 horizontalScrollBar()->setValue (horizontalScrollBar()->value() + dx); 110 110 verticalScrollBar()->setValue (verticalScrollBar()->value() + dy); … … 112 112 QPoint viewportToContents ( const QPoint & vp ) const 113 113 { 114 return QPoint (vp.x() + contentsX(), 114 return QPoint (vp.x() + contentsX(), 115 115 vp.y() + contentsY()); 116 116 } … … 185 185 void resizeEvent (QResizeEvent *); 186 186 void paintEvent (QPaintEvent *); 187 #ifdef VBOX_GUI_USE_REFRESH_TIMER188 void timerEvent( QTimerEvent * );189 #endif190 187 191 188 void captureKbd (bool aCapture, bool aEmitSignal = true); … … 280 277 #endif 281 278 282 #if defined (VBOX_GUI_USE_REFRESH_TIMER)283 QPixmap pm;284 int tid; /**< Timer id */285 #endif286 287 279 VBoxFrameBuffer *mFrameBuf; 288 280 CConsoleCallback mCallback; -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxDefs.h
r7435 r7610 56 56 #if defined (VBOX_GUI_USE_EXT_FRAMEBUFFER) 57 57 #undef VBOX_GUI_USE_EXT_FRAMEBUFFER 58 #endif59 #if !defined (VBOX_GUI_USE_REFRESH_TIMER)60 #define VBOX_GUI_USE_REFRESH_TIMER61 58 #endif 62 59 #endif -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxFrameBuffer.h
r7407 r7610 124 124 QRegion mReg; 125 125 }; 126 127 /////////////////////////////////////////////////////////////////////////////128 129 #if defined (VBOX_GUI_USE_REFRESH_TIMER)130 131 /**132 * Copies the current VM video buffer contents to the pixmap referenced133 * by the argument. The return value indicates whether the134 * buffer has been updated since the last call to this method or not.135 *136 * The copy operation is atomic (guarded by a mutex).137 *138 * This method is intentionally inlined for faster execution and should be139 * called only by VBoxConsoleView members.140 *141 * @return true if the pixmap is updated, and false otherwise.142 */143 inline bool display_to_pixmap( const CConsole &c, QPixmap &pm )144 {145 CDisplay display = c.GetDisplay();146 147 uint8_t *addr = (uint8_t *) display.LockFramebuffer();148 AssertMsg (addr, ("The buffer address must not be null"));149 150 QImage::Format format = QImage::Format_Invalid;151 switch (display.GetBitsPerPixel())152 {153 /* 32-, 8- and 1-bpp are the only depths suported by QImage */154 case 32:155 format = QImage::Format_RGB32;156 break;157 case 8:158 format = QImage::Format_Indexed8;159 break;160 case 1:161 format = QImage::Format_Mono;162 break;163 }164 165 bool rc = false;166 if(format != QImage::Format_Invalid)167 {168 pm = QPixmap::fromImage (QImage (addr,169 display.GetWidth(), display.GetHeight(),170 format));171 rc = !pm.isNull();172 AssertMsg (rc, ("convertFromImage() must always return true"));173 }174 175 display.UnlockFramebuffer();176 177 return rc;178 }179 180 #endif181 126 182 127 /////////////////////////////////////////////////////////////////////////////
Note:
See TracChangeset
for help on using the changeset viewer.