diff options
Diffstat (limited to 'src/Authoring/Studio/DragAndDrop')
-rw-r--r-- | src/Authoring/Studio/DragAndDrop/DropProxy.cpp | 12 | ||||
-rw-r--r-- | src/Authoring/Studio/DragAndDrop/DropSource.cpp | 10 | ||||
-rw-r--r-- | src/Authoring/Studio/DragAndDrop/ListBoxDropSource.cpp | 83 | ||||
-rw-r--r-- | src/Authoring/Studio/DragAndDrop/ListBoxDropSource.h | 60 | ||||
-rw-r--r-- | src/Authoring/Studio/DragAndDrop/ListBoxDropTarget.cpp | 116 | ||||
-rw-r--r-- | src/Authoring/Studio/DragAndDrop/ListBoxDropTarget.h | 65 | ||||
-rw-r--r-- | src/Authoring/Studio/DragAndDrop/TimelineDropSource.cpp | 2 |
7 files changed, 5 insertions, 343 deletions
diff --git a/src/Authoring/Studio/DragAndDrop/DropProxy.cpp b/src/Authoring/Studio/DragAndDrop/DropProxy.cpp index 0ed794ce..f0ab1aea 100644 --- a/src/Authoring/Studio/DragAndDrop/DropProxy.cpp +++ b/src/Authoring/Studio/DragAndDrop/DropProxy.cpp @@ -117,17 +117,15 @@ CDropSource *CDropProxy::GetDropSource(const QMimeData *inDataObject, long inFla } } break; case QT3DS_FLAVOR_TEXT: - // Don't do anythiing for this - case QT3DS_FLAVOR_LISTBOX: - // Don't do anythiing for this + // Don't do anything for this case QT3DS_FLAVOR_BASIC_OBJECTS: - // Don't do anythiing for this + // Don't do anything for this case QT3DS_FLAVOR_ASSET_LIB: - // make an Aset out of this. + // make an asset out of this case QT3DS_FLAVOR_ASSET_TL: - // make an Aset out of this. + // make an asset out of this case QT3DS_FLAVOR_ASSET_UICFILE: - // make an Aset out of this. + // make an asset out of this // Get a pointer to the object theDropSource = dynamic_cast<const CDropSource *>(inDataObject); if (theDropSource != nullptr && theDropSource->GetFlavor() != inFlavor) diff --git a/src/Authoring/Studio/DragAndDrop/DropSource.cpp b/src/Authoring/Studio/DragAndDrop/DropSource.cpp index 190eb95a..ee1f003a 100644 --- a/src/Authoring/Studio/DragAndDrop/DropSource.cpp +++ b/src/Authoring/Studio/DragAndDrop/DropSource.cpp @@ -40,7 +40,6 @@ #include "ExplorerFileDropSource.h" #include "TimelineDropSource.h" #include "BasicObjectDropSource.h" -#include "ListBoxDropSource.h" #include "Views.h" #include "MainFrm.h" #include "TimelineWidget.h" @@ -85,10 +84,6 @@ CDropSource *CDropSourceFactory::Create(long inFlavor, IDragable *inDragable) { CDropSource *theDropSource(nullptr); switch (inFlavor) { - case QT3DS_FLAVOR_LISTBOX: - theDropSource = new CListBoxDropSource(inFlavor, inDragable); - break; - case QT3DS_FLAVOR_BASIC_OBJECTS: theDropSource = new CBasicObjectDropSource(inFlavor, inDragable); break; @@ -109,11 +104,6 @@ CDropSource *CDropSourceFactory::Extract(long inFlavor, void *inData, unsigned l CDropSource *theDropSource(nullptr); switch (inFlavor) { // For all of the Studio Flavors we just need to extract the dropsource out of it. - case QT3DS_FLAVOR_LISTBOX: - // make an Aset out of this. - theDropSource = static_cast<CListBoxDropSource *>(inData); - break; - case QT3DS_FLAVOR_BASIC_OBJECTS: // make an Aset out of this. theDropSource = static_cast<CBasicObjectDropSource *>(inData); diff --git a/src/Authoring/Studio/DragAndDrop/ListBoxDropSource.cpp b/src/Authoring/Studio/DragAndDrop/ListBoxDropSource.cpp deleted file mode 100644 index 04cde06c..00000000 --- a/src/Authoring/Studio/DragAndDrop/ListBoxDropSource.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 1999-2002 NVIDIA Corporation. -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt 3D Studio. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//============================================================================== -// Prefix -//============================================================================== -#include "stdafx.h" - -//============================================================================== -// Includes -//============================================================================== -#include "ListBoxDropSource.h" -#include "DropTarget.h" -#include "ListBoxItem.h" -#include "IDragable.h" - -//=============================================================================== -/** - * Constructor - */ -CListBoxDropSource::CListBoxDropSource(long inFlavor, IDragable *inDragable) - : CDropSource(inFlavor, 0) -{ - m_Item = reinterpret_cast<CListBoxItem *>(inDragable); -} - -//=============================================================================== -/** - * Validate that the drop target is QT3DS_FLAVOR_LISTBOX type. - * @param inTarget Drop target for validation - * @return true if inTarget is QT3DS_FLAVOR_LISTBOX; false if otherwise - */ -bool CListBoxDropSource::ValidateTarget(CDropTarget *inTarget) -{ - bool theValidTarget = (inTarget->GetObjectType() == QT3DS_FLAVOR_LISTBOX); - SetHasValidTarget(theValidTarget); - - return theValidTarget; -} - -//=============================================================================== -/** - * @return true - */ -bool CListBoxDropSource::CanMove() -{ - return true; -} - -//=============================================================================== -/** - * @return true - */ -bool CListBoxDropSource::CanCopy() -{ - return true; -} diff --git a/src/Authoring/Studio/DragAndDrop/ListBoxDropSource.h b/src/Authoring/Studio/DragAndDrop/ListBoxDropSource.h deleted file mode 100644 index a28678d4..00000000 --- a/src/Authoring/Studio/DragAndDrop/ListBoxDropSource.h +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 1999-2002 NVIDIA Corporation. -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt 3D Studio. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//============================================================================== -// Prefix -//============================================================================== -#ifndef __ListBoxDropSource_H__ -#define __ListBoxDropSource_H__ - -//============================================================================== -// Includes -//============================================================================== -#include "DropSource.h" - -class CStudioApp; -class CDropTarget; -class CListBoxItem; - -class CListBoxDropSource : public CDropSource -{ -protected: - CListBoxItem *m_Item; - -public: - CListBoxDropSource(long inFlavor, IDragable *inDragable); - - bool CanMove() override; - bool CanCopy() override; - bool ValidateTarget(CDropTarget *inTarget) override; - - CListBoxItem *GetItem() { return m_Item; } -}; - -#endif // #ifndef __ListBoxDropSource_H__ diff --git a/src/Authoring/Studio/DragAndDrop/ListBoxDropTarget.cpp b/src/Authoring/Studio/DragAndDrop/ListBoxDropTarget.cpp deleted file mode 100644 index f69d0bae..00000000 --- a/src/Authoring/Studio/DragAndDrop/ListBoxDropTarget.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 1999-2002 NVIDIA Corporation. -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt 3D Studio. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//============================================================================== -// Prefix -//============================================================================== -#include "stdafx.h" - -//============================================================================== -// Includes -//============================================================================== -#include "ListBoxDropTarget.h" -#include "ListBoxDropSource.h" -#include "IDragable.h" - -//=============================================================================== -/** - * Constructor - */ -CListBoxDropTarget::CListBoxDropTarget() - : m_Item(nullptr) -{ -} - -//=============================================================================== -/** - * This get called on every DragWithin. - * Note: the source will validate the target instead of the otherway around. - * This is because the DropSource knows how to get information from itself without - * creating an asset. This is mainly for DropSources that have a lazy creation idiom. - * like files. - * @param the DropSource in question. - * @return true if the DropSource likes the DropTarget. - */ -bool CListBoxDropTarget::Accept(CDropSource &inSource) -{ - return inSource.ValidateTarget(this); -} - -//=============================================================================== -/** - * This is where is actually happens. - * Note: At this point everything should be verified, and setup in the dropsource. - * The only thing left to do is to get the Assets and move/copy or connect them. - * @param inSource the Object in question. - * @return true if the drop was successful . - */ -bool CListBoxDropTarget::Drop(CDropSource &inSource) -{ - if (m_Item) { - inSource; - /* - CSlideDropSource* theSlideDropSource = static_cast< CSlideDropSource* >( - &inSource ); - CSlideControl* theSlideControl = theSlideDropSource->GetSlide( ); - CTimeContext* theTimeContext = theSlideControl->GetTimeContext( ); - - // Reorder this slide to the position held by this drop target. - CCmdRearrangeTimeContext* theCommand = new CCmdRearrangeTimeContext( theTimeContext, - m_SlideInsert->GetInsertIndex( ) ); - if ( theCommand ) - { - theTimeContext->GetAsset( )->ExecuteCommand( theCommand, false ); - } - */ - } - - // we are always successful - return true; -} - -//=============================================================================== -/** - * This will get the objec ttype from the Asset. - * Note: The asset can change all of the time, so i always ask the asset for its type. - * @return the Studio object type. - */ -long CListBoxDropTarget::GetObjectType() -{ - return QT3DS_FLAVOR_LISTBOX; -} - -//=============================================================================== -/** - * Set the SlideInsertionControl that is the drop target - */ -void CListBoxDropTarget::SetItem(CListBoxItem *inItem) -{ - m_Item = inItem; -}
\ No newline at end of file diff --git a/src/Authoring/Studio/DragAndDrop/ListBoxDropTarget.h b/src/Authoring/Studio/DragAndDrop/ListBoxDropTarget.h deleted file mode 100644 index 44199092..00000000 --- a/src/Authoring/Studio/DragAndDrop/ListBoxDropTarget.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 1999-2002 NVIDIA Corporation. -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt 3D Studio. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//============================================================================== -// Prefix -//============================================================================== -#ifndef __ListBoxDropTarget_H__ -#define __ListBoxDropTarget_H__ - -//============================================================================== -// Includes -//============================================================================== -#include "DropTarget.h" - -class CDropSource; -class CListBoxItem; - -//============================================================================== -/** - * @class - * @brief justin.ebert needs to enter a brief description here. - * - * justin.ebert needs to enter a long description here. - */ -class CListBoxDropTarget : public CDropTarget -{ -protected: - CListBoxItem *m_Item; ///< The list item that we can drop on - -public: - CListBoxDropTarget(); - bool Accept(CDropSource &inSource) override; - bool Drop(CDropSource &inSource) override; - long GetObjectType() override; - - void SetItem(CListBoxItem *inItem); -}; - -#endif // #ifndef __ListBoxDropTarget_H__ diff --git a/src/Authoring/Studio/DragAndDrop/TimelineDropSource.cpp b/src/Authoring/Studio/DragAndDrop/TimelineDropSource.cpp index 3f5a04b8..7779f950 100644 --- a/src/Authoring/Studio/DragAndDrop/TimelineDropSource.cpp +++ b/src/Authoring/Studio/DragAndDrop/TimelineDropSource.cpp @@ -149,8 +149,6 @@ CCmd *CTimeLineDropSource::GenerateAssetCommand(qt3dsdm::Qt3DSDMInstanceHandle i qt3dsdm::Qt3DSDMSlideHandle inSlide) { CDoc *theDoc = g_StudioApp.GetCore()->GetDoc(); - CClientDataModelBridge *theBridge = theDoc->GetStudioSystem()->GetClientDataModelBridge(); - if (CanCopy()) { SCOPED_DOCUMENT_EDITOR(*theDoc, QObject::tr("Duplicate Object")) ->DuplicateInstances(m_Instances, inTarget, |