LibreOffice Module vcl (master)  1
gtkinst.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_VCL_INC_UNX_GTK_GTKINST_HXX
21 #define INCLUDED_VCL_INC_UNX_GTK_GTKINST_HXX
22 
23 #include <sal/config.h>
24 
25 #include <stack>
26 
27 #include <unx/salinst.h>
28 #include <unx/gensys.h>
29 #include <headless/svpinst.hxx>
30 #include <com/sun/star/datatransfer/DataFlavor.hpp>
31 #include <com/sun/star/datatransfer/dnd/XDragSource.hpp>
32 #include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
33 #include <com/sun/star/lang/XInitialization.hpp>
34 #include <com/sun/star/lang/XServiceInfo.hpp>
35 #include <com/sun/star/awt/XWindow.hpp>
36 #include <cppuhelper/compbase.hxx>
37 #include <vcl/weld.hxx>
38 #include <vcl/weldutils.hxx>
39 #include <gtk/gtk.h>
40 
41 vcl::Font pango_to_vcl(const PangoFontDescription* font, const css::lang::Locale& rLocale);
42 
43 class GenPspGraphics;
44 class GtkYieldMutex final : public SalYieldMutex
45 {
46  thread_local static std::stack<sal_uInt32> yieldCounts;
47 
48 public:
50  void ThreadsEnter();
51  void ThreadsLeave();
52 };
53 
54 class GtkSalFrame;
55 
56 #if GTK_CHECK_VERSION(4, 0, 0)
57 gint gtk_dialog_run(GtkDialog *dialog);
58 
59 struct read_transfer_result
60 {
61  enum { BlockSize = 8192 };
62  size_t nRead = 0;
63  bool bDone = false;
64 
65  std::vector<sal_Int8> aVector;
66 
67  static void read_block_async_completed(GObject* source, GAsyncResult* res, gpointer user_data);
68 
69  OUString get_as_string() const;
70  css::uno::Sequence<sal_Int8> get_as_sequence() const;
71 };
72 
73 #endif
74 
76 {
77  std::vector<css::datatransfer::DataFlavor> aInfoToFlavor;
78 #if GTK_CHECK_VERSION(4, 0, 0)
79  std::vector<OString> FormatsToGtk(const css::uno::Sequence<css::datatransfer::DataFlavor> &rFormats);
80 #else
81  std::vector<GtkTargetEntry> FormatsToGtk(const css::uno::Sequence<css::datatransfer::DataFlavor> &rFormats);
82 #endif
83 #if GTK_CHECK_VERSION(4, 0, 0)
84  void setSelectionData(const css::uno::Reference<css::datatransfer::XTransferable> &rTrans,
85  GdkContentProvider* provider,
86  const char* mime_type,
87  GOutputStream* stream,
88  int io_priority,
89  GCancellable* cancellable,
90  GAsyncReadyCallback callback,
91  gpointer user_data);
92 #else
93  void setSelectionData(const css::uno::Reference<css::datatransfer::XTransferable> &rTrans,
94  GtkSelectionData *selection_data, guint info);
95 #endif
96 private:
97 #if GTK_CHECK_VERSION(4, 0, 0)
98  OString makeGtkTargetEntry(const css::datatransfer::DataFlavor& rFlavor);
99 #else
100  GtkTargetEntry makeGtkTargetEntry(const css::datatransfer::DataFlavor& rFlavor);
101 #endif
102 };
103 
104 class GtkTransferable : public cppu::WeakImplHelper<css::datatransfer::XTransferable>
105 {
106 protected:
107 #if GTK_CHECK_VERSION(4, 0, 0)
108  std::map<OUString, OString> m_aMimeTypeToGtkType;
109 #else
110  std::map<OUString, GdkAtom> m_aMimeTypeToGtkType;
111 #endif
112 
113 #if GTK_CHECK_VERSION(4, 0, 0)
114  std::vector<css::datatransfer::DataFlavor> getTransferDataFlavorsAsVector(const char * const *targets, gint n_targets);
115 #else
116  std::vector<css::datatransfer::DataFlavor> getTransferDataFlavorsAsVector(GdkAtom *targets, gint n_targets);
117 #endif
118 
119 public:
120  virtual css::uno::Any SAL_CALL getTransferData(const css::datatransfer::DataFlavor& rFlavor) override = 0;
121  virtual std::vector<css::datatransfer::DataFlavor> getTransferDataFlavorsAsVector() = 0;
122  virtual css::uno::Sequence<css::datatransfer::DataFlavor> SAL_CALL getTransferDataFlavors() override;
123  virtual sal_Bool SAL_CALL isDataFlavorSupported(const css::datatransfer::DataFlavor& rFlavor) override;
124 };
125 
126 class GtkDnDTransferable;
127 
128 class GtkInstDropTarget final : public cppu::WeakComponentImplHelper<css::datatransfer::dnd::XDropTarget,
129  css::lang::XInitialization,
130  css::lang::XServiceInfo>
131 {
132  osl::Mutex m_aMutex;
134  GtkDnDTransferable* m_pFormatConversionRequest;
135  bool m_bActive;
136  bool m_bInDrag;
138  std::vector<css::uno::Reference<css::datatransfer::dnd::XDropTargetListener>> m_aListeners;
139 public:
141  virtual ~GtkInstDropTarget() override;
142 
143  // XInitialization
144  virtual void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& rArgs) override;
145  void deinitialize();
146 
147  // XDropTarget
148  virtual void SAL_CALL addDropTargetListener(const css::uno::Reference<css::datatransfer::dnd::XDropTargetListener>&) override;
149  virtual void SAL_CALL removeDropTargetListener(const css::uno::Reference<css::datatransfer::dnd::XDropTargetListener>&) override;
150  virtual sal_Bool SAL_CALL isActive() override;
151  virtual void SAL_CALL setActive(sal_Bool active) override;
152  virtual sal_Int8 SAL_CALL getDefaultActions() override;
153  virtual void SAL_CALL setDefaultActions(sal_Int8 actions) override;
154 
155  OUString SAL_CALL getImplementationName() override;
156 
157  sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
158 
159  css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
160 
161  void fire_dragEnter(const css::datatransfer::dnd::DropTargetDragEnterEvent& dtdee);
162  void fire_dragOver(const css::datatransfer::dnd::DropTargetDragEvent& dtde);
163  void fire_drop(const css::datatransfer::dnd::DropTargetDropEvent& dtde);
164  void fire_dragExit(const css::datatransfer::dnd::DropTargetEvent& dte);
165 
166  void SetFormatConversionRequest(GtkDnDTransferable *pRequest)
167  {
168  m_pFormatConversionRequest = pRequest;
169  }
170 
171 #if !GTK_CHECK_VERSION(4, 0, 0)
172  gboolean signalDragMotion(GtkWidget* pWidget, GdkDragContext* context, gint x, gint y, guint time);
173  gboolean signalDragDrop(GtkWidget* pWidget, GdkDragContext* context, gint x, gint y, guint time);
174 #else
175  GdkDragAction signalDragMotion(GtkDropTargetAsync *context, GdkDrop *drop, double x, double y);
176  gboolean signalDragDrop(GtkDropTargetAsync *context, GdkDrop *drop, double x, double y);
177 #endif
178 
179  void signalDragLeave(GtkWidget* pWidget);
180 
181 #if !GTK_CHECK_VERSION(4, 0, 0)
182  void signalDragDropReceived(GtkWidget* pWidget, GdkDragContext* context, gint x, gint y, GtkSelectionData* data, guint ttype, guint time);
183 #endif
184 };
185 
186 class GtkInstDragSource final : public cppu::WeakComponentImplHelper<css::datatransfer::dnd::XDragSource,
187  css::lang::XInitialization,
188  css::lang::XServiceInfo>
189 {
190  osl::Mutex m_aMutex;
192  css::uno::Reference<css::datatransfer::dnd::XDragSourceListener> m_xListener;
193  css::uno::Reference<css::datatransfer::XTransferable> m_xTrans;
195 public:
197  : WeakComponentImplHelper(m_aMutex)
198  , m_pFrame(nullptr)
199  {
200  }
201 
202  void set_datatransfer(const css::uno::Reference<css::datatransfer::XTransferable>& rTrans,
203  const css::uno::Reference<css::datatransfer::dnd::XDragSourceListener>& rListener);
204 
205 #if !GTK_CHECK_VERSION(4, 0, 0)
206  std::vector<GtkTargetEntry> FormatsToGtk(const css::uno::Sequence<css::datatransfer::DataFlavor> &rFormats);
207 #endif
208 
209  void setActiveDragSource();
210 
211  virtual ~GtkInstDragSource() override;
212 
213  // XDragSource
214  virtual sal_Bool SAL_CALL isDragImageSupported() override;
215  virtual sal_Int32 SAL_CALL getDefaultCursor(sal_Int8 dragAction) override;
216  virtual void SAL_CALL startDrag(
217  const css::datatransfer::dnd::DragGestureEvent& trigger, sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image,
218  const css::uno::Reference< css::datatransfer::XTransferable >& transferable,
219  const css::uno::Reference< css::datatransfer::dnd::XDragSourceListener >& listener) override;
220 
221  // XInitialization
222  virtual void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any >& rArguments) override;
223  void deinitialize();
224 
225  OUString SAL_CALL getImplementationName() override;
226 
227  sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
228 
229  css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
230 
231  void dragFailed();
232  void dragDelete();
233 #if GTK_CHECK_VERSION(4, 0, 0)
234  void dragEnd(GdkDrag* drag);
235 #else
236  void dragEnd(GdkDragContext* context);
237  void dragDataGet(GtkSelectionData *data, guint info);
238 #endif
239 
240  // For LibreOffice internal D&D we provide the Transferable without Gtk
241  // intermediaries as a shortcut, see tdf#100097 for how dbaccess depends on this
243  css::uno::Reference<css::datatransfer::XTransferable> const & GetTransferrable() const { return m_xTrans; }
244 };
245 
247 
248 class GtkSalTimer;
249 class GtkInstance final : public SvpSalInstance
250 {
251 public:
252  GtkInstance( std::unique_ptr<SalYieldMutex> pMutex );
253  virtual ~GtkInstance() override;
254  void EnsureInit();
255  virtual void AfterAppInit() override;
256 
257  virtual SalFrame* CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle ) override;
258  virtual SalFrame* CreateChildFrame( SystemParentData* pParent, SalFrameStyleFlags nStyle ) override;
259  virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, bool bShow ) override;
260  virtual SalSystem* CreateSalSystem() override;
261  virtual SalInfoPrinter* CreateInfoPrinter(SalPrinterQueueInfo* pPrinterQueueInfo, ImplJobSetup* pJobSetup) override;
262  virtual std::unique_ptr<SalPrinter> CreatePrinter( SalInfoPrinter* pInfoPrinter ) override;
263  virtual std::unique_ptr<SalMenu> CreateMenu( bool, Menu* ) override;
264  virtual std::unique_ptr<SalMenuItem> CreateMenuItem( const SalItemParams& ) override;
265  virtual SalTimer* CreateSalTimer() override;
266  virtual void AddToRecentDocumentList(const OUString& rFileUrl, const OUString& rMimeType, const OUString& rDocumentService) override;
267  virtual std::unique_ptr<SalVirtualDevice>
269  tools::Long &nDX, tools::Long &nDY,
270  DeviceFormat eFormat,
271  const SystemGraphicsData* = nullptr ) override;
272  virtual std::shared_ptr<SalBitmap> CreateSalBitmap() override;
273 
274  virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents) override;
275  virtual bool AnyInput( VclInputFlags nType ) override;
276  // impossible to handle correctly, as "main thread" depends on the dispatch mutex
277  virtual bool IsMainThread() const override { return false; }
278 
279  virtual std::unique_ptr<GenPspGraphics> CreatePrintGraphics() override;
280 
281  virtual bool hasNativeFileSelection() const override { return true; }
282 
283  virtual css::uno::Reference< css::ui::dialogs::XFilePicker2 >
284  createFilePicker( const css::uno::Reference< css::uno::XComponentContext >& ) override;
285  virtual css::uno::Reference< css::ui::dialogs::XFolderPicker2 >
286  createFolderPicker( const css::uno::Reference< css::uno::XComponentContext >& ) override;
287 
288  virtual css::uno::Reference< css::uno::XInterface > CreateClipboard( const css::uno::Sequence< css::uno::Any >& i_rArguments ) override;
289  virtual css::uno::Reference< css::uno::XInterface > CreateDragSource() override;
290  virtual css::uno::Reference< css::uno::XInterface > CreateDropTarget() override;
291  virtual OpenGLContext* CreateOpenGLContext() override;
292  virtual weld::Builder* CreateBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile) override;
293  virtual weld::Builder* CreateInterimBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile,
294  bool bAllowCycleFocusOut, sal_uInt64 nLOKWindowId = 0) override;
295  virtual weld::MessageDialog* CreateMessageDialog(weld::Widget* pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage) override;
296  virtual weld::Window* GetFrameWeld(const css::uno::Reference<css::awt::XWindow>& rWindow) override;
297 
298  virtual const cairo_font_options_t* GetCairoFontOptions() override;
301 
302  void RemoveTimer ();
303 
304  void* CreateGStreamerSink(const SystemChildWindow*) override;
305 
306 private:
308  css::uno::Reference<css::uno::XInterface> m_aClipboards[2];
309  bool IsTimerExpired();
312 };
313 
315 {
316 private:
318  GtkWidget* m_pWidget;
319 public:
320 
321  SalGtkXWindow(weld::Window* pWeldWidget, GtkWidget* pWidget)
322  : TransportAsXWindow(pWeldWidget)
323  , m_pWeldWidget(pWeldWidget)
324  , m_pWidget(pWidget)
325  {
326  }
327 
328  virtual void clear() override
329  {
330  m_pWeldWidget = nullptr;
331  m_pWidget = nullptr;
332  TransportAsXWindow::clear();
333  }
334 
335  GtkWidget* getGtkWidget() const
336  {
337  return m_pWidget;
338  }
339 
341  {
342  return m_pWeldWidget;
343  }
344 };
345 
346 GdkPixbuf* load_icon_by_name(const OUString& rIconName);
347 
348 #endif // INCLUDED_VCL_INC_UNX_GTK_GTKINST_HXX
349 
350 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual bool hasNativeFileSelection() const override
Definition: gtkinst.hxx:281
virtual void AddToRecentDocumentList(const OUString &rFileUrl, const OUString &rMimeType, const OUString &rDocumentService) override
std::vector< css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > > m_aListeners
Definition: gtkinst.hxx:138
std::vector< GtkTargetEntry > FormatsToGtk(const css::uno::Sequence< css::datatransfer::DataFlavor > &rFormats)
virtual std::unique_ptr< SalMenu > CreateMenu(bool, Menu *) override
GtkDnDTransferable * m_pFormatConversionRequest
Definition: gtkinst.hxx:134
virtual void SAL_CALL removeDropTargetListener(const css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > &) override
virtual void SAL_CALL setDefaultActions(sal_Int8 actions) override
virtual const cairo_font_options_t * GetCairoFontOptions() override
void ThreadsEnter()
VclButtonsType
Definition: vclenum.hxx:242
TransportAsXWindow(weld::Widget *pWeldWidget, weld::Builder *pWeldWidgetBuilder=nullptr)
Definition: weldutils.hxx:52
virtual css::uno::Any SAL_CALL getTransferData(const css::datatransfer::DataFlavor &rFlavor) override=0
weld::Window * getFrameWeld() const
Definition: gtkinst.hxx:340
signed char sal_Int8
css::uno::Reference< css::datatransfer::XTransferable > m_xTrans
Definition: gtkinst.hxx:193
virtual SalSystem * CreateSalSystem() override
virtual css::uno::Sequence< css::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors() override
long Long
void RemoveTimer()
GtkSalFrame * m_pFrame
Definition: gtkinst.hxx:191
virtual void SAL_CALL setActive(sal_Bool active) override
virtual std::vector< css::datatransfer::DataFlavor > getTransferDataFlavorsAsVector()=0
void * CreateGStreamerSink(const SystemChildWindow *) override
virtual OpenGLContext * CreateOpenGLContext() override
virtual void clear() override
Definition: gtkinst.hxx:328
virtual weld::Builder * CreateBuilder(weld::Widget *pParent, const OUString &rUIRoot, const OUString &rUIFile) override
void signalDragDropReceived(GtkWidget *pWidget, GdkDragContext *context, gint x, gint y, GtkSelectionData *data, guint ttype, guint time)
virtual SalTimer * CreateSalTimer() override
GtkWidget * getGtkWidget() const
Definition: gtkinst.hxx:335
vcl::Font pango_to_vcl(const PangoFontDescription *font, const css::lang::Locale &rLocale)
const cairo_font_options_t * GetLastSeenCairoFontOptions() const
void GCancellable
virtual sal_Int8 SAL_CALL getDefaultActions() override
virtual css::uno::Reference< css::ui::dialogs::XFilePicker2 > createFilePicker(const css::uno::Reference< css::uno::XComponentContext > &) override
VclInputFlags
Definition: inputtypes.hxx:25
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual std::unique_ptr< SalVirtualDevice > CreateVirtualDevice(SalGraphics &, tools::Long &nDX, tools::Long &nDY, DeviceFormat eFormat, const SystemGraphicsData *=nullptr) override
virtual css::uno::Reference< css::ui::dialogs::XFolderPicker2 > createFolderPicker(const css::uno::Reference< css::uno::XComponentContext > &) override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &rArguments) override
std::vector< css::datatransfer::DataFlavor > aInfoToFlavor
Definition: gtkinst.hxx:77
virtual SalFrame * CreateFrame(SalFrame *pParent, SalFrameStyleFlags nStyle) override
GdkPixbuf * load_icon_by_name(const OUString &rIconName)
ttype
gboolean signalDragMotion(GtkWidget *pWidget, GdkDragContext *context, gint x, gint y, guint time)
virtual css::uno::Reference< css::uno::XInterface > CreateDragSource() override
VclMessageType
Definition: vclenum.hxx:252
cairo_font_options_t * m_pLastCairoFontOptions
Definition: gtkinst.hxx:311
void dragDataGet(GtkSelectionData *data, guint info)
virtual void AfterAppInit() override
void ThreadsLeave()
virtual std::unique_ptr< SalMenuItem > CreateMenuItem(const SalItemParams &) override
void fire_dragExit(const css::datatransfer::dnd::DropTargetEvent &dte)
virtual void SAL_CALL addDropTargetListener(const css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > &) override
void signalDragLeave(GtkWidget *pWidget)
void SetFormatConversionRequest(GtkDnDTransferable *pRequest)
Definition: gtkinst.hxx:166
std::vector< GtkTargetEntry > FormatsToGtk(const css::uno::Sequence< css::datatransfer::DataFlavor > &rFormats)
sal_Int8 m_nDefaultActions
Definition: gtkinst.hxx:137
void fire_dragOver(const css::datatransfer::dnd::DropTargetDragEvent &dtde)
sal_Bool SAL_CALL supportsService(OUString const &ServiceName) override
virtual std::shared_ptr< SalBitmap > CreateSalBitmap() override
GtkSalTimer * m_pTimer
Definition: gtkinst.hxx:307
virtual bool AnyInput(VclInputFlags nType) override
osl::Mutex m_aMutex
Definition: gtkinst.hxx:190
void dragEnd(GdkDragContext *context)
virtual sal_Bool SAL_CALL isActive() override
static GtkInstDragSource * g_ActiveDragSource
Definition: gtkinst.hxx:242
GtkSalFrame * m_pFrame
Definition: gtkinst.hxx:133
virtual bool IsMainThread() const override
Definition: gtkinst.hxx:277
unsigned char sal_Bool
virtual css::uno::Reference< css::uno::XInterface > CreateClipboard(const css::uno::Sequence< css::uno::Any > &i_rArguments) override
virtual ~GtkInstDropTarget() override
css::uno::Reference< css::uno::XInterface > m_aClipboards[2]
Definition: gtkinst.hxx:308
virtual weld::Window * GetFrameWeld(const css::uno::Reference< css::awt::XWindow > &rWindow) override
SelectionType
virtual sal_Bool SAL_CALL isDragImageSupported() override
DeviceFormat
Definition: salgtype.hxx:28
OUString SAL_CALL getImplementationName() override
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:114
struct _cairo_font_options cairo_font_options_t
Definition: salinst.hxx:72
VclToGtkHelper m_aConversionHelper
Definition: gtkinst.hxx:194
Definition: menu.hxx:123
void fire_dragEnter(const css::datatransfer::dnd::DropTargetDragEnterEvent &dtdee)
void setSelectionData(const css::uno::Reference< css::datatransfer::XTransferable > &rTrans, GtkSelectionData *selection_data, guint info)
void setActiveDragSource()
virtual ~GtkInstance() override
virtual SalObject * CreateObject(SalFrame *pParent, SystemWindowData *pWindowData, bool bShow) override
SalFrameStyleFlags
Definition: salframe.hxx:64
virtual css::uno::Reference< css::uno::XInterface > CreateDropTarget() override
virtual SalFrame * CreateChildFrame(SystemParentData *pParent, SalFrameStyleFlags nStyle) override
SalGtkXWindow(weld::Window *pWeldWidget, GtkWidget *pWidget)
Definition: gtkinst.hxx:321
virtual std::unique_ptr< GenPspGraphics > CreatePrintGraphics() override
bool IsTimerExpired()
weld::Window * m_pWeldWidget
Definition: gtkinst.hxx:317
virtual sal_Bool SAL_CALL isDataFlavorSupported(const css::datatransfer::DataFlavor &rFlavor) override
QPRO_FUNC_TYPE nType
virtual weld::Builder * CreateInterimBuilder(vcl::Window *pParent, const OUString &rUIRoot, const OUString &rUIFile, bool bAllowCycleFocusOut, sal_uInt64 nLOKWindowId=0) override
osl::Mutex m_aMutex
Definition: gtkinst.hxx:132
virtual weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage) override
virtual SalInfoPrinter * CreateInfoPrinter(SalPrinterQueueInfo *pPrinterQueueInfo, ImplJobSetup *pJobSetup) override
css::uno::Reference< css::datatransfer::dnd::XDragSourceListener > m_xListener
Definition: gtkinst.hxx:192
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &rArgs) override
virtual std::unique_ptr< SalPrinter > CreatePrinter(SalInfoPrinter *pInfoPrinter) override
OUString SAL_CALL getImplementationName() override
std::map< OUString, GdkAtom > m_aMimeTypeToGtkType
Definition: gtkinst.hxx:110
bool bNeedsInit
Definition: gtkinst.hxx:310
css::uno::Reference< css::datatransfer::XTransferable > const & GetTransferrable() const
Definition: gtkinst.hxx:243
virtual bool DoYield(bool bWait, bool bHandleAllCurrentEvents) override
Wait for the next event (if bWait) and dispatch it, includes posted events, and timers.
virtual ~GtkInstDragSource() override
GtkTargetEntry makeGtkTargetEntry(const css::datatransfer::DataFlavor &rFlavor)
gboolean signalDragDrop(GtkWidget *pWidget, GdkDragContext *context, gint x, gint y, guint time)
static thread_local std::stack< sal_uInt32 > yieldCounts
Definition: gtkinst.hxx:46
sal_Bool SAL_CALL supportsService(OUString const &ServiceName) override
void fire_drop(const css::datatransfer::dnd::DropTargetDropEvent &dtde)
GtkWidget * m_pWidget
Definition: gtkinst.hxx:318
void ResetLastSeenCairoFontOptions(const cairo_font_options_t *pOptions)
void EnsureInit()
virtual void SAL_CALL startDrag(const css::datatransfer::dnd::DragGestureEvent &trigger, sal_Int8 sourceActions, sal_Int32 cursor, sal_Int32 image, const css::uno::Reference< css::datatransfer::XTransferable > &transferable, const css::uno::Reference< css::datatransfer::dnd::XDragSourceListener > &listener) override
void set_datatransfer(const css::uno::Reference< css::datatransfer::XTransferable > &rTrans, const css::uno::Reference< css::datatransfer::dnd::XDragSourceListener > &rListener)
GtkInstance(std::unique_ptr< SalYieldMutex > pMutex)
virtual sal_Int32 SAL_CALL getDefaultCursor(sal_Int8 dragAction) override