Changeset 6497 in vbox for trunk/src/VBox/Additions/x11/xgraphics
- Timestamp:
- Jan 25, 2008 6:38:54 AM (17 years ago)
- Location:
- trunk/src/VBox/Additions/x11/xgraphics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/xgraphics/vboxutils-new.c
r6495 r6497 1 1 /** @file 2 2 * 3 * Linux Additions X11 graphics driver helper module3 * VirtualBox X11 Additions graphics driver utility functions 4 4 */ 5 5 … … 68 68 size_t size_mask; 69 69 70 image += offsetof 70 image += offsetof(VMMDevReqMousePointer, pointerData); 71 71 mask = image; 72 72 pitch = (w + 7) / 8; … … 74 74 color = (CARD32 *)(image + size_mask); 75 75 76 TRACE_ENTRY 76 TRACE_ENTRY(); 77 77 for (y = 0; y < h; ++y, mask += pitch, color += w) 78 78 { … … 81 81 if (mask[x / 8] & (1 << (7 - (x % 8)))) 82 82 ErrorF (" "); 83 84 83 else 85 84 { 86 85 CARD32 c = color[x]; 87 86 if (c == bg) 88 ErrorF 87 ErrorF("Y"); 89 88 else 90 ErrorF 89 ErrorF("X"); 91 90 } 92 91 } 93 ErrorF 92 ErrorF("\n"); 94 93 } 95 94 } … … 117 116 vbox_close(ScrnInfoPtr pScrn, VBOXPtr pVBox) 118 117 { 119 TRACE_ENTRY 118 TRACE_ENTRY(); 120 119 121 120 xfree (pVBox->reqp); … … 320 319 int scrnIndex = pScrn->scrnIndex; 321 320 322 TRACE_ENTRY 321 TRACE_ENTRY(); 323 322 324 323 pVBox->useVbva = FALSE; … … 339 338 340 339 size = vmmdevGetRequestSize (VMMDevReq_SetPointerShape); 341 p = xcalloc 340 p = xcalloc(1, size); 342 341 if (p) 343 342 { 344 rc = vmmdevInitRequest 343 rc = vmmdevInitRequest(p, VMMDevReq_SetPointerShape); 345 344 if (RT_SUCCESS(rc)) 346 345 { … … 393 392 reqp = (VMMDevReqMousePointer *)image; 394 393 395 dolog 394 dolog("w=%d h=%d size=%d\n", reqp->width, reqp->height, reqp->header.size); 396 395 #ifdef DEBUG_X 397 vbox_show_shape 396 vbox_show_shape(reqp->width, reqp->height, 0, image); 398 397 #endif 399 398 … … 407 406 vbox_set_cursor_colors(ScrnInfoPtr pScrn, int bg, int fg) 408 407 { 409 TRACE_ENTRY 410 411 (void) pScrn;412 (void) bg;413 (void) fg;414 /* ErrorF 408 TRACE_ENTRY(); 409 410 NOREF(pScrn); 411 NOREF(bg); 412 NOREF(fg); 413 /* ErrorF("vbox_set_cursor_colors NOT IMPLEMENTED\n"); */ 415 414 } 416 415 … … 420 419 /* VBOXPtr pVBox = pScrn->driverPrivate; */ 421 420 422 /* TRACE_ENTRY 421 /* TRACE_ENTRY(); */ 423 422 424 423 /* don't disable the mouse cursor if we go out of our visible area … … 431 430 { 432 431 pVBox->pointer_offscreen = TRUE; 433 vbox_vmm_hide_cursor 432 vbox_vmm_hide_cursor(pScrn, pVBox); 434 433 } 435 434 } … … 439 438 { 440 439 pVBox->pointer_offscreen = FALSE; 441 vbox_vmm_show_cursor 440 vbox_vmm_show_cursor(pScrn, pVBox); 442 441 } 443 442 } … … 450 449 VBOXPtr pVBox = pScrn->driverPrivate; 451 450 452 TRACE_ENTRY 453 454 vbox_vmm_hide_cursor 451 TRACE_ENTRY(); 452 453 vbox_vmm_hide_cursor(pScrn, pVBox); 455 454 } 456 455 … … 460 459 VBOXPtr pVBox = pScrn->driverPrivate; 461 460 462 TRACE_ENTRY 463 464 vbox_vmm_show_cursor 461 TRACE_ENTRY(); 462 463 vbox_vmm_show_cursor(pScrn, pVBox); 465 464 } 466 465 … … 470 469 VBOXPtr pVBox = pScrn->driverPrivate; 471 470 472 TRACE_ENTRY 473 474 vbox_vmm_load_cursor_image 471 TRACE_ENTRY(); 472 473 vbox_vmm_load_cursor_image(pScrn, pVBox, image); 475 474 } 476 475 … … 527 526 (unsigned long) size); 528 527 529 rc = vmmdevInitRequest 530 if (VBOX_FAILURE 528 rc = vmmdevInitRequest((VMMDevRequestHeader *)p, VMMDevReq_SetPointerShape); 529 if (VBOX_FAILURE(rc)) 531 530 { 532 531 xf86DrvMsg(scrnIndex, X_ERROR, "Could not init VMM request: rc = %d\n", rc); … … 535 534 } 536 535 537 m = p + offsetof 536 m = p + offsetof(VMMDevReqMousePointer, pointerData); 538 537 cp = (CARD32 *)(m + size_mask); 539 538 … … 580 579 { 581 580 *cp++ = fc; 582 PUT_PIXEL 581 PUT_PIXEL('X'); 583 582 } 584 583 else 585 584 { 586 585 *cp++ = bc; 587 PUT_PIXEL 586 PUT_PIXEL('*'); 588 587 } 589 588 } … … 594 593 /* don't change the screen pixel */ 595 594 *cp++ = 0; 596 PUT_PIXEL 595 PUT_PIXEL(' '); 597 596 } 598 597 } 599 PUT_PIXEL 598 PUT_PIXEL('\n'); 600 599 } 601 600 … … 609 608 610 609 #ifdef DEBUG_X 611 ErrorF 612 vbox_show_shape 610 ErrorF("shape = %p\n", p); 611 vbox_show_shape(w, h, bc, c); 613 612 #endif 614 613 … … 660 659 661 660 size = w * h * 4 + pVBox->set_pointer_shape_size + mask_size; 662 p = xcalloc 661 p = xcalloc(1, size); 663 662 if (!p) 664 663 RETERROR(scrnIndex, , … … 675 674 reqp->header.size = size; 676 675 677 memcpy (p + offsetof(VMMDevReqMousePointer, pointerData) + mask_size,676 memcpy(p + offsetof(VMMDevReqMousePointer, pointerData) + mask_size, 678 677 bitsp->argb, w * h * 4); 679 678 680 679 /* Emulate the AND mask. */ 681 pm = p + offsetof 680 pm = p + offsetof(VMMDevReqMousePointer, pointerData); 682 681 pc = bitsp->argb; 683 682 684 683 /* Init AND mask to 1 */ 685 memset 684 memset(pm, 0xFF, mask_size); 686 685 687 686 /** … … 711 710 VbglR3SetPointerShape(VBOX_MOUSE_POINTER_SHAPE | VBOX_MOUSE_POINTER_ALPHA, bitsp->xhot, bitsp->yhot, w, h, 712 711 (void *)pm, reqp->header.size - pVBox->set_pointer_shape_size); 713 xfree 712 xfree(p); 714 713 } 715 714 #endif … … 735 734 } 736 735 737 pVBox->pCurs = pCurs = xf86CreateCursorInfoRec 736 pVBox->pCurs = pCurs = xf86CreateCursorInfoRec(); 738 737 if (!pCurs) 739 738 RETERROR(pScrn->scrnIndex, FALSE, … … 759 758 #endif 760 759 761 rc = xf86InitCursor 760 rc = xf86InitCursor(pScreen, pCurs); 762 761 if (rc == TRUE) 763 762 return TRUE; -
trunk/src/VBox/Additions/x11/xgraphics/vboxvideo.h
r6484 r6497 1 1 /** @file 2 2 * 3 * Linux Additions X11graphics driver3 * VirtualBox X11 Additions graphics driver 4 4 */ 5 5 … … 165 165 Bool pointer_offscreen; 166 166 Bool useVbva; 167 #ifndef RT_OS_SOLARIS 167 168 VMMDevVideoAccelFlush *reqf; 168 169 VMMDevVideoAccelEnable *reqe; 170 #endif 169 171 VMMDevMemory *pVMMDevMemory; 170 172 VBVAMEMORY *pVbvaMemory;
Note:
See TracChangeset
for help on using the changeset viewer.