diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-11-13 21:28:12 +0000 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-08-20 13:17:33 +0200 |
commit | 9869ca098765ed5ec0325492fa2cdce4a5bab795 (patch) | |
tree | edd40595cc0524e14597f496d7b51897a405ac1b /vcl/inc | |
parent | d2b14dd2bc3b374c7c0fdd528ad97fca070068f9 (diff) |
factor out 'weld::Widget as XWindow'
Reviewed-on: https://gerrit.libreoffice.org/82641
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 20d5f61abfd47fc76da3be8241653fdb7ae10491)
Change-Id: I24b52c5b8908fdf1a66fd26b2dc438b9557afa6e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100423
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/unx/gtk/gtkinst.hxx | 99 |
1 files changed, 11 insertions, 88 deletions
diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx index 78dd9bc6e8b9..b68a7a8286d5 100644 --- a/vcl/inc/unx/gtk/gtkinst.hxx +++ b/vcl/inc/unx/gtk/gtkinst.hxx @@ -34,6 +34,8 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/awt/XWindow.hpp> #include <cppuhelper/compbase.hxx> +#include <vcl/weld.hxx> +#include <vcl/weldutils.hxx> #include <gtk/gtk.h> namespace vcl @@ -250,30 +252,31 @@ private: mutable std::shared_ptr<vcl::unx::GtkPrintWrapper> m_xPrintWrapper; }; -typedef cppu::WeakComponentImplHelper<css::awt::XWindow> SalGtkXWindow_Base; -class SalGtkXWindow : public SalGtkXWindow_Base +//typedef cppu::WeakComponentImplHelper<css::awt::XWindow> SalGtkXWindow_Base; + +class SalGtkXWindow final : public weld::TransportAsXWindow { private: - osl::Mutex m_aHelperMtx; weld::Window* m_pWeldWidget; GtkWidget* m_pWidget; public: SalGtkXWindow(weld::Window* pWeldWidget, GtkWidget* pWidget) - : SalGtkXWindow_Base(m_aHelperMtx) + : TransportAsXWindow(pWeldWidget) , m_pWeldWidget(pWeldWidget) , m_pWidget(pWidget) { } - void clear() + virtual void clear() override { m_pWeldWidget = nullptr; m_pWidget = nullptr; + TransportAsXWindow::clear(); } - GtkWidget* getWidget() const + GtkWidget* getGtkWidget() const { return m_pWidget; } @@ -283,90 +286,10 @@ public: return m_pWeldWidget; } - // css::awt::XWindow - void SAL_CALL setPosSize(sal_Int32, sal_Int32, sal_Int32, sal_Int32, sal_Int16) override - { - throw css::uno::RuntimeException("not implemented"); - } - - css::awt::Rectangle SAL_CALL getPosSize() override - { - throw css::uno::RuntimeException("not implemented"); - } - - void SAL_CALL setVisible(sal_Bool) override - { - throw css::uno::RuntimeException("not implemented"); - } - - void SAL_CALL setEnable(sal_Bool) override - { - throw css::uno::RuntimeException("not implemented"); - } - - void SAL_CALL setFocus() override - { - throw css::uno::RuntimeException("not implemented"); - } - - void SAL_CALL addWindowListener(const css::uno::Reference< css::awt::XWindowListener >& ) override - { - throw css::uno::RuntimeException("not implemented"); - } - void SAL_CALL removeWindowListener(const css::uno::Reference< css::awt::XWindowListener >& ) override - { - throw css::uno::RuntimeException("not implemented"); - } - - void SAL_CALL addFocusListener(const css::uno::Reference< css::awt::XFocusListener >& ) override - { - throw css::uno::RuntimeException("not implemented"); - } - - void SAL_CALL removeFocusListener(const css::uno::Reference< css::awt::XFocusListener >& ) override - { - throw css::uno::RuntimeException("not implemented"); - } - - void SAL_CALL addKeyListener(const css::uno::Reference< css::awt::XKeyListener >& ) override - { - throw css::uno::RuntimeException("not implemented"); - } - - void SAL_CALL removeKeyListener(const css::uno::Reference< css::awt::XKeyListener >& ) override - { - throw css::uno::RuntimeException("not implemented"); - } - - void SAL_CALL addMouseListener(const css::uno::Reference< css::awt::XMouseListener >& ) override - { - throw css::uno::RuntimeException("not implemented"); - } - - void SAL_CALL removeMouseListener(const css::uno::Reference< css::awt::XMouseListener >& ) override - { - throw css::uno::RuntimeException("not implemented"); - } - - void SAL_CALL addMouseMotionListener(const css::uno::Reference< css::awt::XMouseMotionListener >& ) override - { - throw css::uno::RuntimeException("not implemented"); - } - - void SAL_CALL removeMouseMotionListener(const css::uno::Reference< css::awt::XMouseMotionListener >& ) override - { - throw css::uno::RuntimeException("not implemented"); - } + void SAL_CALL setPosSize(sal_Int32, sal_Int32, sal_Int32 w, sal_Int32 h, sal_Int16 nFlags ) override; - void SAL_CALL addPaintListener(const css::uno::Reference< css::awt::XPaintListener >& ) override - { - throw css::uno::RuntimeException("not implemented"); - } + css::awt::Rectangle SAL_CALL getPosSize() override; - void SAL_CALL removePaintListener(const css::uno::Reference< css::awt::XPaintListener >& ) override - { - throw css::uno::RuntimeException("not implemented"); - } }; GdkPixbuf* load_icon_by_name(const OUString& rIconName); |