VirtualBox

Changeset 26980 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Mar 2, 2010 11:30:00 PM (15 years ago)
Author:
vboxsync
Message:

FE/BFE: more clean-up to reduce the difference between MouseImpl.cpp in Main and VBoxBFE

Location:
trunk/src/VBox/Frontends/VBoxBFE
Files:
11 edited
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxBFE/AutoCaller.h

    r26930 r26980  
    11/** @file
    22 *
    3  * VirtualBox COM base classes definition
     3 * VBox frontends: Basic Frontend (BFE):
     4 * VirtualBox COM base class stubs
    45 */
    56
     
    2324#define ____H_AUTOCALLER
    2425
    25 ////////////////////////////////////////////////////////////////////////////////
    26 //
    27 // AutoCaller* classes
    28 //
    29 ////////////////////////////////////////////////////////////////////////////////
     26#define COMMA_LOCKVAL_SRC_POS
    3027
    31 /**
    32  * Smart class that automatically increases the number of callers of the
    33  * given VirtualBoxBase object when an instance is constructed and decreases
    34  * it back when the created instance goes out of scope (i.e. gets destroyed).
    35  *
    36  * If #rc() returns a failure after the instance creation, it means that
    37  * the managed VirtualBoxBase object is not Ready, or in any other invalid
    38  * state, so that the caller must not use the object and can return this
    39  * failed result code to the upper level.
    40  *
    41  * See VirtualBoxBase::addCaller(), VirtualBoxBase::addLimitedCaller() and
    42  * VirtualBoxBase::releaseCaller() for more details about object callers.
    43  *
    44  * @param aLimited  |false| if this template should use
    45  *                  VirtualiBoxBase::addCaller() calls to add callers, or
    46  *                  |true| if VirtualiBoxBase::addLimitedCaller() should be
    47  *                  used.
    48  *
    49  * @note It is preferable to use the AutoCaller and AutoLimitedCaller
    50  *       classes than specify the @a aLimited argument, for better
    51  *       self-descriptiveness.
    52  */
    53 template<bool aLimited>
    54 class AutoCallerBase
    55 {
    56 public:
    57 
    58     /**
    59      * Increases the number of callers of the given object by calling
    60      * VirtualBoxBase::addCaller().
    61      *
    62      * @param aObj      Object to add a caller to. If NULL, this
    63      *                  instance is effectively turned to no-op (where
    64      *                  rc() will return S_OK and state() will be
    65      *                  NotReady).
    66      */
    67     AutoCallerBase(VirtualBoxBase *aObj)
    68         : mObj(aObj), mRC(S_OK), mState(VirtualBoxBase::NotReady)
    69     {
    70         if (mObj)
    71             mRC = mObj->addCaller(&mState, aLimited);
    72     }
    73 
    74     /**
    75      * If the number of callers was successfully increased, decreases it
    76      * using VirtualBoxBase::releaseCaller(), otherwise does nothing.
    77      */
    78     ~AutoCallerBase()
    79     {
    80         if (mObj && SUCCEEDED(mRC))
    81             mObj->releaseCaller();
    82     }
    83 
    84     /**
    85      * Stores the result code returned by VirtualBoxBase::addCaller() after
    86      * instance creation or after the last #add() call. A successful result
    87      * code means the number of callers was successfully increased.
    88      */
    89     HRESULT rc() const { return mRC; }
    90 
    91     /**
    92      * Returns |true| if |SUCCEEDED(rc())| is |true|, for convenience.
    93      * |true| means the number of callers was successfully increased.
    94      */
    95     bool isOk() const { return SUCCEEDED(mRC); }
    96 
    97     /**
    98      * Stores the object state returned by VirtualBoxBase::addCaller() after
    99      * instance creation or after the last #add() call.
    100      */
    101     VirtualBoxBase::State state() const { return mState; }
    102 
    103     /**
    104      * Temporarily decreases the number of callers of the managed object.
    105      * May only be called if #isOk() returns |true|. Note that #rc() will
    106      * return E_FAIL after this method succeeds.
    107      */
    108     void release()
    109     {
    110         Assert(SUCCEEDED(mRC));
    111         if (SUCCEEDED(mRC))
    112         {
    113             if (mObj)
    114                 mObj->releaseCaller();
    115             mRC = E_FAIL;
    116         }
    117     }
    118 
    119     /**
    120      * Restores the number of callers decreased by #release(). May only be
    121      * called after #release().
    122      */
    123     void add()
    124     {
    125         Assert(!SUCCEEDED(mRC));
    126         if (mObj && !SUCCEEDED(mRC))
    127             mRC = mObj->addCaller(&mState, aLimited);
    128     }
    129 
    130     /**
    131      * Attaches another object to this caller instance.
    132      * The previous object's caller is released before the new one is added.
    133      *
    134      * @param aObj  New object to attach, may be @c NULL.
    135      */
    136     void attach(VirtualBoxBase *aObj)
    137     {
    138         /* detect simple self-reattachment */
    139         if (mObj != aObj)
    140         {
    141             if (mObj && SUCCEEDED(mRC))
    142                 release();
    143             mObj = aObj;
    144             add();
    145         }
    146     }
    147 
    148     /** Verbose equivalent to <tt>attach (NULL)</tt>. */
    149     void detach() { attach(NULL); }
    150 
    151 private:
    152 
    153     DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(AutoCallerBase)
    154     DECLARE_CLS_NEW_DELETE_NOOP(AutoCallerBase)
    155 
    156     VirtualBoxBase *mObj;
    157     HRESULT mRC;
    158     VirtualBoxBase::State mState;
    159 };
    160 
    161 /**
    162  * Smart class that automatically increases the number of normal
    163  * (non-limited) callers of the given VirtualBoxBase object when an instance
    164  * is constructed and decreases it back when the created instance goes out
    165  * of scope (i.e. gets destroyed).
    166  *
    167  * A typical usage pattern to declare a normal method of some object (i.e. a
    168  * method that is valid only when the object provides its full
    169  * functionality) is:
    170  * <code>
    171  * STDMETHODIMP Component::Foo()
    172  * {
    173  *     AutoCaller autoCaller(this);
    174  *     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    175  *     ...
    176  * </code>
    177  *
    178  * Using this class is equivalent to using the AutoCallerBase template with
    179  * the @a aLimited argument set to |false|, but this class is preferred
    180  * because provides better self-descriptiveness.
    181  *
    182  * See AutoCallerBase for more information about auto caller functionality.
    183  */
    184 typedef AutoCallerBase<false> AutoCaller;
    185 
    186 /**
    187  * Smart class that automatically increases the number of limited callers of
    188  * the given VirtualBoxBase object when an instance is constructed and
    189  * decreases it back when the created instance goes out of scope (i.e. gets
    190  * destroyed).
    191  *
    192  * A typical usage pattern to declare a limited method of some object (i.e.
    193  * a method that is valid even if the object doesn't provide its full
    194  * functionality) is:
    195  * <code>
    196  * STDMETHODIMP Component::Bar()
    197  * {
    198  *     AutoLimitedCaller autoCaller(this);
    199  *     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    200  *     ...
    201  * </code>
    202  *
    203  * Using this class is equivalent to using the AutoCallerBase template with
    204  * the @a aLimited argument set to |true|, but this class is preferred
    205  * because provides better self-descriptiveness.
    206  *
    207  * See AutoCallerBase for more information about auto caller functionality.
    208  */
    209 typedef AutoCallerBase<true> AutoLimitedCaller;
    210 
    211 /**
    212  * Smart class to enclose the state transition NotReady->InInit->Ready.
    213  *
    214  * The purpose of this span is to protect object initialization.
    215  *
    216  * Instances must be created as a stack-based variable taking |this| pointer
    217  * as the argument at the beginning of init() methods of VirtualBoxBase
    218  * subclasses. When this variable is created it automatically places the
    219  * object to the InInit state.
    220  *
    221  * When the created variable goes out of scope (i.e. gets destroyed) then,
    222  * depending on the result status of this initialization span, it either
    223  * places the object to Ready or Limited state or calls the object's
    224  * VirtualBoxBase::uninit() method which is supposed to place the object
    225  * back to the NotReady state using the AutoUninitSpan class.
    226  *
    227  * The initial result status of the initialization span is determined by the
    228  * @a aResult argument of the AutoInitSpan constructor (Result::Failed by
    229  * default). Inside the initialization span, the success status can be set
    230  * to Result::Succeeded using #setSucceeded(), to to Result::Limited using
    231  * #setLimited() or to Result::Failed using #setFailed(). Please don't
    232  * forget to set the correct success status before getting the AutoInitSpan
    233  * variable destroyed (for example, by performing an early return from
    234  * the init() method)!
    235  *
    236  * Note that if an instance of this class gets constructed when the object
    237  * is in the state other than NotReady, #isOk() returns |false| and methods
    238  * of this class do nothing: the state transition is not performed.
    239  *
    240  * A typical usage pattern is:
    241  * <code>
    242  * HRESULT Component::init()
    243  * {
    244  *     AutoInitSpan autoInitSpan (this);
    245  *     AssertReturn (autoInitSpan.isOk(), E_FAIL);
    246  *     ...
    247  *     if (FAILED(rc))
    248  *         return rc;
    249  *     ...
    250  *     if (SUCCEEDED(rc))
    251  *         autoInitSpan.setSucceeded();
    252  *     return rc;
    253  * }
    254  * </code>
    255  *
    256  * @note Never create instances of this class outside init() methods of
    257  *       VirtualBoxBase subclasses and never pass anything other than |this|
    258  *       as the argument to the constructor!
    259  */
    26028class AutoInitSpan
    26129{
    26230public:
    263 
    264     enum Result { Failed = 0x0, Succeeded = 0x1, Limited = 0x2 };
    265 
    266     AutoInitSpan(VirtualBoxBase *aObj, Result aResult = Failed);
    267     ~AutoInitSpan();
    268 
    269     /**
    270      * Returns |true| if this instance has been created at the right moment
    271      * (when the object was in the NotReady state) and |false| otherwise.
    272      */
    273     bool isOk() const { return mOk; }
    274 
    275     /**
    276      * Sets the initialization status to Succeeded to indicates successful
    277      * initialization. The AutoInitSpan destructor will place the managed
    278      * VirtualBoxBase object to the Ready state.
    279      */
    280     void setSucceeded() { mResult = Succeeded; }
    281 
    282     /**
    283      * Sets the initialization status to Succeeded to indicate limited
    284      * (partly successful) initialization. The AutoInitSpan destructor will
    285      * place the managed VirtualBoxBase object to the Limited state.
    286      */
    287     void setLimited() { mResult = Limited; }
    288 
    289     /**
    290      * Sets the initialization status to Failure to indicates failed
    291      * initialization. The AutoInitSpan destructor will place the managed
    292      * VirtualBoxBase object to the InitFailed state and will automatically
    293      * call its uninit() method which is supposed to place the object back
    294      * to the NotReady state using AutoUninitSpan.
    295      */
    296     void setFailed() { mResult = Failed; }
    297 
    298     /** Returns the current initialization result. */
    299     Result result() { return mResult; }
    300 
    301 private:
    302 
    303     DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(AutoInitSpan)
    304     DECLARE_CLS_NEW_DELETE_NOOP(AutoInitSpan)
    305 
    306     VirtualBoxBase *mObj;
    307     Result mResult : 3; // must be at least total number of bits + 1 (sign)
    308     bool mOk : 1;
     31    AutoInitSpan(VirtualBoxBase *) {}
     32    bool isOk() { return true; }
     33    void setSucceeded() {}
    30934};
    31035
    311 /**
    312  * Smart class to enclose the state transition Limited->InInit->Ready.
    313  *
    314  * The purpose of this span is to protect object re-initialization.
    315  *
    316  * Instances must be created as a stack-based variable taking |this| pointer
    317  * as the argument at the beginning of methods of VirtualBoxBase
    318  * subclasses that try to re-initialize the object to bring it to the Ready
    319  * state (full functionality) after partial initialization (limited
    320  * functionality). When this variable is created, it automatically places
    321  * the object to the InInit state.
    322  *
    323  * When the created variable goes out of scope (i.e. gets destroyed),
    324  * depending on the success status of this initialization span, it either
    325  * places the object to the Ready state or brings it back to the Limited
    326  * state.
    327  *
    328  * The initial success status of the re-initialization span is |false|. In
    329  * order to make it successful, #setSucceeded() must be called before the
    330  * instance is destroyed.
    331  *
    332  * Note that if an instance of this class gets constructed when the object
    333  * is in the state other than Limited, #isOk() returns |false| and methods
    334  * of this class do nothing: the state transition is not performed.
    335  *
    336  * A typical usage pattern is:
    337  * <code>
    338  * HRESULT Component::reinit()
    339  * {
    340  *     AutoReinitSpan autoReinitSpan (this);
    341  *     AssertReturn (autoReinitSpan.isOk(), E_FAIL);
    342  *     ...
    343  *     if (FAILED(rc))
    344  *         return rc;
    345  *     ...
    346  *     if (SUCCEEDED(rc))
    347  *         autoReinitSpan.setSucceeded();
    348  *     return rc;
    349  * }
    350  * </code>
    351  *
    352  * @note Never create instances of this class outside re-initialization
    353  * methods of VirtualBoxBase subclasses and never pass anything other than
    354  * |this| as the argument to the constructor!
    355  */
    356 class AutoReinitSpan
    357 {
    358 public:
    359 
    360     AutoReinitSpan(VirtualBoxBase *aObj);
    361     ~AutoReinitSpan();
    362 
    363     /**
    364      * Returns |true| if this instance has been created at the right moment
    365      * (when the object was in the Limited state) and |false| otherwise.
    366      */
    367     bool isOk() const { return mOk; }
    368 
    369     /**
    370      * Sets the re-initialization status to Succeeded to indicates
    371      * successful re-initialization. The AutoReinitSpan destructor will place
    372      * the managed VirtualBoxBase object to the Ready state.
    373      */
    374     void setSucceeded() { mSucceeded = true; }
    375 
    376 private:
    377 
    378     DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(AutoReinitSpan)
    379     DECLARE_CLS_NEW_DELETE_NOOP(AutoReinitSpan)
    380 
    381     VirtualBoxBase *mObj;
    382     bool mSucceeded : 1;
    383     bool mOk : 1;
    384 };
    385 
    386 /**
    387  * Smart class to enclose the state transition Ready->InUnnit->NotReady,
    388  * InitFailed->InUnnit->NotReady or WillUninit->InUnnit->NotReady.
    389  *
    390  * The purpose of this span is to protect object uninitialization.
    391  *
    392  * Instances must be created as a stack-based variable taking |this| pointer
    393  * as the argument at the beginning of uninit() methods of VirtualBoxBase
    394  * subclasses. When this variable is created it automatically places the
    395  * object to the InUninit state, unless it is already in the NotReady state
    396  * as indicated by #uninitDone() returning |true|. In the latter case, the
    397  * uninit() method must immediately return because there should be nothing
    398  * to uninitialize.
    399  *
    400  * When this variable goes out of scope (i.e. gets destroyed), it places the
    401  * object to NotReady state.
    402  *
    403  * A typical usage pattern is:
    404  * <code>
    405  * void Component::uninit()
    406  * {
    407  *     AutoUninitSpan autoUninitSpan (this);
    408  *     if (autoUninitSpan.uninitDone())
    409  *         return;
    410  *     ...
    411  * }
    412  * </code>
    413  *
    414  * @note The constructor of this class blocks the current thread execution
    415  *       until the number of callers added to the object using #addCaller()
    416  *       or AutoCaller drops to zero. For this reason, it is forbidden to
    417  *       create instances of this class (or call uninit()) within the
    418  *       AutoCaller or #addCaller() scope because it is a guaranteed
    419  *       deadlock.
    420  *
    421  * @note Never create instances of this class outside uninit() methods and
    422  *       never pass anything other than |this| as the argument to the
    423  *       constructor!
    424  */
    42536class AutoUninitSpan
    42637{
    42738public:
    428 
    429     AutoUninitSpan(VirtualBoxBase *aObj);
    430     ~AutoUninitSpan();
    431 
    432     /** |true| when uninit() is called as a result of init() failure */
    433     bool initFailed() { return mInitFailed; }
    434 
    435     /** |true| when uninit() has already been called (so the object is NotReady) */
    436     bool uninitDone() { return mUninitDone; }
    437 
    438 private:
    439 
    440     DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(AutoUninitSpan)
    441     DECLARE_CLS_NEW_DELETE_NOOP(AutoUninitSpan)
    442 
    443     VirtualBoxBase *mObj;
    444     bool mInitFailed : 1;
    445     bool mUninitDone : 1;
     39    AutoUninitSpan(VirtualBoxBase *) {}
     40    bool uninitDone() { return false; }
    44641};
    44742
    448 /**
    449  * Smart class to enclose the state transition Ready->MayUninit->NotReady or
    450  * Ready->MayUninit->WillUninit.
    451  *
    452  * The purpose of this span is to safely check if unintialization is
    453  * possible at the given moment and seamlessly perform it if so.
    454  *
    455  * Instances must be created as a stack-based variable taking |this| pointer
    456  * as the argument at the beginning of methods of VirtualBoxBase
    457  * subclasses that want to uninitialize the object if a necessary set of
    458  * criteria is met and leave it Ready otherwise.
    459  *
    460  * When this variable is created it automatically places the object to the
    461  * MayUninit state if it is Ready, does nothing but returns |true| in
    462  * response to #alreadyInProgress() if it is already in MayUninit, or
    463  * returns a failure in response to #rc() in any other case. The example
    464  * below shows how the user must react in latter two cases.
    465  *
    466  * When this variable goes out of scope (i.e. gets destroyed), it places the
    467  * object back to Ready state unless #acceptUninit() is called in which case
    468  * the object is placed to WillUninit state and uninit() is immediately
    469  * called after that.
    470  *
    471  * A typical usage pattern is:
    472  * <code>
    473  * void Component::uninit()
    474  * {
    475  *     AutoMayUninitSpan mayUninitSpan (this);
    476  *     if (FAILED(mayUninitSpan.rc())) return mayUninitSpan.rc();
    477  *     if (mayUninitSpan.alreadyInProgress())
    478  *          return S_OK;
    479  *     ...
    480  *     if (FAILED(rc))
    481  *         return rc; // will go back to Ready
    482  *     ...
    483  *     if (SUCCEEDED(rc))
    484  *         mayUninitSpan.acceptUninit(); // will call uninit()
    485  *     return rc;
    486  * }
    487  * </code>
    488  *
    489  * @note The constructor of this class blocks the current thread execution
    490  *       until the number of callers added to the object using #addCaller()
    491  *       or AutoCaller drops to zero. For this reason, it is forbidden to
    492  *       create instances of this class (or call uninit()) within the
    493  *       AutoCaller or #addCaller() scope because it is a guaranteed
    494  *       deadlock.
    495  */
    496 class AutoMayUninitSpan
     43class AutoCaller
    49744{
    49845public:
     46    AutoCaller(VirtualBoxBase *) {}
     47    int rc() { return S_OK; }
     48};
    49949
    500     AutoMayUninitSpan(VirtualBoxBase *aObj);
    501     ~AutoMayUninitSpan();
    502 
    503     /**
    504      * Returns a failure if the AutoMayUninitSpan variable was constructed
    505      * at an improper time. If there is a failure, do nothing but return
    506      * it to the caller.
    507      */
    508     HRESULT rc() { return mRC; }
    509 
    510     /**
    511      * Returns |true| if AutoMayUninitSpan is already in progress on some
    512      * other thread. If it's the case, do nothing but return S_OK to
    513      * the caller.
    514      */
    515     bool alreadyInProgress() { return mAlreadyInProgress; }
    516 
    517     /*
    518      * Accepts uninitialization and causes the destructor to go to
    519      * WillUninit state and call uninit() afterwards.
    520      */
    521     void acceptUninit() { mAcceptUninit = true; }
    522 
    523 private:
    524 
    525     DECLARE_CLS_COPY_CTOR_ASSIGN_NOOP(AutoMayUninitSpan)
    526     DECLARE_CLS_NEW_DELETE_NOOP(AutoMayUninitSpan)
    527 
    528     VirtualBoxBase *mObj;
    529 
    530     HRESULT mRC;
    531     bool mAlreadyInProgress : 1;
    532     bool mAcceptUninit : 1;
     50class AutoWriteLock
     51{
     52public:
     53    AutoWriteLock(VirtualBoxBase *) {}
    53354};
    53455
  • trunk/src/VBox/Frontends/VBoxBFE/COMDefs.h

    r26834 r26980  
    4242
    4343#define ATL_NO_VTABLE
     44#define DECLARE_CLASSFACTORY(a)
     45#define DECLARE_CLASSFACTORY_SINGLETON(a)
     46#define DECLARE_REGISTRY_RESOURCEID(a)
     47#define DECLARE_NOT_AGGREGATABLE(a)
     48#define DECLARE_PROTECT_FINAL_CONSTRUCT()
     49#define BEGIN_COM_MAP(a)
     50#define COM_INTERFACE_ENTRY(a)
     51#define COM_INTERFACE_ENTRY2(a,b)
     52#define END_COM_MAP()
    4453
    4554#ifndef RT_OS_WINDOWS
     
    6271# define E_INVALIDARG   ((unsigned long) 0x80070057L)
    6372#define E_ACCESSDENIED  ((unsigned long) 0x80070005L)
    64 #define VBOX_E_IPRT_ERROR ((unsigned long) 0x80BB0005L)
    6573
    6674# if ! defined(FALSE)
     
    102110    };
    103111}
     112
     113#define unconst(val) val
    104114#endif
  • trunk/src/VBox/Frontends/VBoxBFE/ConsoleImpl.h

    r26834 r26980  
    119119    } while (0)
    120120
     121class VMMDev;
     122class Display;
     123
    121124class Console
    122125{
     
    143146                                               uint32_t yHot, uint32_t width,
    144147                                               uint32_t height, void *pShape) = 0;
     148    virtual void     onMouseCapabilityChange(bool fAbs, bool fRel,
     149                                             bool fNeedsHostCursor) {}
    145150
    146151    virtual CONEVENT eventWait() = 0;
     
    149154    virtual void     progressInfo(PVM pVM, unsigned uPercent, void *pvUser) = 0;
    150155    virtual void     resetKeys(void) = 0;
     156    virtual VMMDev  *getVMMDev() = 0;
     157    virtual Display *getDisplay() = 0;
    151158
    152159protected:
  • trunk/src/VBox/Frontends/VBoxBFE/DisplayImpl.cpp

    r26173 r26980  
    22/** @file
    33 * VBox frontends: Basic Frontend (BFE):
    4  * Implementation of VMDisplay class
     4 * Implementation of Display class
    55 */
    66
     
    5050#include "DisplayImpl.h"
    5151#include "Framebuffer.h"
    52 #include "VMMDevInterface.h"
     52#include "VMMDev.h"
    5353
    5454
     
    5858
    5959/**
    60  * VMDisplay driver instance data.
     60 * Display driver instance data.
    6161 */
    6262typedef struct DRVMAINDISPLAY
    6363{
    6464    /** Pointer to the display object. */
    65     VMDisplay                    *pDisplay;
     65    Display                    *pDisplay;
    6666    /** Pointer to the driver instance structure. */
    6767    PPDMDRVINS                  pDrvIns;
     
    7979/////////////////////////////////////////////////////////////////////////////
    8080
    81 VMDisplay::VMDisplay()
     81Display::Display()
    8282{
    8383    mpDrv = NULL;
     
    102102}
    103103
    104 VMDisplay::~VMDisplay()
     104Display::~Display()
    105105{
    106106    mFramebuffer = 0;
     
    117117 * @param h New display height
    118118 */
    119 int VMDisplay::handleDisplayResize (int w, int h)
    120 {
    121     LogFlow(("VMDisplay::handleDisplayResize(): w=%d, h=%d\n", w, h));
     119int Display::handleDisplayResize (int w, int h)
     120{
     121    LogFlow(("Display::handleDisplayResize(): w=%d, h=%d\n", w, h));
    122122
    123123    // if there is no Framebuffer, this call is not interesting
     
    140140    if (!finished)
    141141    {
    142         LogFlow(("VMDisplay::handleDisplayResize: external framebuffer wants us to wait!\n"));
     142        LogFlow(("Display::handleDisplayResize: external framebuffer wants us to wait!\n"));
    143143
    144144        /* Note: The previously obtained framebuffer lock must be preserved.
     
    165165 *  @thread EMT
    166166 */
    167 void VMDisplay::handleResizeCompletedEMT (void)
     167void Display::handleResizeCompletedEMT (void)
    168168{
    169169    LogFlowFunc(("\n"));
     
    190190 * @returns COM status code
    191191 */
    192 STDMETHODIMP VMDisplay::ResizeCompleted()
    193 {
    194     LogFlow(("VMDisplay::ResizeCompleted\n"));
     192STDMETHODIMP Display::ResizeCompleted()
     193{
     194    LogFlow(("Display::ResizeCompleted\n"));
    195195
    196196    // this is only valid for external framebuffers
     
    205205}
    206206
     207STDMETHODIMP Display::COMGETTER(Width)(ULONG *pWidth)
     208{
     209    *pWidth = getWidth();
     210    return S_OK;
     211}
     212
     213STDMETHODIMP Display::COMGETTER(Height)(ULONG *pHeight)
     214{
     215    *pHeight = getHeight();
     216    return S_OK;
     217}
     218
    207219static void checkCoordBounds (int *px, int *py, int *pw, int *ph, int cx, int cy)
    208220{
     
    237249 * @param h New display height
    238250 */
    239 void VMDisplay::handleDisplayUpdate (int x, int y, int w, int h)
     251void Display::handleDisplayUpdate (int x, int y, int w, int h)
    240252{
    241253    // if there is no Framebuffer, this call is not interesting
     
    266278 * @param width Address of result variable.
    267279 */
    268 uint32_t VMDisplay::getWidth()
     280uint32_t Display::getWidth()
    269281{
    270282    Assert(mpDrv);
     
    278290 * @param height Address of result variable.
    279291 */
    280 uint32_t VMDisplay::getHeight()
     292uint32_t Display::getHeight()
    281293{
    282294    Assert(mpDrv);
     
    290302 * @param bitsPerPixel Address of result variable.
    291303 */
    292 uint32_t VMDisplay::getBitsPerPixel()
     304uint32_t Display::getBitsPerPixel()
    293305{
    294306    Assert(mpDrv);
     
    296308}
    297309
    298 void VMDisplay::updatePointerShape(bool fVisible, bool fAlpha, uint32_t xHot, uint32_t yHot, uint32_t width, uint32_t height, void *pShape)
     310void Display::updatePointerShape(bool fVisible, bool fAlpha, uint32_t xHot, uint32_t yHot, uint32_t width, uint32_t height, void *pShape)
    299311{
    300312}
     
    310322 * @param Framebuffer external Framebuffer object
    311323 */
    312 STDMETHODIMP VMDisplay::SetFramebuffer(unsigned iScreenID, Framebuffer *Framebuffer)
     324STDMETHODIMP Display::SetFramebuffer(unsigned iScreenID, Framebuffer *Framebuffer)
    313325{
    314326    if (!Framebuffer)
     
    327339/* related activities this call needs to be framed by Lock/Unlock. */
    328340void
    329 VMDisplay::doInvalidateAndUpdate(struct DRVMAINDISPLAY  *mpDrv)
     341Display::doInvalidateAndUpdate(struct DRVMAINDISPLAY  *mpDrv)
    330342{
    331343    mpDrv->pDisplay->mFramebuffer->Lock();
     
    340352 * @returns COM status code
    341353 */
    342 STDMETHODIMP VMDisplay::InvalidateAndUpdate()
    343 {
    344     LogFlow (("VMDisplay::InvalidateAndUpdate(): BEGIN\n"));
     354STDMETHODIMP Display::InvalidateAndUpdate()
     355{
     356    LogFlow (("Display::InvalidateAndUpdate(): BEGIN\n"));
    345357
    346358    HRESULT rc = S_OK;
    347359
    348     LogFlow (("VMDisplay::InvalidateAndUpdate(): sending DPYUPDATE request\n"));
     360    LogFlow (("Display::InvalidateAndUpdate(): sending DPYUPDATE request\n"));
    349361
    350362    Assert(gpVM);
    351363    /* pdm.h says that this has to be called from the EMT thread */
    352364    int rcVBox = VMR3ReqCallVoidWait(gpVM, VMCPUID_ANY,
    353                                      (PFNRT)VMDisplay::doInvalidateAndUpdate, 1, mpDrv);
     365                                     (PFNRT)Display::doInvalidateAndUpdate, 1, mpDrv);
    354366    if (RT_FAILURE(rcVBox))
    355367        rc = E_FAIL;
    356368
    357     LogFlow (("VMDisplay::InvalidateAndUpdate(): END: rc=%08X\n", rc));
     369    LogFlow (("Display::InvalidateAndUpdate(): END: rc=%08X\n", rc));
    358370    return rc;
    359371}
     
    366378 *
    367379 */
    368 void VMDisplay::updateDisplayData()
     380void Display::updateDisplayData()
    369381{
    370382
     
    392404}
    393405
    394 void VMDisplay::resetFramebuffer()
     406void Display::resetFramebuffer()
    395407{
    396408    if (!mFramebuffer)
     
    410422 * Handle display resize event
    411423 *
    412  * @param  pInterface VMDisplay connector.
     424 * @param  pInterface Display connector.
    413425 * @param  cx         New width in pixels.
    414426 * @param  cy         New height in pixels.
    415427 */
    416 DECLCALLBACK(int) VMDisplay::displayResizeCallback(PPDMIDISPLAYCONNECTOR pInterface, uint32_t bpp, void *pvVRAM, uint32_t cbLine, uint32_t cx, uint32_t cy)
     428DECLCALLBACK(int) Display::displayResizeCallback(PPDMIDISPLAYCONNECTOR pInterface, uint32_t bpp, void *pvVRAM, uint32_t cbLine, uint32_t cx, uint32_t cy)
    417429{
    418430    PDRVMAINDISPLAY pDrv = PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface);
     
    425437 * Handle display update
    426438 *
    427  * @param  pInterface VMDisplay connector.
     439 * @param  pInterface Display connector.
    428440 * @param  x          Left upper boundary x.
    429441 * @param  y          Left upper boundary y.
     
    431443 * @param  cy         Update rect height.
    432444 */
    433 DECLCALLBACK(void) VMDisplay::displayUpdateCallback(PPDMIDISPLAYCONNECTOR pInterface,
     445DECLCALLBACK(void) Display::displayUpdateCallback(PPDMIDISPLAYCONNECTOR pInterface,
    434446                                                  uint32_t x, uint32_t y, uint32_t cx, uint32_t cy)
    435447{
     
    443455 * Periodic display refresh callback.
    444456 *
    445  * @param  pInterface VMDisplay connector.
    446  */
    447 DECLCALLBACK(void) VMDisplay::displayRefreshCallback(PPDMIDISPLAYCONNECTOR pInterface)
     457 * @param  pInterface Display connector.
     458 */
     459DECLCALLBACK(void) Display::displayRefreshCallback(PPDMIDISPLAYCONNECTOR pInterface)
    448460{
    449461    PDRVMAINDISPLAY pDrv = PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface);
     
    455467     * of any locking issues. */
    456468
    457     VMDisplay *pDisplay = pDrv->pDisplay;
     469    Display *pDisplay = pDrv->pDisplay;
    458470
    459471    uint32_t u32ResizeStatus = pDisplay->mu32ResizeStatus;
     
    527539 * @param  pInterface Display connector.
    528540 */
    529 DECLCALLBACK(void) VMDisplay::displayResetCallback(PPDMIDISPLAYCONNECTOR pInterface)
     541DECLCALLBACK(void) Display::displayResetCallback(PPDMIDISPLAYCONNECTOR pInterface)
    530542{
    531543    PDRVMAINDISPLAY pDrv = PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface);
     
    542554 * @see PDMIDISPLAYCONNECTOR::pfnLFBModeChange
    543555 */
    544 DECLCALLBACK(void) VMDisplay::displayLFBModeChangeCallback(PPDMIDISPLAYCONNECTOR pInterface, bool fEnabled)
     556DECLCALLBACK(void) Display::displayLFBModeChangeCallback(PPDMIDISPLAYCONNECTOR pInterface, bool fEnabled)
    545557{
    546558    PDRVMAINDISPLAY pDrv = PDMIDISPLAYCONNECTOR_2_MAINDISPLAY(pInterface);
     
    560572}
    561573
    562 DECLCALLBACK(void) VMDisplay::displayProcessAdapterDataCallback(PPDMIDISPLAYCONNECTOR pInterface, void *pvVRAM, uint32_t u32VRAMSize)
     574DECLCALLBACK(void) Display::displayProcessAdapterDataCallback(PPDMIDISPLAYCONNECTOR pInterface, void *pvVRAM, uint32_t u32VRAMSize)
    563575{
    564576    NOREF(pInterface);
     
    567579}
    568580
    569 DECLCALLBACK(void) VMDisplay::displayProcessDisplayDataCallback(PPDMIDISPLAYCONNECTOR pInterface, void *pvVRAM, unsigned uScreenId)
     581DECLCALLBACK(void) Display::displayProcessDisplayDataCallback(PPDMIDISPLAYCONNECTOR pInterface, void *pvVRAM, unsigned uScreenId)
    570582{
    571583    NOREF(pInterface);
     
    579591    /* Copies of object's pointers used by vbvaRgn functions. */
    580592    Framebuffer     *pFramebuffer;
    581     VMDisplay        *pDisplay;
     593    Display        *pDisplay;
    582594    PPDMIDISPLAYPORT  pPort;
    583595
     
    590602} VBVADIRTYREGION;
    591603
    592 void vbvaRgnInit (VBVADIRTYREGION *prgn, Framebuffer *pfb, VMDisplay *pd, PPDMIDISPLAYPORT pp)
     604void vbvaRgnInit (VBVADIRTYREGION *prgn, Framebuffer *pfb, Display *pd, PPDMIDISPLAYPORT pp)
    593605{
    594606    memset (prgn, 0, sizeof (VBVADIRTYREGION));
     
    677689}
    678690
    679 bool VMDisplay::VideoAccelAllowed (void)
     691bool Display::VideoAccelAllowed (void)
    680692{
    681693    return true;
     
    685697 * @thread EMT
    686698 */
    687 int VMDisplay::VideoAccelEnable (bool fEnable, VBVAMEMORY *pVbvaMemory)
     699int Display::VideoAccelEnable (bool fEnable, VBVAMEMORY *pVbvaMemory)
    688700{
    689701    int rc = VINF_SUCCESS;
     
    818830}
    819831
    820 void VMDisplay::SetVideoModeHint(ULONG aWidth, ULONG aHeight, ULONG aBitsPerPixel, ULONG aDisplay)
     832void Display::SetVideoModeHint(ULONG aWidth, ULONG aHeight, ULONG aBitsPerPixel, ULONG aDisplay)
    821833{
    822834    PPDMIVMMDEVPORT pVMMDevPort = gVMMDev->getVMMDevPort ();
     
    871883 * For crossing boundary - allocate a buffer from heap.
    872884 */
    873 bool VMDisplay::vbvaFetchCmd (VBVACMDHDR **ppHdr, uint32_t *pcbCmd)
     885bool Display::vbvaFetchCmd (VBVACMDHDR **ppHdr, uint32_t *pcbCmd)
    874886{
    875887    uint32_t indexRecordFirst = mpVbvaMemory->indexRecordFirst;
     
    10091021}
    10101022
    1011 void VMDisplay::vbvaReleaseCmd (VBVACMDHDR *pHdr, int32_t cbCmd)
     1023void Display::vbvaReleaseCmd (VBVACMDHDR *pHdr, int32_t cbCmd)
    10121024{
    10131025    uint8_t *au8RingBuffer = mpVbvaMemory->au8RingBuffer;
     
    10531065 * @thread EMT
    10541066 */
    1055 void VMDisplay::VideoAccelFlush (void)
     1067void Display::VideoAccelFlush (void)
    10561068{
    10571069#ifdef DEBUG_sunlover
     
    11491161 * @interface_method_impl{PDMIBASE,pfnQueryInterface}
    11501162 */
    1151 DECLCALLBACK(void *)  VMDisplay::drvQueryInterface(PPDMIBASE pInterface, const char *pszIID)
     1163DECLCALLBACK(void *)  Display::drvQueryInterface(PPDMIBASE pInterface, const char *pszIID)
    11521164{
    11531165    PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
     
    11671179 * @copydoc FNPDMDRVCONSTRUCT
    11681180 */
    1169 DECLCALLBACK(int) VMDisplay::drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)
     1181DECLCALLBACK(int) Display::drvConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)
    11701182{
    11711183    PDRVMAINDISPLAY pData = PDMINS_2_DATA(pDrvIns, PDRVMAINDISPLAY);
    1172     LogFlow(("VMDisplay::drvConstruct: iInstance=%d\n", pDrvIns->iInstance));
     1184    LogFlow(("Display::drvConstruct: iInstance=%d\n", pDrvIns->iInstance));
    11731185    PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
    11741186
     
    11851197     * Init Interfaces.
    11861198     */
    1187     pDrvIns->IBase.pfnQueryInterface    = VMDisplay::drvQueryInterface;
    1188 
    1189     pData->Connector.pfnResize          = VMDisplay::displayResizeCallback;
    1190     pData->Connector.pfnUpdateRect      = VMDisplay::displayUpdateCallback;
    1191     pData->Connector.pfnRefresh         = VMDisplay::displayRefreshCallback;
    1192     pData->Connector.pfnReset           = VMDisplay::displayResetCallback;
    1193     pData->Connector.pfnLFBModeChange   = VMDisplay::displayLFBModeChangeCallback;
    1194     pData->Connector.pfnProcessAdapterData = VMDisplay::displayProcessAdapterDataCallback;
    1195     pData->Connector.pfnProcessDisplayData = VMDisplay::displayProcessDisplayDataCallback;
     1199    pDrvIns->IBase.pfnQueryInterface    = Display::drvQueryInterface;
     1200
     1201    pData->Connector.pfnResize          = Display::displayResizeCallback;
     1202    pData->Connector.pfnUpdateRect      = Display::displayUpdateCallback;
     1203    pData->Connector.pfnRefresh         = Display::displayRefreshCallback;
     1204    pData->Connector.pfnReset           = Display::displayResetCallback;
     1205    pData->Connector.pfnLFBModeChange   = Display::displayLFBModeChangeCallback;
     1206    pData->Connector.pfnProcessAdapterData = Display::displayProcessAdapterDataCallback;
     1207    pData->Connector.pfnProcessDisplayData = Display::displayProcessDisplayDataCallback;
    11961208
    11971209    /*
     
    12061218
    12071219    /*
    1208      * Get the VMDisplay object pointer and update the mpDrv member.
     1220     * Get the Display object pointer and update the mpDrv member.
    12091221     */
    12101222    void *pv;
     
    12151227        return rc;
    12161228    }
    1217     pData->pDisplay = (VMDisplay *)pv;        /** @todo Check this cast! */
     1229    pData->pDisplay = (Display *)pv;        /** @todo Check this cast! */
    12181230    pData->pDisplay->mpDrv = pData;
    12191231
     
    12341246
    12351247/**
    1236  * VMDisplay driver registration record.
    1237  */
    1238 const PDMDRVREG VMDisplay::DrvReg =
     1248 * Display driver registration record.
     1249 */
     1250const PDMDRVREG Display::DrvReg =
    12391251{
    12401252    /* u32Version */
     
    12571269    sizeof(DRVMAINDISPLAY),
    12581270    /* pfnConstruct */
    1259     VMDisplay::drvConstruct,
     1271    Display::drvConstruct,
    12601272    /* pfnDestruct */
    12611273    NULL,
  • trunk/src/VBox/Frontends/VBoxBFE/DisplayImpl.h

    r26173 r26980  
    22/** @file
    33 * VBox frontends: Basic Frontend (BFE):
    4  * Declaration of VMDisplay class
     4 * Declaration of Display class
    55 */
    66
     
    3030struct VBVACMDHDR;
    3131
    32 class VMDisplay
     32class Display
    3333{
    3434
    3535public:
    3636
    37     VMDisplay();
    38     ~VMDisplay();
     37    Display();
     38    ~Display();
    3939
    4040    // public methods only for internal purposes
     
    5858    STDMETHODIMP InvalidateAndUpdate();
    5959    STDMETHODIMP ResizeCompleted();
     60    STDMETHODIMP COMGETTER(Width)(ULONG *pWidth);
     61    STDMETHODIMP COMGETTER(Height)(ULONG *pHeight);
    6062
    6163    void resetFramebuffer();
     
    111113};
    112114
    113 extern VMDisplay *gDisplay;
     115extern Display *gDisplay;
    114116
    115117#endif // !____H_DISPLAYIMPL
  • trunk/src/VBox/Frontends/VBoxBFE/MouseImpl.cpp

    r26935 r26980  
    2222#include "MouseImpl.h"
    2323#include "DisplayImpl.h"
    24 #ifdef VBOXBFE_WITHOUT_COM
    25 # include "VMMDevInterface.h"
    26 # include <iprt/uuid.h>
    27 class AutoInitSpan
    28 {
    29 public:
    30     AutoInitSpan(VirtualBoxBase *) {}
    31     bool isOk() { return true; }
    32     void setSucceeded() {}
    33 };
    34 
    35 class AutoUninitSpan
    36 {
    37 public:
    38     AutoUninitSpan(VirtualBoxBase *) {}
    39     bool uninitDone() { return false; }
    40 };
    41 
    42 class AutoCaller
    43 {
    44 public:
    45     AutoCaller(VirtualBoxBase *) {}
    46     int rc() { return S_OK; }
    47 };
    48 
    49 class AutoWriteLock
    50 {
    51 public:
    52     AutoWriteLock(VirtualBoxBase *) {}
    53 };
    54 #define COMMA_LOCKVAL_SRC_POS
    55 enum
    56 {
    57     MouseButtonState_LeftButton = 1,
    58     MouseButtonState_RightButton = 2,
    59     MouseButtonState_MiddleButton = 4,
    60     MouseButtonState_XButton1 = 8,
    61     MouseButtonState_XButton2 = 16,
    62 };
    63 #else
    64 # include "VMMDev.h"
    65 
    66 # include "AutoCaller.h"
    67 #endif
     24#include "VMMDev.h"
     25
     26#include "AutoCaller.h"
    6827#include "Logging.h"
    6928
     
    12988    AssertReturn(autoInitSpan.isOk(), E_FAIL);
    13089
    131 #ifdef VBOXBFE_WITHOUT_COM
    132     mParent = parent;
    133 #else
    13490    unconst(mParent) = parent;
    135 #endif
    13691
    13792#ifdef RT_OS_L4
     
    14196    uHostCaps = 0;
    14297#endif
    143     uDevCaps = 0;
    14498
    14599    /* Confirm a successful initialization */
     
    177131/////////////////////////////////////////////////////////////////////////////
    178132
    179 #ifdef VBOXBFE_WITHOUT_COM
    180 int Mouse::getVMMDevMouseCaps(uint32_t *pfCaps)
    181 {
    182     gVMMDev->QueryMouseCapabilities(pfCaps);
    183     return S_OK;
    184 }
    185 
    186 int Mouse::setVMMDevMouseCaps(uint32_t fCaps)
    187 {
    188     gVMMDev->SetMouseCapabilities(fCaps);
    189     return S_OK;
    190 }
    191 #else
    192133int Mouse::getVMMDevMouseCaps(uint32_t *pfCaps)
    193134{
     
    212153    return RT_SUCCESS(rc) ? S_OK : E_FAIL;
    213154}
    214 #endif /* !VBOXBFE_WITHOUT_COM */
    215155
    216156/**
     
    364304int Mouse::reportAbsEventToVMMDev(uint32_t mouseXAbs, uint32_t mouseYAbs)
    365305{
    366 #ifdef VBOXBFE_WITHOUT_COM
    367     VMMDev *pVMMDev = gVMMDev;
    368 #else
    369306    VMMDev *pVMMDev = mParent->getVMMDev();
    370 #endif
    371307    ComAssertRet(pVMMDev, E_FAIL);
    372308    PPDMIVMMDEVPORT pVMMDevPort = pVMMDev->getVMMDevPort();
     
    439375{
    440376    AssertPtrReturn(pcX, E_POINTER);
    441 #ifndef VBOXBFE_WITHOUT_COM
    442377    Display *pDisplay = mParent->getDisplay();
    443378    ComAssertRet(pDisplay, E_FAIL);
    444 #endif
    445379
    446380    ULONG displayWidth;
    447 #ifdef VBOXBFE_WITHOUT_COM
    448381    displayWidth = gDisplay->getWidth();
    449 #else
    450     int rc = pDisplay->COMGETTER(Width)(&displayWidth);
    451     ComAssertComRCRet(rc, rc);
    452 #endif
    453382
    454383    *pcX = displayWidth ? (x * 0xFFFF) / displayWidth: 0;
     
    464393{
    465394    AssertPtrReturn(pcY, E_POINTER);
    466 #ifndef VBOXBFE_WITHOUT_COM
    467395    Display *pDisplay = mParent->getDisplay();
    468396    ComAssertRet(pDisplay, E_FAIL);
    469 #endif
    470397
    471398    ULONG displayHeight;
    472 #ifdef VBOXBFE_WITHOUT_COM
    473     displayHeight = gDisplay->getHeight();
    474 #else
    475399    int rc = pDisplay->COMGETTER(Height)(&displayHeight);
    476400    ComAssertComRCRet(rc, rc);
    477 #endif
    478401
    479402    *pcY = displayHeight ? (y * 0xFFFF) / displayHeight: 0;
     
    508431    HRESULT rc = convertDisplayWidth(x, &mouseXAbs);
    509432    ComAssertComRCRet(rc, rc);
    510     if (mouseXAbs > 0xffff)
    511         mouseXAbs = mLastAbsX;
     433    /* if (mouseXAbs > 0xffff)
     434        mouseXAbs = mLastAbsX; */
    512435
    513436    uint32_t mouseYAbs;
    514437    rc = convertDisplayHeight(y, &mouseYAbs);
    515438    ComAssertComRCRet(rc, rc);
    516     if (mouseYAbs > 0xffff)
    517         mouseYAbs = mLastAbsY;
     439    /* if (mouseYAbs > 0xffff)
     440        mouseYAbs = mLastAbsY; */
    518441
    519442    uint32_t fButtons = mouseButtonsToPDM(buttonState);
     
    576499    bool fAbsSupported =   uDevCaps & MOUSE_DEVCAP_ABSOLUTE
    577500                         ? true : fVMMDevCanAbs;
    578 #ifndef VBOXBFE_WITHOUT_COM
    579501    mParent->onMouseCapabilityChange(fAbsSupported, uDevCaps & MOUSE_DEVCAP_RELATIVE, fVMMDevNeedsHostCursor);
    580 #endif
    581502}
    582503
  • trunk/src/VBox/Frontends/VBoxBFE/MouseImpl.h

    r26935 r26980  
    6767public:
    6868
    69 #ifndef VBOXBFE_WITHOUT_COM
    7069    VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT (Mouse)
    7170
     
    7978        COM_INTERFACE_ENTRY2 (IDispatch, IMouse)
    8079    END_COM_MAP()
    81 #endif
    8280
    8381    DECLARE_EMPTY_CTOR_DTOR (Mouse)
     
    106104    static const PDMDRVREG  DrvReg;
    107105
    108 #ifndef VBOXBFE_WITHOUT_COM
    109106    Console *getParent() const
    110107    {
    111108        return mParent;
    112109    }
    113 #endif
    114110
    115111    // for VMMDevInterface
     
    164160#ifdef VBOXBFE_WITHOUT_COM
    165161extern Mouse *gMouse;
     162
     163enum
     164{
     165    MouseButtonState_LeftButton = 1,
     166    MouseButtonState_RightButton = 2,
     167    MouseButtonState_MiddleButton = 4,
     168    MouseButtonState_XButton1 = 8,
     169    MouseButtonState_XButton2 = 16,
     170};
    166171#endif
    167172
  • trunk/src/VBox/Frontends/VBoxBFE/SDLConsole.cpp

    r26853 r26980  
    6767#include "MouseImpl.h"
    6868#include "KeyboardImpl.h"
    69 #include "VMMDevInterface.h"
     69#include "VMMDev.h"
    7070#include "Framebuffer.h"
    7171#include "MachineDebuggerImpl.h"
     
    927927}
    928928
     929VMMDev *SDLConsole::getVMMDev()
     930{
     931    return gVMMDev;
     932}
     933
     934Display *SDLConsole::getDisplay()
     935{
     936    return gDisplay;
     937}
     938
    929939/**
    930940 * Keyboard event handler.
     
    12181228    if (state & SDL_BUTTON(SDL_BUTTON_MIDDLE))
    12191229        buttons |= PDMIMOUSEPORT_BUTTON_MIDDLE;
     1230#ifdef SDL_BUTTON_X1
     1231    if (state & SDL_BUTTON(SDL_BUTTON_X1))
     1232        buttons |= PDMIMOUSEPORT_BUTTON_X1;
     1233#endif
     1234#ifdef SDL_BUTTON_X2
     1235    if (state & SDL_BUTTON(SDL_BUTTON_X2))
     1236        buttons |= PDMIMOUSEPORT_BUTTON_X2;
     1237#endif
    12201238
    12211239    // now send the mouse event
  • trunk/src/VBox/Frontends/VBoxBFE/SDLConsole.h

    r26502 r26980  
    2727#include <SDL.h>
    2828#ifndef RT_OS_DARWIN
     29# define Display Display_  /* Xlib defines "Display" and so do we... */
    2930# include <SDL_syswm.h>
     31# undef Display
    3032#endif
    3133#if defined(RT_OS_WINDOWS) /// @todo someone please explain why this is necessary. This breaks darwin solid.
     
    115117    virtual void     resetCursor();
    116118    virtual void     resetKeys(void);
     119    virtual VMMDev  *getVMMDev();
     120    virtual Display *getDisplay();
    117121
    118122private:
  • trunk/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp

    r26835 r26980  
    7979#include "MouseImpl.h"
    8080#include "KeyboardImpl.h"
    81 #include "VMMDevInterface.h"
     81#include "VMMDev.h"
    8282#include "StatusImpl.h"
    8383#include "Framebuffer.h"
     
    127127PVM                gpVM             = NULL;
    128128Mouse             *gMouse           = NULL;
    129 VMDisplay         *gDisplay         = NULL;
     129Display         *gDisplay         = NULL;
    130130Keyboard          *gKeyboard        = NULL;
    131131VMMDev            *gVMMDev          = NULL;
     
    793793        goto leave;
    794794    gVMMDev = new VMMDev();
    795     gDisplay = new VMDisplay();
     795    gDisplay = new Display();
    796796#if defined(USE_SDL)
    797797    /* First console, then framebuffer!! */
     
    13341334        return rc;
    13351335
    1336     rc = pCallbacks->pfnRegister(pCallbacks, &VMDisplay::DrvReg);
     1336    rc = pCallbacks->pfnRegister(pCallbacks, &Display::DrvReg);
    13371337    AssertRC(rc);
    13381338    if (RT_FAILURE(rc))
  • trunk/src/VBox/Frontends/VBoxBFE/VMMDevInterface.cpp

    r26834 r26980  
    3838
    3939#include "VBoxBFE.h"
    40 #include "VMMDevInterface.h"
     40#include "VMMDev.h"
    4141#include "MouseImpl.h"
    4242#include "DisplayImpl.h"
  • trunk/src/VBox/Frontends/VBoxBFE/VirtualBoxBase.h

    r26853 r26980  
    2626#ifdef VBOXBFE_WITHOUT_COM
    2727# include "COMDefs.h"  // Our wrapper for COM definitions left in the code
     28# include <iprt/uuid.h>
    2829#else
    2930# include <VBox/com/defs.h>
     
    280281    cls::cls () {}; cls::~cls () {};
    281282
     283#define VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(cls)
     284
    282285////////////////////////////////////////////////////////////////////////////////
    283286
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