[Libreoffice-commits] core.git: 2 commits - include/vcl vcl/inc vcl/qa vcl/source vcl/unx vcl/win

2022-04-09 Thread Luboš Luňák (via logerrit)
 include/vcl/glyphitem.hxx |2 -
 vcl/inc/fontinstance.hxx  |2 -
 vcl/inc/fontsubset.hxx|3 +-
 vcl/inc/glyphid.hxx   |   26 +
 vcl/inc/impfontcache.hxx  |2 -
 vcl/inc/impglyphitem.hxx  |   20 ++--
 vcl/inc/listbox.hxx   |3 +-
 vcl/inc/pch/precompiled_vcl.hxx   |1 
 vcl/inc/unx/fontmanager.hxx   |3 +-
 vcl/inc/unx/freetype_glyphcache.hxx   |3 +-
 vcl/inc/unx/printergfx.hxx|1 
 vcl/qa/cppunit/physicalfontfacecollection.cxx |1 
 vcl/source/gdi/CommonSalLayout.cxx|   18 +++---
 vcl/source/gdi/pdfwriter_impl.cxx |4 +--
 vcl/source/gdi/sallayout.cxx  |   32 +-
 vcl/source/outdev/textline.cxx|2 -
 vcl/unx/generic/print/glyphset.hxx|3 +-
 vcl/win/gdi/DWriteTextRenderer.cxx|2 -
 18 files changed, 80 insertions(+), 48 deletions(-)

New commits:
commit 136d9b34459edb444fb5154fa8b5c74d877099d5
Author: Luboš Luňák 
AuthorDate: Fri Apr 8 17:54:26 2022 +0200
Commit: Luboš Luňák 
CommitDate: Sat Apr 9 15:01:23 2022 +0200

no public data members in GlyphItem

Change-Id: Ib5911a8ad33aefffa972f583c2b5fc7d42a2b9bf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132746
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/vcl/inc/impglyphitem.hxx b/vcl/inc/impglyphitem.hxx
index 57efcd827ccb..7228911a3ed7 100644
--- a/vcl/inc/impglyphitem.hxx
+++ b/vcl/inc/impglyphitem.hxx
@@ -50,27 +50,26 @@ template <> struct typed_flags : 
is_typed_flags& rCharWidths)
 const int nIndex = aGlyphItem.charPos() - mnMinCharPos;
 if (nIndex >= nCharCount)
 continue;
-rCharWidths[nIndex] += aGlyphItem.m_nNewWidth;
+rCharWidths[nIndex] += aGlyphItem.newWidth();
 }
 }
 
