LibreOffice Module vcl (master)  1
gtkframe.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_GTKFRAME_HXX
21 #define INCLUDED_VCL_INC_UNX_GTK_GTKFRAME_HXX
22 
23 #include <cairo.h>
24 #include <gdk/gdk.h>
25 #include <gdk/gdkx.h>
26 #include <gtk/gtk.h>
27 #include <gtk/gtkx.h>
28 #include <gdk/gdkkeysyms.h>
29 
30 #include <salframe.hxx>
31 #include <vcl/idle.hxx>
32 #include <vcl/sysdata.hxx>
34 #include <unx/saltype.h>
36 
37 #include <tools/link.hxx>
38 
39 #include <com/sun/star/awt/XTopWindow.hpp>
40 #include <com/sun/star/datatransfer/DataFlavor.hpp>
41 #include <com/sun/star/datatransfer/dnd/XDragSource.hpp>
42 #include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
43 
44 #include <list>
45 #include <vector>
46 
47 #include <config_dbus.h>
48 #include <config_gio.h>
49 
50 #include <headless/svpgdi.hxx>
51 
52 class GtkSalGraphics;
54 
55 typedef sal_uIntPtr GdkNativeWindow;
56 #define GDK_WINDOW_XWINDOW(o) GDK_WINDOW_XID(o)
57 #define gdk_set_sm_client_id(i) gdk_x11_set_sm_client_id(i)
58 #define gdk_window_foreign_new_for_display(a,b) gdk_x11_window_foreign_new_for_display(a,b)
59 class GtkDropTarget;
60 class GtkDragSource;
61 class GtkDnDTransferable;
62 
63 class GtkSalMenu;
64 
65 class GtkSalFrame : public SalFrame
67 {
68  struct IMHandler
69  {
70 
71  // Not all GTK Input Methods swallow key release
72  // events. Since they swallow the key press events and we
73  // are left with the key release events, we need to
74  // manually swallow those. To do this, we keep a list of
75  // the previous 10 key press events in each GtkSalFrame
76  // and when we get a key release that matches one of the
77  // key press events in our list, we swallow it.
79  {
80  GdkWindow *window;
81  gint8 send_event;
82  guint32 time;
83  guint state;
84  guint keyval;
86  guint8 group;
87 
88  PreviousKeyPress (GdkEventKey *event)
89  : window (nullptr),
90  send_event (0),
91  time (0),
92  state (0),
93  keyval (0),
94  hardware_keycode (0),
95  group (0)
96  {
97  if (event)
98  {
99  window = event->window;
100  send_event = event->send_event;
101  time = event->time;
102  state = event->state;
103  keyval = event->keyval;
104  hardware_keycode = event->hardware_keycode;
105  group = event->group;
106  }
107  }
108 
110  : window( rPrev.window ),
111  send_event( rPrev.send_event ),
112  time( rPrev.time ),
113  state( rPrev.state ),
114  keyval( rPrev.keyval ),
115  hardware_keycode( rPrev.hardware_keycode ),
116  group( rPrev.group )
117  {}
118 
119  bool operator== (GdkEventKey const *event) const
120  {
121  return (event != nullptr)
122  && (event->window == window)
123  && (event->send_event == send_event)
124  // ignore non-Gdk state bits, e.g., these used by IBus
125  && ((event->state & GDK_MODIFIER_MASK) == (state & GDK_MODIFIER_MASK))
126  && (event->keyval == keyval)
127  && (event->hardware_keycode == hardware_keycode)
128  && (event->group == group)
129  && (event->time - time < 300)
130  ;
131  }
132  };
133 
135  std::list< PreviousKeyPress > m_aPrevKeyPresses;
136  int m_nPrevKeyPresses; // avoid using size()
137  GtkIMContext* m_pIMContext;
141  std::vector< ExtTextInputAttr > m_aInputFlags;
142 
144  ~IMHandler();
145 
146  void createIMContext();
147  void deleteIMContext();
148  void updateIMSpotLocation();
149  void endExtTextInput( EndExtTextInputFlags nFlags );
150  bool handleKeyEvent( GdkEventKey* pEvent );
151  void focusChanged( bool bFocusIn );
152 
153  void doCallEndExtTextInput();
154  void sendEmptyCommit();
155 
156  static void signalIMCommit( GtkIMContext*, gchar*, gpointer );
157  static gboolean signalIMDeleteSurrounding( GtkIMContext*, gint, gint, gpointer );
158  static void signalIMPreeditChanged( GtkIMContext*, gpointer );
159  static void signalIMPreeditEnd( GtkIMContext*, gpointer );
160  static void signalIMPreeditStart( GtkIMContext*, gpointer );
161  static gboolean signalIMRetrieveSurrounding( GtkIMContext*, gpointer );
162  };
163  friend struct IMHandler;
164 
166  GtkWidget* m_pWindow;
167  GtkHeaderBar* m_pHeaderBar;
168  GtkGrid* m_pTopLevelGrid;
169  GtkEventBox* m_pEventBox;
170  GtkFixed* m_pFixedContainer;
171  GdkWindow* m_pForeignParent;
173  GdkWindow* m_pForeignTopLevel;
177  std::list< GtkSalFrame* > m_aChildren;
178  GdkWindowState m_nState;
180  std::unique_ptr<GtkSalGraphics> m_pGraphics;
183  GdkCursor *m_pCurrentCursor;
190  OUString m_sWMClass;
191 
192  std::unique_ptr<IMHandler> m_pIMHandler;
193 
197 
198  OUString m_aTooltip;
205  cairo_region_t* m_pRegion;
209 
211 
212 #if ENABLE_DBUS && ENABLE_GIO
213  private:
214  friend void ensure_dbus_setup(GdkWindow* gdkWindow, GtkSalFrame* pSalFrame);
215  friend void on_registrar_available (GDBusConnection*, const gchar*, const gchar*, gpointer);
216  friend void on_registrar_unavailable (GDBusConnection*, const gchar*, gpointer);
217 #endif
219 
220  void Init( SalFrame* pParent, SalFrameStyleFlags nStyle );
221  void Init( SystemParentData* pSysData );
222  void InitCommon();
223  void InvalidateGraphics();
224 
225  // signals
226  static gboolean signalButton( GtkWidget*, GdkEventButton*, gpointer );
227  static void signalStyleUpdated(GtkWidget*, gpointer);
228  static gboolean signalDraw( GtkWidget*, cairo_t *cr, gpointer );
229  static void signalRealize(GtkWidget*, gpointer frame);
230  static void sizeAllocated(GtkWidget*, GdkRectangle *pAllocation, gpointer frame);
231  static gboolean signalTooltipQuery(GtkWidget*, gint x, gint y,
232  gboolean keyboard_mode, GtkTooltip *tooltip,
233  gpointer frame);
234  static gboolean signalDragMotion(GtkWidget *widget, GdkDragContext *context, gint x, gint y,
235  guint time, gpointer frame);
236  static gboolean signalDragDrop(GtkWidget* widget, GdkDragContext *context, gint x, gint y,
237  guint time, gpointer frame);
238  static void signalDragDropReceived(GtkWidget *widget, GdkDragContext *context, gint x, gint y,
239  GtkSelectionData *data, guint ttype, guint time, gpointer frame);
240  static void signalDragLeave(GtkWidget *widget, GdkDragContext *context, guint time, gpointer frame);
241 
242  static gboolean signalDragFailed(GtkWidget *widget, GdkDragContext *context, GtkDragResult result, gpointer frame);
243  static void signalDragDelete(GtkWidget *widget, GdkDragContext *context, gpointer frame);
244  static void signalDragEnd(GtkWidget *widget, GdkDragContext *context, gpointer frame);
245  static void signalDragDataGet(GtkWidget* widget, GdkDragContext* context, GtkSelectionData *data, guint info,
246  guint time, gpointer frame);
247 
248  static void gestureSwipe(GtkGestureSwipe* gesture, gdouble velocity_x, gdouble velocity_y, gpointer frame);
249  static void gestureLongPress(GtkGestureLongPress* gesture, gdouble x, gdouble y, gpointer frame);
250  static gboolean signalFocus( GtkWidget*, GdkEventFocus*, gpointer );
251  static gboolean signalMap( GtkWidget*, GdkEvent*, gpointer );
252  static gboolean signalUnmap( GtkWidget*, GdkEvent*, gpointer );
253  static gboolean signalConfigure( GtkWidget*, GdkEventConfigure*, gpointer );
254  static gboolean signalMotion( GtkWidget*, GdkEventMotion*, gpointer );
255  static gboolean signalKey( GtkWidget*, GdkEventKey*, gpointer );
256  static gboolean signalDelete( GtkWidget*, GdkEvent*, gpointer );
257  static gboolean signalWindowState( GtkWidget*, GdkEvent*, gpointer );
258  static gboolean signalScroll( GtkWidget*, GdkEvent*, gpointer );
259  static gboolean signalCrossing( GtkWidget*, GdkEventCrossing*, gpointer );
260  static gboolean signalVisibility( GtkWidget*, GdkEventVisibility*, gpointer );
261  static void signalDestroy( GtkWidget*, gpointer );
262 
263  void Center();
264  void SetDefaultSize();
265 
266  bool doKeyCallback( guint state,
267  guint keyval,
268  guint16 hardware_keycode,
269  guint8 group,
270  sal_Unicode aOrigCode,
271  bool bDown,
272  bool bSendRelease
273  );
274 
276 
277  static int m_nFloats;
278 
279  bool isFloatGrabWindow() const
280  {
281  return
282  (m_nStyle & SalFrameStyleFlags::FLOAT) && // only a float can be floatgrab
283  !(m_nStyle & SalFrameStyleFlags::TOOLTIP) && // tool tips are not
284  !(m_nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION); // toolbars are also not
285  }
286 
287  bool isChild( bool bPlug = true, bool bSysChild = true )
288  {
290  if( bPlug )
291  nMask |= SalFrameStyleFlags::PLUG;
292  if( bSysChild )
294  return bool(m_nStyle & nMask);
295  }
296 
297  //call gtk_window_resize
298  void window_resize(long nWidth, long nHeight);
299  //call gtk_widget_set_size_request
300  void widget_set_size_request(long nWidth, long nHeight);
301 
302  void resizeWindow( long nWidth, long nHeight );
303  void moveWindow( long nX, long nY );
304 
306 
307  void setMinMaxSize();
308 
309  void AllocateFrame();
310  void TriggerPaintEvent();
311 
312  void updateWMClass();
313 
315 
316  void SetScreen( unsigned int nNewScreen, SetType eType, tools::Rectangle const *pSize = nullptr );
317 
318 public:
322  std::vector<GdkEvent*> m_aPendingScrollEvents;
326  GtkSalFrame( SalFrame* pParent, SalFrameStyleFlags nStyle );
327  GtkSalFrame( SystemParentData* pSysData );
328 
332  std::vector<gulong> m_aMouseSignalIds;
333 
334  void grabPointer(bool bGrab, bool bOwnerEvents = false);
335 
336  static GtkSalDisplay* getDisplay();
337  static GdkDisplay* getGdkDisplay();
338  GtkWidget* getWindow() const { return m_pWindow; }
339  GtkFixed* getFixedContainer() const { return m_pFixedContainer; }
340  GtkEventBox* getEventBox() const { return m_pEventBox; }
341  GtkWidget* getMouseEventWidget() const;
342  GtkGrid* getTopLevelGridWidget() const { return m_pTopLevelGrid; }
343  const SalX11Screen& getXScreenNumber() const { return m_nXScreen; }
345  void updateScreenNumber();
346 
347  cairo_t* getCairoContext() const;
348  void damaged(sal_Int32 nExtentsLeft, sal_Int32 nExtentsTop,
349  sal_Int32 nExtentsRight, sal_Int32 nExtentsBottom) const;
350 
352  {
353  assert(!m_pDropTarget);
354  m_pDropTarget = pDropTarget;
355  }
356 
357  void deregisterDropTarget(GtkDropTarget const * pDropTarget)
358  {
359  assert(m_pDropTarget == pDropTarget); (void)pDropTarget;
360  m_pDropTarget = nullptr;
361  }
362 
364  {
365  assert(!m_pDragSource);
366  m_pDragSource = pDragSource;
367  }
368 
369  void deregisterDragSource(GtkDragSource const * pDragSource)
370  {
371  assert(m_pDragSource == pDragSource); (void)pDragSource;
372  m_pDragSource = nullptr;
373  }
374 
375  void startDrag(gint nButton, gint nDragOriginX, gint nDragOriginY,
376  GdkDragAction sourceActions, GtkTargetList* pTargetList);
377 
378  void closePopup();
379 
380  void addGrabLevel();
381  void removeGrabLevel();
382 
383  void nopaint_container_resize_children(GtkContainer*);
384 
385  void LaunchAsyncScroll(GdkEvent const * pEvent);
386  DECL_LINK(AsyncScroll, Timer *, void);
387 
388  virtual ~GtkSalFrame() override;
389 
390  // SalGraphics or NULL, but two Graphics for all SalFrames
391  // must be returned
392  virtual SalGraphics* AcquireGraphics() override;
393  virtual void ReleaseGraphics( SalGraphics* pGraphics ) override;
394 
395  // Event must be destroyed, when Frame is destroyed
396  // When Event is called, SalInstance::Yield() must be returned
397  virtual bool PostEvent(std::unique_ptr<ImplSVEvent> pData) override;
398 
399  virtual void SetTitle( const OUString& rTitle ) override;
400  virtual void SetIcon( sal_uInt16 nIcon ) override;
401  virtual void SetMenu( SalMenu *pSalMenu ) override;
402  SalMenu* GetMenu();
403  virtual void DrawMenuBar() override;
404  void EnsureAppMenuWatch();
405 
406  virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle ) override;
407  // Before the window is visible, a resize event
408  // must be sent with the correct size
409  virtual void Show( bool bVisible, bool bNoActivate = false ) override;
410  // Set ClientSize and Center the Window to the desktop
411  // and send/post a resize message
412  virtual void SetMinClientSize( long nWidth, long nHeight ) override;
413  virtual void SetMaxClientSize( long nWidth, long nHeight ) override;
414  virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) override;
415  virtual void GetClientSize( long& rWidth, long& rHeight ) override;
416  virtual void GetWorkArea( tools::Rectangle& rRect ) override;
417  virtual SalFrame* GetParent() const override;
418  virtual void SetWindowState( const SalFrameState* pState ) override;
419  virtual bool GetWindowState( SalFrameState* pState ) override;
420  virtual void ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) override;
421  // Enable/Disable ScreenSaver, SystemAgents, ...
422  virtual void StartPresentation( bool bStart ) override;
423  // Show Window over all other Windows
424  virtual void SetAlwaysOnTop( bool bOnTop ) override;
425 
426  // Window to top and grab focus
427  virtual void ToTop( SalFrameToTop nFlags ) override;
428 
429  // this function can call with the same
430  // pointer style
431  virtual void SetPointer( PointerStyle ePointerStyle ) override;
432  virtual void CaptureMouse( bool bMouse ) override;
433  virtual void SetPointerPos( long nX, long nY ) override;
434 
435  // flush output buffer
436  using SalFrame::Flush;
437  virtual void Flush() override;
438  // flush output buffer, wait till outstanding operations are done
439 
440  virtual void SetInputContext( SalInputContext* pContext ) override;
441  virtual void EndExtTextInput( EndExtTextInputFlags nFlags ) override;
442 
443  virtual OUString GetKeyName( sal_uInt16 nKeyCode ) override;
444  virtual bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, vcl::KeyCode& rKeyCode ) override;
445 
446  // returns the input language used for the last key stroke
447  // may be LANGUAGE_DONTKNOW if not supported by the OS
448  virtual LanguageType GetInputLanguage() override;
449 
450  virtual void UpdateSettings( AllSettings& rSettings ) override;
451 
452  virtual void Beep() override;
453 
454  // returns system data (most prominent: window handle)
455  virtual const SystemEnvData* GetSystemData() const override;
456 
457  // get current modifier and button mask
458  virtual SalPointerState GetPointerState() override;
459 
460  virtual KeyIndicatorState GetIndicatorState() override;
461 
462  virtual void SimulateKeyPress( sal_uInt16 nKeyCode ) override;
463 
464  // set new parent window
465  virtual void SetParent( SalFrame* pNewParent ) override;
466  // reparent window to act as a plugin; implementation
467  // may choose to use a new system window internally
468  // return false to indicate failure
469  virtual bool SetPluginParent( SystemParentData* pNewParent ) override;
470 
471  virtual void SetScreenNumber( unsigned int ) override;
472  virtual void SetApplicationID( const OUString &rWMClass ) override;
473 
474  // shaped system windows
475  // set clip region to none (-> rectangular windows, normal state)
476  virtual void ResetClipRegion() override;
477  // start setting the clipregion consisting of nRects rectangles
478  virtual void BeginSetClipRegion( sal_uInt32 nRects ) override;
479  // add a rectangle to the clip region
480  virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) override;
481  // done setting up the clipregion
482  virtual void EndSetClipRegion() override;
483 
484  virtual void PositionByToolkit(const tools::Rectangle& rRect, FloatWinPopupFlags nFlags) override;
485  virtual void SetModal(bool bModal) override;
486  virtual bool GetModal() const override;
487  void HideTooltip();
488  virtual bool ShowTooltip(const OUString& rHelpText, const tools::Rectangle& rHelpArea) override;
489  virtual void* ShowPopover(const OUString& rHelpText, vcl::Window* pParent, const tools::Rectangle& rHelpArea, QuickHelpFlags nFlags) override;
490  virtual bool UpdatePopover(void* nId, const OUString& rHelpText, vcl::Window* pParent, const tools::Rectangle& rHelpArea) override;
491  virtual bool HidePopover(void* nId) override;
492  virtual weld::Window* GetFrameWeld() const override;
493 
494  static GtkSalFrame *getFromWindow( GtkWindow *pWindow );
495 
496  sal_uIntPtr GetNativeWindowHandle(GtkWidget *pWidget);
497  virtual sal_uIntPtr GetNativeWindowHandle() override;
498 
499  //Call the usual SalFrame Callback, but catch uno exceptions and delegate
500  //to GtkSalData to rethrow them after the gsignal is processed when its safe
501  //to do so again in our own code after the g_main_context_iteration call
502  //which triggers the gsignals.
503  bool CallCallbackExc(SalEvent nEvent, const void* pEvent) const;
504 
505 
506  static void KeyCodeToGdkKey(const vcl::KeyCode& rKeyCode,
507  guint* pGdkKeyCode, GdkModifierType *pGdkModifiers);
508 
509  static guint32 GetLastInputEventTime();
510  static void UpdateLastInputEventTime(guint32 nUserInputTime);
511  static sal_uInt16 GetMouseModCode(guint nState);
512  static sal_uInt16 GetKeyCode(guint nKeyVal);
513  static guint GetKeyValFor(GdkKeymap* pKeyMap, guint16 hardware_keycode, guint8 group);
514  static sal_uInt16 GetKeyModCode(guint nState);
515  static GdkEvent* makeFakeKeyPress(GtkWidget* pWidget);
516  static SalWheelMouseEvent GetWheelEvent(GdkEventScroll& rEvent);
517 };
518 
519 #define OOO_TYPE_FIXED ooo_fixed_get_type()
520 
521 extern "C" {
522 
523 GType ooo_fixed_get_type();
524 AtkObject* ooo_fixed_get_accessible(GtkWidget *obj);
525 
526 } // extern "C"
527 
528 #endif // INCLUDED_VCL_INC_UNX_GTK_GTKFRAME_HXX
529 
530 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
tools::Rectangle m_aRestorePosSize
Definition: gtkframe.hxx:196
GdkNativeWindow m_aForeignTopLevelWindow
Definition: gtkframe.hxx:174
virtual bool HidePopover(void *nId) override
GdkNativeWindow m_aForeignParentWindow
Definition: gtkframe.hxx:172
guint m_nActionGroupExportId
Definition: gtkframe.hxx:330
bool doKeyCallback(guint state, guint keyval, guint16 hardware_keycode, guint8 group, sal_Unicode aOrigCode, bool bDown, bool bSendRelease)
struct _GDBusConnection GDBusConnection
Definition: cpdmgr.hxx:30
virtual void SetMaxClientSize(long nWidth, long nHeight) override
void nopaint_container_resize_children(GtkContainer *)
virtual void Show(bool bVisible, bool bNoActivate=false) override
static void gestureLongPress(GtkGestureLongPress *gesture, gdouble x, gdouble y, gpointer frame)
void EnsureAppMenuWatch()
static sal_uInt16 GetKeyCode(guint nKeyVal)
static void signalDragDataGet(GtkWidget *widget, GdkDragContext *context, GtkSelectionData *data, guint info, guint time, gpointer frame)
virtual bool MapUnicodeToKeyCode(sal_Unicode aUnicode, LanguageType aLangType, vcl::KeyCode &rKeyCode) override
bool isFloatGrabWindow() const
Definition: gtkframe.hxx:279
void deregisterDragSource(GtkDragSource const *pDragSource)
Definition: gtkframe.hxx:369
static gboolean signalWindowState(GtkWidget *, GdkEvent *, gpointer)
cairo_t * getCairoContext() const
static void signalDragDropReceived(GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *data, guint ttype, guint time, gpointer frame)
virtual void Flush() override
static gboolean signalDelete(GtkWidget *, GdkEvent *, gpointer)
GtkDropTarget * m_pDropTarget
Definition: gtkframe.hxx:206
virtual void SetParent(SalFrame *pNewParent) override
SalMenu * GetMenu()
Size calcDefaultSize()
GtkHeaderBar * m_pHeaderBar
Definition: gtkframe.hxx:167
std::vector< gulong > m_aMouseSignalIds
Definition: gtkframe.hxx:332
static void signalDestroy(GtkWidget *, gpointer)
virtual const SystemEnvData * GetSystemData() const override
static sal_uInt16 GetKeyModCode(guint nState)
virtual void EndExtTextInput(EndExtTextInputFlags nFlags) override
OUString m_aTooltip
Definition: gtkframe.hxx:198
long m_nHeightRequest
Definition: gtkframe.hxx:204
virtual void SimulateKeyPress(sal_uInt16 nKeyCode) override
static gboolean signalIMRetrieveSurrounding(GtkIMContext *, gpointer)
void setMinMaxSize()
ModKeyFlags
Definition: keycodes.hxx:163
std::unique_ptr< GtkSalGraphics > m_pGraphics
Definition: gtkframe.hxx:180
SalExtTextInputEvent m_aInputEvent
Definition: gtkframe.hxx:140
std::vector< GdkEvent * > m_aPendingScrollEvents
Definition: gtkframe.hxx:322
std::vector< ExtTextInputAttr > m_aInputFlags
Definition: gtkframe.hxx:141
GtkDragSource * m_pDragSource
Definition: gtkframe.hxx:207
void Center()
virtual bool GetModal() const override
virtual void UnionClipRegion(long nX, long nY, long nWidth, long nHeight) override
IMHandler(GtkSalFrame *)
virtual void ShowFullScreen(bool bFullScreen, sal_Int32 nDisplay) override
virtual SalFrame * GetParent() const override
void removeGrabLevel()
virtual void PositionByToolkit(const tools::Rectangle &rRect, FloatWinPopupFlags nFlags) override
static void gestureSwipe(GtkGestureSwipe *gesture, gdouble velocity_x, gdouble velocity_y, gpointer frame)
GtkEventBox * m_pEventBox
Definition: gtkframe.hxx:169
virtual KeyIndicatorState GetIndicatorState() override
GdkWindow * m_pForeignParent
Definition: gtkframe.hxx:171
void updateWMClass()
GtkFixed * m_pFixedContainer
Definition: gtkframe.hxx:170
GdkWindow * m_pForeignTopLevel
Definition: gtkframe.hxx:173
std::list< PreviousKeyPress > m_aPrevKeyPresses
Definition: gtkframe.hxx:135
static gboolean signalIMDeleteSurrounding(GtkIMContext *, gint, gint, gpointer)
virtual void SetMenu(SalMenu *pSalMenu) override
GtkSalFrame * m_pParent
Definition: gtkframe.hxx:176
PointerStyle m_ePointerStyle
Definition: gtkframe.hxx:184
sal_uInt16 sal_Unicode
virtual void * ShowPopover(const OUString &rHelpText, vcl::Window *pParent, const tools::Rectangle &rHelpArea, QuickHelpFlags nFlags) override
static void KeyCodeToGdkKey(const vcl::KeyCode &rKeyCode, guint *pGdkKeyCode, GdkModifierType *pGdkModifiers)
guint m_nHudAwarenessId
Definition: gtkframe.hxx:331
OUString m_sWMClass
Definition: gtkframe.hxx:190
bool handleKeyEvent(GdkEventKey *pEvent)
GtkIMContext * m_pIMContext
Definition: gtkframe.hxx:137
GtkGrid * getTopLevelGridWidget() const
Definition: gtkframe.hxx:342
GtkSalFrame(SalFrame *pParent, SalFrameStyleFlags nStyle)
static gboolean signalMotion(GtkWidget *, GdkEventMotion *, gpointer)
static gboolean signalDragFailed(GtkWidget *widget, GdkDragContext *context, GtkDragResult result, gpointer frame)
virtual void GetWorkArea(tools::Rectangle &rRect) override
virtual void EndSetClipRegion() override
sal_uInt64 SalExtStyle
Definition: salframe.hxx:95
ttype
void startDrag(gint nButton, gint nDragOriginX, gint nDragOriginY, GdkDragAction sourceActions, GtkTargetList *pTargetList)
DECL_LINK(AsyncScroll, Timer *, void)
static void UpdateLastInputEventTime(guint32 nUserInputTime)
virtual void SetScreenNumber(unsigned int) override
static GdkEvent * makeFakeKeyPress(GtkWidget *pWidget)
void damaged(sal_Int32 nExtentsLeft, sal_Int32 nExtentsTop, sal_Int32 nExtentsRight, sal_Int32 nExtentsBottom) const
PreviousKeyPress(const PreviousKeyPress &rPrev)
Definition: gtkframe.hxx:109
static GtkSalFrame * getFromWindow(GtkWindow *pWindow)
void window_resize(long nWidth, long nHeight)
bool CallCallbackExc(SalEvent nEvent, const void *pEvent) const
bool operator==(GdkEventKey const *event) const
Definition: gtkframe.hxx:119
virtual void SetMinClientSize(long nWidth, long nHeight) override
GtkWidget * getWindow() const
Definition: gtkframe.hxx:338
void moveWindow(long nX, long nY)
void registerDropTarget(GtkDropTarget *pDropTarget)
Definition: gtkframe.hxx:351
virtual void ReleaseGraphics(SalGraphics *pGraphics) override
SalFrameToTop
Definition: salframe.hxx:43
virtual void SetApplicationID(const OUString &rWMClass) override
virtual void SetAlwaysOnTop(bool bOnTop) override
GType ooo_fixed_get_type()
GtkEventBox * getEventBox() const
Definition: gtkframe.hxx:340
static void signalDragDelete(GtkWidget *widget, GdkDragContext *context, gpointer frame)
virtual bool PostEvent(std::unique_ptr< ImplSVEvent > pData) override
void updateScreenNumber()
Size m_aMaxSize
Definition: gtkframe.hxx:194
static guint GetKeyValFor(GdkKeymap *pKeyMap, guint16 hardware_keycode, guint8 group)
virtual void CaptureMouse(bool bMouse) override
virtual void SetPointer(PointerStyle ePointerStyle) override
void HideTooltip()
GtkGrid * m_pTopLevelGrid
Definition: gtkframe.hxx:168
virtual SalPointerState GetPointerState() override
static gboolean signalDragDrop(GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint time, gpointer frame)
bool m_bGraphics
Definition: gtkframe.hxx:181
KeyIndicatorState
Definition: keycodes.hxx:180
void registerDragSource(GtkDragSource *pDragSource)
Definition: gtkframe.hxx:363
void widget_set_size_request(long nWidth, long nHeight)
QuickHelpFlags
Definition: help.hxx:32
sal_uIntPtr GdkNativeWindow
Definition: gtkframe.hxx:53
void Init(SalFrame *pParent, SalFrameStyleFlags nStyle)
virtual void SetTitle(const OUString &rTitle) override
GtkWidget * getMouseEventWidget() const
static guint32 GetLastInputEventTime()
static void signalIMPreeditEnd(GtkIMContext *, gpointer)
SalFrameGeometry maGeometry
absolute, unmirrored values
Definition: salframe.hxx:127
EndExtTextInputFlags
Definition: window.hxx:379
void closePopup()
FloatWinPopupFlags m_nFloatFlags
Definition: gtkframe.hxx:201
static void signalIMPreeditStart(GtkIMContext *, gpointer)
static void signalRealize(GtkWidget *, gpointer frame)
static sal_uInt16 GetMouseModCode(guint nState)
struct _cairo cairo_t
Definition: svpgdi.hxx:69
void grabPointer(bool bGrab, bool bOwnerEvents=false)
void endExtTextInput(EndExtTextInputFlags nFlags)
DamageHandler m_aDamageHandler
Definition: gtkframe.hxx:321
virtual OUString GetKeyName(sal_uInt16 nKeyCode) override
bool m_bSalObjectSetPosSize
Definition: gtkframe.hxx:325
virtual void Flush()=0
basegfx::B2IVector m_aFrameSize
Definition: gtkframe.hxx:320
static void signalDragLeave(GtkWidget *widget, GdkDragContext *context, guint time, gpointer frame)
static gboolean signalDraw(GtkWidget *, cairo_t *cr, gpointer)
static gboolean signalButton(GtkWidget *, GdkEventButton *, gpointer)
FloatWinPopupFlags
Definition: floatwin.hxx:31
GtkWidget * m_pWindow
Definition: gtkframe.hxx:166
SalEvent
Definition: salwtype.hxx:40
static void sizeAllocated(GtkWidget *, GdkRectangle *pAllocation, gpointer frame)
void SetScreen(unsigned int nNewScreen, SetType eType, tools::Rectangle const *pSize=nullptr)
cairo_surface_t * m_pSurface
Definition: gtkframe.hxx:319
virtual void StartPresentation(bool bStart) override
guint m_nWatcherId
Definition: gtkframe.hxx:218
long m_nWidthRequest
Definition: gtkframe.hxx:203
static gboolean signalDragMotion(GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint time, gpointer frame)
static gboolean signalKey(GtkWidget *, GdkEventKey *, gpointer)
virtual void GetClientSize(long &rWidth, long &rHeight) override
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:112
static GdkDisplay * getGdkDisplay()
static gboolean signalMap(GtkWidget *, GdkEvent *, gpointer)
static gboolean signalVisibility(GtkWidget *, GdkEventVisibility *, gpointer)
bool m_bDefaultSize
Definition: gtkframe.hxx:189
void resizeWindow(long nWidth, long nHeight)
bool m_bDefaultPos
Definition: gtkframe.hxx:188
virtual void SetPointerPos(long nX, long nY) override
GtkSalFrame * m_pFrame
Definition: gtkframe.hxx:134
cairo_region_t * m_pRegion
Definition: gtkframe.hxx:205
virtual bool SetPluginParent(SystemParentData *pNewParent) override
virtual bool UpdatePopover(void *nId, const OUString &rHelpText, vcl::Window *pParent, const tools::Rectangle &rHelpArea) override
virtual void SetModal(bool bModal) override
static void signalIMPreeditChanged(GtkIMContext *, gpointer)
void deregisterDropTarget(GtkDropTarget const *pDropTarget)
Definition: gtkframe.hxx:357
void InvalidateGraphics()
virtual sal_uIntPtr GetNativeWindowHandle() override
SalFrameStyleFlags
Definition: salframe.hxx:64
virtual void DrawMenuBar() override
static gboolean signalCrossing(GtkWidget *, GdkEventCrossing *, gpointer)
ScreenSaverInhibitor m_ScreenSaverInhibitor
Definition: gtkframe.hxx:185
GtkFixed * getFixedContainer() const
Definition: gtkframe.hxx:339
GtkSalMenu * m_pSalMenu
Definition: gtkframe.hxx:210
ModKeyFlags m_nKeyModifiers
Definition: gtkframe.hxx:182
static SalWheelMouseEvent GetWheelEvent(GdkEventScroll &rEvent)
virtual bool ShowTooltip(const OUString &rHelpText, const tools::Rectangle &rHelpArea) override
static void signalDragEnd(GtkWidget *widget, GdkDragContext *context, gpointer frame)
virtual void Beep() override
bool m_bSpanMonitorsWhenFullscreen
Definition: gtkframe.hxx:187
static void signalIMCommit(GtkIMContext *, gchar *, gpointer)
bool isChild(bool bPlug=true, bool bSysChild=true)
Definition: gtkframe.hxx:287
static GdkNativeWindow findTopLevelSystemWindow(GdkNativeWindow aWindow)
static gboolean signalUnmap(GtkWidget *, GdkEvent *, gpointer)
Idle m_aSmoothScrollIdle
Definition: gtkframe.hxx:323
bool m_bFloatPositioned
Definition: gtkframe.hxx:202
virtual void SetIcon(sal_uInt16 nIcon) override
static void signalStyleUpdated(GtkWidget *, gpointer)
guint m_nMenuExportId
Definition: gtkframe.hxx:329
AtkObject * ooo_fixed_get_accessible(GtkWidget *obj)
virtual void SetExtendedFrameStyle(SalExtStyle nExtStyle) override
PointerStyle
Definition: ptrstyle.hxx:25
int GetDisplayScreen() const
Definition: gtkframe.hxx:344
void addGrabLevel()
void SetDefaultSize()
SystemEnvData m_aSystemData
Definition: gtkframe.hxx:179
static gboolean signalConfigure(GtkWidget *, GdkEventConfigure *, gpointer)
std::unique_ptr< IMHandler > m_pIMHandler
Definition: gtkframe.hxx:192
virtual void UpdateSettings(AllSettings &rSettings) override
virtual SalGraphics * AcquireGraphics() override
void TriggerPaintEvent()
virtual bool GetWindowState(SalFrameState *pState) override
static gboolean signalTooltipQuery(GtkWidget *, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip, gpointer frame)
virtual void ToTop(SalFrameToTop nFlags) override
static gboolean signalScroll(GtkWidget *, GdkEvent *, gpointer)
std::list< GtkSalFrame * > m_aChildren
Definition: gtkframe.hxx:177
Definition: timer.hxx:26
virtual weld::Window * GetFrameWeld() const override
Size m_aMinSize
Definition: gtkframe.hxx:195
void AllocateFrame()
tools::Rectangle m_aHelpArea
Definition: gtkframe.hxx:199
SalX11Screen m_nXScreen
Definition: gtkframe.hxx:165
static gboolean signalFocus(GtkWidget *, GdkEventFocus *, gpointer)
static int m_nFloats
Definition: gtkframe.hxx:277
GdkWindowState m_nState
Definition: gtkframe.hxx:178
struct _cairo_surface cairo_surface_t
Definition: svpgdi.hxx:70
virtual void ResetClipRegion() override
const SalX11Screen & getXScreenNumber() const
Definition: gtkframe.hxx:343
virtual LanguageType GetInputLanguage() override
virtual void SetInputContext(SalInputContext *pContext) override
tools::Rectangle m_aFloatRect
Definition: gtkframe.hxx:200
virtual void BeginSetClipRegion(sal_uInt32 nRects) override
int m_nGrabLevel
Definition: gtkframe.hxx:324
virtual void SetWindowState(const SalFrameState *pState) override
void focusChanged(bool bFocusIn)
void InitCommon()
bool m_bFullscreen
Definition: gtkframe.hxx:186
unsigned int nDisplayScreenNumber
Definition: salgeom.hxx:37
An idle is a timer to be scheduled immediately.
Definition: idle.hxx:30
void LaunchAsyncScroll(GdkEvent const *pEvent)
static GtkSalDisplay * getDisplay()
bool m_bGeometryIsProvisional
Definition: gtkframe.hxx:208
GdkCursor * m_pCurrentCursor
Definition: gtkframe.hxx:183
virtual ~GtkSalFrame() override
virtual void SetPosSize(long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags) override
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo
SalFrameStyleFlags m_nStyle
Definition: gtkframe.hxx:175