Changeset 47464 in vbox
- Timestamp:
- Jul 29, 2013 2:54:33 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 87625
- Location:
- trunk/src/VBox/Main
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/include/ConsoleVRDPServer.h
r47158 r47464 30 30 #define VRDE_VIDEOIN_WITH_VRDEINTERFACE /* Get the VRDE interface definitions. */ 31 31 #include <VBox/RemoteDesktop/VRDEVideoIn.h> 32 #include <VBox/RemoteDesktop/VRDEInput.h> 32 33 33 34 #include <VBox/HostServices/VBoxClipboardExt.h> … … 342 343 const VRDEVIDEOINPAYLOADHDR *pFrame, 343 344 uint32_t cbFrame); 345 346 /* Input interface. */ 347 VRDEINPUTINTERFACE m_interfaceInput; 348 VRDEINPUTCALLBACKS m_interfaceCallbacksInput; 349 static DECLCALLBACK(void) VRDECallbackInputSetup(void *pvCallback, 350 int rcRequest, 351 uint32_t u32Method, 352 const void *pvResult, 353 uint32_t cbResult); 354 static DECLCALLBACK(void) VRDECallbackInputEvent(void *pvCallback, 355 uint32_t u32Method, 356 const void *pvEvent, 357 uint32_t cbEvent); 344 358 }; 345 359 -
trunk/src/VBox/Main/src-client/ConsoleVRDPServer.cpp
r47251 r47464 1404 1404 RT_ZERO(m_interfaceVideoIn); 1405 1405 RT_ZERO(m_interfaceCallbacksVideoIn); 1406 RT_ZERO(m_interfaceInput); 1407 RT_ZERO(m_interfaceCallbacksInput); 1406 1408 1407 1409 rc = RTCritSectInit(&mTSMFLock); … … 1712 1714 } 1713 1715 1716 /* Input interface. */ 1717 m_interfaceInput.header.u64Version = 1; 1718 m_interfaceInput.header.u64Size = sizeof(m_interfaceInput); 1719 1720 m_interfaceCallbacksInput.header.u64Version = 1; 1721 m_interfaceCallbacksInput.header.u64Size = sizeof(m_interfaceCallbacksInput); 1722 m_interfaceCallbacksInput.VRDECallbackInputSetup = VRDECallbackInputSetup; 1723 m_interfaceCallbacksInput.VRDECallbackInputEvent = VRDECallbackInputEvent; 1724 1725 vrc = mpEntryPoints->VRDEGetInterface(mhServer, 1726 VRDE_INPUT_INTERFACE_NAME, 1727 &m_interfaceInput.header, 1728 &m_interfaceCallbacksInput.header, 1729 this); 1730 if (RT_SUCCESS(vrc)) 1731 { 1732 LogRel(("VRDE: [%s]\n", VRDE_INPUT_INTERFACE_NAME)); 1733 } 1734 else 1735 { 1736 RT_ZERO(m_interfaceInput); 1737 } 1738 1714 1739 /* Since these interfaces are optional, it is always a success here. */ 1715 1740 vrc = VINF_SUCCESS; … … 2760 2785 return rc; 2761 2786 } 2787 2788 2789 /* static */ DECLCALLBACK(void) ConsoleVRDPServer::VRDECallbackInputSetup(void *pvCallback, 2790 int rcRequest, 2791 uint32_t u32Method, 2792 const void *pvResult, 2793 uint32_t cbResult) 2794 { 2795 NOREF(pvCallback); 2796 NOREF(rcRequest); 2797 NOREF(u32Method); 2798 NOREF(pvResult); 2799 NOREF(cbResult); 2800 } 2801 2802 /* static */ DECLCALLBACK(void) ConsoleVRDPServer::VRDECallbackInputEvent(void *pvCallback, 2803 uint32_t u32Method, 2804 const void *pvEvent, 2805 uint32_t cbEvent) 2806 { 2807 ConsoleVRDPServer *pThis = static_cast<ConsoleVRDPServer*>(pvCallback); 2808 2809 if (u32Method == VRDE_INPUT_METHOD_TOUCH) 2810 { 2811 if (cbEvent >= sizeof(VRDEINPUTHEADER)) 2812 { 2813 VRDEINPUTHEADER *pHeader = (VRDEINPUTHEADER *)pvEvent; 2814 2815 if (pHeader->u16EventId == VRDEINPUT_EVENTID_TOUCH) 2816 { 2817 VRDEINPUT_TOUCH_EVENT_PDU *p = (VRDEINPUT_TOUCH_EVENT_PDU *)pHeader; 2818 2819 uint16_t iFrame; 2820 for (iFrame = 0; iFrame < p->u16FrameCount; iFrame++) 2821 { 2822 VRDEINPUT_TOUCH_FRAME *pFrame = &p->aFrames[iFrame]; 2823 2824 uint16_t iContact; 2825 for (iContact = 0; iContact < pFrame->u16ContactCount; iContact++) 2826 { 2827 VRDEINPUT_CONTACT_DATA *pContact = &pFrame->aContacts[iContact]; 2828 2829 LONG x = pContact->i32X; 2830 LONG y = pContact->i32Y; 2831 LONG cContact = pContact->u8ContactId; 2832 LONG contactState = TouchContactState_None; 2833 2834 /* @todo */ 2835 if (pContact->u32ContactFlags & VRDEINPUT_CONTACT_FLAG_INRANGE) 2836 { 2837 contactState |= TouchContactState_InRange; 2838 } 2839 if (pContact->u32ContactFlags & VRDEINPUT_CONTACT_FLAG_INCONTACT) 2840 { 2841 contactState |= TouchContactState_InContact; 2842 } 2843 2844 HRESULT hrc = pThis->mConsole->getMouse()->PutMouseEventMultiTouch(x, y, cContact, contactState); 2845 } 2846 } 2847 } 2848 else if (pHeader->u16EventId == VRDEINPUT_EVENTID_DISMISS_HOVERING_CONTACT) 2849 { 2850 /* @todo */ 2851 } 2852 else 2853 { 2854 AssertMsgFailed(("EventId %d\n", pHeader->u16EventId)); 2855 } 2856 } 2857 } 2858 } 2859 2762 2860 2763 2861 void ConsoleVRDPServer::EnableConnections(void)
Note:
See TracChangeset
for help on using the changeset viewer.