[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - desktop/source include/vcl vcl/source vcl/unx

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 23 04:17:56 UTC 2020


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

New commits:
commit 787930f5400538766f5bf2fdcffeed2cf51b2a2c
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: Tue Jun 23 06:17:25 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>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 0c171784d40f..2d043e276a7c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3664,6 +3664,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 48114541280e..736f653c7665 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -662,16 +662,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))
@@ -742,6 +732,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/salvtables.hxx b/include/vcl/salvtables.hxx
index 126b771b97bf..0b4266a45645 100644
--- a/include/vcl/salvtables.hxx
+++ b/include/vcl/salvtables.hxx
@@ -1008,6 +1008,8 @@ public:
     virtual ~SalInstanceDrawingArea() override;
 
     virtual OutputDevice& get_ref_device() override;
+
+    virtual void click(Point pos) override;
 };
 
 #endif
\ No newline at end of file
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index a904269515ec..bc2b5d530334 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -1870,6 +1870,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/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index e485d0ea770f..084c1714d711 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -5421,6 +5421,13 @@ 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 d8ec90389bce..99a708126ac5 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -11158,6 +11158,11 @@ public:
     {
         return *m_xDevice;
     }
+
+    void click(Point /*pos*/) override
+    {
+        //TODO
+    }
 };
 
 #define g_signal_handlers_block_by_data(instance, data) \


More information about the Libreoffice-commits mailing list