@@ -722,15 +722,15 @@ void GenericSalLayout::ApplyDXArray(const DC* pDXArray, 
SalLayoutFlags nLayoutFl
 {
 // Adjust the width and position of the first (leftmost) glyph in
 // the cluster.
-m_GlyphItems[i].m_nNewWidth += nDiff;
-m_GlyphItems[i].m_aLinearPos.adjustX(nDelta);
+m_GlyphItems[i].addNewWidth(nDiff);
+m_GlyphItems[i].adjustLinearPosX(nDelta);
 
 // Adjust the position of the rest of the glyphs in the cluster.
 while (++i < m_GlyphItems.size())
 {
 if (!m_GlyphItems[i].IsInCluster())
 break;
-m_GlyphItems[i].m_aLinearPos.adjustX(nDelta);
+m_GlyphItems[i].adjustLinearPosX(nDelta);
 }
 }
 else if (m_GlyphItems[i].IsInCluster())
@@ -744,8 +744,8 @@ void GenericSalLayout::ApplyDXArray(const DC* pDXArray, 
SalLayoutFlags nLayoutFl
 // Adjust the width and position of the first (rightmost) glyph in
 // the cluster.
 // For RTL, we put all the adjustment to the left of the glyph.
-m_GlyphItems[i].m_nNewWidth += nDiff;
-m_GlyphItems[i].m_aLinearPos.adjustX(nDelta + nDiff);
+m_GlyphItems[i].addNewWidth(nDiff);
+m_GlyphItems[i].adjustLinearPosX(nDelta + nDiff);
 
 // Adjust the X position of all glyphs in the cluster.
 size_t j = i;
@@ -754,7 +754,7 @@ void GenericSalLayout::ApplyDXArray(const DC* pDXArray, 
SalLayoutFlags nLayoutFl
 --j;
 if (!m_GlyphItems[j].IsInCluster())
 break;
-m_GlyphItems[j].m_aLinearPos.adjustX(nDelta + nDiff);
+m_GlyphItems[j].adjustLinearPosX(nDelta + nDiff);
 }
 
 // If this glyph is Kashida-justifiable, then mark this as a
@@ -771,7 +771,7 @@ void GenericSalLayout::ApplyDXArray(const DC* pDXArray, 
SalLayoutFlags nLayoutFl
 {
 if (!m_GlyphItems[j].IsDiacritic())
 break;
-m_GlyphItems[j--].m_aLinearPos.adjustX(nDiff);
+m_GlyphItems[j--].adjustLinearPosX(nDiff);
 }
 }
 i++;
@@ -813,7 +813,7 @@ void GenericSalLayout::ApplyDXArray(const DC* pDXArray, 
SalLayoutFlags nLayoutFl
 nOverlap = nExcess / (nCopies - 1);
 }
 
-DevicePoint aPos(pGlyphIter->m_aLinearPos.getX() - nTotalWidth, 0);
+DevicePoint aPos(pGlyphIter->linearPos().getX() - nTotalWidth, 0);
 int nCharPos = pGlyphIter->charPos();
 GlyphItemFlags const nFlags = GlyphItemFlags::IS_IN_CLUSTER | 
GlyphItemFlags::IS_RTL_GLYPH;
 while (nCopies--)
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 7e01ed70dc58..8f9792acf54a 100644
--- 

[Libreoffice-commits] core.git: 2 commits - include/vcl vcl/inc vcl/qa vcl/source

2019-03-25 Thread Tomaž Vajngerl (via logerrit)
 include/vcl/GestureEvent.hxx |   42 ++
 include/vcl/commandevent.hxx |   24 +++
 include/vcl/svapp.hxx|3 
 include/vcl/vclevent.hxx |1 
 vcl/inc/salwtype.hxx |   14 +-
 vcl/inc/widgetdraw/WidgetDefinition.hxx  |   66 --
 vcl/qa/cppunit/widgetdraw/WidgetDefinitionReaderTest.cxx |   13 +
 vcl/qa/cppunit/widgetdraw/data/definition1.xml   |8 -
 vcl/source/app/svapp.cxx |   68 +-
 vcl/source/gdi/FileDefinitionWidgetDraw.cxx  |   99 ++-
 vcl/source/gdi/WidgetDefinition.cxx  |   31 +---
 vcl/source/gdi/WidgetDefinitionReader.cxx|   25 ---
 vcl/source/window/commandevent.cxx   |9 +
 vcl/source/window/winproc.cxx|   44 ++
 14 files changed, 284 insertions(+), 163 deletions(-)

New commits:
commit 6b476080da0678faa59606ef814760bd4235de24
Author: Tomaž Vajngerl 
AuthorDate: Mon Mar 25 18:05:35 2019 +0900
Commit: Tomaž Vajngerl 
CommitDate: Tue Mar 26 01:30:45 2019 +0100

tdf#124146 add (general) gesture event support to VCL

Change-Id: I766930bb35071442e132b91477cd3d55e8f00f48
Reviewed-on: https://gerrit.libreoffice.org/69655
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/vcl/GestureEvent.hxx b/include/vcl/GestureEvent.hxx
new file mode 100644
index ..2070fc76d39a
--- /dev/null
+++ b/include/vcl/GestureEvent.hxx
@@ -0,0 +1,42 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#ifndef INCLUDED_VCL_GESTUREEVENT_HXX
+#define INCLUDED_VCL_GESTUREEVENT_HXX
+
+#include 
+
+enum class GestureEventType
+{
+PanningBegin,
+PanningUpdate,
+PanningEnd
+};
+
+enum class PanningOrientation
+{
+Horizontal,
+Vertical
+};
+
+class VCL_DLLPUBLIC GestureEvent
+{
+public:
+sal_Int32 mnX;
+sal_Int32 mnY;
+GestureEventType meEventType;
+
+sal_Int32 mnOffset;
+PanningOrientation meOrientation;
+};
+
+#endif // INCLUDED_VCL_GESTUREEVENT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/commandevent.hxx b/include/vcl/commandevent.hxx
index 88185efde077..a3ee2fb73c99 100644
--- a/include/vcl/commandevent.hxx
+++ b/include/vcl/commandevent.hxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 class CommandExtTextInputData;
 class CommandWheelData;
@@ -37,6 +38,8 @@ class CommandMediaData;
 class CommandSelectionChangeData;
 class CommandSwipeData;
 class CommandLongPressData;
+class CommandGestureData;
+
 enum class CommandEventId;
 
 enum class ExtTextInputAttr {
@@ -86,6 +89,7 @@ public:
 const CommandSelectionChangeData*   GetSelectionChangeData() const;
 const CommandSwipeData* GetSwipeData() const;
 const CommandLongPressData* GetLongPressData() const;
+const CommandGestureData*   GetGestureData() const;
 };
 
 class VCL_DLLPUBLIC CommandExtTextInputData
@@ -300,6 +304,25 @@ public:
 double getY() const { return mnY; }
 };
 
+class VCL_DLLPUBLIC CommandGestureData
+{
+public:
+double const mfX;
+double const mfY;
+GestureEventType const meEventType;
+
+double const mfOffset;
+PanningOrientation const meOrientation;
+
+CommandGestureData(double fX, double fY, GestureEventType eEventType, 
double fOffset, PanningOrientation eOrientation)
+: mfX(fX)
+, mfY(fY)
+, meEventType(eEventType)
+, mfOffset(fOffset)
+, meOrientation(eOrientation)
+{}
+};
+
 enum class CommandEventId
 {
 NONE= 0,
@@ -323,6 +346,7 @@ enum class CommandEventId
 QueryCharPosition   = 20,
 Swipe   = 21,
 LongPress   = 22,
+Gesture = 23,
 };
 
 #endif // INCLUDED_VCL_COMMANDEVENT_HXX
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index 712f75a0f09d..d89a23e54a13 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -63,6 +63,7 @@ class WorkWindow;
 class NotifyEvent;
 class KeyEvent;
 class MouseEvent;
+class GestureEvent;
 struct ImplSVEvent;
 struct ConvertData;
 
@@ -747,6 +748,8 @@ public:
 */
 static ImplSVEvent *PostMouseEvent( VclEventId nEvent, vcl::Window 
*pWin, MouseEvent const * pMouseEvent );
 
+static ImplSVEvent* PostGestureEvent(VclEventId nEvent, vcl::Window* pWin, 
GestureEvent const * pGestureEvent);
+
 /** Remove mouse and keypress events from a window... any also zoom and 
scroll events
 

[Libreoffice-commits] core.git: 2 commits - include/vcl vcl/inc vcl/qa vcl/source vcl/workben

2016-01-13 Thread Chris Sherlock
 include/vcl/metric.hxx|1 
 vcl/inc/impfont.hxx   |1 
 vcl/qa/cppunit/fontmetric.cxx |7 -
 vcl/source/gdi/metric.cxx |5 
 vcl/source/outdev/font.cxx|   52 +-
 vcl/workben/svpclient.cxx |   19 +--
 6 files changed, 56 insertions(+), 29 deletions(-)

New commits:
commit d9c20d142539b53b052937274efd2e576d0712ec
Author: Chris Sherlock 
Date:   Thu Jan 14 08:33:12 2016 +1100

vcl: (workbench) check error status of socket writes

Change-Id: I0825a4e1a0dc49d7ab2d74ad4b11cfb8baf973f7

diff --git a/vcl/workben/svpclient.cxx b/vcl/workben/svpclient.cxx
index 1d25daf..65d16c1 100644
--- a/vcl/workben/svpclient.cxx
+++ b/vcl/workben/svpclient.cxx
@@ -44,6 +44,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -214,8 +215,22 @@ OString MyWin::processCommand( const OString& rCommand )
 else
 {
 ssize_t nBytes = 0;
-write( nSocket, rCommand.getStr(), rCommand.getLength() );
-write( nSocket, "\n", 1 );
+ssize_t fd = 0;
+fd = write( nSocket, rCommand.getStr(), rCommand.getLength() );
+
+if (fd == 0)
+SAL_WARN("vcl", "Connection closed on other end");
+else if (fd < 0)
+SAL_WARN("vcl", "Error writing to socket: " << strerror( errno 
));
+
+fd = write( nSocket, "\n", 1 );
+
+if (fd == 0)
+SAL_WARN("vcl", "Connection closed on other end");
+else if (fd < 0)
+SAL_WARN("vcl", "Error writing to socket: " << strerror( errno 
));
+
+
 char buf[256];
 do
 {
commit a5bc28e073c2dd1eb8ad733687dc827e6bac31bd
Author: Chris Sherlock 
Date:   Thu Jan 14 08:15:40 2016 +1100

vcl: Create mutator for line height attribute in FontMetric

Mutator created for line height in attribute FontMetric.

See commit description in 8bfccd3a71d911b6d ("vcl: Create accessor
and mutator for font scaling in FontMetric") for reasoning behind
patch.

Unit tests
- check to ensure that can get and set line height attribute
- check equality operator on FontMetric after setting line height
  attribute

Change-Id: I86dff217fa24850b5f9d04a17ddda464dfb0156a

diff --git a/include/vcl/metric.hxx b/include/vcl/metric.hxx
index 0a7d0e6..e4e6661 100644
--- a/include/vcl/metric.hxx
+++ b/include/vcl/metric.hxx
@@ -58,6 +58,7 @@ public:
 voidSetDescent(long);
 voidSetExternalLeading(long);
 voidSetInternalLeading(long);
+voidSetLineHeight(long);
 
 boolIsScalable() const;
 boolIsFullstopCentered() const;
diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx
index 182f4e8..e0a1ca1 100644
--- a/vcl/inc/impfont.hxx
+++ b/vcl/inc/impfont.hxx
@@ -127,6 +127,7 @@ public:
 voidSetDescent( long nDescent ) { 
mnDescent = nDescent; }
 voidSetInternalLeading( long nIntLeading )  { 
mnIntLeading = nIntLeading; }
 voidSetExternalLeading( long nExtLeading )  { 
mnExtLeading = nExtLeading; }
+voidSetLineHeight( long nHeight )   { 
mnLineHeight = nHeight; }
 
 boolIsScalable() const  { return 
mbScalableFont; }
 boolIsFullstopCentered() const  { return 
mbFullstopCentered; }
diff --git a/vcl/qa/cppunit/fontmetric.cxx b/vcl/qa/cppunit/fontmetric.cxx
index 07fc0e6..3093783 100644
--- a/vcl/qa/cppunit/fontmetric.cxx
+++ b/vcl/qa/cppunit/fontmetric.cxx
@@ -33,8 +33,8 @@ public:
 CPPUNIT_TEST(testScalableFlag);
 CPPUNIT_TEST(testFullstopCenteredFlag);
 CPPUNIT_TEST(testBuiltInFontFlag);
-CPPUNIT_TEST(testEqualityOperator);
 CPPUNIT_TEST(testSpacings);
+CPPUNIT_TEST(testEqualityOperator);
 CPPUNIT_TEST_SUITE_END();
 };
 
@@ -83,6 +83,8 @@ void VclFontMetricTest::testSpacings()
 CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetDescent(), 0L );
 CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetExternalLeading(), 0L );
 CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetInternalLeading(), 0L );
+CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetLineHeight(), 0L );
+
 
 aFontMetric.SetAscent( 100 );
 CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetAscent(), 100L );
@@ -95,6 +97,9 @@ void VclFontMetricTest::testSpacings()
 
 aFontMetric.SetInternalLeading( 100L );
 CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetInternalLeading(), 100L );
+
+aFontMetric.SetLineHeight( 100L );
+CPPUNIT_ASSERT_EQUAL( (long) aFontMetric.GetLineHeight(), 100L );
 }
 
 
diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx
index df4d11d..1b7206f 100644
---