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