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 <gtk/gtk.h>
26#if !GTK_CHECK_VERSION(4,0,0)
27#include <gtk/gtkx.h>
28#endif
29#include <gdk/gdkkeysyms.h>
30
31#include <salframe.hxx>
32#include <vcl/idle.hxx>
33#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#include "gtkdata.hxx"
53
54class GtkSalGraphics;
55class GtkSalDisplay;
56
57typedef sal_uIntPtr GdkNativeWindow;
60class GtkDnDTransferable;
61
62class GtkSalMenu;
63
64struct VclToGtkHelper;
65
66class GtkSalFrame final : public SalFrame
67{
68 struct IMHandler
69 {
70
71#if !GTK_CHECK_VERSION(4, 0, 0)
72 // Not all GTK Input Methods swallow key release
73 // events. Since they swallow the key press events and we
74 // are left with the key release events, we need to
75 // manually swallow those. To do this, we keep a list of
76 // the previous 10 key press events in each GtkSalFrame
77 // and when we get a key release that matches one of the
78 // key press events in our list, we swallow it.
80 {
81 GdkWindow *window;
83 guint32 time;
84 guint state;
85 guint keyval;
87 guint8 group;
88
89 PreviousKeyPress (GdkEventKey *event)
90 : window (nullptr),
91 send_event (0),
92 time (0),
93 state (0),
94 keyval (0),
96 group (0)
97 {
98 if (event)
99 {
100 window = event->window;
101 send_event = event->send_event;
102 time = event->time;
103 state = event->state;
104 keyval = event->keyval;
105 hardware_keycode = event->hardware_keycode;
106 group = event->group;
107 }
108 }
109
111 : window( rPrev.window ),
112 send_event( rPrev.send_event ),
113 time( rPrev.time ),
114 state( rPrev.state ),
115 keyval( rPrev.keyval ),
117 group( rPrev.group )
118 {}
119
120 bool operator== (GdkEventKey const *event) const
121 {
122 return (event != nullptr)
123 && (event->window == window)
124 && (event->send_event == send_event)
125 // ignore non-Gdk state bits, e.g., these used by IBus
126 && ((event->state & GDK_MODIFIER_MASK) == (state & GDK_MODIFIER_MASK))
127 && (event->keyval == keyval)
128 && (event->hardware_keycode == hardware_keycode)
129 && (event->group == group)
130 && (event->time - time < 300)
131 ;
132 }
133 };
134#endif
135
137#if !GTK_CHECK_VERSION(4, 0, 0)
138 std::list< PreviousKeyPress > m_aPrevKeyPresses;
139#endif
140 int m_nPrevKeyPresses; // avoid using size()
141 GtkIMContext* m_pIMContext;
145 std::vector< ExtTextInputAttr > m_aInputFlags;
146
149
154#if !GTK_CHECK_VERSION(4, 0, 0)
155 bool handleKeyEvent( GdkEventKey* pEvent );
156#endif
157 void focusChanged( bool bFocusIn );
158
161
162 static void signalIMCommit( GtkIMContext*, gchar*, gpointer );
163 static gboolean signalIMDeleteSurrounding( GtkIMContext*, gint, gint, gpointer );
164 static void signalIMPreeditChanged( GtkIMContext*, gpointer );
165 static void signalIMPreeditEnd( GtkIMContext*, gpointer );
166 static void signalIMPreeditStart( GtkIMContext*, gpointer );
167 static gboolean signalIMRetrieveSurrounding( GtkIMContext*, gpointer );
168 };
169 friend struct IMHandler;
170
172
175 GtkHeaderBar* m_pHeaderBar;
177#if !GTK_CHECK_VERSION(4, 0, 0)
178 GtkEventBox* m_pEventBox;
180 GtkFixed* m_pDrawingArea;
181#else
182 GtkOverlay* m_pOverlay;
183 GtkFixed* m_pFixedContainer;
184 GtkDrawingArea* m_pDrawingArea;
185 GtkEventControllerKey* m_pKeyController;
186 gulong m_nSettingChangedSignalId;
187#endif
190#if !GTK_CHECK_VERSION(4, 0, 0)
195#endif
198 std::list< GtkSalFrame* > m_aChildren;
201 std::unique_ptr<GtkSalGraphics> m_pGraphics;
211 OUString m_sWMClass;
212
213 std::unique_ptr<IMHandler> m_pIMHandler;
214
218
219 OUString m_aTooltip;
226 cairo_region_t* m_pRegion;
231
233
234#if ENABLE_DBUS && ENABLE_GIO
235 private:
236 friend void on_registrar_available (GDBusConnection*, const gchar*, const gchar*, gpointer);
237 friend void on_registrar_unavailable (GDBusConnection*, const gchar*, gpointer);
238#endif
240
241 void Init( SalFrame* pParent, SalFrameStyleFlags nStyle );
242 void Init( SystemParentData* pSysData );
245
246 // signals
247#if !GTK_CHECK_VERSION(4, 0, 0)
248 static gboolean signalButton( GtkWidget*, GdkEventButton*, gpointer );
249 static void signalStyleUpdated(GtkWidget*, gpointer);
250#else
251 static void signalStyleUpdated(GtkWidget*, const gchar* pSetting, pointer);
252#endif
253 void DrawingAreaResized(GtkWidget* pWidget, int nWidth, int nHeight);
255#if !GTK_CHECK_VERSION(4, 0, 0)
256 static gboolean signalDraw( GtkWidget*, cairo_t *cr, gpointer );
257 static void sizeAllocated(GtkWidget*, GdkRectangle *pAllocation, gpointer frame);
258#else
259 static void signalDraw(GtkDrawingArea*, cairo_t *cr, int width, int height, gpointer);
260 static void sizeAllocated(GtkWidget*, int nWidth, int nHeight, gpointer frame);
261#endif
262 static void signalRealize(GtkWidget*, gpointer frame);
263 static gboolean signalTooltipQuery(GtkWidget*, gint x, gint y,
264 gboolean keyboard_mode, GtkTooltip *tooltip,
265 gpointer frame);
266#if GTK_CHECK_VERSION(4, 0, 0)
267 static GdkDragAction signalDragMotion(GtkDropTargetAsync *dest, GdkDrop *drop, double x, double y, gpointer frame);
268 static void signalDragLeave(GtkDropTargetAsync *dest, GdkDrop *drop, gpointer frame);
269 static gboolean signalDragDrop(GtkDropTargetAsync* context, GdkDrop* drop, double x, double y, gpointer frame);
270
271 static void signalDragFailed(GdkDrag* drag, GdkDragCancelReason reason, gpointer frame);
272 static void signalDragDelete(GdkDrag* drag, gpointer frame);
273 static void signalDragEnd(GdkDrag* drag, gpointer frame);
274#else
275 static gboolean signalDragMotion(GtkWidget *widget, GdkDragContext *context, gint x, gint y,
276 guint time, gpointer frame);
277 static gboolean signalDragDrop(GtkWidget* widget, GdkDragContext *context, gint x, gint y,
278 guint time, gpointer frame);
279 static void signalDragDropReceived(GtkWidget *widget, GdkDragContext *context, gint x, gint y,
280 GtkSelectionData *data, guint ttype, guint time, gpointer frame);
281 static void signalDragLeave(GtkWidget *widget, GdkDragContext *context, guint time, gpointer frame);
282
283 static gboolean signalDragFailed(GtkWidget *widget, GdkDragContext *context, GtkDragResult result, gpointer frame);
284 static void signalDragDelete(GtkWidget *widget, GdkDragContext *context, gpointer frame);
285 static void signalDragEnd(GtkWidget *widget, GdkDragContext *context, gpointer frame);
286 static void signalDragDataGet(GtkWidget* widget, GdkDragContext* context, GtkSelectionData *data, guint info,
287 guint time, gpointer frame);
288
289#endif
290 static void gestureSwipe(GtkGestureSwipe* gesture, gdouble velocity_x, gdouble velocity_y, gpointer frame);
291 static void gestureLongPress(GtkGestureLongPress* gesture, gdouble x, gdouble y, gpointer frame);
292 bool DrawingAreaButton(SalEvent nEventType, int nEventX, int nEventY, int nButton, guint32 nTime, guint nState);
293#if GTK_CHECK_VERSION(4, 0, 0)
294 static void gesturePressed(GtkGestureClick* gesture, int n_press, gdouble x, gdouble y, gpointer frame);
295 static void gestureReleased(GtkGestureClick* gesture, int n_press, gdouble x, gdouble y, gpointer frame);
296 void gestureButton(GtkGestureClick* gesture, SalEvent nEventType, gdouble x, gdouble y);
297#endif
299#if GTK_CHECK_VERSION(4, 0, 0)
300 static void signalFocusEnter(GtkEventControllerFocus* pController, gpointer frame);
301 static void signalFocusLeave(GtkEventControllerFocus* pController, gpointer frame);
302#else
303 static gboolean signalFocus( GtkWidget*, GdkEventFocus*, gpointer );
304#endif
305#if !GTK_CHECK_VERSION(4, 0, 0)
306 static void signalSetFocus(GtkWindow* pWindow, GtkWidget* pWidget, gpointer frame);
307#else
308 static void signalSetFocus(GtkWindow* pWindow, GParamSpec* pSpec, gpointer frame);
309#endif
310 void WindowMap();
313 void DrawingAreaMotion(int nEventX, int nEventY, guint32 nTime, guint nState);
314 void DrawingAreaCrossing(SalEvent nEventType, int nEventX, int nEventY, guint32 nTime, guint nState);
315 void DrawingAreaScroll(double delta_x, double delta_y, int nEventX, int nEventY, guint32 nTime, guint nState);
316#if GTK_CHECK_VERSION(4, 0, 0)
317 bool DrawingAreaKey(GtkEventControllerKey* pController, SalEvent nEventType, guint keyval, guint keycode, guint nState);
318
319 static void signalMap(GtkWidget*, gpointer);
320 static void signalUnmap(GtkWidget*, gpointer);
321
322 static gboolean signalDelete(GtkWidget*, gpointer);
323
324 static void signalMotion(GtkEventControllerMotion *controller, double x, double y, gpointer);
325
326 static gboolean signalScroll(GtkEventControllerScroll* pController, double delta_x, double delta_y, gpointer);
327
328 static void signalEnter(GtkEventControllerMotion *controller, double x, double y, gpointer);
329 static void signalLeave(GtkEventControllerMotion *controller, gpointer);
330
331 static gboolean signalKeyPressed(GtkEventControllerKey *controller, guint keyval, guint keycode, GdkModifierType state, gpointer);
332 static gboolean signalKeyReleased(GtkEventControllerKey *controller, guint keyval, guint keycode, GdkModifierType state, gpointer);
333
334 static void signalWindowState(GdkToplevel*, GParamSpec*, gpointer);
335#else
336 static gboolean signalMap( GtkWidget*, GdkEvent*, gpointer );
337 static gboolean signalUnmap( GtkWidget*, GdkEvent*, gpointer );
338
339 static gboolean signalDelete( GtkWidget*, GdkEvent*, gpointer );
340
341 static gboolean signalMotion( GtkWidget*, GdkEventMotion*, gpointer );
342
343 static gboolean signalScroll( GtkWidget*, GdkEvent*, gpointer );
344
345 static gboolean signalCrossing( GtkWidget*, GdkEventCrossing*, gpointer );
346
347 static gboolean signalKey( GtkWidget*, GdkEventKey*, gpointer );
348
349 static gboolean signalWindowState( GtkWidget*, GdkEvent*, gpointer );
350#endif
351#if !GTK_CHECK_VERSION(4, 0, 0)
352 static gboolean signalConfigure( GtkWidget*, GdkEventConfigure*, gpointer );
353#endif
354 static void signalDestroy( GtkWidget*, gpointer );
355
356 void Center();
358
359 bool doKeyCallback( guint state,
360 guint keyval,
361 guint16 hardware_keycode,
362 guint8 group,
363 sal_Unicode aOrigCode,
364 bool bDown,
365 bool bSendRelease
366 );
367
368#if !GTK_CHECK_VERSION(4, 0, 0)
370#endif
371
372 static int m_nFloats;
373
374 bool isFloatGrabWindow() const
375 {
376 return
377 (m_nStyle & SalFrameStyleFlags::FLOAT) && // only a float can be floatgrab
378 !(m_nStyle & SalFrameStyleFlags::TOOLTIP) && // tool tips are not
379 !(m_nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION); // toolbars are also not
380 }
381
382 bool isChild( bool bPlug = true, bool bSysChild = true )
383 {
385 if( bPlug )
387 if( bSysChild )
389 return bool(m_nStyle & nMask);
390 }
391
392 //call gtk_window_resize
393 void window_resize(tools::Long nWidth, tools::Long nHeight);
394 //call gtk_widget_set_size_request
396
397 void resizeWindow( tools::Long nWidth, tools::Long nHeight );
399
401
403
406
408
409 enum class SetType { RetainSize, Fullscreen, UnFullscreen };
410
411 void SetScreen( unsigned int nNewScreen, SetType eType, tools::Rectangle const *pSize = nullptr );
412
413 void SetIcon(const char* pIcon);
414
415 bool HandleMenubarMnemonic(guint eState, guint nKeyval);
416
418
419public:
423 std::vector<GdkEvent*> m_aPendingScrollEvents;
424#if !GTK_CHECK_VERSION(4, 0, 0)
426#endif
431
435 std::vector<gulong> m_aMouseSignalIds;
436
437 void grabPointer(bool bGrab, bool bKeyboardAlso, bool bOwnerEvents);
438
440 static GdkDisplay* getGdkDisplay();
441 GtkWidget* getWindow() const { return m_pWindow; }
442 GtkFixed* getFixedContainer() const { return GTK_FIXED(m_pFixedContainer); }
444 GtkGrid* getTopLevelGridWidget() const { return m_pTopLevelGrid; }
445 const SalX11Screen& getXScreenNumber() const { return m_nXScreen; }
446 int GetDisplayScreen() const { return maGeometry.screen(); }
448
450 void damaged(sal_Int32 nExtentsLeft, sal_Int32 nExtentsTop,
451 sal_Int32 nExtentsRight, sal_Int32 nExtentsBottom) const;
452
454 {
455 assert(!m_pDropTarget);
456 m_pDropTarget = pDropTarget;
457 }
458
459 void deregisterDropTarget(GtkInstDropTarget const * pDropTarget)
460 {
461 assert(m_pDropTarget == pDropTarget); (void)pDropTarget;
462 m_pDropTarget = nullptr;
463 }
464
466 {
467 assert(!m_pDragSource);
468 m_pDragSource = pDragSource;
469 }
470
471 void deregisterDragSource(GtkInstDragSource const * pDragSource)
472 {
473 assert(m_pDragSource == pDragSource); (void)pDragSource;
474 m_pDragSource = nullptr;
475 }
476
477 void startDrag(const css::datatransfer::dnd::DragGestureEvent& rEvent,
478 const css::uno::Reference<css::datatransfer::XTransferable>& rTrans,
479 VclToGtkHelper& rConversionHelper,
480 GdkDragAction sourceActions);
481
483
486
487#if !GTK_CHECK_VERSION(4, 0, 0)
489
490 void LaunchAsyncScroll(GdkEvent const * pEvent);
491 DECL_LINK(AsyncScroll, Timer *, void);
492#endif
493
494 virtual ~GtkSalFrame() override;
495
496 // SalGraphics or NULL, but two Graphics for all SalFrames
497 // must be returned
498 virtual SalGraphics* AcquireGraphics() override;
499 virtual void ReleaseGraphics( SalGraphics* pGraphics ) override;
500
501 // Event must be destroyed, when Frame is destroyed
502 // When Event is called, SalInstance::Yield() must be returned
503 virtual bool PostEvent(std::unique_ptr<ImplSVEvent> pData) override;
504
505 virtual void SetTitle( const OUString& rTitle ) override;
506 virtual void SetIcon( sal_uInt16 nIcon ) override;
507 virtual void SetMenu( SalMenu *pSalMenu ) override;
510
511 virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle ) override;
512 // Before the window is visible, a resize event
513 // must be sent with the correct size
514 virtual void Show( bool bVisible, bool bNoActivate = false ) override;
515 // Set ClientSize and Center the Window to the desktop
516 // and send/post a resize message
517 virtual void SetMinClientSize( tools::Long nWidth, tools::Long nHeight ) override;
518 virtual void SetMaxClientSize( tools::Long nWidth, tools::Long nHeight ) override;
519 virtual void SetPosSize( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt16 nFlags ) override;
520 virtual void GetClientSize( tools::Long& rWidth, tools::Long& rHeight ) override;
521 virtual void GetWorkArea( tools::Rectangle& rRect ) override;
522 virtual SalFrame* GetParent() const override;
523 virtual void SetWindowState(const vcl::WindowData*) override;
524 virtual bool GetWindowState(vcl::WindowData*) override;
525 virtual void ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) override;
526 // Enable/Disable ScreenSaver, SystemAgents, ...
527 virtual void StartPresentation( bool bStart ) override;
528 // Show Window over all other Windows
529 virtual void SetAlwaysOnTop( bool bOnTop ) override;
530
531 // Window to top and grab focus
532 virtual void ToTop( SalFrameToTop nFlags ) override;
533
534 // this function can call with the same
535 // pointer style
536 virtual void SetPointer( PointerStyle ePointerStyle ) override;
537 virtual void CaptureMouse( bool bMouse ) override;
538 virtual void GrabFocus() override;
539 virtual void SetPointerPos( tools::Long nX, tools::Long nY ) override;
540
541 // flush output buffer
542 using SalFrame::Flush;
543 virtual void Flush() override;
544 // flush output buffer, wait till outstanding operations are done
545
546 virtual void SetInputContext( SalInputContext* pContext ) override;
547 virtual void EndExtTextInput( EndExtTextInputFlags nFlags ) override;
548
549 virtual OUString GetKeyName( sal_uInt16 nKeyCode ) override;
550 virtual bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, vcl::KeyCode& rKeyCode ) override;
551
552 // returns the input language used for the last key stroke
553 // may be LANGUAGE_DONTKNOW if not supported by the OS
554 virtual LanguageType GetInputLanguage() override;
555
556 virtual void UpdateSettings( AllSettings& rSettings ) override;
557
558 virtual void Beep() override;
559
560 // returns system data (most prominent: window handle)
561 virtual const SystemEnvData* GetSystemData() const override;
562
563 virtual void ResolveWindowHandle(SystemEnvData& rData) const override;
564
565 // get current modifier and button mask
567
569
570 virtual void SimulateKeyPress( sal_uInt16 nKeyCode ) override;
571
572 // set new parent window
573 virtual void SetParent( SalFrame* pNewParent ) override;
574 // reparent window to act as a plugin; implementation
575 // may choose to use a new system window internally
576 // return false to indicate failure
577 virtual void SetPluginParent( SystemParentData* pNewParent ) override;
578
579 virtual void SetScreenNumber( unsigned int ) override;
580 virtual void SetApplicationID( const OUString &rWMClass ) override;
581
582 // shaped system windows
583 // set clip region to none (-> rectangular windows, normal state)
584 virtual void ResetClipRegion() override;
585 // start setting the clipregion consisting of nRects rectangles
586 virtual void BeginSetClipRegion( sal_uInt32 nRects ) override;
587 // add a rectangle to the clip region
588 virtual void UnionClipRegion( tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight ) override;
589 // done setting up the clipregion
590 virtual void EndSetClipRegion() override;
591
592 virtual void PositionByToolkit(const tools::Rectangle& rRect, FloatWinPopupFlags nFlags) override;
593 virtual void SetModal(bool bModal) override;
594 virtual bool GetModal() const override;
598 virtual bool ShowTooltip(const OUString& rHelpText, const tools::Rectangle& rHelpArea) override;
599 virtual void* ShowPopover(const OUString& rHelpText, vcl::Window* pParent, const tools::Rectangle& rHelpArea, QuickHelpFlags nFlags) override;
600 virtual bool UpdatePopover(void* nId, const OUString& rHelpText, vcl::Window* pParent, const tools::Rectangle& rHelpArea) override;
601 virtual bool HidePopover(void* nId) override;
602 virtual weld::Window* GetFrameWeld() const override;
603
605
606 static sal_uIntPtr GetNativeWindowHandle(GtkWidget *pWidget);
607
608 //Call the usual SalFrame Callback, but catch uno exceptions and delegate
609 //to GtkSalData to rethrow them after the gsignal is processed when its safe
610 //to do so again in our own code after the g_main_context_iteration call
611 //which triggers the gsignals.
612 bool CallCallbackExc(SalEvent nEvent, const void* pEvent) const;
613
614 // call gtk_widget_queue_draw on the drawing widget
616
617 static void KeyCodeToGdkKey(const vcl::KeyCode& rKeyCode,
618 guint* pGdkKeyCode, GdkModifierType *pGdkModifiers);
619
620 static guint32 GetLastInputEventTime();
621 static void UpdateLastInputEventTime(guint32 nUserInputTime);
622 static sal_uInt16 GetMouseModCode(guint nState);
623 static sal_uInt16 GetKeyCode(guint nKeyVal);
624#if !GTK_CHECK_VERSION(4, 0, 0)
625 static guint GetKeyValFor(GdkKeymap* pKeyMap, guint16 hardware_keycode, guint8 group);
626#endif
627 static sal_uInt16 GetKeyModCode(guint nState);
628 static GdkEvent* makeFakeKeyPress(GtkWidget* pWidget);
629#if !GTK_CHECK_VERSION(4, 0, 0)
630 static SalWheelMouseEvent GetWheelEvent(const GdkEventScroll& rEvent);
631 static gboolean NativeWidgetHelpPressed(GtkAccelGroup*, GObject*, guint,
632 GdkModifierType, gpointer pFrame);
633#endif
634 static OUString GetPreeditDetails(GtkIMContext* pIMContext, std::vector<ExtTextInputAttr>& rInputFlags, sal_Int32& rCursorPos, sal_uInt8& rCursorFlags);
635
637
638 void SetColorScheme(GVariant* variant);
639
643};
644
645#define OOO_TYPE_FIXED ooo_fixed_get_type()
646
647#if !GTK_CHECK_VERSION(4, 0, 0)
648extern "C" {
649
652
653} // extern "C"
654#endif
655
656#if !GTK_CHECK_VERSION(3, 22, 0)
658{
669#endif
670
671#endif // INCLUDED_VCL_INC_UNX_GTK_GTKFRAME_HXX
672
673/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _cairo_surface cairo_surface_t
Definition: CairoCommon.hxx:72
struct _cairo cairo_t
Definition: CairoCommon.hxx:71
DECL_LINK(AsyncScroll, Timer *, void)
bool doKeyCallback(guint state, guint keyval, guint16 hardware_keycode, guint8 group, sal_Unicode aOrigCode, bool bDown, bool bSendRelease)
bool m_bIconSetWhileUnmapped
Definition: gtkframe.hxx:230
GtkEventBox * m_pEventBox
Definition: gtkframe.hxx:178
static void UpdateLastInputEventTime(guint32 nUserInputTime)
void HideTooltip()
virtual void SetTitle(const OUString &rTitle) override
void ListenPortalSettings()
void SetIcon(const char *pIcon)
std::vector< GdkEvent * > m_aPendingScrollEvents
Definition: gtkframe.hxx:423
virtual void UnionClipRegion(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight) override
virtual void SetPointer(PointerStyle ePointerStyle) override
DamageHandler m_aDamageHandler
Definition: gtkframe.hxx:422
virtual ~GtkSalFrame() override
void InitCommon()
virtual void UpdateSettings(AllSettings &rSettings) override
virtual void Beep() override
bool m_bSalObjectSetPosSize
Definition: gtkframe.hxx:428
static void KeyCodeToGdkKey(const vcl::KeyCode &rKeyCode, guint *pGdkKeyCode, GdkModifierType *pGdkModifiers)
void closePopup()
virtual void SimulateKeyPress(sal_uInt16 nKeyCode) override
bool m_bDefaultPos
Definition: gtkframe.hxx:208
std::unique_ptr< GtkSalGraphics > m_pGraphics
Definition: gtkframe.hxx:201
GdkWindow * m_pForeignTopLevel
Definition: gtkframe.hxx:193
virtual void GetWorkArea(tools::Rectangle &rRect) override
virtual weld::Window * GetFrameWeld() const override
virtual void PositionByToolkit(const tools::Rectangle &rRect, FloatWinPopupFlags nFlags) override
void widget_set_size_request(tools::Long nWidth, tools::Long nHeight)
Idle m_aSmoothScrollIdle
Definition: gtkframe.hxx:425
FloatWinPopupFlags m_nFloatFlags
Definition: gtkframe.hxx:222
void WindowMap()
guint m_nActionGroupExportId
Definition: gtkframe.hxx:433
void deregisterDragSource(GtkInstDragSource const *pDragSource)
Definition: gtkframe.hxx:471
static void sizeAllocated(GtkWidget *, GdkRectangle *pAllocation, gpointer frame)
void BlockTooltip()
static guint GetKeyValFor(GdkKeymap *pKeyMap, guint16 hardware_keycode, guint8 group)
GtkInstDropTarget * m_pDropTarget
Definition: gtkframe.hxx:227
GtkSalFrame(SystemParentData *pSysData)
virtual void SetInputContext(SalInputContext *pContext) override
bool DrawingAreaButton(SalEvent nEventType, int nEventX, int nEventY, int nButton, guint32 nTime, guint nState)
static sal_uInt16 GetKeyCode(guint nKeyVal)
bool isChild(bool bPlug=true, bool bSysChild=true)
Definition: gtkframe.hxx:382
SalMenu * GetMenu()
void damaged(sal_Int32 nExtentsLeft, sal_Int32 nExtentsTop, sal_Int32 nExtentsRight, sal_Int32 nExtentsBottom) const
static GtkSalFrame * getFromWindow(GtkWidget *pWindow)
void grabPointer(bool bGrab, bool bKeyboardAlso, bool bOwnerEvents)
virtual SalGraphics * AcquireGraphics() override
static gboolean signalConfigure(GtkWidget *, GdkEventConfigure *, gpointer)
static gboolean signalKey(GtkWidget *, GdkEventKey *, gpointer)
static gboolean signalDelete(GtkWidget *, GdkEvent *, gpointer)
GdkNativeWindow m_aForeignTopLevelWindow
Definition: gtkframe.hxx:194
static void signalSetFocus(GtkWindow *pWindow, GtkWidget *pWidget, gpointer frame)
guint m_nHudAwarenessId
Definition: gtkframe.hxx:434
virtual bool HidePopover(void *nId) override
OUString m_aTooltip
Definition: gtkframe.hxx:219
gulong m_nPortalSettingChangedSignalId
Definition: gtkframe.hxx:188
bool m_bGeometryIsProvisional
Definition: gtkframe.hxx:229
void DrawingAreaCrossing(SalEvent nEventType, int nEventX, int nEventY, guint32 nTime, guint nState)
void DisallowCycleFocusOut()
SalX11Screen m_nXScreen
Definition: gtkframe.hxx:173
void SetScreen(unsigned int nNewScreen, SetType eType, tools::Rectangle const *pSize=nullptr)
GtkGrid * getTopLevelGridWidget() const
Definition: gtkframe.hxx:444
bool m_bGraphics
Definition: gtkframe.hxx:202
void DrawingAreaFocusInOut(SalEvent nEventType)
static gboolean signalDragDrop(GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint time, gpointer frame)
int m_nGrabLevel
Definition: gtkframe.hxx:427
bool HandleMenubarMnemonic(guint eState, guint nKeyval)
basegfx::B2IVector m_aFrameSize
Definition: gtkframe.hxx:421
GtkWidget * m_pWindow
Definition: gtkframe.hxx:174
static gboolean signalDragMotion(GtkWidget *widget, GdkDragContext *context, gint x, gint y, guint time, gpointer frame)
static sal_uInt16 GetMouseModCode(guint nState)
GtkHeaderBar * m_pHeaderBar
Definition: gtkframe.hxx:175
ScreenSaverInhibitor m_ScreenSaverInhibitor
Definition: gtkframe.hxx:205
static void signalDestroy(GtkWidget *, gpointer)
void window_resize(tools::Long nWidth, tools::Long nHeight)
Size m_aMaxSize
Definition: gtkframe.hxx:215
virtual void ResolveWindowHandle(SystemEnvData &rData) const override
GtkInstDragSource * m_pDragSource
Definition: gtkframe.hxx:228
void DrawingAreaMotion(int nEventX, int nEventY, guint32 nTime, guint nState)
static gboolean signalDragFailed(GtkWidget *widget, GdkDragContext *context, GtkDragResult result, gpointer frame)
void registerDropTarget(GtkInstDropTarget *pDropTarget)
Definition: gtkframe.hxx:453
static gboolean signalScroll(GtkWidget *, GdkEvent *, gpointer)
bool CallCallbackExc(SalEvent nEvent, const void *pEvent) const
virtual OUString GetKeyName(sal_uInt16 nKeyCode) override
static OUString GetPreeditDetails(GtkIMContext *pIMContext, std::vector< ExtTextInputAttr > &rInputFlags, sal_Int32 &rCursorPos, sal_uInt8 &rCursorFlags)
void UnblockTooltip()
GtkWidget * getMouseEventWidget() const
tools::Rectangle m_aRestorePosSize
Definition: gtkframe.hxx:217
SalFrameStyleFlags m_nStyle
Definition: gtkframe.hxx:196
virtual SalFrame * GetParent() const override
virtual void SetPluginParent(SystemParentData *pNewParent) override
void Center()
virtual void BeginSetClipRegion(sal_uInt32 nRects) override
static GdkEvent * makeFakeKeyPress(GtkWidget *pWidget)
virtual void SetWindowState(const vcl::WindowData *) override
virtual void Flush() override
GtkFixed * m_pDrawingArea
Definition: gtkframe.hxx:180
void WindowUnmap()
OUString m_sWMClass
Definition: gtkframe.hxx:211
gulong m_nSetFocusSignalId
Definition: gtkframe.hxx:206
void updateScreenNumber()
static gboolean NativeWidgetHelpPressed(GtkAccelGroup *, GObject *, guint, GdkModifierType, gpointer pFrame)
bool m_bFloatPositioned
Definition: gtkframe.hxx:223
virtual void SetMaxClientSize(tools::Long nWidth, tools::Long nHeight) override
std::vector< gulong > m_aMouseSignalIds
Definition: gtkframe.hxx:435
const SalX11Screen & getXScreenNumber() const
Definition: gtkframe.hxx:445
guint m_nMenuExportId
Definition: gtkframe.hxx:432
std::unique_ptr< IMHandler > m_pIMHandler
Definition: gtkframe.hxx:213
bool m_bFullscreen
Definition: gtkframe.hxx:207
virtual void ToTop(SalFrameToTop nFlags) override
virtual bool ShowTooltip(const OUString &rHelpText, const tools::Rectangle &rHelpArea) override
int GetDisplayScreen() const
Definition: gtkframe.hxx:446
virtual void SetExtendedFrameStyle(SalExtStyle nExtStyle) override
void registerDragSource(GtkInstDragSource *pDragSource)
Definition: gtkframe.hxx:465
virtual void SetParent(SalFrame *pNewParent) override
static GtkSalDisplay * getDisplay()
tools::Long m_nWidthRequest
Definition: gtkframe.hxx:224
tools::Rectangle m_aFloatRect
Definition: gtkframe.hxx:221
static sal_uInt16 GetKeyModCode(guint nState)
void SetColorScheme(GVariant *variant)
static void signalRealize(GtkWidget *, gpointer frame)
void TriggerPaintEvent()
GdkToplevelState m_nState
Definition: gtkframe.hxx:199
tools::Rectangle m_aHelpArea
Definition: gtkframe.hxx:220
void nopaint_container_resize_children(GtkContainer *)
static gboolean signalWindowState(GtkWidget *, GdkEvent *, gpointer)
bool m_bDefaultSize
Definition: gtkframe.hxx:209
void EnsureAppMenuWatch()
bool m_bTooltipBlocked
Definition: gtkframe.hxx:210
virtual void ReleaseGraphics(SalGraphics *pGraphics) override
virtual SalPointerState GetPointerState() override
virtual void SetApplicationID(const OUString &rWMClass) override
virtual void GrabFocus() override
static void signalStyleUpdated(GtkWidget *, gpointer)
static gboolean signalFocus(GtkWidget *, GdkEventFocus *, gpointer)
cairo_t * getCairoContext() const
Size m_aMinSize
Definition: gtkframe.hxx:216
virtual void CaptureMouse(bool bMouse) override
virtual bool UpdatePopover(void *nId, const OUString &rHelpText, vcl::Window *pParent, const tools::Rectangle &rHelpArea) override
static void gestureLongPress(GtkGestureLongPress *gesture, gdouble x, gdouble y, gpointer frame)
void addGrabLevel()
virtual void SetIcon(sal_uInt16 nIcon) override
void SetDefaultSize()
cairo_region_t * m_pRegion
Definition: gtkframe.hxx:226
virtual void EndSetClipRegion() override
static void signalDragDelete(GtkWidget *widget, GdkDragContext *context, gpointer frame)
PointerStyle m_ePointerStyle
Definition: gtkframe.hxx:204
std::list< GtkSalFrame * > m_aChildren
Definition: gtkframe.hxx:198
static gboolean signalDraw(GtkWidget *, cairo_t *cr, gpointer)
static int m_nFloats
Definition: gtkframe.hxx:372
void Init(SalFrame *pParent, SalFrameStyleFlags nStyle)
static guint32 GetLastInputEventTime()
void startDrag(const css::datatransfer::dnd::DragGestureEvent &rEvent, const css::uno::Reference< css::datatransfer::XTransferable > &rTrans, VclToGtkHelper &rConversionHelper, GdkDragAction sourceActions)
static void signalDragEnd(GtkWidget *widget, GdkDragContext *context, gpointer frame)
virtual const SystemEnvData * GetSystemData() const override
static gboolean signalTooltipQuery(GtkWidget *, gint x, gint y, gboolean keyboard_mode, GtkTooltip *tooltip, gpointer frame)
virtual LanguageType GetInputLanguage() override
cairo_surface_t * m_pSurface
Definition: gtkframe.hxx:420
const cairo_font_options_t * get_font_options()
static gboolean signalMotion(GtkWidget *, GdkEventMotion *, gpointer)
void DrawingAreaResized(GtkWidget *pWidget, int nWidth, int nHeight)
virtual KeyIndicatorState GetIndicatorState() override
virtual void SetPointerPos(tools::Long nX, tools::Long nY) override
static SalWheelMouseEvent GetWheelEvent(const GdkEventScroll &rEvent)
void InvalidateGraphics()
void Init(SystemParentData *pSysData)
GdkWindow * m_pForeignParent
Definition: gtkframe.hxx:191
GDBusProxy * m_pSettingsPortal
Definition: gtkframe.hxx:189
virtual void GetClientSize(tools::Long &rWidth, tools::Long &rHeight) override
GtkGrid * m_pTopLevelGrid
Definition: gtkframe.hxx:176
virtual void SetModal(bool bModal) override
virtual bool GetModal() const override
virtual void SetMenu(SalMenu *pSalMenu) override
virtual bool MapUnicodeToKeyCode(sal_Unicode aUnicode, LanguageType aLangType, vcl::KeyCode &rKeyCode) override
virtual bool GetWindowState(vcl::WindowData *) override
static void signalDragDataGet(GtkWidget *widget, GdkDragContext *context, GtkSelectionData *data, guint info, guint time, gpointer frame)
void resizeWindow(tools::Long nWidth, tools::Long nHeight)
void AllowCycleFocusOut()
SystemEnvData m_aSystemData
Definition: gtkframe.hxx:200
Size calcDefaultSize()
GdkNativeWindow m_aForeignParentWindow
Definition: gtkframe.hxx:192
bool WindowCloseRequest()
virtual bool PostEvent(std::unique_ptr< ImplSVEvent > pData) override
static gboolean signalUnmap(GtkWidget *, GdkEvent *, gpointer)
virtual void SetPosSize(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, sal_uInt16 nFlags) override
virtual void SetMinClientSize(tools::Long nWidth, tools::Long nHeight) override
virtual void EndExtTextInput(EndExtTextInputFlags nFlags) override
static gboolean signalButton(GtkWidget *, GdkEventButton *, gpointer)
void updateWMClass()
void AllocateFrame()
virtual void * ShowPopover(const OUString &rHelpText, vcl::Window *pParent, const tools::Rectangle &rHelpArea, QuickHelpFlags nFlags) override
void LaunchAsyncScroll(GdkEvent const *pEvent)
void queue_draw()
void DrawingAreaDraw(cairo_t *cr)
tools::Long m_nHeightRequest
Definition: gtkframe.hxx:225
static void signalDragDropReceived(GtkWidget *widget, GdkDragContext *context, gint x, gint y, GtkSelectionData *data, guint ttype, guint time, gpointer frame)
GtkFixed * m_pFixedContainer
Definition: gtkframe.hxx:179
bool isFloatGrabWindow() const
Definition: gtkframe.hxx:374
GtkFixed * getFixedContainer() const
Definition: gtkframe.hxx:442
GtkSalFrame * m_pParent
Definition: gtkframe.hxx:197
void moveWindow(tools::Long nX, tools::Long nY)
virtual void SetAlwaysOnTop(bool bOnTop) override
virtual void ShowFullScreen(bool bFullScreen, sal_Int32 nDisplay) override
virtual void Show(bool bVisible, bool bNoActivate=false) override
virtual void SetScreenNumber(unsigned int) override
void deregisterDropTarget(GtkInstDropTarget const *pDropTarget)
Definition: gtkframe.hxx:459
static gboolean signalMap(GtkWidget *, GdkEvent *, gpointer)
static sal_uIntPtr GetNativeWindowHandle(GtkWidget *pWidget)
bool IsCycleFocusOutDisallowed() const
virtual void ResetClipRegion() override
void DrawingAreaScroll(double delta_x, double delta_y, int nEventX, int nEventY, guint32 nTime, guint nState)
static gboolean signalCrossing(GtkWidget *, GdkEventCrossing *, gpointer)
void setMinMaxSize()
static void gestureSwipe(GtkGestureSwipe *gesture, gdouble velocity_x, gdouble velocity_y, gpointer frame)
static GdkNativeWindow findTopLevelSystemWindow(GdkNativeWindow aWindow)
GtkWidget * getWindow() const
Definition: gtkframe.hxx:441
void removeGrabLevel()
guint m_nWatcherId
Definition: gtkframe.hxx:239
virtual void StartPresentation(bool bStart) override
ModKeyFlags m_nKeyModifiers
Definition: gtkframe.hxx:203
static void signalDragLeave(GtkWidget *widget, GdkDragContext *context, guint time, gpointer frame)
static GdkDisplay * getGdkDisplay()
GtkSalMenu * m_pSalMenu
Definition: gtkframe.hxx:232
GtkSalFrame(SalFrame *pParent, SalFrameStyleFlags nStyle)
An idle is a timer to be scheduled immediately.
Definition: idle.hxx:35
unsigned int screen() const
Definition: salgeom.hxx:95
A SalFrame is a system window (e.g. an X11 window).
Definition: salframe.hxx:115
virtual void Flush()=0
SalFrameGeometry maGeometry
absolute, unmirrored values
Definition: salframe.hxx:127
Definition: timer.hxx:27
struct _GDBusProxy GDBusProxy
Definition: cpdmgr.hxx:29
struct _GDBusConnection GDBusConnection
Definition: cpdmgr.hxx:30
GdkWindowState GdkToplevelState
Definition: gtkdata.hxx:52
AtkObject * ooo_fixed_get_accessible(GtkWidget *obj)
sal_uIntPtr GdkNativeWindow
Definition: gtkframe.hxx:55
GType ooo_fixed_get_type()
GdkAnchorHints
Definition: gtkframe.hxx:658
@ GDK_ANCHOR_FLIP_X
Definition: gtkframe.hxx:659
@ GDK_ANCHOR_FLIP
Definition: gtkframe.hxx:665
@ GDK_ANCHOR_SLIDE_X
Definition: gtkframe.hxx:661
@ GDK_ANCHOR_SLIDE
Definition: gtkframe.hxx:666
@ GDK_ANCHOR_RESIZE_X
Definition: gtkframe.hxx:663
@ GDK_ANCHOR_FLIP_Y
Definition: gtkframe.hxx:660
@ GDK_ANCHOR_RESIZE_Y
Definition: gtkframe.hxx:664
@ GDK_ANCHOR_RESIZE
Definition: gtkframe.hxx:667
@ GDK_ANCHOR_SLIDE_Y
Definition: gtkframe.hxx:662
struct _GtkWidget GtkWidget
ttype
QuickHelpFlags
Definition: help.hxx:33
KeyIndicatorState
Definition: keycodes.hxx:185
ModKeyFlags
Definition: keycodes.hxx:164
long Long
PointerStyle
Definition: ptrstyle.hxx:26
sal_uInt64 SalExtStyle
Definition: salframe.hxx:95
SalFrameToTop
Definition: salframe.hxx:43
SalFrameStyleFlags
Definition: salframe.hxx:65
struct _cairo_font_options cairo_font_options_t
Definition: salinst.hxx:73
SalEvent
Definition: salwtype.hxx:44
PreviousKeyPress(const PreviousKeyPress &rPrev)
Definition: gtkframe.hxx:110
bool operator==(GdkEventKey const *event) const
Definition: gtkframe.hxx:120
SalExtTextInputEvent m_aInputEvent
Definition: gtkframe.hxx:144
static void signalIMPreeditEnd(GtkIMContext *, gpointer)
GtkIMContext * m_pIMContext
Definition: gtkframe.hxx:141
static void signalIMCommit(GtkIMContext *, gchar *, gpointer)
std::vector< ExtTextInputAttr > m_aInputFlags
Definition: gtkframe.hxx:145
IMHandler(GtkSalFrame *)
static void signalIMPreeditChanged(GtkIMContext *, gpointer)
bool handleKeyEvent(GdkEventKey *pEvent)
static void signalIMPreeditStart(GtkIMContext *, gpointer)
static gboolean signalIMDeleteSurrounding(GtkIMContext *, gint, gint, gpointer)
static gboolean signalIMRetrieveSurrounding(GtkIMContext *, gpointer)
GtkSalFrame * m_pFrame
Definition: gtkframe.hxx:136
void focusChanged(bool bFocusIn)
std::list< PreviousKeyPress > m_aPrevKeyPresses
Definition: gtkframe.hxx:138
void endExtTextInput(EndExtTextInputFlags nFlags)
unsigned char sal_uInt8
sal_uInt16 sal_Unicode
FloatWinPopupFlags
Definition: vclenum.hxx:330
EndExtTextInputFlags
Definition: window.hxx:345