VirtualBox

Changeset 6241 in vbox


Ignore:
Timestamp:
Jan 4, 2008 4:25:30 PM (17 years ago)
Author:
vboxsync
Message:

Guest r3 lib for x11 mouse. The solaris mouse driver doesn't yet work like it should.

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r6230 r6241  
    26712671 TEMPLATE_VBOXGUESTR3EXE_DEFS  += IN_RT_R3
    26722672 TEMPLATE_VBOXGUESTR3EXE_LDFLAGS = $(TEMPLATE_VBOXR3EXE_LDFLAGS) -static
     2673else if1of ($(BUILD_TARGET),solaris)
     2674 TEMPLATE_VBOXGUESTR3EXE_DEFS   += PIC
     2675 TEMPLATE_VBOXGUESTR3EXE_CFLAGS = $(TEMPLATE_VBOXR3EXE_CFLAGS) -fPIC
     2676 TEMPLATE_VBOXGUESTR3EXE_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) -fPIC
    26732677endif
    26742678
  • trunk/include/VBox/VBoxGuest.h

    r6232 r6241  
    13751375VBGLR3DECL(int)     VbglR3SeamlessSendRects(uint32_t cRects, PRTRECT pRects);
    13761376
     1377/* Mouse */
     1378
     1379VBGLR3DECL(int)     VbglR3GetMouseStatus(uint32_t *pu32Features, uint32_t *pu32PointerX, uint32_t *pu32PointerY);
     1380VBGLR3DECL(int)     VbglR3SetMouseStatus(uint32_t u32Features);
     1381
    13771382/* Backdoor logging */
    13781383
  • trunk/src/VBox/Additions/Makefile.kmk

    r6181 r6241  
    8686  endif
    8787 endif
     88endif
     89
     90# Solaris additions
     91ifeq ($(BUILD_TARGET),solaris)
     92 SUBDIRS += x11
    8893endif
    8994
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-solaris.c

    r6154 r6241  
    499499    LogFlow((DEVICE_NAME ":VBoxAddSolarisOpen\n"));
    500500
     501        /*
     502         * Verify we are being opened as a character device
     503         */
     504        if (fType != OTYP_CHR)
     505                return EINVAL;
     506
    501507#ifndef USE_SESSION_HASH
    502508    VBoxAddDevState *pState = NULL;
     
    565571    }
    566572#endif
    567     LogRel((DEVICE_NAME "VBoxAddSolarisOpen: VBoxGuestCreateUserSession failed. rc=%d\n", rc));
     573    LogRel((DEVICE_NAME ":VBoxAddSolarisOpen: VBoxGuestCreateUserSession failed. rc=%d\n", rc));
    568574    return rc;
    569575}
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3Lib.cpp

    r6236 r6241  
    217217
    218218
     219VBGLR3DECL(int) VbglR3GetMouseStatus(uint32_t *pu32Features, uint32_t *pu32PointerX, uint32_t *pu32PointerY)
     220{
     221    VMMDevReqMouseStatus Req;
     222    vmmdevInitRequest(&Req.header, VMMDevReq_GetMouseStatus);
     223    Req.mouseFeatures = 0;
     224    Req.pointerXPos = 0;
     225    Req.pointerYPos = 0;
     226    int rc = VbglR3GRPerform(&Req.header);
     227    if (RT_SUCCESS(rc))
     228    {
     229        if (pu32Features)
     230            *pu32Features = Req.mouseFeatures;
     231        if (pu32PointerX)
     232            *pu32PointerX = Req.pointerXPos;
     233        if (pu32PointerY)
     234            *pu32PointerY = Req.pointerYPos;
     235    }
     236    return rc;
     237}
     238
     239
     240VBGLR3DECL(int) VbglR3SetMouseStatus(uint32_t u32Features)
     241{
     242    VMMDevReqMouseStatus Req;
     243    vmmdevInitRequest(&Req.header, VMMDevReq_SetMouseStatus);
     244    Req.mouseFeatures = u32Features;
     245    Req.pointerXPos = 0;
     246    Req.pointerYPos = 0;
     247    return VbglR3GRPerform(&Req.header);
     248}
     249
     250
    219251/**
    220252 * Cause any pending WaitEvent calls (VBOXGUEST_IOCTL_WAITEVENT) to return
  • trunk/src/VBox/Additions/x11/Makefile.kmk

    r6202 r6241  
    2828endif
    2929
     30ifeq ($(BUILD_TARGET),solaris)
     31SUBDIRS += xmouse
     32endif
     33
    3034include $(PATH_KBUILD)/subfooter.kmk
    3135
  • trunk/src/VBox/Additions/x11/xmouse/Makefile.kmk

    r6202 r6241  
    1919include $(PATH_KBUILD)/header.kmk
    2020
     21if1of ($(BUILD_TARGET),linux l4)
    2122SYSMODS  = vboxmouse_drv
    2223DLLS     = vboxmouse_drv_70 vboxmouse_drv_71 vboxmouse_drv_14
     
    100101        xorg14/pnp.c \
    101102        VBoxUtils.c
     103endif
    102104
     105ifeq ($(BUILD_TARGET),solaris)
     106DLLS = vboxmouse_drv
     107
     108vboxmouse_drv_TEMPLATE = VBOXGUESTR3EXE
     109vboxmouse_drv_DEFS =    \
     110        XFree86Server IN_MODULE XFree86Module XFree86LOADER XINPUT \
     111        IN_RING3 VBOX XORG_7X PIC
     112vboxmouse_drv_INCS = \
     113        /usr/X11/include/xorg \
     114        $(PATH_SUB_CURRENT)
     115vboxmouse_drv_SOURCES  = \
     116        xorg71/mouse.c \
     117        xorg71/pnp.c \
     118        VBoxUtils.c
     119vboxmouse_drv_LIBS = \
     120        $(VBOX_LIB_VBGL_R3) \
     121        $(VBOX_LIB_IPRT_GUEST_R3)
     122endif
    103123
    104124include $(PATH_KBUILD)/footer.kmk
  • trunk/src/VBox/Additions/x11/xmouse/VBoxUtils.c

    r6202 r6241  
    1616 */
    1717
     18#include <iprt/assert.h>
    1819#include <VBox/VBoxGuest.h>
    1920#include "VBoxUtils.h"
     
    2425#include "compiler.h"
    2526
     27#ifndef RT_OS_SOLARIS
    2628#include <asm/ioctl.h>
     29#endif
    2730
     31#ifdef RT_OS_SOLARIS        /** @todo later Linux should also use R3 lib for this */
     32int VBoxMouseInit(void)
     33{
     34    int rc = VbglR3Init();
     35    if (RT_FAILURE(rc))
     36    {
     37        ErrorF("VbglR3Init failed.\n");
     38        return 1;
     39    }
     40
     41    rc = VbglR3SetMouseStatus(VBOXGUEST_MOUSE_GUEST_CAN_ABSOLUTE | VBOXGUEST_MOUSE_GUEST_NEEDS_HOST_CURSOR);
     42    if (VBOX_FAILURE(rc))
     43    {
     44        ErrorF("Error sending mouse pointer capabilities to VMM! rc = %d (%s)\n",
     45               errno, strerror(errno));
     46        return 1;
     47    }
     48    xf86Msg(X_INFO, "VirtualBox mouse pointer integration available.\n");
     49    return 0;
     50}
     51
     52
     53int VBoxMouseQueryPosition(unsigned int *puAbsXPos, unsigned int *puAbsYPos)
     54{
     55    int rc;
     56    uint32_t pointerXPos;
     57    uint32_t pointerYPos;
     58
     59    AssertPtrReturn(puAbsXPos, VERR_INVALID_PARAMETER);
     60    AssertPtrReturn(puAbsYPos, VERR_INVALID_PARAMETER);
     61    rc = VbglR3GetMouseStatus(NULL, &pointerXPos, &pointerYPos);
     62    if (VBOX_SUCCESS(rc))
     63    {
     64        *puAbsXPos = pointerXPos;
     65        *puAbsYPos = pointerYPos;
     66        xf86Msg(X_INFO, "VBoxMouseQueryPosition x=%u y=%u\n", *puAbsXPos, *puAbsYPos);
     67        return 0;
     68    }
     69    ErrorF("Error querying host mouse position! rc = %d\n", rc);
     70    return 2;
     71}
     72
     73
     74int VBoxMouseFini(void)
     75{
     76    int rc = VbglR3SetMouseStatus(0);
     77    VbglR3Term();
     78    return rc;
     79}
     80#else
    2881/* the vboxadd module file handle */
    2982static int g_vboxaddHandle = -1;
     
    141194    return 0;
    142195}
     196#endif  /* !RT_OS_SOLARIS */
     197
  • trunk/src/VBox/Additions/x11/xmouse/xorg71/mouse.c

    r6202 r6241  
    8181#include <X11/Xproto.h>
    8282
     83#if defined(VBOX) && defined(RT_OS_SOLARIS)
     84# undef RANDR
     85#endif
    8386#include "xf86.h"
    8487
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette