Changeset 51476 in vbox for trunk/src/VBox/Main/include
- Timestamp:
- May 30, 2014 2:58:02 PM (11 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 added
- 6 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox
- Property svn:mergeinfo changed
/branches/VBox-4.3/src/VBox merged: 93628-93629
- Property svn:mergeinfo changed
-
trunk/src/VBox/Main/include/ConsoleImpl.h
r51342 r51476 220 220 HRESULT onCPUExecutionCapChange(ULONG aExecutionCap); 221 221 HRESULT onClipboardModeChange(ClipboardMode_T aClipboardMode); 222 HRESULT onD ragAndDropModeChange(DragAndDropMode_T aDragAndDropMode);222 HRESULT onDnDModeChange(DnDMode_T aDnDMode); 223 223 HRESULT onVRDEServerChange(BOOL aRestart); 224 224 HRESULT onVideoCaptureChange(); … … 699 699 700 700 void changeClipboardMode(ClipboardMode_T aClipboardMode); 701 void changeDragAndDropMode(DragAndDropMode_T aDragAndDropMode);701 int changeDnDMode(DnDMode_T aDnDMode); 702 702 703 703 #ifdef VBOX_WITH_USB -
trunk/src/VBox/Main/include/DisplayImpl.h
r51460 r51476 5 5 6 6 /* 7 * Copyright (C) 2006-201 3Oracle Corporation7 * Copyright (C) 2006-2014 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 66 66 uint16_t flags; 67 67 68 /* for saving the rectangles arrived during fb resize is in progress. */68 /** For saving the rectangles arrived during fb resize is in progress. */ 69 69 PRTRECT mpSavedVisibleRegion; 70 70 uint32_t mcSavedVisibleRegion; … … 74 74 volatile uint32_t u32ResizeStatus; 75 75 76 /* The Framebuffer has default format and must be updates immediately. */76 /** The framebuffer has default format and must be updates immediately. */ 77 77 bool fDefaultFormat; 78 78 -
trunk/src/VBox/Main/include/GuestDnDPrivate.h
r51474 r51476 1 /* $Id$ */ 1 2 /** @file 2 * Definition of GuestDnD 3 * Private guest drag and drop code, used by GuestDnDTarget + 4 * GuestDnDSource. 3 5 */ 4 6 … … 15 17 */ 16 18 17 #ifndef ____H_GUESTDND 18 #define ____H_GUESTDND 19 #ifndef ____H_GUESTDNDPRIVATE 20 #define ____H_GUESTDNDPRIVATE 19 21 20 /* Forward declaration of the d-pointer. */ 21 class GuestDnDPrivate; 22 #ifdef VBOX_WITH_DRAG_AND_DROP_GH 23 class DnDGuestResponse; 24 #endif 22 #include "VBox/hgcmsvc.h" /* For PVBOXHGCMSVCPARM. */ 25 23 24 /* Forward prototype declarations. */ 25 class Guest; 26 class Progress; 27 28 /** 29 * Class for handling drag'n drop responses from 30 * the guest side. 31 */ 32 class GuestDnDResponse 33 { 34 35 public: 36 37 GuestDnDResponse(const ComObjPtr<Guest>& pGuest); 38 39 virtual ~GuestDnDResponse(void); 40 41 public: 42 43 int notifyAboutGuestResponse(void); 44 int waitForGuestResponse(RTMSINTERVAL msTimeout = 500); 45 46 void setDefAction(uint32_t a) { m_defAction = a; } 47 uint32_t defAction(void) const { return m_defAction; } 48 49 void setAllActions(uint32_t a) { m_allActions = a; } 50 uint32_t allActions() const { return m_allActions; } 51 52 void setFormat(const Utf8Str &strFormat) { m_strFormat = strFormat; } 53 Utf8Str format(void) const { return m_strFormat; } 54 55 void setDropDir(const Utf8Str &strDropDir) { m_strDropDir = strDropDir; } 56 Utf8Str dropDir(void) const { return m_strDropDir; } 57 58 int dataAdd(const void *pvData, uint32_t cbData, uint32_t *pcbCurSize); 59 int dataSetStatus(size_t cbDataAdd, size_t cbDataTotal = 0); 60 void reset(void); 61 const void *data(void) { return m_pvData; } 62 size_t size(void) const { return m_cbData; } 63 64 int setProgress(unsigned uPercentage, uint32_t uState, int rcOp = VINF_SUCCESS); 65 HRESULT resetProgress(const ComObjPtr<Guest>& pParent); 66 HRESULT queryProgressTo(IProgress **ppProgress); 67 68 int writeToFile(const char *pszPath, size_t cbPath, void *pvData, size_t cbData, uint32_t fMode); 69 70 public: 71 72 Utf8Str errorToString(const ComObjPtr<Guest>& pGuest, int guestRc); 73 74 private: 75 RTSEMEVENT m_EventSem; 76 uint32_t m_defAction; 77 uint32_t m_allActions; 78 Utf8Str m_strFormat; 79 80 /** The actual MIME data.*/ 81 void *m_pvData; 82 /** Size (in bytes) of MIME data. */ 83 uint32_t m_cbData; 84 85 size_t m_cbDataCurrent; 86 size_t m_cbDataTotal; 87 /** Dropped files directory on the host. */ 88 Utf8Str m_strDropDir; 89 /** The handle of the currently opened file being written to 90 * or read from. */ 91 RTFILE m_hFile; 92 Utf8Str m_strFile; 93 94 ComObjPtr<Guest> m_parent; 95 ComObjPtr<Progress> m_progress; 96 }; 97 98 /** 99 * Private singleton class for the guest's DnD 100 * implementation. Can't be instanciated directly, only via 101 * the factory pattern. 102 */ 26 103 class GuestDnD 27 104 { 28 105 public: 106 107 static GuestDnD *createInstance(const ComObjPtr<Guest>& pGuest) 108 { 109 Assert(NULL == GuestDnD::s_pInstance); 110 GuestDnD::s_pInstance = new GuestDnD(pGuest); 111 return GuestDnD::s_pInstance; 112 } 113 114 static void destroyInstance(void) 115 { 116 if (GuestDnD::s_pInstance) 117 { 118 delete GuestDnD::s_pInstance; 119 GuestDnD::s_pInstance = NULL; 120 } 121 } 122 123 static inline GuestDnD *getInstance(void) 124 { 125 AssertPtr(GuestDnD::s_pInstance); 126 return GuestDnD::s_pInstance; 127 } 128 129 protected: 130 29 131 GuestDnD(const ComObjPtr<Guest>& pGuest); 30 ~GuestDnD();132 virtual ~GuestDnD(void); 31 133 32 /* Host -> Guest */ 33 HRESULT dragHGEnter(ULONG uScreenId, ULONG uX, ULONG uY, DragAndDropAction_T defaultAction, ComSafeArrayIn(DragAndDropAction_T, allowedActions), ComSafeArrayIn(IN_BSTR, formats), DragAndDropAction_T *pResultAction); 34 HRESULT dragHGMove(ULONG uScreenId, ULONG uX, ULONG uY, DragAndDropAction_T defaultAction, ComSafeArrayIn(DragAndDropAction_T, allowedActions), ComSafeArrayIn(IN_BSTR, formats), DragAndDropAction_T *pResultAction); 35 HRESULT dragHGLeave(ULONG uScreenId); 36 HRESULT dragHGDrop(ULONG uScreenId, ULONG uX, ULONG uY, DragAndDropAction_T defaultAction, ComSafeArrayIn(DragAndDropAction_T, allowedActions), ComSafeArrayIn(IN_BSTR, formats), BSTR *pstrFormat, DragAndDropAction_T *pResultAction); 37 HRESULT dragHGPutData(ULONG uScreenId, IN_BSTR wstrFormat, ComSafeArrayIn(BYTE, data), IProgress **ppProgress); 134 public: 38 135 39 /* Guest -> Host */ 40 HRESULT dragGHPending(ULONG uScreenId, ComSafeArrayOut(BSTR, formats), ComSafeArrayOut(DragAndDropAction_T, allowedActions), DragAndDropAction_T *pDefaultAction); 41 HRESULT dragGHDropped(IN_BSTR bstrFormat, DragAndDropAction_T action, IProgress **ppProgress); 42 HRESULT dragGHGetData(ComSafeArrayOut(BYTE, data)); 136 /** @name Public helper functions. 137 * @{ */ 138 int adjustScreenCoordinates(ULONG uScreenId, ULONG *puX, ULONG *puY) const; 139 int hostCall(uint32_t u32Function, uint32_t cParms, PVBOXHGCMSVCPARM paParms) const; 140 GuestDnDResponse *response(void) { return m_pResponse; } 141 std::vector<com::Utf8Str> supportedFormats(void) const { return m_strSupportedFormats; } 142 /** @} */ 43 143 44 /* Guest response */ 45 static DECLCALLBACK(int) notifyGuestDragAndDropEvent(void *pvExtension, uint32_t u32Function, void *pvParms, uint32_t cbParms); 144 public: 145 146 /** @name Static low-level HGCM callback handler. 147 * @{ */ 148 static DECLCALLBACK(int) notifyDnDDispatcher(void *pvExtension, uint32_t u32Function, void *pvParms, uint32_t cbParms); 149 /** @} */ 150 151 /** @name Static helper methods. 152 * @{ */ 153 static com::Utf8Str toFormatString(const std::vector<com::Utf8Str> &lstSupportedFormats, const std::vector<com::Utf8Str> &lstFormats); 154 static void toFormatVector(const std::vector<com::Utf8Str> &lstSupportedFormats, const com::Utf8Str &strFormats, std::vector<com::Utf8Str> &vecformats); 155 static DnDAction_T toMainAction(uint32_t uAction); 156 static void toMainActions(uint32_t uActions, std::vector<DnDAction_T> &vecActions); 157 static uint32_t toHGCMAction(DnDAction_T enmAction); 158 static void toHGCMActions(DnDAction_T enmDefAction, uint32_t *puDefAction, const std::vector<DnDAction_T> vecAllowedActions, uint32_t *puAllowedActions); 159 /** @} */ 160 161 protected: 162 163 /** @name Singleton properties. 164 * @{ */ 165 /** List of supported MIME types (formats). */ 166 std::vector<com::Utf8Str> m_strSupportedFormats; 167 /** Pointer to guest implementation. */ 168 const ComObjPtr<Guest> m_pGuest; 169 /** The current (last) response from the guest. At the 170 * moment we only support only response a time (ARQ-style). */ 171 GuestDnDResponse *m_pResponse; 172 /** @} */ 46 173 47 174 protected: 48 175 49 176 #ifdef VBOX_WITH_DRAG_AND_DROP_GH 50 int onGHSendData(DnDGuestResponse *pResp, const void *pvData, size_t cbData, size_t cbTotalSize); 51 int onGHSendDir(DnDGuestResponse *pResp, const char *pszPath, size_t cbPath, uint32_t fMode); 52 int onGHSendFile(DnDGuestResponse *pResp, const char *pszPath, size_t cbPath, void *pvData, size_t cbData, uint32_t fMode); 177 /** @name Dispatch handlers for the HGCM callbacks. 178 * @{ */ 179 int onGHSendData(GuestDnDResponse *pResp, const void *pvData, size_t cbData, size_t cbTotalSize); 180 int onGHSendDir(GuestDnDResponse *pResp, const char *pszPath, size_t cbPath, uint32_t fMode); 181 int onGHSendFile(GuestDnDResponse *pResp, const char *pszPath, size_t cbPath, void *pvData, size_t cbData, uint32_t fMode); 182 /** @} */ 53 183 #endif /* VBOX_WITH_DRAG_AND_DROP_GH */ 54 184 55 185 private: 56 186 57 /* d-pointer */ 58 GuestDnDPrivate *d_ptr; 59 60 friend class GuestDnDPrivate; 187 /** Staic pointer to singleton instance. */ 188 static GuestDnD *s_pInstance; 61 189 }; 62 190 63 #endif /* ____H_GUESTDND */ 191 /** Access to the GuestDnD's singleton instance. */ 192 #define GuestDnDInst() GuestDnD::getInstance() 64 193 194 #endif /* ____H_GUESTDNDPRIVATE */ 195 -
trunk/src/VBox/Main/include/GuestImpl.h
r47310 r51476 4 4 5 5 /* 6 * Copyright (C) 2006-201 3Oracle Corporation6 * Copyright (C) 2006-2014 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 26 26 #include "AdditionsFacilityImpl.h" 27 27 #include "GuestCtrlImplPrivate.h" 28 #ifdef VBOX_WITH_DRAG_AND_DROP 29 # include "GuestDnDSourceImpl.h" 30 # include "GuestDnDTargetImpl.h" 31 #endif 28 32 #include "GuestSessionImpl.h" 29 33 #include "HGCM.h" 30 31 #ifdef VBOX_WITH_DRAG_AND_DROP32 class GuestDnD;33 #endif34 34 35 35 typedef enum … … 48 48 49 49 class Console; 50 #ifdef VBOX_WITH_GUEST_CONTROL51 class Progress;52 #endif53 50 54 51 class ATL_NO_VTABLE Guest : … … 77 74 78 75 // IGuest properties. 79 STDMETHOD(COMGETTER(OSTypeId)) 80 STDMETHOD(COMGETTER(AdditionsRunLevel)) 76 STDMETHOD(COMGETTER(OSTypeId))(BSTR *aOSTypeId); 77 STDMETHOD(COMGETTER(AdditionsRunLevel))(AdditionsRunLevelType_T *aRunLevel); 81 78 STDMETHOD(COMGETTER(AdditionsVersion))(BSTR *a_pbstrAdditionsVersion); 82 79 STDMETHOD(COMGETTER(AdditionsRevision))(ULONG *a_puAdditionsRevision); 80 STDMETHOD(COMGETTER(DnDSource))(IGuestDnDSource ** aSource); 81 STDMETHOD(COMGETTER(DnDTarget))(IGuestDnDTarget ** aTarget); 83 82 STDMETHOD(COMGETTER(EventSource))(IEventSource ** aEventSource); 84 STDMETHOD(COMGETTER(Facilities)) 85 STDMETHOD(COMGETTER(Sessions)) 83 STDMETHOD(COMGETTER(Facilities))(ComSafeArrayOut(IAdditionsFacility *, aFacilities)); 84 STDMETHOD(COMGETTER(Sessions))(ComSafeArrayOut(IGuestSession *, aSessions)); 86 85 STDMETHOD(COMGETTER(MemoryBalloonSize)) (ULONG *aMemoryBalloonSize); 87 86 STDMETHOD(COMSETTER(MemoryBalloonSize)) (ULONG aMemoryBalloonSize); … … 93 92 STDMETHOD(SetCredentials)(IN_BSTR aUsername, IN_BSTR aPassword, 94 93 IN_BSTR aDomain, BOOL aAllowInteractiveLogon); 95 // Drag'n drop support.96 STDMETHOD(DragHGEnter)(ULONG uScreenId, ULONG uX, ULONG uY, DragAndDropAction_T defaultAction, ComSafeArrayIn(DragAndDropAction_T, allowedActions), ComSafeArrayIn(IN_BSTR, formats), DragAndDropAction_T *pResultAction);97 STDMETHOD(DragHGMove)(ULONG uScreenId, ULONG uX, ULONG uY, DragAndDropAction_T defaultAction, ComSafeArrayIn(DragAndDropAction_T, allowedActions), ComSafeArrayIn(IN_BSTR, formats), DragAndDropAction_T *pResultAction);98 STDMETHOD(DragHGLeave)(ULONG uScreenId);99 STDMETHOD(DragHGDrop)(ULONG uScreenId, ULONG uX, ULONG uY, DragAndDropAction_T defaultAction, ComSafeArrayIn(DragAndDropAction_T, allowedActions), ComSafeArrayIn(IN_BSTR, formats), BSTR *pstrFormat, DragAndDropAction_T *pResultAction);100 STDMETHOD(DragHGPutData)(ULONG uScreenId, IN_BSTR strFormat, ComSafeArrayIn(BYTE, data), IProgress **ppProgress);101 STDMETHOD(DragGHPending)(ULONG uScreenId, ComSafeArrayOut(BSTR, formats), ComSafeArrayOut(DragAndDropAction_T, allowedActions), DragAndDropAction_T *pDefaultAction);102 STDMETHOD(DragGHDropped)(IN_BSTR strFormat, DragAndDropAction_T action, IProgress **ppProgress);103 STDMETHOD(DragGHGetData)(ComSafeArrayOut(BYTE, data));104 94 // Guest control. 105 95 STDMETHOD(CreateSession)(IN_BSTR aUser, IN_BSTR aPassword, IN_BSTR aDomain, IN_BSTR aSessionName, IGuestSession **aGuestSession); … … 129 119 bool facilityIsActive(VBoxGuestFacilityType enmFacility); 130 120 void facilityUpdate(VBoxGuestFacilityType a_enmFacility, VBoxGuestFacilityStatus a_enmStatus, uint32_t a_fFlags, PCRTTIMESPEC a_pTimeSpecTS); 121 ComObjPtr<Console> getConsole(void) { return mParent; } 131 122 void setAdditionsStatus(VBoxGuestFacilityType a_enmFacility, VBoxGuestFacilityStatus a_enmStatus, uint32_t a_fFlags, PCRTTIMESPEC a_pTimeSpecTS); 132 123 void onUserStateChange(Bstr aUser, Bstr aDomain, VBoxGuestUserState enmState, const uint8_t *puDetails, uint32_t cbDetails); … … 142 133 int dispatchToSession(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb); 143 134 uint32_t getAdditionsVersion(void) { return mData.mAdditionsVersionFull; } 144 Console *getConsole(void) { return mParent; }145 135 int sessionRemove(GuestSession *pSession); 146 136 int sessionCreate(const GuestSessionStartupInfo &ssInfo, const GuestCredentials &guestCreds, ComObjPtr<GuestSession> &pGuestSession); … … 170 160 { } 171 161 172 Bstr mOSTypeId;173 FacilityMap mFacilityMap;174 AdditionsRunLevelType_T mAdditionsRunLevel;175 uint32_t mAdditionsVersionFull;176 Bstr mAdditionsVersionNew;177 uint32_t mAdditionsRevision;178 uint32_t mAdditionsFeatures;179 Bstr mInterfaceVersion;180 GuestSessions mGuestSessions;181 uint32_t mNextSessionID;162 Bstr mOSTypeId; 163 FacilityMap mFacilityMap; 164 AdditionsRunLevelType_T mAdditionsRunLevel; 165 uint32_t mAdditionsVersionFull; 166 Bstr mAdditionsVersionNew; 167 uint32_t mAdditionsRevision; 168 uint32_t mAdditionsFeatures; 169 Bstr mInterfaceVersion; 170 GuestSessions mGuestSessions; 171 uint32_t mNextSessionID; 182 172 } mData; 183 173 … … 192 182 BOOL mfPageFusionEnabled; 193 183 194 Console *mParent;184 const ComObjPtr<Console> mParent; 195 185 196 186 #ifdef VBOX_WITH_GUEST_CONTROL … … 206 196 207 197 #ifdef VBOX_WITH_DRAG_AND_DROP 208 GuestDnD *m_pGuestDnD; 209 friend class GuestDnD; 210 friend class GuestDnDPrivate; 211 #endif 212 213 RTTIMERLR mStatTimer; 214 uint32_t mMagic; 198 /** The guest's DnD source. */ 199 const ComObjPtr<GuestDnDSource> mDnDSource; 200 /** The guest's DnD target. */ 201 const ComObjPtr<GuestDnDTarget> mDnDTarget; 202 #endif 203 204 RTTIMERLR mStatTimer; 205 uint32_t mMagic; /** @todo r=andy Rename this to something more meaningful. */ 215 206 }; 216 #define GUEST_MAGIC 0xCEED2006u 207 #define GUEST_MAGIC 0xCEED2006u /** @todo r=andy Not very well defined!? */ 217 208 218 209 #endif // ____H_GUESTIMPL -
trunk/src/VBox/Main/include/MachineImpl.h
r50996 r51476 297 297 298 298 ClipboardMode_T mClipboardMode; 299 D ragAndDropMode_T mDragAndDropMode;299 DnDMode_T mDnDMode; 300 300 301 301 typedef std::map<Utf8Str, GuestProperty> GuestPropertyMap; … … 473 473 STDMETHOD(COMGETTER(ClipboardMode))(ClipboardMode_T *aClipboardMode); 474 474 STDMETHOD(COMSETTER(ClipboardMode))(ClipboardMode_T aClipboardMode); 475 STDMETHOD(COMGETTER(D ragAndDropMode))(DragAndDropMode_T *aDragAndDropMode);476 STDMETHOD(COMSETTER(D ragAndDropMode))(DragAndDropMode_T aDragAndDropMode);475 STDMETHOD(COMGETTER(DnDMode))(DnDMode_T *aDnDMode); 476 STDMETHOD(COMSETTER(DnDMode))(DnDMode_T aDnDMode); 477 477 STDMETHOD(COMGETTER(GuestPropertyNotificationPatterns))(BSTR *aPattern); 478 478 STDMETHOD(COMSETTER(GuestPropertyNotificationPatterns))(IN_BSTR aPattern); … … 749 749 virtual HRESULT onSharedFolderChange() { return S_OK; } 750 750 virtual HRESULT onClipboardModeChange(ClipboardMode_T /* aClipboardMode */) { return S_OK; } 751 virtual HRESULT onD ragAndDropModeChange(DragAndDropMode_T /* aDragAndDropMode */) { return S_OK; }751 virtual HRESULT onDnDModeChange(DnDMode_T /* aDnDMode */) { return S_OK; } 752 752 virtual HRESULT onBandwidthGroupChange(IBandwidthGroup * /* aBandwidthGroup */) { return S_OK; } 753 753 virtual HRESULT onStorageDeviceChange(IMediumAttachment * /* mediumAttachment */, BOOL /* remove */, BOOL /* silent */) { return S_OK; } … … 1139 1139 HRESULT onSharedFolderChange(); 1140 1140 HRESULT onClipboardModeChange(ClipboardMode_T aClipboardMode); 1141 HRESULT onD ragAndDropModeChange(DragAndDropMode_T aDragAndDropMode);1141 HRESULT onDnDModeChange(DnDMode_T aDnDMode); 1142 1142 HRESULT onBandwidthGroupChange(IBandwidthGroup *aBandwidthGroup); 1143 1143 HRESULT onStorageDeviceChange(IMediumAttachment *aMediumAttachment, BOOL aRemove, BOOL aSilent); -
trunk/src/VBox/Main/include/SessionImpl.h
r48431 r51476 4 4 5 5 /* 6 * Copyright (C) 2006-201 3Oracle Corporation6 * Copyright (C) 2006-2014 Oracle Corporation 7 7 * 8 8 * This file is part of VirtualBox Open Source Edition (OSE), as … … 92 92 STDMETHOD(OnSharedFolderChange)(BOOL aGlobal); 93 93 STDMETHOD(OnClipboardModeChange)(ClipboardMode_T aClipboardMode); 94 STDMETHOD(OnD ragAndDropModeChange)(DragAndDropMode_T aDragAndDropMode);94 STDMETHOD(OnDnDModeChange)(DnDMode_T aDnDMode); 95 95 STDMETHOD(OnUSBDeviceAttach)(IUSBDevice *aDevice, IVirtualBoxErrorInfo *aError, ULONG aMaskedIfs); 96 96 STDMETHOD(OnUSBDeviceDetach)(IN_BSTR aId, IVirtualBoxErrorInfo *aError);
Note:
See TracChangeset
for help on using the changeset viewer.