[Libreoffice-commits] core.git: desktop/source include/vcl vcl/inc vcl/source vcl/unx

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Mon Jun 29 13:16:18 UTC 2020


 desktop/source/lib/init.cxx   |   13 +++++++++++++
 include/vcl/layout.hxx        |   20 ++++++++++----------
 include/vcl/weld.hxx          |    2 ++
 vcl/inc/salvtables.hxx        |    2 ++
 vcl/source/app/salvtables.cxx |    7 +++++++
 vcl/unx/gtk3/gtk3gtkinst.cxx  |    5 +++++
 6 files changed, 39 insertions(+), 10 deletions(-)

New commits:
commit a40cb25a21d6d36ca227c77c5e58c102660bdd65
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Jun 16 08:38:04 2020 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Mon Jun 29 15:15:08 2020 +0200

    jsdialog: click action for drawing area
    
    Change-Id: I2434bec675559a97e5d251c6d6a958464b6db034
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96853
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97395
    Tested-by: Jenkins

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 20ec8c0caccf..9dcd1a2e0dac 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3679,6 +3679,19 @@ static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWin
                             bContinueWithLOKWindow = true;
                     }
                 }
+                else if (sControlType == "drawingarea")
+                {
+                    auto pArea = dynamic_cast<weld::DrawingArea*>(pWidget);
+                    if (pArea)
+                    {
+                        if (sAction == "click")
+                        {
+                            pArea->click(Point(10, 10));
+                        }
+                        else
+                            bContinueWithLOKWindow = true;
+                    }
+                }
                 else if (sControlType == "spinfield")
                 {
                     auto pSpinField = dynamic_cast<weld::SpinButton*>(pWidget);
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index cee1621f2f3b..ff33f1a107f8 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -666,16 +666,6 @@ private:
         if (!m_aMouseMotionHdl.Call(rMEvt))
             Control::MouseMove(rMEvt);
     }
-    virtual void MouseButtonDown(const MouseEvent& rMEvt) override
-    {
-        if (!m_aMousePressHdl.Call(rMEvt))
-            Control::MouseButtonDown(rMEvt);
-    }
-    virtual void MouseButtonUp(const MouseEvent& rMEvt) override
-    {
-        if (!m_aMouseReleaseHdl.Call(rMEvt))
-            Control::MouseButtonUp(rMEvt);
-    }
     virtual void KeyInput(const KeyEvent& rKEvt) override
     {
         if (!m_aKeyPressHdl.Call(rKEvt))
@@ -749,6 +739,16 @@ public:
     {
         SetBackground();
     }
+    virtual void MouseButtonDown(const MouseEvent& rMEvt) override
+    {
+        if (!m_aMousePressHdl.Call(rMEvt))
+            Control::MouseButtonDown(rMEvt);
+    }
+    virtual void MouseButtonUp(const MouseEvent& rMEvt) override
+    {
+        if (!m_aMouseReleaseHdl.Call(rMEvt))
+            Control::MouseButtonUp(rMEvt);
+    }
     void SetUITestFactory(FactoryFunction pFactoryFunction, void* pUserData)
     {
         m_pFactoryFunction = pFactoryFunction;
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 05d5eeeb50d4..6d72135b21ee 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -2107,6 +2107,8 @@ public:
     virtual a11yref get_accessible_parent() = 0;
     virtual a11yrelationset get_accessible_relation_set() = 0;
     virtual Point get_accessible_location() = 0;
+
+    virtual void click(Point pos) = 0;
 };
 
 class VCL_DLLPUBLIC Menu
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 3e748bf5a657..53515ad13ac6 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -1160,6 +1160,8 @@ public:
     virtual ~SalInstanceDrawingArea() override;
 
     virtual OutputDevice& get_ref_device() override;
+
+    virtual void click(Point pos) override;
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 6a299156b404..391f2a6dc40a 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -5760,6 +5760,13 @@ SalInstanceDrawingArea::~SalInstanceDrawingArea()
 
 OutputDevice& SalInstanceDrawingArea::get_ref_device() { return *m_xDrawingArea; }
 
+void SalInstanceDrawingArea::click(Point pos)
+{
+    MouseEvent aEvent(pos);
+    m_xDrawingArea->MouseButtonDown(aEvent);
+    m_xDrawingArea->MouseButtonUp(aEvent);
+}
+
 IMPL_LINK(SalInstanceDrawingArea, PaintHdl, target_and_area, aPayload, void)
 {
     m_aDrawHdl.Call(aPayload);
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 804fa0ec7df3..620cc74b5fae 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -12826,6 +12826,11 @@ public:
     {
         return *m_xDevice;
     }
+
+    void click(Point /*pos*/) override
+    {
+        //TODO
+    }
 };
 
 }


More information about the Libreoffice-commits mailing list