/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
// find the window that is toplevel for this coordinates // because those coordinates come from outside, they must be mirrored if RTL layout is active if( AllSettings::GetLayoutRTL() )
m_pTopWindow->ImplMirrorFramePos( location );
vcl::Window * pChildWindow = m_pTopWindow->ImplFindWindow( location );
// handle the case that drop is in another vcl window than the last dragOver if( pChildWindow != m_pCurrentWindow.get() )
{ // fire dragExit on listeners of previous window
fireDragExitEvent( m_pCurrentWindow );
// send drop event to the child window
sal_Int32 nListeners = fireDropEvent( pChildWindow, dtde.Context, dtde.DropAction,
location, dtde.SourceActions, dtde.Transferable );
// reject drop if no listeners found if( nListeners == 0 ) {
SAL_WARN( "vcl", "rejecting drop due to missing listeners." );
dtde.Context->rejectDrop();
}
// this is a drop -> no further drag overs
designate_currentwindow(nullptr);
m_aDataFlavorList.realloc( 0 );
}
// assume pointer write operation to be atomic
designate_currentwindow(pChildWindow);
m_aDataFlavorList = dtdee.SupportedDataFlavors;
// fire dragEnter on listeners of current window
sal_Int32 nListeners = fireDragEnterEvent( pChildWindow, dtdee.Context, dtdee.DropAction, location,
dtdee.SourceActions, dtdee.SupportedDataFlavors );
// reject drag if no listener found if( nListeners == 0 ) {
SAL_WARN( "vcl", "rejecting drag enter due to missing listeners." );
dtdee.Context->rejectDrag();
}
if( pChildWindow != m_pCurrentWindow.get() )
{ // fire dragExit on listeners of previous window
fireDragExitEvent( m_pCurrentWindow );
// remember new window
designate_currentwindow(pChildWindow);
// fire dragEnter on listeners of current window
nListeners = fireDragEnterEvent( pChildWindow, dtde.Context, dtde.DropAction, location,
dtde.SourceActions, m_aDataFlavorList );
} else
{ // fire dragOver on listeners of current window
nListeners = fireDragOverEvent( pChildWindow, dtde.Context, dtde.DropAction, location,
dtde.SourceActions );
}
// reject drag if no listener found if( nListeners == 0 )
{
SAL_WARN( "vcl", "rejecting drag over due to missing listeners." );
dtde.Context->rejectDrag();
}
}
if( pChildWindow != m_pCurrentWindow.get() )
{ // fire dragExit on listeners of previous window
fireDragExitEvent( m_pCurrentWindow );
// remember new window
designate_currentwindow(pChildWindow);
// fire dragEnter on listeners of current window
nListeners = fireDragEnterEvent( pChildWindow, dtde.Context, dtde.DropAction, location,
dtde.SourceActions, m_aDataFlavorList );
} else
{ // fire dropActionChanged on listeners of current window
nListeners = fireDropActionChangedEvent( pChildWindow, dtde.Context, dtde.DropAction, location,
dtde.SourceActions );
}
// reject drag if no listener found if( nListeners == 0 )
{
SAL_WARN( "vcl", "rejecting dropActionChanged due to missing listeners." );
dtde.Context->rejectDrag();
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.