20#ifndef INCLUDED_VCL_INC_UNX_GTK_GTKDATA_HXX
21#define INCLUDED_VCL_INC_UNX_GTK_GTKDATA_HXX
23#define GLIB_DISABLE_DEPRECATION_WARNINGS
26#if GTK_CHECK_VERSION(4,0,0)
27#include <gdk/x11/gdkx.h>
32#include <com/sun/star/accessibility/XAccessibleContext.hpp>
33#include <com/sun/star/accessibility/XAccessibleEventListener.hpp>
38#include <osl/conditn.hxx>
52#if !GTK_CHECK_VERSION(4,0,0)
59#if !GTK_CHECK_VERSION(4, 0, 0)
62 g_main_loop_run(pLoop);
63#if !GTK_CHECK_VERSION(4, 0, 0)
72#if GTK_CHECK_VERSION(4, 0, 0)
73 gtk_css_provider_load_from_data(css_provider, data,
length);
75 gtk_css_provider_load_from_data(css_provider, data,
length,
nullptr);
81#if GTK_CHECK_VERSION(4, 0, 0)
82 GtkRoot* pRoot = gtk_widget_get_root(pWidget);
83 return pRoot ? GTK_WIDGET(pRoot) : pWidget;
85 return gtk_widget_get_toplevel(pWidget);
91#if GTK_CHECK_VERSION(4, 0, 0)
92 return gtk_image_get_icon_name(pImage);
94 const gchar* icon_name;
95 gtk_image_get_icon_name(pImage, &icon_name,
nullptr);
102#if GTK_CHECK_VERSION(4, 0, 0)
103 return gtk_widget_get_first_child(pWidget);
105 GList* pChildren = gtk_container_get_children(GTK_CONTAINER(pWidget));
106 GList* pChild = g_list_first(pChildren);
108 g_list_free(pChildren);
115#if GTK_CHECK_VERSION(4, 0, 0)
116 return gtk_style_context_get_color(pStyle, pColor);
118 return gtk_style_context_get_color(pStyle, gtk_style_context_get_state(pStyle), pColor);
124#if GTK_CHECK_VERSION(4,0,0)
125 return gtk_native_get_surface(gtk_widget_get_native(pWidget));
127 return gtk_widget_get_window(pWidget);
133#if GTK_CHECK_VERSION(4, 0, 0)
134 gtk_widget_set_cursor(pWidget, pCursor);
136 gdk_window_set_cursor(gtk_widget_get_window(pWidget), pCursor);
141 cairo_content_t eContent,
145#if GTK_CHECK_VERSION(4, 0, 0)
146 return gdk_surface_create_similar_surface(pSurface, eContent, nWidth, nHeight);
148 return gdk_window_create_similar_surface(pSurface, eContent, nWidth, nHeight);
154#if GTK_CHECK_VERSION(4, 0, 0)
155 gtk_im_context_set_client_widget(pIMContext, pWidget);
157 gtk_im_context_set_client_window(pIMContext, pWidget ? gtk_widget_get_window(pWidget) :
nullptr);
161#if GTK_CHECK_VERSION(4, 0, 0)
171 GdkModifierType* pMask)
173#if GTK_CHECK_VERSION(4, 0, 0)
174 return gdk_surface_get_device_position(pSurface, pDevice,
179 bool bRet = gdk_window_get_device_position(pSurface, pDevice,
190#if GTK_CHECK_VERSION(4, 0, 0)
191 return gdk_surface_create_gl_context(pSurface,
nullptr);
193 return gdk_window_create_gl_context(pSurface,
nullptr);
203#if !GTK_CHECK_VERSION(4, 0, 0)
215 virtual void Start( sal_uInt64 nMS )
override;
223 public ::cppu::WeakImplHelper< css::accessibility::XAccessibleEventListener >
232 const css::uno::Reference< css::accessibility::XAccessible >& xAccessible
238 const css::uno::Reference< css::accessibility::XAccessible >& xAccessible,
239 const css::uno::Reference< css::accessibility::XAccessibleContext >& xContext
245 const css::uno::Reference< css::accessibility::XAccessible >& xAccessible,
246 const css::uno::Reference< css::accessibility::XAccessibleContext >& xContext,
253 const css::uno::Reference< css::accessibility::XAccessible >& xAccessible
259 const css::uno::Reference< css::accessibility::XAccessibleContext >& xContext
265 const css::uno::Reference< css::accessibility::XAccessibleContext >& xContext,
271 static css::uno::Reference< css::accessibility::XAccessible >
getAccessible(
const css::lang::EventObject& aEvent );
274 virtual void SAL_CALL
disposing(
const css::lang::EventObject& Source )
override;
277 virtual void SAL_CALL
notifyEvent(
const css::accessibility::AccessibleEventObject& aEvent )
override;
304 bool Yield(
bool bWait,
bool bHandleAllCurrentEvents );
323 GdkCursor*
getFromSvg( OUString
const & name,
int nXHot,
int nYHot );
344#if !GTK_CHECK_VERSION(4,0,0)
struct _cairo_surface cairo_surface_t
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
void detachRecursive(const css::uno::Reference< css::accessibility::XAccessible > &xAccessible)
void attachRecursive(const css::uno::Reference< css::accessibility::XAccessible > &xAccessible)
static css::uno::Reference< css::accessibility::XAccessible > getAccessible(const css::lang::EventObject &aEvent)
o3tl::sorted_vector< css::uno::Reference< css::uno::XInterface > > m_aRefList
void attachRecursive(const css::uno::Reference< css::accessibility::XAccessible > &xAccessible, const css::uno::Reference< css::accessibility::XAccessibleContext > &xContext, sal_Int64 nStateSet)
void detachRecursive(const css::uno::Reference< css::accessibility::XAccessibleContext > &xContext)
void attachRecursive(const css::uno::Reference< css::accessibility::XAccessible > &xAccessible, const css::uno::Reference< css::accessibility::XAccessibleContext > &xContext)
void detachRecursive(const css::uno::Reference< css::accessibility::XAccessibleContext > &xContext, sal_Int64 nStateSet)
virtual void SAL_CALL notifyEvent(const css::accessibility::AccessibleEventObject &aEvent) override
SalGenericDisplay * GetDisplay() const
virtual bool ErrorTrapPop(bool bIgnoreError=true) override
virtual void ErrorTrapPush() override
void setException(const std::exception_ptr &exception)
virtual ~GtkSalData() override
unotools::WeakReference< DocumentFocusListener > m_xDocumentFocusListener
GtkSalDisplay * GetGtkDisplay() const
rtl::Reference< DocumentFocusListener > GetDocumentFocusListener()
osl::Condition m_aDispatchCondition
void TriggerUserEventProcessing()
bool Yield(bool bWait, bool bHandleAllCurrentEvents)
osl::Mutex m_aDispatchMutex
GdkDisplay * GetGdkDisplay()
void TriggerAllUserEventsProcessed()
virtual void Dispose() override
std::exception_ptr m_aException
GdkDisplay * GetGdkDisplay() const
GdkDisplay * m_pGdkDisplay
virtual void TriggerAllUserEventsProcessed() override
void screenSizeChanged(GdkScreen const *)
GtkSalDisplay(GdkDisplay *pDisplay)
GtkWidget * findGtkWidgetForNativeHandle(sal_uIntPtr hWindow) const
GdkCursor * getFromSvg(OUString const &name, int nXHot, int nYHot)
Size GetScreenSize(int nDisplayScreen)
virtual void TriggerUserEventProcessing() override
virtual ~GtkSalDisplay() override
SalX11Screen GetDefaultXScreen()
GtkSalSystem * getSystem() const
o3tl::enumarray< PointerStyle, GdkCursor * > m_aCursors
GdkCursor * getCursor(PointerStyle ePointerStyle)
virtual int CaptureMouse(SalFrame *pFrame)
void startupNotificationCompleted()
void monitorsChanged(GdkScreen const *)
virtual void deregisterFrame(SalFrame *pFrame) override
SalX11Screen GetDisplayDefaultXScreen()
virtual ~GtkSalTimer() override
virtual void Stop() override
virtual void Start(sal_uInt64 nMS) override
struct SalGtkTimeoutSource * m_pTimeout
A SalFrame is a system window (e.g. an X11 window).
void css_provider_load_from_data(GtkCssProvider *css_provider, const gchar *data, gssize length)
GdkGLContext * surface_create_gl_context(GdkSurface *pSurface)
GtkClipboard GdkClipboard
void container_remove(GtkWidget *pContainer, GtkWidget *pChild)
GtkWidget * widget_get_first_child(GtkWidget *pWidget)
void set_buildable_id(GtkBuildable *pWidget, const OUString &rId)
OUString get_buildable_id(GtkBuildable *pWidget)
void main_loop_run(GMainLoop *pLoop)
void im_context_set_client_widget(GtkIMContext *pIMContext, GtkWidget *pWidget)
GdkSurface * widget_get_surface(GtkWidget *pWidget)
void widget_set_cursor(GtkWidget *pWidget, GdkCursor *pCursor)
void style_context_get_color(GtkStyleContext *pStyle, GdkRGBA *pColor)
bool surface_get_device_position(GdkSurface *pSurface, GdkDevice *pDevice, double &x, double &y, GdkModifierType *pMask)
int getButtonPriority(std::u16string_view rType)
void container_add(GtkWidget *pContainer, GtkWidget *pChild)
const char * image_get_icon_name(GtkImage *pImage)
GdkWindowState GdkToplevelState
cairo_surface_t * surface_create_similar_surface(GdkSurface *pSurface, cairo_content_t eContent, int nWidth, int nHeight)
GtkSalData * GetGtkSalData()
GtkWidget * widget_get_toplevel(GtkWidget *pWidget)
struct _GtkWidget GtkWidget
ImplSVData * ImplGetSVData()