VirtualBox

Changeset 35177 in vbox


Ignore:
Timestamp:
Dec 16, 2010 12:41:35 PM (14 years ago)
Author:
vboxsync
Message:

Main: OnGuestMonitorChanged event.

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/DisplayImpl.cpp

    r35157 r35177  
    429429
    430430        maFramebuffers[ul].pFramebuffer = NULL;
     431        maFramebuffers[ul].fDisabled = false;
    431432
    432433        maFramebuffers[ul].xOrigin = 0;
     
    38523853    if (pScreen->u16Flags & VBVA_SCREEN_F_DISABLED)
    38533854    {
    3854         fireGuestMonitorDisabledEvent(pThis->mParent->getEventSource(), pScreen->u32ViewIndex);
     3855        pFBInfo->fDisabled = true;
     3856
     3857        /* Temporary: ask framebuffer to resize using a default format. The framebuffer will be black. */
     3858        pThis->handleDisplayResize(pScreen->u32ViewIndex, 0,
     3859                                   (uint8_t *)NULL,
     3860                                   0, pFBInfo->w, pFBInfo->h, pScreen->u16Flags);
     3861
     3862        fireGuestMonitorChangedEvent(pThis->mParent->getEventSource(),
     3863                                     GuestMonitorChangedEventType_Disabled,
     3864                                     pScreen->u32ViewIndex,
     3865                                     0, 0, 0, 0);
    38553866        return VINF_SUCCESS;
     3867    }
     3868
     3869    if (pFBInfo->fDisabled)
     3870    {
     3871        pFBInfo->fDisabled = false;
     3872        fireGuestMonitorChangedEvent(pThis->mParent->getEventSource(),
     3873                                     GuestMonitorChangedEventType_Enabled,
     3874                                     pScreen->u32ViewIndex,
     3875                                     pScreen->i32OriginX, pScreen->i32OriginY,
     3876                                     pScreen->u32Width, pScreen->u32Height);
     3877        if (pFBInfo->pFramebuffer.isNull())
     3878        {
     3879            /* @todo If no framebuffer, remember the resize parameters to issue a requestResize later. */
     3880            return VINF_SUCCESS;
     3881        }
     3882        /* If the framebuffer already set for the screen, do a regular resize. */
    38563883    }
    38573884
     
    38863913    if (fNewOrigin)
    38873914    {
    3888         /* @todo May be framebuffer/display should be notified in this case. */
     3915        fireGuestMonitorChangedEvent(pThis->mParent->getEventSource(),
     3916                                     GuestMonitorChangedEventType_NewOrigin,
     3917                                     pScreen->u32ViewIndex,
     3918                                     pScreen->i32OriginX, pScreen->i32OriginY,
     3919                                     0, 0);
    38893920    }
    38903921
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r35172 r35177  
    1476514765  <enum
    1476614766    name="VBoxEventType"
    14767     uuid="ad800907-657f-4cd5-b14e-b609fd280a49"
     14767    uuid="e71c487f-755e-46e9-a476-dd6a5d134597"
    1476814768    >
    1476914769
     
    1501315013      </desc>
    1501415014    </const>
    15015     <const name="OnGuestMonitorDisabled" value="70">
    15016       <desc>
    15017         See <link to="IGuestMonitorDisabledEvent">IGuestMonitorDisabledEvent</link>.
     15015    <const name="OnGuestMonitorChanged" value="70">
     15016      <desc>
     15017        See <link to="IGuestMonitorChangedEvent">IGuestMonitorChangedEvent</link>.
    1501815018      </desc>
    1501915019    </const>
     
    1633516335  </interface>
    1633616336
     16337  <enum
     16338    name="GuestMonitorChangedEventType"
     16339    uuid="ef172985-7e36-4297-95be-e46396968d66"
     16340    >
     16341
     16342    <desc>
     16343      How the guest monitor has been changed.
     16344    </desc>
     16345
     16346    <const name="Enabled" value="0">
     16347      <desc>
     16348        The guest monitor has been enabled by the guest.
     16349      </desc>
     16350    </const>
     16351
     16352    <const name="Disabled" value="1">
     16353      <desc>
     16354        The guest monitor has been disabled by the guest.
     16355      </desc>
     16356    </const>
     16357
     16358    <const name="NewOrigin" value="2">
     16359      <desc>
     16360        The guest monitor origin has changed in the guest.
     16361      </desc>
     16362    </const>
     16363  </enum>
     16364
    1633716365  <interface
    16338     name="IGuestMonitorDisabledEvent" extends="IEvent"
    16339     uuid="87760f7d-05fc-40d8-be04-5bf2763a51d5"
    16340     wsmap="managed" autogen="VBoxEvent" id="OnGuestMonitorDisabled"
     16366    name="IGuestMonitorChangedEvent" extends="IEvent"
     16367    uuid="0f7b8a22-c71f-4a36-8e5f-a77d01d76090"
     16368    wsmap="managed" autogen="VBoxEvent" id="OnGuestMonitorChanged"
    1634116369    >
    1634216370    <desc>
    16343       Notification when the guest disables one of its monitors.
     16371      Notification when the guest enables one of its monitors.
    1634416372    </desc>
    1634516373
     16374    <attribute name="changeType" type="GuestMonitorChangedEventType" readonly="yes">
     16375      <desc>
     16376        What was changed for this guest monitor.
     16377      </desc>
     16378    </attribute>
     16379
    1634616380    <attribute name="screenId" type="unsigned long" readonly="yes">
    1634716381      <desc>
    16348         The monitor which was disabled.
    16349       </desc>
    16350     </attribute>
     16382        The monitor which was changed.
     16383      </desc>
     16384    </attribute>
     16385
     16386    <attribute name="originX" type="unsigned long" readonly="yes">
     16387      <desc>
     16388        Physical X origin relative to the primary screen.
     16389        Valid for Enabled and NewOrigin.
     16390      </desc>
     16391    </attribute>
     16392
     16393    <attribute name="originY" type="unsigned long" readonly="yes">
     16394      <desc>
     16395        Physical Y origin relative to the primary screen.
     16396        Valid for Enabled and NewOrigin.
     16397      </desc>
     16398    </attribute>
     16399
     16400    <attribute name="width" type="unsigned long" readonly="yes">
     16401      <desc>
     16402        Width of the screen.
     16403        Valid for Enabled.
     16404      </desc>
     16405    </attribute>
     16406
     16407    <attribute name="height" type="unsigned long" readonly="yes">
     16408      <desc>
     16409        Height of the screen.
     16410        Valid for Enabled.
     16411      </desc>
     16412    </attribute>
     16413
    1635116414  </interface>
    1635216415
  • trunk/src/VBox/Main/include/DisplayImpl.h

    r35148 r35177  
    4242
    4343    ComPtr<IFramebuffer> pFramebuffer;
     44    bool fDisabled;
    4445
    4546    LONG xOrigin;
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