VirtualBox

Ignore:
Timestamp:
Mar 10, 2007 10:47:37 AM (18 years ago)
Author:
vboxsync
Message:

Darwin cursors (didn't get inverted cursors working right, so doing the same as X11).

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile

    r1339 r1391  
    130130
    131131VirtualBox_SOURCES.darwin = \
    132         src/darwin/DarwinKeyboard.cpp
     132        src/darwin/DarwinKeyboard.cpp \
     133        src/darwin/DarwinCursor.cpp
    133134
    134135VirtualBox_DEFS           = VBOX_GUI_SEPARATE_VM_PROCESS
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxConsoleView.h

    r1339 r1391  
    3838#if defined (Q_WS_MAC)
    3939# include <Carbon/Carbon.h>
     40# include "DarwinCursor.h"
    4041#endif
    4142
     
    218219
    219220#if defined(Q_WS_MAC)
     221# ifndef VBOX_WITH_HACKED_QT
    220222    /** Event handler reference. NULL if the handler isn't installed. */
    221223    EventHandlerRef m_darwinEventHandlerRef;
     224# endif
    222225    /** The current modifier key mask. Used to figure out which modifier
    223226     *  key was pressed when we get a kEventRawKeyModifiersChanged event. */
    224227    UInt32 m_darwinKeyModifiers;
     228    /** The darwin cursor handle (see DarwinCursor.h/.cpp). */
     229    DARWINCURSOR m_darwinCursor;
    225230#endif
    226231
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp

    r1339 r1391  
    8080#if defined (Q_WS_MAC)
    8181# include "DarwinKeyboard.h"
     82# include "DarwinCursor.h"
    8283# ifdef VBOX_WITH_HACKED_QT
    8384#  include "QIApplication.h"
    8485# endif
     86# include <VBox/err.h>
    8587#endif /* defined (Q_WS_MAC) */
    8688
     
    419421#endif
    420422#if defined(Q_WS_MAC)
     423# ifndef VBOX_WITH_HACKED_QT
    421424    , m_darwinEventHandlerRef (NULL)
     425# endif
    422426    , m_darwinKeyModifiers (0)
    423427#endif
     
    535539#if defined (Q_WS_WIN)
    536540    g_view = this;
     541#endif
     542
     543#ifdef Q_WS_MAC
     544    DarwinCursorClearHandle (&m_darwinCursor);
    537545#endif
    538546}
     
    15011509    {
    15021510        ::DarwinReleaseKeyboard ();
     1511#ifndef VBOX_WITH_HACKED_QT
    15031512        if (m_darwinEventHandlerRef)
    15041513        {
     
    15061515            m_darwinEventHandlerRef = NULL;
    15071516        }
    1508 #ifdef VBOX_WITH_HACKED_QT
     1517#else
    15091518        ((QIApplication *)qApp)->setEventFilter (NULL, NULL);
    15101519#endif
     
    26372646        }
    26382647
     2648#elif defined(Q_WS_MAC)
     2649
     2650        /*
     2651         * Qt3/Mac only supports black/white cursors and it offers no way
     2652         * to create your own cursors here unlike on X11 and Windows.
     2653         * Which means we're pretty much forced to do it our own way.
     2654         */
     2655        int rc;
     2656
     2657        /* dispose of the old cursor. */
     2658        if (!DarwinCursorIsNull (&m_darwinCursor))
     2659        {
     2660            rc = DarwinCursorDestroy (&m_darwinCursor);
     2661            AssertRC (rc);
     2662        }
     2663
     2664        /* create the new cursor */
     2665        rc = DarwinCursorCreate (me->width(), me->height(), me->xHot(), me->yHot(), me->hasAlpha(),
     2666                                 srcAndMaskPtr, srcShapePtr, &m_darwinCursor);
     2667        AssertRC (rc);
     2668        if (VBOX_SUCCESS (rc))
     2669        {
     2670            /** @todo check current mouse coordinates. */
     2671            rc = DarwinCursorSet (&m_darwinCursor);
     2672            AssertRC (rc);
     2673        }
     2674        ok = VBOX_SUCCESS (rc);
     2675        NOREF (srcShapePtrScan);
     2676
     2677#else
     2678
     2679# warning "port me"
     2680
    26392681#endif
    26402682        if (!ok)
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