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 final : 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 
168  GtkWidget* m_pWindow;
169  GtkHeaderBar* m_pHeaderBar;
170  GtkGrid* m_pTopLevelGrid;
171  GtkEventBox* m_pEventBox;
172  GtkFixed* m_pFixedContainer;
173  GdkWindow* m_pForeignParent;
175  GdkWindow* m_pForeignTopLevel;
179  std::list< GtkSalFrame* > m_aChildren;
180  GdkWindowState m_nState;
182  std::unique_ptr<GtkSalGraphics> m_pGraphics;
185  GdkCursor *m_pCurrentCursor;
194  OUString m_sWMClass;
195 
196  std::unique_ptr<IMHandler> m_pIMHandler;
197 
201 
202  OUString m_aTooltip;
209  cairo_region_t* m_pRegion;
214 
216 
217 #if ENABLE_DBUS && ENABLE_GIO
218  private:
219  friend void ensure_dbus_setup(GdkWindow* gdkWindow, GtkSalFrame* pSalFrame);
220  friend void on_registrar_available (GDBusConnection*, const gchar*, const gchar*, gpointer);
221  friend void on_registrar_unavailable (GDBusConnection*, const gchar*, gpointer);
222 #endif
224 
225  void Init( SalFrame* pParent, SalFrameStyleFlags nStyle );
226  void Init( SystemParentData* pSysData );
227  void InitCommon();
228  void InvalidateGraphics();
229 
230  // signals
231  static gboolean signalButton( GtkWidget*, GdkEventButton*, gpointer );
232  static void signalStyleUpdated(GtkWidget*, gpointer);
233  static gboolean signalDraw( GtkWidget*, cairo_t *cr, gpointer );
234  static void signalRealize(GtkWidget*, gpointer frame);
235  static void sizeAllocated(GtkWidget*, GdkRectangle *pAllocation, gpointer frame);
236  static gboolean signalTooltipQuery(GtkWidget*, gint x, gint y,
237  gboolean keyboard_mode, GtkTooltip *tooltip,
238  gpointer frame);
239  static gboolean signalDragMotion(GtkWidget *widget, GdkDragContext *context, gint x, gint y,
240  guint time, gpointer frame);
241  static gboolean signalDragDrop(GtkWidget* widget, GdkDragContext *context, gint x, gint y,
242  guint time, gpointer frame);
243  static void signalDragDropReceived(GtkWidget *widget, GdkDragContext *context, gint x, gint y,
244  GtkSelectionData *data, guint ttype, guint time, gpointer frame);
245  static void signalDragLeave(GtkWidget *widget, GdkDragContext *context, guint time, gpointer frame);
246 
247  static gboolean signalDragFailed(GtkWidget *widget, GdkDragContext *context, GtkDragResult result, gpointer frame);
248  static void signalDragDelete(GtkWidget *widget, GdkDragContext *context, gpointer frame);
249  static void signalDragEnd(GtkWidget *widget, GdkDragContext *context, gpointer frame);
250  static void signalDragDataGet(GtkWidget* widget, GdkDragContext* context, GtkSelectionData *data, guint info,
251  guint time, gpointer frame);
252 
253  static void gestureSwipe(GtkGestureSwipe* gesture, gdouble velocity_x, gdouble velocity_y, gpointer frame);
254  static void gestureLongPress(GtkGestureLongPress* gesture, gdouble x, gdouble y, gpointer frame);
255  static gboolean signalFocus( GtkWidget*, GdkEventFocus*, gpointer );
256  static void signalSetFocus( GtkWindow* pWindow, GtkWidget* pWidget, gpointer frame );
257  static gboolean signalMap( GtkWidget*, GdkEvent*, gpointer );
258  static gboolean signalUnmap( GtkWidget*, GdkEvent*, gpointer );
259  static gboolean signalConfigure( GtkWidget*, GdkEventConfigure*, gpointer );
260  static gboolean signalMotion( GtkWidget*, GdkEventMotion*, gpointer );
261  static gboolean signalKey( GtkWidget*, GdkEventKey*, gpointer );
262  static gboolean signalDelete( GtkWidget*, GdkEvent*, gpointer );
263  static gboolean signalWindowState( GtkWidget*, GdkEvent*, gpointer );
264  static gboolean signalScroll( GtkWidget*, GdkEvent*, gpointer );
265  static gboolean signalCrossing( GtkWidget*, GdkEventCrossing*, gpointer );
266  static gboolean signalVisibility( GtkWidget*, GdkEventVisibility*, gpointer );
267  static void signalDestroy( GtkWidget*, gpointer );
268 
269  void Center();
270  void SetDefaultSize();
271 
272  bool doKeyCallback( guint state,
273  guint keyval,
274  guint16 hardware_keycode,
275  guint8 group,
276  sal_Unicode aOrigCode,
277  bool bDown,
278  bool bSendRelease
279  );
280 
282 
283  static int m_nFloats;
284 
285  bool isFloatGrabWindow() const
286  {
287  return
288  (m_nStyle & SalFrameStyleFlags::FLOAT) && // only a float can be floatgrab
289  !(m_nStyle & SalFrameStyleFlags::TOOLTIP) && // tool tips are not
290  !(m_nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION); // toolbars are also not
291  }
292 
293  bool isChild( bool bPlug = true, bool bSysChild = true )
294  {
296  if( bPlug )
297  nMask |= SalFrameStyleFlags::PLUG;
298  if( bSysChild )
300  return bool(m_nStyle & nMask);
301  }
302 
303  //call gtk_window_resize
304  void window_resize(long nWidth, long nHeight);
305  //call gtk_widget_set_size_request
306  void widget_set_size_request(long nWidth, long nHeight);
307 
308  void resizeWindow( long nWidth, long nHeight );
309  void moveWindow( long nX, long nY );
310 
312 
313  void setMinMaxSize();
314 
315  void AllocateFrame();
316  void TriggerPaintEvent();
317 
318  void updateWMClass();
319 
321 
322  void SetScreen( unsigned int nNewScreen, SetType eType, tools::Rectangle const *pSize = nullptr );
323 
324  void SetIcon(const char* pIcon);
325 
326 public:
330  std::vector<GdkEvent*> m_aPendingScrollEvents;
334  GtkSalFrame( SalFrame* pParent, SalFrameStyleFlags nStyle );
335  GtkSalFrame( SystemParentData* pSysData );
336 
340  std::vector<gulong> m_aMouseSignalIds;
341 
342  void grabPointer(bool bGrab, bool bKeyboardAlso, bool bOwnerEvents);
343 
344  static GtkSalDisplay* getDisplay();
345  static GdkDisplay* getGdkDisplay();
346  GtkWidget* getWindow() const { return m_pWindow; }
347  GtkFixed* getFixedContainer() const { return m_pFixedContainer; }
348  GtkEventBox* getEventBox() const { return m_pEventBox; }
349  GtkWidget* getMouseEventWidget() const;
350  GtkGrid* getTopLevelGridWidget() const { return m_pTopLevelGrid; }
351  const SalX11Screen& getXScreenNumber() const { return m_nXScreen; }
353  void updateScreenNumber();
354 
355  cairo_t* getCairoContext() const;
356  void damaged(sal_Int32 nExtentsLeft, sal_Int32 nExtentsTop,
357  sal_Int32 nExtentsRight, sal_Int32 nExtentsBottom) const;
358 
360  {
361  assert(!m_pDropTarget);
362  m_pDropTarget = pDropTarget;
363  }
364 
365  void deregisterDropTarget(GtkDropTarget const * pDropTarget)
366  {
367  assert(m_pDropTarget == pDropTarget); (void)pDropTarget;
368  m_pDropTarget = nullptr;
369  }
370 
372  {
373  assert(!m_pDragSource);
374  m_pDragSource = pDragSource;
375  }
376 
377  void deregisterDragSource(GtkDragSource const * pDragSource)
378  {
379  assert(m_pDragSource == pDragSource); (void)pDragSource;
380  m_pDragSource = nullptr;
381  }
382 
383  void startDrag(gint nButton, gint nDragOriginX, gint nDragOriginY,
384  GdkDragAction sourceActions, GtkTargetList* pTargetList);
385 
386  void closePopup();
387 
388  void addGrabLevel();
389  void removeGrabLevel();
390 
391  void nopaint_container_resize_children(GtkContainer*);
392 
393  void LaunchAsyncScroll(GdkEvent const * pEvent);
394  DECL_LINK(AsyncScroll, Timer *, void);
395 
396  virtual ~GtkSalFrame() override;
397 
398  // SalGraphics or NULL, but two Graphics for all SalFrames
399  // must be returned
400  virtual SalGraphics* AcquireGraphics() override;
401  virtual void ReleaseGraphics( SalGraphics* pGraphics ) override;
402 
403  // Event must be destroyed, when Frame is destroyed
404  // When Event is called, SalInstance::Yield() must be returned
405  virtual bool PostEvent(std::unique_ptr<ImplSVEvent> pData) override;
406 
407  virtual void SetTitle( const OUString& rTitle ) override;
408  virtual void SetIcon( sal_uInt16 nIcon ) override;
409  virtual void SetMenu( SalMenu *pSalMenu ) override;
410  SalMenu* GetMenu();
411  virtual void DrawMenuBar() override;
412  void EnsureAppMenuWatch();
413 
414  virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle ) override;
415  // Before the window is visible, a resize event
416  // must be sent with the correct size
417  virtual void Show( bool bVisible, bool bNoActivate = false ) override;
418  // Set ClientSize and Center the Window to the desktop
419  // and send/post a resize message
420  virtual void SetMinClientSize( long nWidth, long nHeight ) override;
421  virtual void SetMaxClientSize( long nWidth, long nHeight ) override;
422  virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) override;
423  virtual void GetClientSize( long& rWidth, long& rHeight ) override;
424  virtual void GetWorkArea( tools::Rectangle& rRect ) override;
425  virtual SalFrame* GetParent() const override;
426  virtual void SetWindowState( const SalFrameState* pState ) override;
427  virtual bool GetWindowState( SalFrameState* pState ) override;
428  virtual void ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) override;
429  // Enable/Disable ScreenSaver, SystemAgents, ...
430  virtual void StartPresentation( bool bStart ) override;
431  // Show Window over all other Windows
432  virtual void SetAlwaysOnTop( bool bOnTop ) override;
433 
434  // Window to top and grab focus
435  virtual void ToTop( SalFrameToTop nFlags ) override;
436 
437  // this function can call with the same
438  // pointer style
439  virtual void SetPointer( PointerStyle ePointerStyle ) override;
440  virtual void CaptureMouse( bool bMouse ) override;
441  virtual void GrabFocus() override;
442  virtual void SetPointerPos( long nX, long nY ) override;
443 
444  // flush output buffer
445  using SalFrame::Flush;
446  virtual void Flush() override;
447  // flush output buffer, wait till outstanding operations are done
448 
449  virtual void SetInputContext( SalInputContext* pContext ) override;
450  virtual void EndExtTextInput( EndExtTextInputFlags nFlags ) override;
451 
452  virtual OUString GetKeyName( sal_uInt16 nKeyCode ) override;
453  virtual bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, vcl::KeyCode& rKeyCode ) override;
454 
455  // returns the input language used for the last key stroke
456  // may be LANGUAGE_DONTKNOW if not supported by the OS
457  virtual LanguageType GetInputLanguage() override;
458 
459  virtual void UpdateSettings( AllSettings& rSettings ) override;
460 
461  virtual void Beep() override;
462 
463  // returns system data (most prominent: window handle)
464  virtual const SystemEnvData* GetSystemData() const override;
465 
466  // get current modifier and button mask
467  virtual SalPointerState GetPointerState() override;
468 
469  virtual KeyIndicatorState GetIndicatorState() override;
470 
471  virtual void SimulateKeyPress( sal_uInt16 nKeyCode ) override;
472 
473  // set new parent window
474  virtual void SetParent( SalFrame* pNewParent ) override;
475  // reparent window to act as a plugin; implementation
476  // may choose to use a new system window internally
477  // return false to indicate failure
478  virtual bool SetPluginParent( SystemParentData* pNewParent ) override;
479 
480  virtual void SetScreenNumber( unsigned int ) override;
481  virtual void SetApplicationID( const OUString &rWMClass ) override;
482 
483  // shaped system windows
484  // set clip region to none (-> rectangular windows, normal state)
485  virtual void ResetClipRegion() override;
486  // start setting the clipregion consisting of nRects rectangles
487  virtual void BeginSetClipRegion( sal_uInt32 nRects ) override;
488  // add a rectangle to the clip region
489  virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) override;
490  // done setting up the clipregion
491  virtual void EndSetClipRegion() override;
492 
493  virtual void PositionByToolkit(const tools::Rectangle& rRect, FloatWinPopupFlags nFlags) override;
494  virtual void SetModal(bool bModal) override;
495  virtual bool GetModal() const override;
496  void HideTooltip();
497  void BlockTooltip();
498  void UnblockTooltip();
499  virtual bool ShowTooltip(const OUString& rHelpText, const tools::Rectangle& rHelpArea) override;
500  virtual void* ShowPopover(const OUString& rHelpText, vcl::Window* pParent, const tools::Rectangle& rHelpArea, QuickHelpFlags nFlags) override;
501  virtual bool UpdatePopover(void* nId, const OUString& rHelpText, vcl::Window* pParent, const tools::Rectangle& rHelpArea) override;
502  virtual bool HidePopover(void* nId) override;
503  virtual weld::Window* GetFrameWeld() const override;
504 
505  static GtkSalFrame *getFromWindow( GtkWidget *pWindow );
506 
507  sal_uIntPtr GetNativeWindowHandle(GtkWidget *pWidget);
508  virtual sal_uIntPtr GetNativeWindowHandle() override;
509 
510  //Call the usual SalFrame Callback, but catch uno exceptions and delegate
511  //to GtkSalData to rethrow them after the gsignal is processed when its safe
512  //to do so again in our own code after the g_main_context_iteration call
513  //which triggers the gsignals.
514  bool CallCallbackExc(SalEvent nEvent, const void* pEvent) const;
515 
516 
517  static void KeyCodeToGdkKey(const vcl::KeyCode& rKeyCode,
518  guint* pGdkKeyCode, GdkModifierType *pGdkModifiers);
519 
520  static guint32 GetLastInputEventTime();
521  static void UpdateLastInputEventTime(guint32 nUserInputTime);
522  static sal_uInt16 GetMouseModCode(guint nState);
523  static sal_uInt16 GetKeyCode(guint nKeyVal);
524  static guint GetKeyValFor(GdkKeymap* pKeyMap, guint16 hardware_keycode, guint8 group);
525  static sal_uInt16 GetKeyModCode(guint nState);
526  static GdkEvent* makeFakeKeyPress(GtkWidget* pWidget);
527  static SalWheelMouseEvent GetWheelEvent(const GdkEventScroll& rEvent);
528  static gboolean NativeWidgetHelpPressed(GtkAccelGroup*, GObject*, guint,
529  GdkModifierType, gpointer pFrame);
530  static OUString GetPreeditDetails(GtkIMContext* pIMContext, std::vector<ExtTextInputAttr>& rInputFlags, sal_Int32& rCursorPos, sal_uInt8& rCursorFlags);
531 
532  void DisallowCycleFocusOut();
533 };
534 
535 #define OOO_TYPE_FIXED ooo_fixed_get_type()
536 
537 extern "C" {
538 
539 GType ooo_fixed_get_type();
540 AtkObject* ooo_fixed_get_accessible(GtkWidget *obj);
541 
542 } // extern "C"
543 
544 #if !GTK_CHECK_VERSION(3, 22, 0)
546 {
556 };
557 #endif
558 
559 #endif // INCLUDED_VCL_INC_UNX_GTK_GTKFRAME_HXX
560 
561 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
tools::Rectangle m_aRestorePosSize
Definition: gtkframe.hxx:200
GdkNativeWindow m_aForeignTopLevelWindow
Definition: gtkframe.hxx:176
virtual bool HidePopover(void *nId) override
GdkNativeWindow m_aForeignParentWindow
Definition: gtkframe.hxx:174
guint m_nActionGroupExportId
Definition: gtkframe.hxx:338
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:285
void deregisterDragSource(GtkDragSource const *pDragSource)
Definition: gtkframe.hxx:377
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:210
virtual void SetParent(SalFrame *pNewParent) override
SalMenu * GetMenu()
Size calcDefaultSize()
GtkHeaderBar * m_pHeaderBar
Definition: gtkframe.hxx:169
std::vector< gulong > m_aMouseSignalIds
Definition: gtkframe.hxx:340
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:202
long m_nHeightRequest
Definition: gtkframe.hxx:208
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:182
SalExtTextInputEvent m_aInputEvent
Definition: gtkframe.hxx:140
std::vector< GdkEvent * > m_aPendingScrollEvents
Definition: gtkframe.hxx:330
std::vector< ExtTextInputAttr > m_aInputFlags
Definition: gtkframe.hxx:141
GtkDragSource * m_pDragSource
Definition: gtkframe.hxx:211
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:171
virtual KeyIndicatorState GetIndicatorState() override
gulong m_nSetFocusSignalId
Definition: gtkframe.hxx:188
GdkWindow * m_pForeignParent
Definition: gtkframe.hxx:173
void updateWMClass()
GtkFixed * m_pFixedContainer
Definition: gtkframe.hxx:172
GdkWindow * m_pForeignTopLevel
Definition: gtkframe.hxx:175
std::list< PreviousKeyPress > m_aPrevKeyPresses
Definition: gtkframe.hxx:135
static gboolean signalIMDeleteSurrounding(GtkIMContext *, gint, gint, gpointer)
static GtkSalFrame * getFromWindow(GtkWidget *pWindow)
virtual void SetMenu(SalMenu *pSalMenu) override
GtkSalFrame * m_pParent
Definition: gtkframe.hxx:178
PointerStyle m_ePointerStyle
Definition: gtkframe.hxx:186
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:339
OUString m_sWMClass
Definition: gtkframe.hxx:194
bool handleKeyEvent(GdkEventKey *pEvent)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
GtkIMContext * m_pIMContext
Definition: gtkframe.hxx:137
GtkGrid * getTopLevelGridWidget() const
Definition: gtkframe.hxx:350
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
void grabPointer(bool bGrab, bool bKeyboardAlso, bool bOwnerEvents)
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 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:109
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:346
void moveWindow(long nX, long nY)
void registerDropTarget(GtkDropTarget *pDropTarget)
Definition: gtkframe.hxx:359
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()
void UnblockTooltip()
GtkEventBox * getEventBox() const
Definition: gtkframe.hxx:348
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:198
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:170
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:183
KeyIndicatorState
Definition: keycodes.hxx:180
void registerDragSource(GtkDragSource *pDragSource)
Definition: gtkframe.hxx:371
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:385
void closePopup()
FloatWinPopupFlags m_nFloatFlags
Definition: gtkframe.hxx:205
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:329
virtual OUString GetKeyName(sal_uInt16 nKeyCode) override
bool m_bSalObjectSetPosSize
Definition: gtkframe.hxx:333
virtual void Flush()=0
basegfx::B2IVector m_aFrameSize
Definition: gtkframe.hxx:328
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
GdkAnchorHints
Definition: gtkframe.hxx:545
GtkWidget * m_pWindow
Definition: gtkframe.hxx:168
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:327
virtual void StartPresentation(bool bStart) override
guint m_nWatcherId
Definition: gtkframe.hxx:223
long m_nWidthRequest
Definition: gtkframe.hxx:207
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:192
void resizeWindow(long nWidth, long nHeight)
bool m_bDefaultPos
Definition: gtkframe.hxx:191
virtual void SetPointerPos(long nX, long nY) override
GtkSalFrame * m_pFrame
Definition: gtkframe.hxx:134
cairo_region_t * m_pRegion
Definition: gtkframe.hxx:209
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:365
unsigned char sal_uInt8
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:187
GtkFixed * getFixedContainer() const
Definition: gtkframe.hxx:347
GtkSalMenu * m_pSalMenu
Definition: gtkframe.hxx:215
ModKeyFlags m_nKeyModifiers
Definition: gtkframe.hxx:184
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:190
static void signalIMCommit(GtkIMContext *, gchar *, gpointer)
bool isChild(bool bPlug=true, bool bSysChild=true)
Definition: gtkframe.hxx:293
static GdkNativeWindow findTopLevelSystemWindow(GdkNativeWindow aWindow)
static gboolean signalUnmap(GtkWidget *, GdkEvent *, gpointer)
Idle m_aSmoothScrollIdle
Definition: gtkframe.hxx:331
bool m_bFloatPositioned
Definition: gtkframe.hxx:206
static void signalStyleUpdated(GtkWidget *, gpointer)
guint m_nMenuExportId
Definition: gtkframe.hxx:337
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:213
int GetDisplayScreen() const
Definition: gtkframe.hxx:352
void addGrabLevel()
void SetDefaultSize()
SystemEnvData m_aSystemData
Definition: gtkframe.hxx:181
static gboolean signalConfigure(GtkWidget *, GdkEventConfigure *, gpointer)
std::unique_ptr< IMHandler > m_pIMHandler
Definition: gtkframe.hxx:196
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:193
virtual void ToTop(SalFrameToTop nFlags) override
static gboolean signalScroll(GtkWidget *, GdkEvent *, gpointer)
std::list< GtkSalFrame * > m_aChildren
Definition: gtkframe.hxx:179
Definition: timer.hxx:26
virtual weld::Window * GetFrameWeld() const override
void BlockTooltip()
Size m_aMinSize
Definition: gtkframe.hxx:199
void AllocateFrame()
tools::Rectangle m_aHelpArea
Definition: gtkframe.hxx:203
SalX11Screen m_nXScreen
Definition: gtkframe.hxx:167
static gboolean signalFocus(GtkWidget *, GdkEventFocus *, gpointer)
static int m_nFloats
Definition: gtkframe.hxx:283
GdkWindowState m_nState
Definition: gtkframe.hxx:180
struct _cairo_surface cairo_surface_t
Definition: svpgdi.hxx:71
virtual void ResetClipRegion() override
const SalX11Screen & getXScreenNumber() const
Definition: gtkframe.hxx:351
virtual LanguageType GetInputLanguage() override
virtual void SetInputContext(SalInputContext *pContext) override
tools::Rectangle m_aFloatRect
Definition: gtkframe.hxx:204
virtual void BeginSetClipRegion(sal_uInt32 nRects) override
int m_nGrabLevel
Definition: gtkframe.hxx:332
virtual void SetWindowState(const SalFrameState *pState) override
void focusChanged(bool bFocusIn)
void InitCommon()
bool m_bFullscreen
Definition: gtkframe.hxx:189
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:212
GdkCursor * m_pCurrentCursor
Definition: gtkframe.hxx:185
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:177