Permalink
Browse files

Move and rename DragAndDropTarget to DragAndDropData::Target

  • Loading branch information...
1 parent 05c6bc7 commit 46c360df352bf529fcc9ce42460cf8518a460213 @vinniefalco vinniefalco committed Apr 12, 2012
@@ -221,10 +221,6 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
</ClCompile>
- <ClCompile Include="..\..\include\vf\modules\vf_gui\mouse\vf_DragAndDropTarget.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
- </ClCompile>
<ClCompile Include="..\..\include\vf\modules\vf_gui\mouse\vf_MouseEnterEditable.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
@@ -477,7 +473,6 @@
<ClInclude Include="..\..\include\vf\modules\vf_gui\layout\vf_ResizableLayout.h" />
<ClInclude Include="..\..\include\vf\modules\vf_gui\layout\vf_StackedLayout.h" />
<ClInclude Include="..\..\include\vf\modules\vf_gui\mouse\vf_DragAndDropData.h" />
- <ClInclude Include="..\..\include\vf\modules\vf_gui\mouse\vf_DragAndDropTarget.h" />
<ClInclude Include="..\..\include\vf\modules\vf_gui\mouse\vf_MouseEnterEditable.h" />
<ClInclude Include="..\..\include\vf\modules\vf_gui\mouse\vf_MouseEnterGroup.h" />
<ClInclude Include="..\..\include\vf\modules\vf_gui\vf_gui.h" />
@@ -264,9 +264,6 @@
<ClCompile Include="..\..\include\vf\modules\vf_gui\mouse\vf_DragAndDropData.cpp">
<Filter>VF Modules\vf_gui\mouse</Filter>
</ClCompile>
- <ClCompile Include="..\..\include\vf\modules\vf_gui\mouse\vf_DragAndDropTarget.cpp">
- <Filter>VF Modules\vf_gui\mouse</Filter>
- </ClCompile>
<ClCompile Include="..\..\include\vf\modules\vf_gui\graphics\vf_FreeTypeFaces.cpp">
<Filter>VF Modules\vf_gui\graphics</Filter>
</ClCompile>
@@ -641,9 +638,6 @@
<ClInclude Include="..\..\include\vf\modules\vf_gui\layout\vf_ResizableLayout.h">
<Filter>VF Modules\vf_gui\layout</Filter>
</ClInclude>
- <ClInclude Include="..\..\include\vf\modules\vf_gui\mouse\vf_DragAndDropTarget.h">
- <Filter>VF Modules\vf_gui\mouse</Filter>
- </ClInclude>
<ClInclude Include="..\..\include\vf\modules\vf_gui\mouse\vf_MouseEnterEditable.h">
<Filter>VF Modules\vf_gui\mouse</Filter>
</ClInclude>
@@ -31,3 +31,52 @@ DragAndDropData::~DragAndDropData ()
delete item;
}
}
+
+//==============================================================================
+
+bool DragAndDropData::Target::isInterestedInDragSource (const SourceDetails& dragSourceDetails)
+{
+ DragAndDropData* data = dragSourceDetails.description.isObject () ?
+ dynamic_cast <DragAndDropData*> (dragSourceDetails.description.getObject ()) :
+ 0;
+ if (data)
+ return this->isInterestedInDragSource (*data, dragSourceDetails);
+ else
+ return false;
+}
+
+void DragAndDropData::Target::itemDragEnter (const SourceDetails& dragSourceDetails)
+{
+ DragAndDropData* data = dragSourceDetails.description.isObject () ?
+ dynamic_cast <DragAndDropData*> (dragSourceDetails.description.getObject ()) :
+ 0;
+ if (data)
+ this->itemDragEnter (*data, dragSourceDetails);
+}
+
+void DragAndDropData::Target::itemDragMove (const SourceDetails& dragSourceDetails)
+{
+ DragAndDropData* data = dragSourceDetails.description.isObject () ?
+ dynamic_cast <DragAndDropData*> (dragSourceDetails.description.getObject ()) :
+ 0;
+ if (data)
+ this->itemDragMove (*data, dragSourceDetails);
+}
+
+void DragAndDropData::Target::itemDragExit (const SourceDetails& dragSourceDetails)
+{
+ DragAndDropData* data = dragSourceDetails.description.isObject () ?
+ dynamic_cast <DragAndDropData*> (dragSourceDetails.description.getObject ()) :
+ 0;
+ if (data)
+ this->itemDragExit (*data, dragSourceDetails);
+}
+
+void DragAndDropData::Target::itemDropped (const SourceDetails& dragSourceDetails)
+{
+ DragAndDropData* data = dragSourceDetails.description.isObject () ?
+ dynamic_cast <DragAndDropData*> (dragSourceDetails.description.getObject ()) :
+ 0;
+ if (data)
+ this->itemDropped (*data, dragSourceDetails);
+}
@@ -181,6 +181,39 @@ class DragAndDropData : public juce::ReferenceCountedObject
return found;
}
+public:
+ /**
+ DragAndDropTarget wrapper supporting the DragAndDropData container.
+
+ @ingroup vf_gui
+ */
+ class Target : public juce::DragAndDropTarget
+ {
+ public:
+ virtual bool isInterestedInDragSource (DragAndDropData const& data,
+ const SourceDetails& dragSourceDetails)
+ { return false; }
+
+ virtual void itemDragEnter (DragAndDropData const& data,
+ const SourceDetails& dragSourceDetails) { }
+
+ virtual void itemDragMove (DragAndDropData const& data,
+ const SourceDetails& dragSourceDetails) { }
+
+ virtual void itemDragExit (DragAndDropData const& data,
+ const SourceDetails& dragSourceDetails) { }
+
+ virtual void itemDropped (DragAndDropData const& data,
+ const SourceDetails& dragSourceDetails) { }
+
+ private:
+ bool isInterestedInDragSource (const SourceDetails& dragSourceDetails);
+ void itemDragEnter (const SourceDetails& dragSourceDetails);
+ void itemDragMove (const SourceDetails& dragSourceDetails);
+ void itemDragExit (const SourceDetails& dragSourceDetails);
+ void itemDropped (const SourceDetails& dragSourceDetails);
+ };
+
private:
class Item;
typedef List <Item> Items;
@@ -1,67 +0,0 @@
-//==============================================================================
-//
-// Copyright (C) 2008 by Vinnie Falco, this file is part of VFLib.
-// See the file GNU_GPL_v2.txt for full licensing terms.
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License as published by the Free
-// Software Foundation; either version 2 of the License, or (at your option)
-// any later version.
-//
-// This program is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-// details.
-//
-// You should have received a copy of the GNU General Public License along with
-// this program; if not, write to the Free Software Foundation, Inc., 51
-// Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-//
-//==============================================================================
-
-bool DragAndDropTarget::isInterestedInDragSource (const SourceDetails& dragSourceDetails)
-{
- DragAndDropData* data = dragSourceDetails.description.isObject () ?
- dynamic_cast <DragAndDropData*> (dragSourceDetails.description.getObject ()) :
- 0;
- if (data)
- return this->isInterestedInDragSource (*data, dragSourceDetails);
- else
- return false;
-}
-
-void DragAndDropTarget::itemDragEnter (const SourceDetails& dragSourceDetails)
-{
- DragAndDropData* data = dragSourceDetails.description.isObject () ?
- dynamic_cast <DragAndDropData*> (dragSourceDetails.description.getObject ()) :
- 0;
- if (data)
- this->itemDragEnter (*data, dragSourceDetails);
-}
-
-void DragAndDropTarget::itemDragMove (const SourceDetails& dragSourceDetails)
-{
- DragAndDropData* data = dragSourceDetails.description.isObject () ?
- dynamic_cast <DragAndDropData*> (dragSourceDetails.description.getObject ()) :
- 0;
- if (data)
- this->itemDragMove (*data, dragSourceDetails);
-}
-
-void DragAndDropTarget::itemDragExit (const SourceDetails& dragSourceDetails)
-{
- DragAndDropData* data = dragSourceDetails.description.isObject () ?
- dynamic_cast <DragAndDropData*> (dragSourceDetails.description.getObject ()) :
- 0;
- if (data)
- this->itemDragExit (*data, dragSourceDetails);
-}
-
-void DragAndDropTarget::itemDropped (const SourceDetails& dragSourceDetails)
-{
- DragAndDropData* data = dragSourceDetails.description.isObject () ?
- dynamic_cast <DragAndDropData*> (dragSourceDetails.description.getObject ()) :
- 0;
- if (data)
- this->itemDropped (*data, dragSourceDetails);
-}
@@ -1,61 +0,0 @@
-//==============================================================================
-//
-// Copyright (C) 2008 by Vinnie Falco, this file is part of VFLib.
-// See the file GNU_GPL_v2.txt for full licensing terms.
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License as published by the Free
-// Software Foundation; either version 2 of the License, or (at your option)
-// any later version.
-//
-// This program is distributed in the hope that it will be useful, but WITHOUT
-// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
-// details.
-//
-// You should have received a copy of the GNU General Public License along with
-// this program; if not, write to the Free Software Foundation, Inc., 51
-// Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-//
-//==============================================================================
-
-#ifndef VF_DRAGANDDROPTARGET_VFHEADER
-#define VF_DRAGANDDROPTARGET_VFHEADER
-
-#include "vf_DragAndDropData.h"
-
-//==============================================================================
-/**
- DragAndDropTarget wrapper supporting the DragAndDropData container.
-
- @ingroup vf_gui
-*/
-class DragAndDropTarget : public juce::DragAndDropTarget
-{
-public:
- virtual bool isInterestedInDragSource (DragAndDropData const& data,
- const SourceDetails& dragSourceDetails)
- { return false; }
-
- virtual void itemDragEnter (DragAndDropData const& data,
- const SourceDetails& dragSourceDetails) { }
-
- virtual void itemDragMove (DragAndDropData const& data,
- const SourceDetails& dragSourceDetails) { }
-
- virtual void itemDragExit (DragAndDropData const& data,
- const SourceDetails& dragSourceDetails) { }
-
- virtual void itemDropped (DragAndDropData const& data,
- const SourceDetails& dragSourceDetails) { }
-
-private:
- bool isInterestedInDragSource (const SourceDetails& dragSourceDetails);
- void itemDragEnter (const SourceDetails& dragSourceDetails);
- void itemDragMove (const SourceDetails& dragSourceDetails);
- void itemDragExit (const SourceDetails& dragSourceDetails);
- void itemDropped (const SourceDetails& dragSourceDetails);
-};
-
-#endif
-
@@ -54,7 +54,6 @@ namespace vf
#include "layout/vf_StackedLayout.cpp"
#include "mouse/vf_DragAndDropData.cpp"
-#include "mouse/vf_DragAndDropTarget.cpp"
#include "mouse/vf_MouseEnterEditable.cpp"
}
@@ -67,7 +67,6 @@ namespace vf
#include "layout/vf_StackedLayout.h"
#include "mouse/vf_DragAndDropData.h"
-#include "mouse/vf_DragAndDropTarget.h"
#include "mouse/vf_MouseEnterEditable.h"
#include "mouse/vf_MouseEnterGroup.h"

0 comments on commit 46c360d

Please sign in to comment.