VirtualBox

Ignore:
Timestamp:
Sep 9, 2019 10:00:04 AM (5 years ago)
Author:
vboxsync
Message:

Shared Clipboard: More renaming + unification.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/SharedClipboard/ClipboardDataObjectImpl-win.cpp

    r80662 r80664  
    4141//#define VBOX_CLIPBOARD_WITH_UNICODE_SUPPORT 0
    4242
    43 VBoxClipboardWinDataObject::VBoxClipboardWinDataObject(PSHCLURITRANSFER pTransfer,
    44                                                        LPFORMATETC pFormatEtc, LPSTGMEDIUM pStgMed, ULONG cFormats)
     43SharedClipboardWinDataObject::SharedClipboardWinDataObject(PSHCLURITRANSFER pTransfer,
     44                                                           LPFORMATETC pFormatEtc, LPSTGMEDIUM pStgMed, ULONG cFormats)
    4545    : m_enmStatus(Uninitialized)
    4646    , m_lRefCount(0)
     
    129129}
    130130
    131 VBoxClipboardWinDataObject::~VBoxClipboardWinDataObject(void)
     131SharedClipboardWinDataObject::~SharedClipboardWinDataObject(void)
    132132{
    133133    RTSemEventDestroy(m_EventListComplete);
     
    153153 */
    154154
    155 STDMETHODIMP_(ULONG) VBoxClipboardWinDataObject::AddRef(void)
     155STDMETHODIMP_(ULONG) SharedClipboardWinDataObject::AddRef(void)
    156156{
    157157    LONG lCount = InterlockedIncrement(&m_lRefCount);
     
    160160}
    161161
    162 STDMETHODIMP_(ULONG) VBoxClipboardWinDataObject::Release(void)
     162STDMETHODIMP_(ULONG) SharedClipboardWinDataObject::Release(void)
    163163{
    164164    LONG lCount = InterlockedDecrement(&m_lRefCount);
     
    173173}
    174174
    175 STDMETHODIMP VBoxClipboardWinDataObject::QueryInterface(REFIID iid, void **ppvObject)
     175STDMETHODIMP SharedClipboardWinDataObject::QueryInterface(REFIID iid, void **ppvObject)
    176176{
    177177    AssertPtrReturn(ppvObject, E_INVALIDARG);
     
    198198 * @param   phGlobal            Where to store the allocated HGLOBAL object.
    199199 */
    200 int VBoxClipboardWinDataObject::copyToHGlobal(const void *pvData, size_t cbData, UINT fFlags, HGLOBAL *phGlobal)
     200int SharedClipboardWinDataObject::copyToHGlobal(const void *pvData, size_t cbData, UINT fFlags, HGLOBAL *phGlobal)
    201201{
    202202    AssertPtrReturn(phGlobal, VERR_INVALID_POINTER);
     
    229229 * @param   strDir              Directory path to handle.
    230230 */
    231 int VBoxClipboardWinDataObject::readDir(PSHCLURITRANSFER pTransfer, const Utf8Str &strDir)
     231int SharedClipboardWinDataObject::readDir(PSHCLURITRANSFER pTransfer, const Utf8Str &strDir)
    232232{
    233233    LogFlowFunc(("strDir=%s\n", strDir.c_str()));
     
    309309 * @returns VBox status code.
    310310 * @param   ThreadSelf          Thread handle. Unused at the moment.
    311  * @param   pvUser              Pointer to user-provided data. Of type VBoxClipboardWinDataObject.
     311 * @param   pvUser              Pointer to user-provided data. Of type SharedClipboardWinDataObject.
    312312 */
    313313/* static */
    314 DECLCALLBACK(int) VBoxClipboardWinDataObject::readThread(RTTHREAD ThreadSelf, void *pvUser)
     314DECLCALLBACK(int) SharedClipboardWinDataObject::readThread(RTTHREAD ThreadSelf, void *pvUser)
    315315{
    316316    RT_NOREF(ThreadSelf);
     
    318318    LogFlowFuncEnter();
    319319
    320     VBoxClipboardWinDataObject *pThis = (VBoxClipboardWinDataObject *)pvUser;
     320    SharedClipboardWinDataObject *pThis = (SharedClipboardWinDataObject *)pvUser;
    321321
    322322    PSHCLURITRANSFER pTransfer = pThis->m_pTransfer;
     
    405405 * @param   phGlobal            Where to store the allocated HGLOBAL object on success.
    406406 */
    407 int VBoxClipboardWinDataObject::createFileGroupDescriptorFromTransfer(PSHCLURITRANSFER pTransfer,
     407int SharedClipboardWinDataObject::createFileGroupDescriptorFromTransfer(PSHCLURITRANSFER pTransfer,
    408408                                                                      bool fUnicode, HGLOBAL *phGlobal)
    409409{
     
    529529 * @param   pMedium
    530530 */
    531 STDMETHODIMP VBoxClipboardWinDataObject::GetData(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium)
     531STDMETHODIMP SharedClipboardWinDataObject::GetData(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium)
    532532{
    533533    AssertPtrReturn(pFormatEtc, DV_E_FORMATETC);
     
    564564            {
    565565                /* Start the transfer asynchronously in a separate thread. */
    566                 rc = SharedClipboardURITransferRun(m_pTransfer, &VBoxClipboardWinDataObject::readThread, this);
     566                rc = SharedClipboardURITransferRun(m_pTransfer, &SharedClipboardWinDataObject::readThread, this);
    567567                if (RT_SUCCESS(rc))
    568568                {
     
    614614
    615615            /* Hand-in the provider so that our IStream implementation can continue working with it. */
    616             hr = VBoxClipboardWinStreamImpl::Create(this /* pParent */, m_pTransfer,
    617                                                     fsObjEntry.strPath.c_str()/* File name */, &fsObjEntry.objInfo /* PSHCLFSOBJINFO */,
    618                                                     &m_pStream);
     616            hr = SharedClipboardWinStreamImpl::Create(this /* pParent */, m_pTransfer,
     617                                                      fsObjEntry.strPath.c_str()/* File name */, &fsObjEntry.objInfo /* PSHCLFSOBJINFO */,
     618                                                      &m_pStream);
    619619            if (SUCCEEDED(hr))
    620620            {
     
    650650 * @param   pMedium
    651651 */
    652 STDMETHODIMP VBoxClipboardWinDataObject::GetDataHere(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium)
     652STDMETHODIMP SharedClipboardWinDataObject::GetDataHere(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium)
    653653{
    654654    RT_NOREF(pFormatEtc, pMedium);
     
    664664 * @param   pFormatEtc
    665665 */
    666 STDMETHODIMP VBoxClipboardWinDataObject::QueryGetData(LPFORMATETC pFormatEtc)
     666STDMETHODIMP SharedClipboardWinDataObject::QueryGetData(LPFORMATETC pFormatEtc)
    667667{
    668668    LogFlowFunc(("\n"));
     
    670670}
    671671
    672 STDMETHODIMP VBoxClipboardWinDataObject::GetCanonicalFormatEtc(LPFORMATETC pFormatEtc, LPFORMATETC pFormatEtcOut)
     672STDMETHODIMP SharedClipboardWinDataObject::GetCanonicalFormatEtc(LPFORMATETC pFormatEtc, LPFORMATETC pFormatEtcOut)
    673673{
    674674    RT_NOREF(pFormatEtc);
     
    680680}
    681681
    682 STDMETHODIMP VBoxClipboardWinDataObject::SetData(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium, BOOL fRelease)
     682STDMETHODIMP SharedClipboardWinDataObject::SetData(LPFORMATETC pFormatEtc, LPSTGMEDIUM pMedium, BOOL fRelease)
    683683{
    684684    RT_NOREF(pFormatEtc, pMedium, fRelease);
     
    688688}
    689689
    690 STDMETHODIMP VBoxClipboardWinDataObject::EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppEnumFormatEtc)
     690STDMETHODIMP SharedClipboardWinDataObject::EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppEnumFormatEtc)
    691691{
    692692    LogFlowFunc(("dwDirection=%RI32, mcFormats=%RI32, mpFormatEtc=%p\n", dwDirection, m_cFormats, m_pFormatEtc));
     
    694694    HRESULT hr;
    695695    if (dwDirection == DATADIR_GET)
    696         hr = VBoxClipboardWinEnumFormatEtc::CreateEnumFormatEtc(m_cFormats, m_pFormatEtc, ppEnumFormatEtc);
     696        hr = SharedClipboardWinEnumFormatEtc::CreateEnumFormatEtc(m_cFormats, m_pFormatEtc, ppEnumFormatEtc);
    697697    else
    698698        hr = E_NOTIMPL;
     
    702702}
    703703
    704 STDMETHODIMP VBoxClipboardWinDataObject::DAdvise(LPFORMATETC pFormatEtc, DWORD fAdvise, IAdviseSink *pAdvSink, DWORD *pdwConnection)
     704STDMETHODIMP SharedClipboardWinDataObject::DAdvise(LPFORMATETC pFormatEtc, DWORD fAdvise, IAdviseSink *pAdvSink, DWORD *pdwConnection)
    705705{
    706706    RT_NOREF(pFormatEtc, fAdvise, pAdvSink, pdwConnection);
     
    708708}
    709709
    710 STDMETHODIMP VBoxClipboardWinDataObject::DUnadvise(DWORD dwConnection)
     710STDMETHODIMP SharedClipboardWinDataObject::DUnadvise(DWORD dwConnection)
    711711{
    712712    RT_NOREF(dwConnection);
     
    714714}
    715715
    716 STDMETHODIMP VBoxClipboardWinDataObject::EnumDAdvise(IEnumSTATDATA **ppEnumAdvise)
     716STDMETHODIMP SharedClipboardWinDataObject::EnumDAdvise(IEnumSTATDATA **ppEnumAdvise)
    717717{
    718718    RT_NOREF(ppEnumAdvise);
     
    725725 */
    726726
    727 STDMETHODIMP VBoxClipboardWinDataObject::EndOperation(HRESULT hResult, IBindCtx *pbcReserved, DWORD dwEffects)
     727STDMETHODIMP SharedClipboardWinDataObject::EndOperation(HRESULT hResult, IBindCtx *pbcReserved, DWORD dwEffects)
    728728{
    729729     RT_NOREF(hResult, pbcReserved, dwEffects);
     
    731731}
    732732
    733 STDMETHODIMP VBoxClipboardWinDataObject::GetAsyncMode(BOOL *pfIsOpAsync)
     733STDMETHODIMP SharedClipboardWinDataObject::GetAsyncMode(BOOL *pfIsOpAsync)
    734734{
    735735     RT_NOREF(pfIsOpAsync);
     
    737737}
    738738
    739 STDMETHODIMP VBoxClipboardWinDataObject::InOperation(BOOL *pfInAsyncOp)
     739STDMETHODIMP SharedClipboardWinDataObject::InOperation(BOOL *pfInAsyncOp)
    740740{
    741741     RT_NOREF(pfInAsyncOp);
     
    743743}
    744744
    745 STDMETHODIMP VBoxClipboardWinDataObject::SetAsyncMode(BOOL fDoOpAsync)
     745STDMETHODIMP SharedClipboardWinDataObject::SetAsyncMode(BOOL fDoOpAsync)
    746746{
    747747     RT_NOREF(fDoOpAsync);
     
    749749}
    750750
    751 STDMETHODIMP VBoxClipboardWinDataObject::StartOperation(IBindCtx *pbcReserved)
     751STDMETHODIMP SharedClipboardWinDataObject::StartOperation(IBindCtx *pbcReserved)
    752752{
    753753     RT_NOREF(pbcReserved);
     
    760760 */
    761761
    762 int VBoxClipboardWinDataObject::Init(void)
     762int SharedClipboardWinDataObject::Init(void)
    763763{
    764764    LogFlowFuncLeaveRC(VINF_SUCCESS);
     
    766766}
    767767
    768 void VBoxClipboardWinDataObject::OnTransferComplete(int rc /* = VINF_SUCESS */)
     768void SharedClipboardWinDataObject::OnTransferComplete(int rc /* = VINF_SUCESS */)
    769769{
    770770    RT_NOREF(rc);
     
    785785}
    786786
    787 void VBoxClipboardWinDataObject::OnTransferCanceled(void)
     787void SharedClipboardWinDataObject::OnTransferCanceled(void)
    788788{
    789789    LogFlowFuncEnter();
     
    799799
    800800/* static */
    801 const char* VBoxClipboardWinDataObject::ClipboardFormatToString(CLIPFORMAT fmt)
     801const char* SharedClipboardWinDataObject::ClipboardFormatToString(CLIPFORMAT fmt)
    802802{
    803803#if 0
     
    881881}
    882882
    883 bool VBoxClipboardWinDataObject::lookupFormatEtc(LPFORMATETC pFormatEtc, ULONG *puIndex)
     883bool SharedClipboardWinDataObject::lookupFormatEtc(LPFORMATETC pFormatEtc, ULONG *puIndex)
    884884{
    885885    AssertReturn(pFormatEtc, false);
     
    894894        {
    895895            LogRel3(("Shared Clipboard: Format found: tyMed=%RI32, cfFormat=%RI16, sFormats=%s, dwAspect=%RI32, ulIndex=%RU32\n",
    896                       pFormatEtc->tymed, pFormatEtc->cfFormat, VBoxClipboardWinDataObject::ClipboardFormatToString(m_pFormatEtc[i].cfFormat),
     896                      pFormatEtc->tymed, pFormatEtc->cfFormat, SharedClipboardWinDataObject::ClipboardFormatToString(m_pFormatEtc[i].cfFormat),
    897897                      pFormatEtc->dwAspect, i));
    898898            if (puIndex)
     
    903903
    904904    LogRel3(("Shared Clipboard: Format NOT found: tyMed=%RI32, cfFormat=%RI16, sFormats=%s, dwAspect=%RI32\n",
    905              pFormatEtc->tymed, pFormatEtc->cfFormat, VBoxClipboardWinDataObject::ClipboardFormatToString(pFormatEtc->cfFormat),
     905             pFormatEtc->tymed, pFormatEtc->cfFormat, SharedClipboardWinDataObject::ClipboardFormatToString(pFormatEtc->cfFormat),
    906906             pFormatEtc->dwAspect));
    907907
     
    909909}
    910910
    911 void VBoxClipboardWinDataObject::registerFormat(LPFORMATETC pFormatEtc, CLIPFORMAT clipFormat,
    912                                                 TYMED tyMed, LONG lIndex, DWORD dwAspect,
    913                                                 DVTARGETDEVICE *pTargetDevice)
     911void SharedClipboardWinDataObject::registerFormat(LPFORMATETC pFormatEtc, CLIPFORMAT clipFormat,
     912                                                  TYMED tyMed, LONG lIndex, DWORD dwAspect,
     913                                                  DVTARGETDEVICE *pTargetDevice)
    914914{
    915915    AssertPtr(pFormatEtc);
     
    922922
    923923    LogFlowFunc(("Registered format=%ld, sFormat=%s\n",
    924                  pFormatEtc->cfFormat, VBoxClipboardWinDataObject::ClipboardFormatToString(pFormatEtc->cfFormat)));
    925 }
    926 
     924                 pFormatEtc->cfFormat, SharedClipboardWinDataObject::ClipboardFormatToString(pFormatEtc->cfFormat)));
     925}
     926
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