儲存庫 vbox 的更動 11971
- 時間撮記:
- 2008-9-2 上午11:33:18 (16 年 以前)
- 位置:
- trunk/src/VBox/Frontends/VirtualBox4
- 檔案:
-
- 刪除 2 筆資料
- 修改 3 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Frontends/VirtualBox4/Makefile.kmk
r11867 r11971 621 621 VirtualBox4_SOURCES.darwin = \ 622 622 src/darwin/DarwinKeyboard.cpp \ 623 src/darwin/DarwinCursor.cpp \624 623 src/darwin/VBoxUtils-darwin.cpp \ 625 624 src/VBoxFBQuartz2D.cpp -
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleView.h
r11622 r11971 40 40 #if defined (Q_WS_MAC) 41 41 # include <Carbon/Carbon.h> 42 # include "DarwinCursor.h"43 42 #endif 44 43 … … 291 290 * key was pressed when we get a kEventRawKeyModifiersChanged event. */ 292 291 UInt32 mDarwinKeyModifiers; 293 /** The darwin cursor handle (see DarwinCursor.h/.cpp). */294 DARWINCURSOR mDarwinCursor;295 292 #endif 296 293 -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleView.cpp
r11942 r11971 81 81 #if defined (Q_WS_MAC) 82 82 # include "DarwinKeyboard.h" 83 # include "DarwinCursor.h"84 83 # ifdef VBOX_WITH_HACKED_QT 85 84 # include "QIApplication.h" … … 825 824 Assert (ok); 826 825 NOREF (ok); 827 #endif828 829 #ifdef Q_WS_MAC830 // DarwinCursorClearHandle (&mDarwinCursor);831 826 #endif 832 827 } … … 2815 2810 else /* !mMouseCaptured */ 2816 2811 { 2817 #ifdef Q_WS_MAC /** @todo Christian, can you look at this. It causes flickering and IIRC is really a Qt3 workaround which probably isn't needed. If it is needed it needs to be redone. */2818 /* Update the mouse cursor; this is a bit excessive really... */2819 // if (!DarwinCursorIsNull (&mDarwinCursor))2820 // DarwinCursorSet (&mDarwinCursor);2821 #endif2822 2812 if (mMainWnd->isTrueFullscreen()) 2823 2813 { … … 3507 3497 3508 3498 /* Create a ARGB image out of the shape data. */ 3509 /* @todo: The following isn't nice but is working. Will fix this tomorrow. */3510 3499 QImage image (me->width(), me->height(), QImage::Format_ARGB32); 3511 unsigned char alpha; 3512 const uint8_t *pbSrcMask = (const uint8_t *)srcAndMaskPtr; 3513 unsigned cbSrcMaskLine = RT_ALIGN(me->width(), 8) / 8; 3500 const uint8_t* pbSrcMask = static_cast<const uint8_t*> (srcAndMaskPtr); 3501 unsigned cbSrcMaskLine = RT_ALIGN (me->width(), 8) / 8; 3514 3502 for (unsigned int y = 0; y < me->height(); ++y) 3515 3503 { 3516 3504 for (unsigned int x = 0; x < me->width(); ++x) 3517 3505 { 3518 int i = y*me->width()+x;3519 unsigned int color = ((unsigned int*)srcShapePtr)[i];3520 if (me->hasAlpha())3521 alpha = qAlpha (color);3522 else3506 unsigned int color = ((unsigned int*)srcShapePtr)[y*me->width()+x]; 3507 /* If the alpha channel isn't in the shape data, we have to 3508 * create them from the and-mask. This is a bit field where 1 3509 * represent transparency & 0 opaque respectively. */ 3510 if (!me->hasAlpha()) 3523 3511 { 3524 // alpha = !srcAndMaskPtr[i] ? 0xff : 0x00;3525 3512 if (!(pbSrcMask[x / 8] & (1 << (7 - (x % 8))))) 3526 alpha = 0xff;3513 color |= 0xff000000; 3527 3514 else 3528 3515 { 3529 if (qRed (color) == 0xff && 3530 qGreen (color) == 0xff && 3531 qBlue (color) == 0xff) 3532 { 3533 color = 0; 3534 alpha = 0xff; 3535 }else 3536 { 3537 color = 0; 3538 alpha = 0; 3539 } 3516 /* This isn't quite right, but it's the best we can do I 3517 * think... */ 3518 if (color & 0x00ffffff) 3519 color = 0xff000000; 3520 else 3521 color = 0x00000000; 3540 3522 } 3541 3523 } 3542 image.setPixel (x, y, qRgba (qRed (color), qGreen (color), qBlue (color), alpha)); 3543 } 3524 image.setPixel (x, y, color); 3525 } 3526 /* Move one scanline forward. */ 3544 3527 pbSrcMask += cbSrcMaskLine; 3545 3528 } 3546 /* Invert the mask channel if there is one */3547 QPixmap pixmap (QPixmap::fromImage (image));3548 // if (!me->hasAlpha())3549 // {3550 // uchar* pu8DstData = (uchar*)alloca(me->width() * me->height());3551 // unsigned int i = 0;3552 // while (i < me->width() * me->height())3553 // {3554 // pu8DstData[i] = !srcAndMaskPtr[i] ? 0xff : 0x00;3555 // ++i;3556 // }3557 // QBitmap bitmap = QBitmap::fromData (QSize (me->width(), me->height()),3558 // pu8DstData, QImage::Format_Mono);3559 // /* Set the mask to the pixmap */3560 // pixmap.setMask (bitmap);3561 // }3562 // printf ("has alpha %d- %d %d\n", me->hasAlpha(), me->width(), me->height());3563 3529 /* Set the new cursor */ 3564 QCursor cursor ( pixmap,3530 QCursor cursor (QPixmap::fromImage (image), 3565 3531 me->xHot(), me->yHot()); 3566 3532 viewport()->setCursor (cursor); 3567 3533 ok = true; 3568 /*3569 * Qt3/Mac only supports black/white cursors and it offers no way3570 * to create your own cursors here unlike on X11 and Windows.3571 * Which means we're pretty much forced to do it our own way.3572 */3573 // int rc;3574 //3575 // /* dispose of the old cursor. */3576 // if (!DarwinCursorIsNull (&mDarwinCursor))3577 // {3578 // rc = DarwinCursorDestroy (&mDarwinCursor);3579 // AssertRC (rc);3580 // }3581 //3582 // /* create the new cursor */3583 // rc = DarwinCursorCreate (me->width(), me->height(), me->xHot(), me->yHot(), me->hasAlpha(),3584 // srcAndMaskPtr, srcShapePtr, &mDarwinCursor);3585 // AssertRC (rc);3586 // if (VBOX_SUCCESS (rc))3587 // {3588 // /** @todo check current mouse coordinates. */3589 // rc = DarwinCursorSet (&mDarwinCursor);3590 // AssertRC (rc);3591 // }3592 // ok = VBOX_SUCCESS (rc);3593 3534 NOREF (srcShapePtrScan); 3594 3535
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器