summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-03-14 12:51:31 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-03-15 09:57:43 +0100
commit8bddb3c77048814b370351e0eb72c31f289fb34f (patch)
tree8b081c15b1779301eee613e6f24de1371dd77265 /vcl/inc
parentf5efc3cb9d2bbcaaca95e15a03815e8f8eda7b09 (diff)
add drop target support to welded widget
refactor the mega-widget dnd drop target to be reused at mini-widget level and weld SwInsertBookmarkDlg Change-Id: I3f36e1cd902ecf166e369d0a05902d3df2b4f791 Reviewed-on: https://gerrit.libreoffice.org/69274 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/unx/gtk/gtkframe.hxx7
-rw-r--r--vcl/inc/unx/gtk/gtkinst.hxx18
2 files changed, 15 insertions, 10 deletions
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 248c896b28a1..d67046a940ae 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -219,8 +219,6 @@ class GtkSalFrame : public SalFrame
cairo_region_t* m_pRegion;
GtkDropTarget* m_pDropTarget;
GtkDragSource* m_pDragSource;
- bool m_bInDrag;
- GtkDnDTransferable* m_pFormatConversionRequest;
bool m_bGeometryIsProvisional;
#else
GdkRegion* m_pRegion;
@@ -419,11 +417,6 @@ public:
m_pDragSource = nullptr;
}
- void SetFormatConversionRequest(GtkDnDTransferable *pRequest)
- {
- m_pFormatConversionRequest = pRequest;
- }
-
void startDrag(gint nButton, gint nDragOriginX, gint nDragOriginY,
GdkDragAction sourceActions, GtkTargetList* pTargetList);
diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx
index 83e56184ddb1..c0e073cca845 100644
--- a/vcl/inc/unx/gtk/gtkinst.hxx
+++ b/vcl/inc/unx/gtk/gtkinst.hxx
@@ -76,23 +76,25 @@ protected:
std::map<OUString, GdkAtom> m_aMimeTypeToAtom;
std::vector<css::datatransfer::DataFlavor> getTransferDataFlavorsAsVector(GdkAtom *targets, gint n_targets);
-public:
+public:
virtual css::uno::Any SAL_CALL getTransferData(const css::datatransfer::DataFlavor& rFlavor) override = 0;
-
virtual std::vector<css::datatransfer::DataFlavor> getTransferDataFlavorsAsVector() = 0;
-
virtual css::uno::Sequence<css::datatransfer::DataFlavor> SAL_CALL getTransferDataFlavors() override;
virtual sal_Bool SAL_CALL isDataFlavorSupported(const css::datatransfer::DataFlavor& rFlavor) override;
};
+class GtkDnDTransferable;
+
class GtkDropTarget : public cppu::WeakComponentImplHelper<css::datatransfer::dnd::XDropTarget,
css::lang::XInitialization,
css::lang::XServiceInfo>
{
osl::Mutex m_aMutex;
GtkSalFrame* m_pFrame;
+ GtkDnDTransferable* m_pFormatConversionRequest;
bool m_bActive;
+ bool m_bInDrag;
sal_Int8 m_nDefaultActions;
std::vector<css::uno::Reference<css::datatransfer::dnd::XDropTargetListener>> m_aListeners;
public:
@@ -121,6 +123,16 @@ public:
void fire_dragOver(const css::datatransfer::dnd::DropTargetDragEvent& dtde);
void fire_drop(const css::datatransfer::dnd::DropTargetDropEvent& dtde);
void fire_dragExit(const css::datatransfer::dnd::DropTargetEvent& dte);
+
+ void SetFormatConversionRequest(GtkDnDTransferable *pRequest)
+ {
+ m_pFormatConversionRequest = pRequest;
+ }
+
+ gboolean signalDragDrop(GtkWidget* pWidget, GdkDragContext* context, gint x, gint y, guint time);
+ gboolean signalDragMotion(GtkWidget* pWidget, GdkDragContext* context, gint x, gint y, guint time);
+ void signalDragDropReceived(GtkWidget* pWidget, GdkDragContext* context, gint x, gint y, GtkSelectionData* data, guint ttype, guint time);
+ void signalDragLeave(GtkWidget* pWidget, GdkDragContext* context, guint time);
};
class GtkDragSource : public cppu::WeakComponentImplHelper<css::datatransfer::dnd::XDragSource,