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

2023-07-22 Thread Khaled Hosny (via logerrit)
 include/vcl/outdev.hxx|2 
 include/vcl/vcllayout.hxx |2 
 vcl/inc/sallayout.hxx |4 -
 vcl/inc/textlayout.hxx|6 --
 vcl/source/control/edit.cxx   |   74 +++---
 vcl/source/gdi/sallayout.cxx  |   90 --
 vcl/source/gdi/textlayout.cxx |   17 ---
 vcl/source/outdev/text.cxx|   46 ++---
 8 files changed, 119 insertions(+), 122 deletions(-)

New commits:
commit 21013c4662a9ab32d293de263c54ebeceb66828c
Author: Khaled Hosny 
AuthorDate: Wed Jul 19 19:07:34 2023 +0300
Commit: خالد حسني 
CommitDate: Sun Jul 23 06:05:02 2023 +0200

tdf#156377: Improve cursor traversal in UI widgets

Re-implement GetCaretPositions() on top of GetCharWidths() so it can
benefit from our code that handles cursor insertion in middle of
ligatures.

Change-Id: I2b76b3b0125f2454f78cb6779d88617dc29386fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154660
Tested-by: Jenkins
Reviewed-by: خالد حسني 

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 7e0a17fec545..f3d2e912d0a6 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1047,7 +1047,7 @@ public:
   vcl::text::TextLayoutCache 
const* = nullptr,
   SalLayoutGlyphs const*const 
pLayoutCache = nullptr) const;
 
-voidGetCaretPositions( const OUString&, sal_Int32* 
pCaretXArray,
+voidGetCaretPositions( const OUString&, KernArray& 
rCaretXArray,
   sal_Int32 nIndex, sal_Int32 nLen,
   const SalLayoutGlyphs* pGlyphs = 
nullptr ) const;
 voidDrawStretchText( const Point& rStartPt, 
sal_Int32 nWidth,
diff --git a/include/vcl/vcllayout.hxx b/include/vcl/vcllayout.hxx
index dda07f1c710e..7c7a179b9b05 100644
--- a/include/vcl/vcllayout.hxx
+++ b/include/vcl/vcllayout.hxx
@@ -96,7 +96,7 @@ public:
 virtual sal_Int32 GetTextBreak(double nMaxWidth, double nCharExtra, int 
nFactor) const = 0;
 virtual double  FillDXArray( std::vector* pDXArray, const 
OUString& rStr ) const = 0;
 virtual double  GetTextWidth() const { return FillDXArray( nullptr, {} ); }
-virtual voidGetCaretPositions( int nArraySize, sal_Int32* pCaretXArray 
) const = 0;
+virtual voidGetCaretPositions( std::vector& rCaretPositions, 
const OUString& rStr ) const = 0;
 virtual boolIsKashidaPosValid ( int /*nCharPos*/, int /*nNextCharPos*/ 
) const = 0; // i60594
 
 // methods using glyph indexing
diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx
index f96eb7df2977..dbe3000f8a83 100644
--- a/vcl/inc/sallayout.hxx
+++ b/vcl/inc/sallayout.hxx
@@ -64,7 +64,7 @@ public:
 sal_Int32   GetTextBreak(double nMaxWidth, double nCharExtra, int 
nFactor) const override;
 double  GetTextWidth() const final override;
 double  FillDXArray(std::vector* pDXArray, const OUString& 
rStr) const override;
-voidGetCaretPositions(int nArraySize, sal_Int32* pCaretXArray) 
const override;
+voidGetCaretPositions(std::vector& rCaretPositions, 
const OUString& rStr) const override;
 boolGetNextGlyph(const GlyphItem** pGlyph, basegfx::B2DPoint& 
rPos, int& nStart,
  const LogicalFontInstance** ppGlyphFont = 
nullptr) const override;
 boolGetOutline(basegfx::B2DPolyPolygonVector&) const override;
@@ -120,7 +120,7 @@ public:
 double  GetTextWidth() const final override;
 double  FillDXArray(std::vector* pDXArray, const OUString& 
rStr) const final override;
 sal_Int32   GetTextBreak(double nMaxWidth, double nCharExtra, int 
nFactor) const final override;
-voidGetCaretPositions(int nArraySize, sal_Int32* pCaretXArray) 
const final override;
+voidGetCaretPositions(std::vector& rCaretPositions, 
const OUString& rStr) const override;
 
 // used by display layers
 LogicalFontInstance& GetFont() const
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index 10c68412a627..0db27e8a315a 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -473,20 +473,9 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, 
const tools::Rectangl
 const OUString aText = ImplGetText();
 const sal_Int32 nLen = aText.getLength();
 
-sal_Int32 nDXBuffer[256];
-std::unique_ptr pDXBuffer;
-sal_Int32* pDX = nDXBuffer;
-
+KernArray aDX;
 if (nLen)
-{
-if (o3tl::make_unsigned(2 * nLen) > SAL_N_ELEMENTS(nDXBuffer))
-{
-pDXBuffer.reset(new sal_Int32[2 * (nLen + 1)]);
-pDX = pDXBuffer.get();
-}
-
-GetOutDev()->GetCaretPositions(aText, pDX, 0, nLen);

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

2023-03-21 Thread Szymon Kłos (via logerrit)
 include/vcl/jsdialog/executor.hxx|   10 ++
 include/vcl/weld.hxx |2 +
 vcl/inc/jsdialog/jsdialogbuilder.hxx |   27 
 vcl/jsdialog/executor.cxx|   21 
 vcl/jsdialog/jsdialogbuilder.cxx |   57 +++
 5 files changed, 117 insertions(+)

New commits:
commit b46defbc331c3c91553bc8967cdf48eacea87afd
Author: Szymon Kłos 
AuthorDate: Fri Mar 10 13:53:04 2023 +0100
Commit: Szymon Kłos 
CommitDate: Tue Mar 21 15:00:32 2023 +

jsdialog: update Entry on replace_selection

Signed-off-by: Szymon Kłos 
Change-Id: Ie0c3586fbf4bda1a9d68dceec61e08ff9f75bb97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148634
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149201
Tested-by: Jenkins

diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 783aeaacfff7..6f59b7d5ca64 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -572,6 +572,7 @@ public:
 bool bTakeOwnership);
 virtual void set_text(const OUString& rText) override;
 void set_text_without_notify(const OUString& rText);
+virtual void replace_selection(const OUString& rText) override;
 };
 
 class JSListBox final : public JSWidget
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index d623e9723a7e..9a0f61d90caa 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -1488,6 +1488,12 @@ void JSEntry::set_text(const OUString& rText)
 
 void JSEntry::set_text_without_notify(const OUString& rText) { 
SalInstanceEntry::set_text(rText); }
 
+void JSEntry::replace_selection(const OUString& rText)
+{
+SalInstanceEntry::replace_selection(rText);
+sendUpdate();
+}
+
 JSListBox::JSListBox(JSDialogSender* pSender, ::ListBox* pListBox, 
SalInstanceBuilder* pBuilder,
  bool bTakeOwnership)
 : JSWidget(pSender, pListBox, 
pBuilder,
commit 74e8476d23b72f06328dcbe183597847471771e1
Author: Szymon Kłos 
AuthorDate: Fri Mar 10 10:03:49 2023 +0100
Commit: Szymon Kłos 
CommitDate: Tue Mar 21 15:00:25 2023 +

jsdialog: add wrapper for ScrolledWindow

Change-Id: I59489e4cf1e5fb492272108e3a19afb4212753f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148610
Tested-by: Szymon Kłos 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149200

diff --git a/include/vcl/jsdialog/executor.hxx 
b/include/vcl/jsdialog/executor.hxx
index 9bccad3f1865..50f71272bb61 100644
--- a/include/vcl/jsdialog/executor.hxx
+++ b/include/vcl/jsdialog/executor.hxx
@@ -27,6 +27,16 @@ public:
 
 static void trigger_changed(weld::IconView& rIconView) { 
rIconView.signal_selection_changed(); }
 
+static void trigger_scrollv(weld::ScrolledWindow& rScrolledWindow)
+{
+rScrolledWindow.signal_vadjustment_changed();
+}
+
+static void trigger_scrollh(weld::ScrolledWindow& rScrolledWindow)
+{
+rScrolledWindow.signal_hadjustment_changed();
+}
+
 static void trigger_toggled(weld::Toggleable& rButton) { 
rButton.signal_toggled(); }
 
 static void trigger_row_activated(weld::TreeView& rTreeView)
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 4acece25f052..d22fa5eb616e 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -404,6 +404,8 @@ public:
 
 class VCL_DLLPUBLIC ScrolledWindow : virtual public Container
 {
+friend class ::LOKTrigger;
+
 Link m_aVChangeHdl;
 Link m_aHChangeHdl;
 
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 0c6cbaa48080..783aeaacfff7 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -40,6 +40,7 @@ class ComboBox;
 class VclMultiLineEdit;
 class SvTabListBox;
 class IconView;
+class VclScrolledWindow;
 
 namespace vcl
 {
@@ -304,6 +305,8 @@ public:
 virtual std::unique_ptr weld_tree_view(const OString& id) 
override;
 virtual std::unique_ptr weld_expander(const OString& id) 
override;
 virtual std::unique_ptr weld_icon_view(const OString& id) 
override;
+virtual std::unique_ptr
+weld_scrolled_window(const OString& id, bool bUserManagedScrolling = 
false) override;
 virtual std::unique_ptr weld_radio_button(const 
OString& id) override;
 virtual std::unique_ptr weld_frame(const OString& id) 
override;
 virtual std::unique_ptr weld_menu_button(const OString& 
id) override;
@@ -368,6 +371,14 @@ public:
 {
 }
 
+JSWidget(JSDialogSender* pSender, VclClass* pObject, SalInstanceBuilder* 
pBuilder,
+ bool bTakeOwnership, bool bUserManagedScrolling)
+: BaseInstanceClass(pObject, pBuilder, bTakeOwnership, 
bUserManagedScrolling)
+, m_bIsFreezed(false)
+, m_pSender(pSender)
+{
+}
+
 JSWidget(JSDialogSender* pSender, VclClass* 

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

2023-03-21 Thread Szymon Kłos (via logerrit)
 include/vcl/layout.hxx   |1 
 vcl/inc/jsdialog/jsdialogbuilder.hxx |   22 
 vcl/jsdialog/jsdialogbuilder.cxx |   40 -
 vcl/source/window/layout.cxx |   47 +++
 4 files changed, 48 insertions(+), 62 deletions(-)

New commits:
commit 8f0a337afd8cf40a74e6668b4441903a1b49f4ae
Author: Szymon Kłos 
AuthorDate: Thu Mar 9 15:43:15 2023 +0100
Commit: Szymon Kłos 
CommitDate: Tue Mar 21 09:35:41 2023 +

jsdialog: dump properties of scrolled window

Change-Id: Id6d072e951efec4c1de7641c94017c82840fa50b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148609
Tested-by: Szymon Kłos 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149190
Tested-by: Jenkins

diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index 2296f8097a4a..f5090b24eac2 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -498,6 +498,7 @@ public:
 //to override it
 void setUserManagedScrolling(bool bUserManagedScrolling) { 
m_bUserManagedScrolling = bUserManagedScrolling;}
 void doSetAllocation(const Size , bool bRetryOnFailure);
+virtual void DumpAsPropertyTree(::tools::JsonWriter& rJsonWriter) override;
 private:
 virtual Size calculateRequisition() const override;
 virtual void setAllocation(const Size ) override;
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 039cb2690a9d..c77a4a0d30e1 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -2167,6 +2167,53 @@ void VclScrolledWindow::Paint(vcl::RenderContext& 
rRenderContext, const tools::R
 nBorderWidth << " is larger than expected " << m_nBorderWidth);
 }
 
+namespace {
+void lcl_dumpScrollbar(::tools::JsonWriter& rJsonWriter, ScrollBar& rScrollBar)
+{
+rJsonWriter.put("lower", rScrollBar.GetRangeMin());
+rJsonWriter.put("upper", rScrollBar.GetRangeMax());
+rJsonWriter.put("step_increment", rScrollBar.GetLineSize());
+rJsonWriter.put("page_increment", rScrollBar.GetPageSize());
+rJsonWriter.put("value", rScrollBar.GetThumbPos());
+rJsonWriter.put("page_size", rScrollBar.GetVisibleSize());
+}
+};
+
+void VclScrolledWindow::DumpAsPropertyTree(::tools::JsonWriter& rJsonWriter)
+{
+VclBin::DumpAsPropertyTree(rJsonWriter);
+
+{
+auto aVertical = rJsonWriter.startNode("vertical");
+
+ScrollBar& rScrollBar = getVertScrollBar();
+lcl_dumpScrollbar(rJsonWriter, rScrollBar);
+
+WinBits nWinBits = GetStyle();
+if (nWinBits & WB_VSCROLL)
+rJsonWriter.put("policy", "always");
+else if (nWinBits & WB_AUTOVSCROLL)
+rJsonWriter.put("policy", "auto");
+else
+rJsonWriter.put("policy", "never");
+}
+
+{
+auto aHorizontal = rJsonWriter.startNode("horizontal");
+
+ScrollBar& rScrollBar = getHorzScrollBar();
+lcl_dumpScrollbar(rJsonWriter, rScrollBar);
+
+WinBits nWinBits = GetStyle();
+if (nWinBits & WB_HSCROLL)
+rJsonWriter.put("policy", "always");
+else if (nWinBits & WB_AUTOHSCROLL)
+rJsonWriter.put("policy", "auto");
+else
+rJsonWriter.put("policy", "never");
+}
+}
+
 void VclViewport::setAllocation(const Size )
 {
 vcl::Window *pChild = get_child();
commit 103e656e4f9e073354dc6a683889fd3fb922ecf2
Author: Szymon Kłos 
AuthorDate: Tue Mar 7 13:09:20 2023 +0100
Commit: Szymon Kłos 
CommitDate: Tue Mar 21 09:35:30 2023 +

jsdialog: don't send full updates on tab change

All tabs are now sent with the first full message.
So client can switch between tabs by showing another
tabpage content. We don't need to send structure again.

Change-Id: I0f3dfc8be4816fba5813a83b41722407631edb73
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148421
Tested-by: Szymon Kłos 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149189
Tested-by: Jenkins

diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 0864c3d7ab8a..19458a938c02 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -575,34 +575,12 @@ public:
 
 class JSNotebook final : public JSWidget
 {
-Link m_aLeavePageOverridenHdl;
-Link m_aEnterPageOverridenHdl;
-
-DECL_LINK(LeaveHdl, const OString&, bool);
-DECL_LINK(EnterHdl, const OString&, bool);
-
 public:
 JSNotebook(JSDialogSender* pSender, ::TabControl* pControl, 
SalInstanceBuilder* pBuilder,
bool bTakeOwnership);
 
-virtual void set_current_page(int nPage) override;
-
-virtual void set_current_page(const OString& rIdent) override;
-
 virtual void remove_page(const OString& rIdent) override;
-
 virtual void insert_page(const OString& rIdent, const OUString& rLabel, 

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

2023-03-04 Thread Pranam Lashkari (via logerrit)
 include/vcl/toolkit/button.hxx   |4 ++
 vcl/inc/jsdialog/jsdialogbuilder.hxx |8 +
 vcl/inc/salvtables.hxx   |   51 +
 vcl/jsdialog/enabled.cxx |   26 -
 vcl/jsdialog/executor.cxx|5 +++
 vcl/jsdialog/jsdialogbuilder.cxx |   18 +++
 vcl/source/app/salvtables.cxx|   53 ---
 vcl/source/control/button.cxx|2 +
 8 files changed, 101 insertions(+), 66 deletions(-)

New commits:
commit 95ee8a692cbc3f8ead72e61eb36b9015f1c57605
Author: Pranam Lashkari 
AuthorDate: Fri Mar 3 02:27:01 2023 +0530
Commit: Szymon Kłos 
CommitDate: Sat Mar 4 19:52:07 2023 +

jsdialog: sort enabled UI files by name

this helps avoid repeating them

Change-Id: Iaa1d73ca1e396c18a0486ca89cb3b0a26571569d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148241
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index 1916c8dfe41f..9a10f5bc0079 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -38,8 +38,8 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool 
bMobile)
 || rUIFile == u"cui/ui/macroselectordialog.ui"
 || rUIFile == u"cui/ui/numberingformatpage.ui"
 || rUIFile == u"cui/ui/password.ui"
-|| rUIFile == u"cui/ui/splitcellsdialog.ui"
 || rUIFile == u"cui/ui/similaritysearchdialog.ui"
+|| rUIFile == u"cui/ui/splitcellsdialog.ui"
 || rUIFile == u"cui/ui/widgettestdialog.ui"
 // scalc
 || rUIFile == u"modules/scalc/ui/analysisofvariancedialog.ui"
@@ -80,12 +80,12 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool 
bMobile)
 || rUIFile == u"modules/swriter/ui/captionoptions.ui"
 || rUIFile == u"modules/swriter/ui/contentcontroldlg.ui"
 || rUIFile == u"modules/swriter/ui/contentcontrollistitemdlg.ui"
+|| rUIFile == u"modules/swriter/ui/dropdownfielddialog.ui"
 || rUIFile == u"modules/swriter/ui/insertcaption.ui"
 || rUIFile == u"modules/swriter/ui/linenumbering.ui"
+|| rUIFile == u"modules/swriter/ui/pagenumberdlg.ui"
 || rUIFile == u"modules/swriter/ui/splittable.ui"
 || rUIFile == u"modules/swriter/ui/translationdialog.ui"
-|| rUIFile == u"modules/swriter/ui/pagenumberdlg.ui"
-|| rUIFile == u"modules/swriter/ui/dropdownfielddialog.ui"
 // sfx
 || rUIFile == u"sfx/ui/cmisinfopage.ui"
 || rUIFile == u"sfx/ui/custominfopage.ui"
@@ -105,19 +105,19 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool 
bMobile)
 // vcl
 || rUIFile == u"vcl/ui/wizard.ui"
 // xmlsec
-|| rUIFile == u"xmlsec/ui/certgeneral.ui"
-|| rUIFile == u"xmlsec/ui/certpage.ui"
-|| rUIFile == u"xmlsec/ui/digitalsignaturesdialog.ui"
-|| rUIFile == u"xmlsec/ui/viewcertdialog.ui"
-|| rUIFile == u"filter/ui/pdfoptionsdialog.ui"
 || rUIFile == u"filter/ui/pdfgeneralpage.ui"
-|| rUIFile == u"filter/ui/pdfviewpage.ui"
-|| rUIFile == u"filter/ui/pdfuserinterfacepage.ui"
-|| rUIFile == u"filter/ui/pdfsecuritypage.ui"
 || rUIFile == u"filter/ui/pdflinkspage.ui"
-|| rUIFile == u"filter/ui/warnpdfdialog.ui"
+|| rUIFile == u"filter/ui/pdfoptionsdialog.ui"
+|| rUIFile == u"filter/ui/pdfsecuritypage.ui"
 || rUIFile == u"filter/ui/pdfsignpage.ui"
+|| rUIFile == u"filter/ui/pdfuserinterfacepage.ui"
+|| rUIFile == u"filter/ui/pdfviewpage.ui"
+|| rUIFile == u"filter/ui/warnpdfdialog.ui"
 || rUIFile == u"writerperfect/ui/exportepub.ui"
+|| rUIFile == u"xmlsec/ui/certgeneral.ui"
+|| rUIFile == u"xmlsec/ui/certpage.ui"
+|| rUIFile == u"xmlsec/ui/digitalsignaturesdialog.ui"
+|| rUIFile == u"xmlsec/ui/viewcertdialog.ui"
 )
 {
 return true;
@@ -196,8 +196,8 @@ bool isBuilderEnabledForSidebar(std::u16string_view rUIFile)
 // swriter
 || rUIFile == u"modules/swriter/ui/managechangessidebar.ui"
 //|| rUIFile == u"modules/swriter/ui/navigatorpanel.ui"
-|| rUIFile == u"modules/swriter/ui/pageformatpanel.ui"
 || rUIFile == u"modules/swriter/ui/pagefooterpanel.ui"
+|| rUIFile == u"modules/swriter/ui/pageformatpanel.ui"
 || rUIFile == u"modules/swriter/ui/pageheaderpanel.ui"
 || rUIFile == u"modules/swriter/ui/pagestylespanel.ui"
 || rUIFile == u"modules/swriter/ui/sidebarstylepresets.ui"
commit 542cef171ceed4577c1c71735726b1e7c7c9c8c9
Author: Pranam Lashkari 
AuthorDate: Fri Mar 3 02:16:08 2023 +0530
Commit: Szymon Kłos 
CommitDate: Sat Mar 4 19:51:58 2023 +

JSDialog: implemented jsdialog support for the toggle buttons

Change-Id: I21408f7344f7e100373c368036f81503302b93ad
Reviewed-on: 

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

2022-08-26 Thread Povilas Kanapickas (via logerrit)
 include/vcl/GestureEventRotate.hxx |   46 
 include/vcl/GestureEventZoom.hxx   |   46 
 include/vcl/commandevent.hxx   |   41 +
 vcl/inc/salwtype.hxx   |   20 ++
 vcl/source/window/commandevent.cxx |   15 +++
 vcl/source/window/winproc.cxx  |   70 +
 6 files changed, 238 insertions(+)

New commits:
commit 85b65b90ac10d39190097af87a2de609e87eea9c
Author: Povilas Kanapickas 
AuthorDate: Thu Aug 25 00:18:29 2022 +0300
Commit: Tomaž Vajngerl 
CommitDate: Fri Aug 26 09:12:54 2022 +0200

vcl: implement rotate gesture infrastructure

This change implements internal infrastructure to pass rotate gestures
from low-level sources to the consuming GUI widgets. The API follows the
established begin-update-update-...-end event convention that is used on
various platforms.

The API should be enough to support bouth touchpad and touchscreen
gestures, as long as the underlying low-level source exposes enough
information. The hardware drivers usually expose touchpad gestures
already recognized whereas touchscreen gestures come as a set of moving
touchpoints and application needs to figure out their meaning itself.
Many toolkits recognize both and offer a unified higher-level interface
that can be used by us.

Change-Id: Iae667b3248d6f78bfb1eef755af6bc996432b6a7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138788
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/vcl/GestureEventRotate.hxx 
b/include/vcl/GestureEventRotate.hxx
new file mode 100644
index ..39f4b310f973
--- /dev/null
+++ b/include/vcl/GestureEventRotate.hxx
@@ -0,0 +1,46 @@
+/* -*- 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/.
+ *
+ */
+
+#pragma once
+
+#include 
+
+enum class GestureEventRotateType
+{
+Begin,
+Update,
+End
+};
+
+class VCL_DLLPUBLIC GestureEventRotate
+{
+public:
+sal_Int32 mnX = 0;
+sal_Int32 mnY = 0;
+
+GestureEventRotateType meEventType = GestureEventRotateType::Begin;
+
+// The difference of between the current gesture scale and the scale at 
the beginning of the
+// gesture.
+double mfAngleDelta = 0;
+
+GestureEventRotate() = default;
+
+GestureEventRotate(sal_Int32 nInitialX, sal_Int32 nInitialY, 
GestureEventRotateType eEventType,
+   double fAngleDelta)
+: mnX(nInitialX)
+, mnY(nInitialY)
+, meEventType(eEventType)
+, mfAngleDelta(fAngleDelta)
+{
+}
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/commandevent.hxx b/include/vcl/commandevent.hxx
index 71694cc6f087..7b3199b18ccd 100644
--- a/include/vcl/commandevent.hxx
+++ b/include/vcl/commandevent.hxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 
 class CommandExtTextInputData;
 class CommandWheelData;
@@ -41,6 +42,7 @@ class CommandSwipeData;
 class CommandLongPressData;
 class CommandGestureData;
 class CommandGestureZoomData;
+class CommandGestureRotateData;
 
 enum class CommandEventId;
 
@@ -93,6 +95,7 @@ public:
 const CommandLongPressData* GetLongPressData() const;
 const CommandGestureData*   GetGestureData() const;
 const CommandGestureZoomData*   GetGestureZoomData() const;
+const CommandGestureRotateData* GetGestureRotateData() const;
 };
 
 class VCL_DLLPUBLIC CommandExtTextInputData
@@ -341,6 +344,23 @@ public:
 {}
 };
 
+class VCL_DLLPUBLIC CommandGestureRotateData
+{
+public:
+const double mfX = 0;
+const double mfY = 0;
+const GestureEventRotateType meEventType = GestureEventRotateType::Begin;
+const double mfAngleDelta = 0;
+
+CommandGestureRotateData(double fX, double fY, GestureEventRotateType 
eEventType,
+ double fAngleDelta)
+: mfX(fX)
+, mfY(fY)
+, meEventType(eEventType)
+, mfAngleDelta(fAngleDelta)
+{}
+};
+
 enum class CommandEventId
 {
 NONE= 0,
@@ -366,6 +386,7 @@ enum class CommandEventId
 LongPress   = 22,
 Gesture = 23,
 GestureZoom = 24,
+GestureRotate   = 25,
 };
 
 #endif // INCLUDED_VCL_COMMANDEVENT_HXX
diff --git a/vcl/inc/salwtype.hxx b/vcl/inc/salwtype.hxx
index d920a16dc5d4..7b66ef5a2d45 100644
--- a/vcl/inc/salwtype.hxx
+++ b/vcl/inc/salwtype.hxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 class LogicalFontInstance;
 class SalGraphics;
@@ -93,6 +94,7 @@ enum class SalEvent {
 ExternalGesture,
 Gesture,
 

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

2022-08-25 Thread Caolán McNamara (via logerrit)
 include/vcl/outdev.hxx|2 ++
 vcl/inc/pdf/Matrix3.hxx   |2 ++
 vcl/inc/pdf/pdfwriter_impl.hxx|4 ++--
 vcl/source/gdi/pdfwriter_impl.cxx |   31 ++-
 vcl/source/outdev/map.cxx |   19 +++
 vcl/source/pdf/Matrix3.cxx|6 ++
 6 files changed, 45 insertions(+), 19 deletions(-)

New commits:
commit 38a29acd7e305ec99c4eb1871b9f31f75a3ab80c
Author: Caolán McNamara 
AuthorDate: Wed Aug 24 11:32:30 2022 +0100
Commit: Caolán McNamara 
CommitDate: Thu Aug 25 09:51:12 2022 +0200

use DevicePoint and SubPixelToLogic to return to source coord system

Change-Id: I1aeae6270feb6cb0a44b7850e1b3143e68ae780f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138770
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/vcl/inc/pdf/Matrix3.hxx b/vcl/inc/pdf/Matrix3.hxx
index 795b2af4be52..da88cc31399b 100644
--- a/vcl/inc/pdf/Matrix3.hxx
+++ b/vcl/inc/pdf/Matrix3.hxx
@@ -11,6 +11,7 @@
 #pragma once
 
 #include 
+#include 
 #include 
 
 namespace vcl::pdf
@@ -45,6 +46,7 @@ public:
 double get(size_t i) const { return f[i]; }
 
 Point transform(const Point& rPoint) const;
+DevicePoint transform(const DevicePoint& rPoint) const;
 };
 }
 
diff --git a/vcl/inc/pdf/pdfwriter_impl.hxx b/vcl/inc/pdf/pdfwriter_impl.hxx
index 4ebddbe5edaf..9af21e81baee 100644
--- a/vcl/inc/pdf/pdfwriter_impl.hxx
+++ b/vcl/inc/pdf/pdfwriter_impl.hxx
@@ -579,14 +579,14 @@ struct PDFAddStream
 // helper structure for drawLayout and friends
 struct PDFGlyph
 {
-Point const   m_aPos;
+DevicePoint const m_aPos;
 const GlyphItem* m_pGlyph;
 sal_Int32 const   m_nNativeWidth;
 sal_Int32 const   m_nMappedFontId;
 sal_uInt8 const   m_nMappedGlyphId;
 int const m_nCharPos;
 
-PDFGlyph( const Point& rPos,
+PDFGlyph( const DevicePoint& rPos,
   const GlyphItem* pGlyph,
   sal_Int32 nNativeWidth,
   sal_Int32 nFontId,
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 48a8b472df03..74b7ccdbcf7d 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -5944,8 +5944,7 @@ void PDFWriterImpl::drawVerticalGlyphs(
 sal_Int32 nFontHeight )
 {
 tools::Long nXOffset = 0;
-Point aCurPos( rGlyphs[0].m_aPos );
-aCurPos = PixelToLogic( aCurPos );
+Point aCurPos(SubPixelToLogic(rGlyphs[0].m_aPos));
 aCurPos += rAlignOffset;
 for( size_t i = 0; i < rGlyphs.size(); i++ )
 {
@@ -5969,9 +5968,9 @@ void PDFWriterImpl::drawVerticalGlyphs(
 if( i < rGlyphs.size()-1 )
 // #i120627# the text on the Y axis is reversed when export ppt file 
to PDF format
 {
-tools::Long nOffsetX = rGlyphs[i+1].m_aPos.X() - 
rGlyphs[i].m_aPos.X();
-tools::Long nOffsetY = rGlyphs[i+1].m_aPos.Y() - 
rGlyphs[i].m_aPos.Y();
-nXOffset += static_cast(sqrt(double(nOffsetX*nOffsetX + 
nOffsetY*nOffsetY)));
+double nOffsetX = rGlyphs[i+1].m_aPos.getX() - 
rGlyphs[i].m_aPos.getX();
+double nOffsetY = rGlyphs[i+1].m_aPos.getY() - 
rGlyphs[i].m_aPos.getY();
+nXOffset += static_cast(sqrt(nOffsetX*nOffsetX + 
nOffsetY*nOffsetY));
 }
 if (!rGlyphs[i].m_pGlyph->glyphId())
 continue;
@@ -6022,7 +6021,7 @@ void PDFWriterImpl::drawHorizontalGlyphs(
 for( size_t i = 1; i < rGlyphs.size(); i++ )
 {
 if( rGlyphs[i].m_nMappedFontId != rGlyphs[i-1].m_nMappedFontId ||
-rGlyphs[i].m_aPos.Y() != rGlyphs[i-1].m_aPos.Y() )
+rGlyphs[i].m_aPos.getY() != rGlyphs[i-1].m_aPos.getY() )
 {
 aRunEnds.push_back(i);
 }
@@ -6034,10 +6033,8 @@ void PDFWriterImpl::drawHorizontalGlyphs(
 sal_uInt32 nBeginRun = 0;
 for( size_t nRun = 0; nRun < aRunEnds.size(); nRun++ )
 {
-// setup text matrix
-Point aCurPos = rGlyphs[nBeginRun].m_aPos;
-// back transformation to current coordinate system
-aCurPos = PixelToLogic( aCurPos );
+// setup text matrix back transformed to current coordinate system
+Point aCurPos(SubPixelToLogic(rGlyphs[nBeginRun].m_aPos));
 aCurPos += rAlignOffset;
 // the first run can be set with "Td" operator
 // subsequent use of that operator would move
@@ -6079,9 +6076,9 @@ void PDFWriterImpl::drawHorizontalGlyphs(
 {
 appendHex( rGlyphs[nPos].m_nMappedGlyphId, aUnkernedLine );
 // check if default glyph positioning is sufficient
-const Point aThisPos = aMat.transform( rGlyphs[nPos].m_aPos );
-const Point aPrevPos = aMat.transform( rGlyphs[nPos-1].m_aPos );
-double fAdvance = aThisPos.X() - aPrevPos.X();
+const DevicePoint aThisPos = aMat.transform( rGlyphs[nPos].m_aPos 
);
+const DevicePoint aPrevPos = aMat.transform( 

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

2022-06-01 Thread Mike Kaganski (via logerrit)
 include/vcl/toolkit/treelistbox.hxx  |2 
 include/vcl/weld.hxx |4 
 vcl/inc/iconview.hxx |7 
 vcl/inc/jsdialog/jsdialogbuilder.hxx |3 
 vcl/inc/salvtables.hxx   |2 
 vcl/inc/svimpbox.hxx |2 
 vcl/jsdialog/jsdialogbuilder.cxx |6 
 vcl/source/app/salvtables.cxx|   23 +
 vcl/source/treelist/iconview.cxx |   75 ++---
 vcl/source/treelist/iconviewimpl.cxx |  523 +--
 vcl/source/treelist/iconviewimpl.hxx |   28 +
 vcl/source/treelist/svimpbox.cxx |4 
 vcl/source/treelist/treelistbox.cxx  |8 
 vcl/unx/gtk3/gtkinst.cxx |6 
 14 files changed, 442 insertions(+), 251 deletions(-)

New commits:
commit c2253f587b68f7277f30259160155f2bbf7adc78
Author: Mike Kaganski 
AuthorDate: Mon May 30 10:37:53 2022 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jun 1 16:30:11 2022 +0200

Introduce weld::IconView::insert_separator

Needed to eventual re-implementation of starmath's SmElementsControl
using IconView.

This required re-implementation of IconViewImpl, to layout entries
by iteration, because now it's impossible to find an entry position
just based on its index.

This coincidentally fixed some visual glitches in non-gtk IconView
implementation from commit 5813660e7bfe128ac076e592fe31de64a6863780
  Author Szymon Kłos 
  Date   Tue Feb 16 16:03:30 2016 +0100
icon view for RemoteFilesDialog

where any selected element could become first in row when scrolling.

SvTreeListBox::SetEntryHeight taking a SvTreeListEntry const* had to
be renamed to CalcEntryHeight, to avoid both virtual and non-virtual
overloads, additionally having different accessibility.

A TODO is implement separators in GtkInstanceIconView. I couldn't
find a GTK API for separators in IconView, so possibly a workaround
would be needed with some non-selectable narrow elements.

Change-Id: Ie8dc35d94049a1c48e4eb49697681ffbe93c17f4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135112
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/include/vcl/toolkit/treelistbox.hxx 
b/include/vcl/toolkit/treelistbox.hxx
index 685540b2d858..7e21dfda21e7 100644
--- a/include/vcl/toolkit/treelistbox.hxx
+++ b/include/vcl/toolkit/treelistbox.hxx
@@ -476,7 +476,7 @@ public:
 
 protected:
 
-VCL_DLLPRIVATE void SetEntryHeight( SvTreeListEntry const * pEntry 
);
+virtual voidCalcEntryHeight(SvTreeListEntry const* pEntry);
void AdjustEntryHeight( const Image& rBmp );
 VCL_DLLPRIVATE void AdjustEntryHeight();
 
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index dba513870818..528405643716 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -1361,6 +1361,8 @@ public:
 const VirtualDevice* pIcon, TreeIter* pRet)
 = 0;
 
+virtual void insert_separator(int pos, const OUString* pId) = 0;
+
 void append(const OUString& rId, const OUString& rStr, const OUString& 
rImage)
 {
 insert(-1, , , , nullptr);
@@ -1371,6 +1373,8 @@ public:
 insert(-1, , , pImage, nullptr);
 }
 
+void append_separator(const OUString& rId) { insert_separator(-1, ); }
+
 void connect_selection_changed(const Link& rLink)
 {
 m_aSelectionChangeHdl = rLink;
diff --git a/vcl/inc/iconview.hxx b/vcl/inc/iconview.hxx
index c1e62bc2ec65..971a638cc6ef 100644
--- a/vcl/inc/iconview.hxx
+++ b/vcl/inc/iconview.hxx
@@ -27,15 +27,20 @@ class IconView final : public SvTreeListBox
 public:
 IconView(vcl::Window* pParent, WinBits nBits);
 
+Size GetEntrySize(const SvTreeListEntry&) const;
+
 virtual void Resize() override;
 
-virtual tools::Rectangle GetFocusRect(const SvTreeListEntry*, tools::Long 
nEntryPos) override;
+virtual tools::Rectangle GetFocusRect(const SvTreeListEntry*, tools::Long) 
override;
 
 void PaintEntry(SvTreeListEntry&, tools::Long nX, tools::Long nY,
 vcl::RenderContext& rRenderContext);
 
 virtual FactoryFunction GetUITestFactory() const override;
 virtual void DumpAsPropertyTree(tools::JsonWriter& rJsonWriter) override;
+
+protected:
+virtual void CalcEntryHeight(SvTreeListEntry const* pEntry) override;
 };
 
 #endif
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index a25aeac55c10..5e7437b2725a 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -670,6 +670,9 @@ public:
 
 virtual void insert(int pos, const OUString* pStr, const OUString* pId,
 const VirtualDevice* pIcon, weld::TreeIter* pRet) 
override;
+
+virtual void insert_separator(int pos, const OUString* pId) override;
+
 virtual void clear() override;
 virtual void select(int pos) override;
 

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

2022-06-01 Thread Mike Kaganski (via logerrit)
 include/vcl/weld.hxx  |   10 +
 vcl/inc/salvtables.hxx|6 +
 vcl/source/app/salvtables.cxx |   29 ++
 vcl/unx/gtk3/gtkinst.cxx  |   46 ++
 4 files changed, 91 insertions(+)

New commits:
commit a130f0f406e67cda098adc3086e937317f737583
Author: Mike Kaganski 
AuthorDate: Tue May 24 18:43:45 2022 +0200
Commit: Mike Kaganski 
CommitDate: Wed Jun 1 16:29:42 2022 +0200

Implement weld::IconView::[gs]et_item_width

Change-Id: I211e3c21b4e0148c4ff6fc9931838e37ccd0cc41
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134897
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index aacbc7c310c4..dba513870818 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -1350,6 +1350,9 @@ protected:
 OUString signal_query_tooltip(const TreeIter& rIter) { return 
m_aQueryTooltipHdl.Call(rIter); }
 
 public:
+virtual int get_item_width() const = 0;
+virtual void set_item_width(int width) = 0;
+
 virtual void insert(int pos, const OUString* pStr, const OUString* pId,
 const OUString* pIconName, TreeIter* pRet)
 = 0;
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 7752b5243c11..45e9700ad2c8 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -1761,6 +1761,9 @@ private:
 public:
 SalInstanceIconView(::IconView* pIconView, SalInstanceBuilder* pBuilder, 
bool bTakeOwnership);
 
+virtual int get_item_width() const override;
+virtual void set_item_width(int width) override;
+
 virtual void freeze() override;
 
 virtual void thaw() override;
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 4755c94e51cb..4432b4c5afe6 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -5308,6 +5308,9 @@ SalInstanceIconView::SalInstanceIconView(::IconView* 
pIconView, SalInstanceBuild
 m_xIconView->SetPopupMenuHdl(LINK(this, SalInstanceIconView, CommandHdl));
 }
 
+int SalInstanceIconView::get_item_width() const { return 
m_xIconView->GetEntryWidth(); }
+void SalInstanceIconView::set_item_width(int width) { 
m_xIconView->SetEntryWidth(width); }
+
 void SalInstanceIconView::freeze()
 {
 bool bIsFirstFreeze = IsFirstFreeze();
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 1f61fc49db3d..0575aa8c3c7a 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -16252,6 +16252,16 @@ public:
 m_nIdCol = m_nTextCol + 1;
 }
 
+virtual int get_item_width() const override
+{
+return gtk_icon_view_get_item_width(m_pIconView);
+}
+
+virtual void set_item_width(int width) override
+{
+gtk_icon_view_set_item_width(m_pIconView, width);
+}
+
 virtual void insert(int pos, const OUString* pText, const OUString* pId, 
const OUString* pIconName, weld::TreeIter* pRet) override
 {
 disable_notify_events();
commit 1c2d3b069859f466f59f35e50819fadc0ab61af7
Author: Mike Kaganski 
AuthorDate: Mon May 23 12:48:15 2022 +0300
Commit: Mike Kaganski 
CommitDate: Wed Jun 1 16:29:28 2022 +0200

Implement weld::IconView::connect_query_tooltip

Change-Id: I8a8540e240d6a7046f564404c7c3b6bff8c2f04d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134806
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 06cb4d037b3b..aacbc7c310c4 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -1343,9 +1343,11 @@ protected:
 Link m_aSelectionChangeHdl;
 Link m_aItemActivatedHdl;
 Link m_aCommandHdl;
+Link m_aQueryTooltipHdl;
 
 void signal_selection_changed() { m_aSelectionChangeHdl.Call(*this); }
 bool signal_item_activated() { return m_aItemActivatedHdl.Call(*this); }
+OUString signal_query_tooltip(const TreeIter& rIter) { return 
m_aQueryTooltipHdl.Call(rIter); }
 
 public:
 virtual void insert(int pos, const OUString* pStr, const OUString* pId,
@@ -1381,6 +1383,11 @@ public:
 
 void connect_command(const Link& rLink) { 
m_aCommandHdl = rLink; }
 
+virtual void connect_query_tooltip(const Link& 
rLink)
+{
+m_aQueryTooltipHdl = rLink;
+}
+
 virtual OUString get_selected_id() const = 0;
 
 virtual void clear() = 0;
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 3f574237444b..7752b5243c11 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -1756,6 +1756,7 @@ private:
 DECL_LINK(DeSelectHdl, SvTreeListBox*, void);
 DECL_LINK(DoubleClickHdl, SvTreeListBox*, bool);
 DECL_LINK(CommandHdl, const CommandEvent&, bool);
+DECL_LINK(TooltipHdl, const HelpEvent&, bool);
 
 public:
 SalInstanceIconView(::IconView* pIconView, SalInstanceBuilder* pBuilder, 
bool bTakeOwnership);
@@ -1770,6 +1771,8 @@ public:
 virtual void 

[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/source

2022-04-08 Thread Luboš Luňák (via logerrit)
 include/vcl/glyphitemcache.hxx|6 +-
 vcl/inc/pdf/pdfwriter_impl.hxx|3 +++
 vcl/source/gdi/impglyphitem.cxx   |   35 +--
 vcl/source/gdi/pdfwriter_impl.cxx |   12 ++--
 4 files changed, 39 insertions(+), 17 deletions(-)

New commits:
commit 9ed2912d4ecfd9573b3ca9d2390a0f1b0e3060a2
Author: Luboš Luňák 
AuthorDate: Thu Apr 7 12:07:02 2022 +0200
Commit: Luboš Luňák 
CommitDate: Fri Apr 8 21:28:44 2022 +0200

check better for unchanged OutputDevice in SalLayoutGlyphsCache

Some things like font could change, so it needs to be saved and compared.
If would be even better to avoid comparing OutputDevice pointers
and instead compare only what actually matters, in order to reuse
the same glyphs used for different output devices, but I can't
find all the relevant data in OutputDevice.

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

diff --git a/include/vcl/glyphitemcache.hxx b/include/vcl/glyphitemcache.hxx
index 83c77309a632..64a1a64186ee 100644
--- a/include/vcl/glyphitemcache.hxx
+++ b/include/vcl/glyphitemcache.hxx
@@ -61,12 +61,16 @@ public:
 private:
 struct CachedGlyphsKey
 {
-VclPtr outputDevice;
 OUString text;
 sal_Int32 index;
 sal_Int32 len;
 Point logicPos;
 tools::Long logicWidth;
+VclPtr outputDevice;
+vcl::Font font;
+bool rtl;
+vcl::text::ComplexTextLayoutFlags layoutMode;
+LanguageType digitLanguage;
 size_t hashValue;
 CachedGlyphsKey(const VclPtr& dev, const OUString& 
t, sal_Int32 i,
 sal_Int32 l, const Point& p, tools::Long w);
diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx
index d320d27dad88..ea3c490b0ba2 100644
--- a/vcl/source/gdi/impglyphitem.cxx
+++ b/vcl/source/gdi/impglyphitem.cxx
@@ -135,32 +135,47 @@ SalLayoutGlyphsCache::GetLayoutGlyphs(VclPtr outputDevice, c
 SalLayoutGlyphsCache::CachedGlyphsKey::CachedGlyphsKey(const VclPtr& d,
const OUString& t, 
sal_Int32 i, sal_Int32 l,
const Point& p, 
tools::Long w)
-: outputDevice(d)
-, text(t)
+: text(t)
 , index(i)
 , len(l)
 , logicPos(p)
 , logicWidth(w)
+, outputDevice(d)
+// we also need to save things used in 
OutputDevice::ImplPrepareLayoutArgs(), in case they
+// change in the output device
+// TODO there is still something missing, otherwise it wouldn't be 
necessary to compare
+// also the OutputDevice pointers
+, font(outputDevice->GetFont())
+, rtl(outputDevice->IsRTLEnabled())
+, layoutMode(outputDevice->GetLayoutMode())
+, digitLanguage(outputDevice->GetDigitLanguage())
 {
 hashValue = 0;
-o3tl::hash_combine(hashValue, outputDevice.get());
-SvMemoryStream stream;
-WriteFont(stream, outputDevice->GetFont());
-o3tl::hash_combine(hashValue, static_cast(stream.GetData()), 
stream.GetSize());
 o3tl::hash_combine(hashValue, vcl::text::FirstCharsStringHash()(text));
 o3tl::hash_combine(hashValue, index);
 o3tl::hash_combine(hashValue, len);
 o3tl::hash_combine(hashValue, logicPos.X());
 o3tl::hash_combine(hashValue, logicPos.Y());
 o3tl::hash_combine(hashValue, logicWidth);
+
+o3tl::hash_combine(hashValue, outputDevice.get());
+SvMemoryStream stream;
+WriteFont(stream, font);
+o3tl::hash_combine(hashValue, static_cast(stream.GetData()), 
stream.GetSize());
+o3tl::hash_combine(hashValue, rtl);
+o3tl::hash_combine(hashValue, layoutMode);
+o3tl::hash_combine(hashValue, digitLanguage.get());
 }
 
 inline bool SalLayoutGlyphsCache::CachedGlyphsKey::operator==(const 
CachedGlyphsKey& other) const
 {
-return hashValue == other.hashValue && outputDevice == other.outputDevice
-   && index == other.index && len == other.len && logicPos == 
other.logicPos
-   && logicWidth == other.logicWidth
-   && vcl::text::FastStringCompareEqual()(text, other.text);
+return hashValue == other.hashValue && index == other.index && len == 
other.len
+   && logicPos == other.logicPos && logicWidth == other.logicWidth
+   && outputDevice == other.outputDevice && rtl == other.rtl
+   && layoutMode == other.layoutMode
+   && digitLanguage == other.digitLanguage
+   // slower things here
+   && font == other.font && vcl::text::FastStringCompareEqual()(text, 
other.text);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 376a9792c32a51c91079a54a0cf190acd58485af
Author: Luboš Luňák 
AuthorDate: Wed Apr 6 19:29:06 2022 +0200
Commit: Luboš Luňák 
CommitDate: Fri Apr 8 21:28:29 2022 +0200

use SalLayoutGlyphsCache in PDFWriterImpl
   

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

2022-04-08 Thread Luboš Luňák (via logerrit)
 include/vcl/glyphitemcache.hxx |   17 ++---
 vcl/inc/TextLayoutCache.hxx|   32 
 vcl/source/gdi/CommonSalLayout.cxx |   30 +-
 vcl/source/gdi/impglyphitem.cxx|   20 +++-
 4 files changed, 58 insertions(+), 41 deletions(-)

New commits:
commit 94c2fb28d76c9c37849412a66b31d6861bce3155
Author: Luboš Luňák 
AuthorDate: Wed Apr 6 19:28:07 2022 +0200
Commit: Luboš Luňák 
CommitDate: Fri Apr 8 21:28:15 2022 +0200

faster hashing of very long strings in SalLayoutGlyphsCache

tdf#147284 being a (pathological) testcase.

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

diff --git a/vcl/inc/TextLayoutCache.hxx b/vcl/inc/TextLayoutCache.hxx
index 0ce0c19d8278..ecb85ea7043d 100644
--- a/vcl/inc/TextLayoutCache.hxx
+++ b/vcl/inc/TextLayoutCache.hxx
@@ -20,6 +20,8 @@
 #pragma once
 
 #include 
+#include 
+#include 
 
 #include 
 
@@ -48,6 +50,36 @@ public:
 std::vector runs;
 TextLayoutCache(sal_Unicode const* pStr, sal_Int32 const nEnd);
 };
+
+struct FirstCharsStringHash
+{
+size_t operator()(const OUString& str) const
+{
+// Strings passed to GenericSalLayout::CreateTextLayoutCache() may be 
very long,
+// and computing an entire hash could almost negate the gain of 
hashing. Hash just first
+// characters, that should be good enough.
+size_t hash
+= rtl_ustr_hashCode_WithLength(str.getStr(), std::min(100, 
str.getLength()));
+o3tl::hash_combine(hash, str.getLength());
+return hash;
+}
+};
+
+struct FastStringCompareEqual
+{
+bool operator()(const OUString& str1, const OUString& str2) const
+{
+// Strings passed to GenericSalLayout::CreateTextLayoutCache() may be 
very long,
+// and OUString operator == compares backwards and using hard-written 
code, while
+// memcmp() compares much faster.
+if (str1.getLength() != str2.getLength())
+return false;
+if (str1.getStr() == str2.getStr())
+return true;
+return memcmp(str1.getStr(), str2.getStr(), str1.getLength() * 
sizeof(str1.getStr()[0]))
+   == 0;
+}
+};
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/vcl/source/gdi/CommonSalLayout.cxx 
b/vcl/source/gdi/CommonSalLayout.cxx
index 8dee28727997..2c8a4db8398f 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -154,40 +154,12 @@ namespace {
 return VerticalOrientation(nRet);
 }
 
-struct FirstCharsStringHash
-{
-size_t operator()( const OUString& str ) const
-{
-// Strings passed to GenericSalLayout::CreateTextLayoutCache() may be 
very long,
-// and computing an entire hash could almost negate the gain of 
hashing. Hash just first
-// characters, that should be good enough.
-size_t hash = rtl_ustr_hashCode_WithLength( str.getStr(), 
std::min( 100, str.getLength()));
-o3tl::hash_combine(hash, str.getLength());
-return hash;
-}
-};
-
-struct ForwardStringCompareEqual
-{
-bool operator()( const OUString& str1, const OUString& str2 ) const
-{
-// Strings passed to GenericSalLayout::CreateTextLayoutCache() may be 
very long,
-// and OUString operator == compares backwards, which is inefficient 
for very long
-// strings (bad memory prefetch).
-if( str1.getLength() != str2.getLength())
-return false;
-if( str1.getStr() == str2.getStr())
-return true;
-return memcmp( str1.getStr(), str2.getStr(), str1.getLength() * 
sizeof( str1.getStr()[ 0 ] )) == 0;
-}
-};
-
 } // namespace
 
 std::shared_ptr 
GenericSalLayout::CreateTextLayoutCache(OUString const& rString)
 {
 typedef o3tl::lru_map,
-FirstCharsStringHash, ForwardStringCompareEqual> Cache;
+vcl::text::FirstCharsStringHash, vcl::text::FastStringCompareEqual> 
Cache;
 static vcl::DeleteOnDeinit< Cache > cache( 1000 );
 if( Cache* map = cache.get())
 {
diff --git a/vcl/source/gdi/impglyphitem.cxx b/vcl/source/gdi/impglyphitem.cxx
index eaf8cf5c8453..d320d27dad88 100644
--- a/vcl/source/gdi/impglyphitem.cxx
+++ b/vcl/source/gdi/impglyphitem.cxx
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 
 SalLayoutGlyphs::SalLayoutGlyphs() {}
 
@@ -146,7 +147,7 @@ 
SalLayoutGlyphsCache::CachedGlyphsKey::CachedGlyphsKey(const VclPtrGetFont());
 o3tl::hash_combine(hashValue, static_cast(stream.GetData()), 
stream.GetSize());
-o3tl::hash_combine(hashValue, text);
+o3tl::hash_combine(hashValue, vcl::text::FirstCharsStringHash()(text));
 o3tl::hash_combine(hashValue, index);
 o3tl::hash_combine(hashValue, len);
 o3tl::hash_combine(hashValue, 

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

2021-08-05 Thread oguzbalkaya (via logerrit)
 include/vcl/toolkit/dialog.hxx |6 +++---
 vcl/inc/osx/vclnsapp.h |5 +
 2 files changed, 4 insertions(+), 7 deletions(-)

New commits:
commit ae1ac7eaf14a78bff050b90daaf7a9996cfc2f9a
Author: oguzbalkaya 
AuthorDate: Wed Aug 4 00:08:12 2021 +0300
Commit: Ilmari Lauhakangas 
CommitDate: Thu Aug 5 20:22:37 2021 +0200

tdf#143148: Use pragma once instead of include guards

Change-Id: I036dd26b2e70c12896afcef2ce25586e8db3098c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119959
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/vcl/inc/osx/vclnsapp.h b/vcl/inc/osx/vclnsapp.h
index 82f0229a9f93..5cf8582c3771 100644
--- a/vcl/inc/osx/vclnsapp.h
+++ b/vcl/inc/osx/vclnsapp.h
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_VCL_INC_OSX_VCLNSAPP_H
-#define INCLUDED_VCL_INC_OSX_VCLNSAPP_H
+#pragma once
 
 #include 
 
@@ -63,6 +62,4 @@ class AquaSalFrame;
 -(void)setDockIconClickHandler: (NSObject*)pHandler;
 @end
 
-#endif // INCLUDED_VCL_INC_OSX_VCLNSAPP_H
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit c4127ca194a20aa81da6fb09d765f353cadd6eb8
Author: Caolán McNamara 
AuthorDate: Thu Aug 5 16:49:18 2021 +0100
Commit: Caolán McNamara 
CommitDate: Thu Aug 5 20:22:22 2021 +0200

make Dialog::GetDefaultParent private

Change-Id: I47d8e125646ee72aa6a9c12bbfdf09a784769d85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120080
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/include/vcl/toolkit/dialog.hxx b/include/vcl/toolkit/dialog.hxx
index 377ae37cc66d..52f58957bc5a 100644
--- a/include/vcl/toolkit/dialog.hxx
+++ b/include/vcl/toolkit/dialog.hxx
@@ -74,6 +74,9 @@ private:
 DECL_DLLPRIVATE_LINK(ImplAsyncCloseHdl, void*, void);
 DECL_DLLPRIVATE_LINK(ResponseHdl, Button*, void);
 
+// get the default parent for a dialog as is done in standard 
initialization
+SAL_DLLPRIVATE static vcl::Window* GetDefaultParent(WinBits nStyle);
+
 protected:
 voidImplInitDialog( vcl::Window* pParent, WinBits nStyle, InitFlag 
eFlag = InitFlag::Default );
 
@@ -102,9 +105,6 @@ public:
 virtual ~Dialog() override;
 virtual voiddispose() override;
 
-// get the default parent for a dialog as is done in standard 
initialization
-static vcl::Window* GetDefaultParent(WinBits nStyle);
-
 virtual boolEventNotify( NotifyEvent& rNEvt ) override;
 virtual voidStateChanged( StateChangedType nStateChange ) override;
 virtual voidDataChanged( const DataChangedEvent& rDCEvt ) override;


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

2021-03-04 Thread Szymon Kłos (via logerrit)
 include/vcl/toolkit/treelistbox.hxx  |1 +
 vcl/inc/jsdialog/jsdialogbuilder.hxx |2 ++
 vcl/jsdialog/executor.cxx|8 
 vcl/jsdialog/jsdialogbuilder.cxx |   35 +++
 vcl/source/treelist/svtabbx.cxx  |2 ++
 vcl/source/window/dialog.cxx |   10 ++
 6 files changed, 58 insertions(+)

New commits:
commit 62fcfdfef4790f2569838e5f3ef39ee4e33028b8
Author: Szymon Kłos 
AuthorDate: Tue Feb 9 09:38:58 2021 +0100
Commit: Szymon Kłos 
CommitDate: Thu Mar 4 15:42:55 2021 +0100

jsdialog: single activation property for treeview

Change-Id: Iaaeab7f14f1a05c38f41c4beb774a0980844fdb3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110621
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111959
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/include/vcl/toolkit/treelistbox.hxx 
b/include/vcl/toolkit/treelistbox.hxx
index 3cd50dddee65..d11a006d4c1a 100644
--- a/include/vcl/toolkit/treelistbox.hxx
+++ b/include/vcl/toolkit/treelistbox.hxx
@@ -677,6 +677,7 @@ public:
 
 // Make single click "activate" a row like a double-click normally does
 voidSetActivateOnSingleClick(bool bEnable) { 
mbActivateOnSingleClick = bEnable; }
+boolGetActivateOnSingleClick() { return 
mbActivateOnSingleClick; }
 
 // Make mouse over a row "select" a row like a single-click normally does
 voidSetHoverSelection(bool bEnable) { mbHoverSelection = 
bEnable; }
diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx
index 613d1831bf2b..ab1736f32120 100644
--- a/vcl/source/treelist/svtabbx.cxx
+++ b/vcl/source/treelist/svtabbx.cxx
@@ -115,6 +115,8 @@ void SvTabListBox::DumpAsPropertyTree(tools::JsonWriter& 
rJsonWriter)
 {
 SvTreeListBox::DumpAsPropertyTree(rJsonWriter);
 
+rJsonWriter.put("singleclickactivate", GetActivateOnSingleClick());
+
 bool bCheckButtons = static_cast(nTreeFlags & SvTreeFlags::CHKBTN);
 
 auto entriesNode = rJsonWriter.startArray("entries");
commit 325d349c04a3b1cd6d17990ac9255cc432a4e24b
Author: Szymon Kłos 
AuthorDate: Mon Feb 8 16:58:44 2021 +0100
Commit: Szymon Kłos 
CommitDate: Thu Mar 4 15:42:33 2021 +0100

jsdialog: handle standard buttons like help

- dump response bindings
- execute help callback

Change-Id: Ib0696b4ba74a186a2b80d49f21a1442d1c520821
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110586
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111958
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 462b1cfeb1ef..3a6e338a80c2 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -401,6 +401,8 @@ public:
 virtual void set_primary_text(const OUString& rText) override;
 
 virtual void set_secondary_text(const OUString& rText) override;
+
+virtual void response(int response) override;
 };
 
 class JSCheckButton : public JSWidget
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 8c76e77d8b37..3644dc1bcf9b 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -321,6 +321,14 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& 
rWidget, StringMap& rDat
 pDialog->response(RET_CANCEL);
 return true;
 }
+else if (sAction == "response")
+{
+OString nResponseString
+= OUStringToOString(rData["data"], 
RTL_TEXTENCODING_ASCII_US);
+int nResponse = std::atoi(nResponseString.getStr());
+pDialog->response(nResponse);
+return true;
+}
 }
 }
 else if (sControlType == "radiobutton")
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index da0537893a35..c7c8c3735fd5 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -27,6 +27,23 @@
 #include 
 #include 
 
+namespace
+{
+void response_help(vcl::Window* pWindow)
+{
+::Dialog* pDialog = dynamic_cast<::Dialog*>(pWindow);
+if (!pDialog)
+return;
+
+vcl::Window* pButtonWindow = pDialog->get_widget_for_response(RET_HELP);
+::Button* pButton = dynamic_cast<::Button*>(pButtonWindow);
+if (!pButton)
+return;
+
+pButton->Click();
+}
+}
+
 JSDialogNotifyIdle::JSDialogNotifyIdle(VclPtr aNotifierWindow,
VclPtr aContentWindow, 
std::string sTypeOfJSON)
 : Idle("JSDialog notify")
@@ -748,6 +765,12 @@ void JSDialog::undo_collapse()
 
 void JSDialog::response(int response)
 {
+if (response == 

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

2020-12-28 Thread Szymon Kłos (via logerrit)
 include/vcl/layout.hxx   |1 +
 vcl/inc/jsdialog/jsdialogbuilder.hxx |9 +
 vcl/jsdialog/jsdialogbuilder.cxx |   22 ++
 vcl/source/window/layout.cxx |6 ++
 4 files changed, 38 insertions(+)

New commits:
commit 6c8dad40a18e588a0404485ff5cae0f9cd4a5ea7
Author: Szymon Kłos 
AuthorDate: Wed Dec 16 10:18:15 2020 +0100
Commit: Szymon Kłos 
CommitDate: Tue Dec 29 06:03:55 2020 +0100

jsdialog: update JSON on treeview modification

Change-Id: Ibaf186768f9be0cb2dc893082590c851abae29b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107819
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108413
Tested-by: Jenkins

diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index cf7b17dca2d1..0a02e64cf890 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -382,6 +382,15 @@ public:
 
 virtual weld::TreeView* get_drag_source() const override;
 
+using SalInstanceTreeView::insert;
+virtual void insert(const weld::TreeIter* pParent, int pos, const 
OUString* pStr,
+const OUString* pId, const OUString* pIconName,
+VirtualDevice* pImageSurface, bool bChildrenOnDemand,
+weld::TreeIter* pRet) override;
+
+virtual void set_text(int row, const OUString& rText, int col = -1) 
override;
+virtual void set_text(const weld::TreeIter& rIter, const OUString& rStr, 
int col = -1) override;
+
 void drag_start();
 void drag_end();
 };
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index aa1febfe5d2a..1bef2653ae11 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -1031,6 +1031,28 @@ IMPL_LINK(JSTreeView, on_window_event, VclWindowEvent&, 
rEvent, void)
 }
 }
 
+void JSTreeView::insert(const weld::TreeIter* pParent, int pos, const 
OUString* pStr,
+const OUString* pId, const OUString* pIconName,
+VirtualDevice* pImageSurface, bool bChildrenOnDemand, 
weld::TreeIter* pRet)
+{
+SalInstanceTreeView::insert(pParent, pos, pStr, pId, pIconName, 
pImageSurface,
+bChildrenOnDemand, pRet);
+
+notifyDialogState();
+}
+
+void JSTreeView::set_text(int row, const OUString& rText, int col)
+{
+SalInstanceTreeView::set_text(row, rText, col);
+notifyDialogState();
+}
+
+void JSTreeView::set_text(const weld::TreeIter& rIter, const OUString& rStr, 
int col)
+{
+SalInstanceTreeView::set_text(rIter, rStr, col);
+notifyDialogState();
+}
+
 JSExpander::JSExpander(VclPtr aNotifierWindow, 
VclPtr aContentWindow,
::VclExpander* pExpander, SalInstanceBuilder* pBuilder, 
bool bTakeOwnership,
std::string sTypeOfJSON)
commit d6b2835e0f98e751f0161ff8f3be33013dab5cfd
Author: Szymon Kłos 
AuthorDate: Fri Dec 11 11:37:49 2020 +0100
Commit: Szymon Kłos 
CommitDate: Tue Dec 29 06:03:47 2020 +0100

jsdialog: export alignment type

Change-Id: I846f51d522fb0639b22148c73563b177d091178c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107589
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108412
Tested-by: Jenkins

diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index cbcb6d2373f0..5c4a60c4f5e8 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -461,6 +461,7 @@ public:
 {
 }
 virtual bool set_property(const OString , const OUString ) 
override;
+virtual void DumpAsPropertyTree(tools::JsonWriter&) override;
 private:
 virtual Size calculateRequisition() const override;
 virtual void setAllocation(const Size ) override;
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index b8407e84afba..1c503194b5ae 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1580,6 +1580,12 @@ bool VclAlignment::set_property(const OString , 
const OUString )
 return true;
 }
 
+void VclAlignment::DumpAsPropertyTree(tools::JsonWriter& rJsonWriter)
+{
+VclContainer::DumpAsPropertyTree(rJsonWriter);
+rJsonWriter.put("type", "alignment");
+}
+
 class DisclosureButton final : public CheckBox
 {
 virtual void ImplDrawCheckBoxState(vcl::RenderContext& rRenderContext) 
override
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-11-25 Thread Szymon Kłos (via logerrit)
 include/vcl/toolkit/svtabbx.hxx |2 
 vcl/inc/salvtables.hxx  |  358 +
 vcl/source/app/salvtables.cxx   | 2446 +++-
 vcl/source/treelist/svtabbx.cxx |   49 
 4 files changed, 1608 insertions(+), 1247 deletions(-)

New commits:
commit 01e54822635b965c068094493294c579af4c4161
Author: Szymon Kłos 
AuthorDate: Tue Nov 24 16:31:40 2020 +0100
Commit: Szymon Kłos 
CommitDate: Wed Nov 25 09:03:43 2020 +0100

Move SalInstanceTreeView decl to header file

Change-Id: Ie49f4113332de5c4fa825f93dde46bb408187fe4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106536
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index 4fca8ff49cc5..cb7ccc7b12e3 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -24,6 +24,9 @@
 #include 
 #include 
 #include "messagedialog.hxx"
+#include 
+#include 
+#include 
 
 class SalInstanceBuilder : public weld::Builder
 {
@@ -1297,4 +1300,359 @@ public:
 virtual ~SalInstanceTextView() override;
 };
 
+class SalInstanceTreeView : public SalInstanceContainer, public virtual 
weld::TreeView
+{
+private:
+// owner for UserData
+std::vector> m_aUserData;
+VclPtr m_xTreeView;
+SvLBoxButtonData m_aCheckButtonData;
+SvLBoxButtonData m_aRadioButtonData;
+// currently expanding parent that logically, but not currently physically,
+// contain placeholders
+o3tl::sorted_vector m_aExpandingPlaceHolderParents;
+// which columns should be custom rendered
+o3tl::sorted_vector m_aCustomRenders;
+bool m_bTogglesAsRadio;
+int m_nSortColumn;
+
+DECL_LINK(SelectHdl, SvTreeListBox*, void);
+DECL_LINK(DeSelectHdl, SvTreeListBox*, void);
+DECL_LINK(DoubleClickHdl, SvTreeListBox*, bool);
+DECL_LINK(ExpandingHdl, SvTreeListBox*, bool);
+DECL_LINK(EndDragHdl, HeaderBar*, void);
+DECL_LINK(HeaderBarClickedHdl, HeaderBar*, void);
+DECL_LINK(ToggleHdl, SvLBoxButtonData*, void);
+DECL_LINK(ModelChangedHdl, SvTreeListBox*, void);
+DECL_LINK(StartDragHdl, SvTreeListBox*, bool);
+DECL_STATIC_LINK(SalInstanceTreeView, FinishDragHdl, SvTreeListBox*, void);
+DECL_LINK(EditingEntryHdl, SvTreeListEntry*, bool);
+typedef std::pair IterString;
+DECL_LINK(EditedEntryHdl, IterString, bool);
+DECL_LINK(VisibleRangeChangedHdl, SvTreeListBox*, void);
+DECL_LINK(CompareHdl, const SvSortData&, sal_Int32);
+DECL_LINK(PopupMenuHdl, const CommandEvent&, bool);
+DECL_LINK(TooltipHdl, const HelpEvent&, bool);
+DECL_LINK(CustomRenderHdl, svtree_render_args, void);
+DECL_LINK(CustomMeasureHdl, svtree_measure_args, Size);
+
+// Each row has a cell for the expander image, (and an optional cell for a
+// checkbutton if enable_toggle_buttons has been called) which precede
+// index 0
+int to_internal_model(int col) const;
+
+int to_external_model(int col) const;
+
+bool IsDummyEntry(SvTreeListEntry* pEntry) const;
+
+SvTreeListEntry* GetPlaceHolderChild(SvTreeListEntry* pEntry) const;
+
+static void set_font_color(SvTreeListEntry* pEntry, const Color& rColor);
+
+void AddStringItem(SvTreeListEntry* pEntry, const OUString& rStr, int 
nCol);
+
+void do_insert(const weld::TreeIter* pParent, int pos, const OUString* 
pStr,
+   const OUString* pId, const OUString* pIconName,
+   const VirtualDevice* pImageSurface, bool bChildrenOnDemand, 
weld::TreeIter* pRet,
+   bool bIsSeparator);
+
+void update_checkbutton_column_width(SvTreeListEntry* pEntry);
+
+void InvalidateModelEntry(SvTreeListEntry* pEntry);
+
+void do_set_toggle(SvTreeListEntry* pEntry, TriState eState, int col);
+
+static TriState do_get_toggle(SvTreeListEntry* pEntry, int col);
+
+TriState get_toggle(SvTreeListEntry* pEntry, int col) const;
+
+void set_toggle(SvTreeListEntry* pEntry, TriState eState, int col);
+
+bool get_text_emphasis(SvTreeListEntry* pEntry, int col) const;
+
+void set_header_item_width(const std::vector& rWidths);
+
+public:
+SalInstanceTreeView(SvTabListBox* pTreeView, SalInstanceBuilder* pBuilder, 
bool bTakeOwnership);
+
+virtual void connect_query_tooltip(const Link& rLink) override;
+
+virtual void columns_autosize() override;
+
+virtual void freeze() override;
+
+virtual void thaw() override;
+
+virtual void set_column_fixed_widths(const std::vector& rWidths) 
override;
+
+virtual void set_column_editables(const std::vector& rEditables) 
override;
+
+virtual void set_centered_column(int nCol) override;
+
+virtual int get_column_width(int nColumn) const override;
+
+virtual OUString get_column_title(int nColumn) const override;
+
+virtual void set_column_title(int nColumn, const OUString& rTitle) 
override;
+
+virtual void set_column_custom_renderer(int nColumn, bool bEnable) 
override;
+
+virtual void 

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

2020-07-16 Thread Szymon Kłos (via logerrit)
 include/vcl/jsdialog/executor.hxx|2 
 include/vcl/weld.hxx |2 
 vcl/inc/jsdialog/jsdialogbuilder.hxx |   12 +
 vcl/inc/salvtables.hxx   |   57 +++
 vcl/jsdialog/executor.cxx|   11 +
 vcl/jsdialog/jsdialogbuilder.cxx |   29 
 vcl/source/app/salvtables.cxx|  252 ---
 7 files changed, 231 insertions(+), 134 deletions(-)

New commits:
commit 10775fb4006dcdf3ce5b01179b4d9a6f009d8592
Author: Szymon Kłos 
AuthorDate: Thu Jul 2 14:44:24 2020 +0200
Commit: Szymon Kłos 
CommitDate: Thu Jul 16 13:24:59 2020 +0200

jsdialog: weld text view

Change-Id: Ia3bae7a8b812e791fc6ae63adca17b8910d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98883
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 

diff --git a/include/vcl/jsdialog/executor.hxx 
b/include/vcl/jsdialog/executor.hxx
index d988f5460a08..1cfa24c28a8a 100644
--- a/include/vcl/jsdialog/executor.hxx
+++ b/include/vcl/jsdialog/executor.hxx
@@ -16,6 +16,8 @@
 class LOKTrigger
 {
 public:
+static void trigger_changed(weld::TextView& rView) { 
rView.signal_changed(); }
+
 static void trigger_changed(weld::Entry& rEdit) { rEdit.signal_changed(); }
 
 static void trigger_changed(weld::ComboBox& rComboBox) { 
rComboBox.signal_changed(); }
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 7bd54920a0bc..7d29e1c7f605 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -1937,6 +1937,8 @@ public:
 
 class VCL_DLLPUBLIC TextView : virtual public Container
 {
+friend class ::LOKTrigger;
+
 private:
 OUString m_sSavedValue;
 
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx 
b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 1622cc0f6ade..c9673e778c16 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -21,6 +21,8 @@
 
 class ToolBox;
 class ComboBox;
+class VclMultiLineEdit;
+
 typedef std::map WidgetMap;
 
 class JSDialogNotifyIdle : public Idle
@@ -92,6 +94,8 @@ public:
   bool bTakeOwnership = false) override;
 std::unique_ptr weld_toolbar(const OString& id,
 bool bTakeOwnership = false) 
override;
+std::unique_ptr weld_text_view(const OString& id,
+   bool bTakeOwnership = 
false) override;
 
 static weld::MessageDialog* CreateMessageDialog(weld::Widget* pParent,
 VclMessageType 
eMessageType,
@@ -249,4 +253,12 @@ public:
 virtual void signal_clicked(const OString& rIdent) override;
 };
 
+class JSTextView : public JSWidget
+{
+public:
+JSTextView(VclPtr aOwnedToplevel, ::VclMultiLineEdit* 
pTextView,
+   SalInstanceBuilder* pBuilder, bool bTakeOwnership);
+virtual void set_text(const OUString& rText) override;
+};
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx
index 1df6af10c9c6..53fded14e1c1 100644
--- a/vcl/jsdialog/executor.cxx
+++ b/vcl/jsdialog/executor.cxx
@@ -131,6 +131,17 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& 
rWidget, StringMap& rDat
 return true;
 }
 }
+
+auto pTextView = dynamic_cast(pWidget);
+if (pTextView)
+{
+if (sAction == "change")
+{
+pTextView->set_text(rData["data"]);
+LOKTrigger::trigger_changed(*pTextView);
+return true;
+}
+}
 }
 }
 
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index e3245a40a73b..33a7b8c3c992 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 
 JSDialogNotifyIdle::JSDialogNotifyIdle(VclPtr aWindow)
 : Idle("JSDialog notify")
@@ -331,6 +332,21 @@ std::unique_ptr 
JSInstanceBuilder::weld_toolbar(const OString& id
 return pWeldWidget;
 }
 
+std::unique_ptr JSInstanceBuilder::weld_text_view(const 
OString& id,
+  bool 
bTakeOwnership)
+{
+VclMultiLineEdit* pTextView = m_xBuilder->get(id);
+auto pWeldWidget = pTextView ? std::make_unique(
+   m_bHasTopLevelDialog ? m_aOwnedToplevel 
: m_aParentDialog,
+   pTextView, this, bTakeOwnership)
+ : nullptr;
+
+if (pWeldWidget)
+RememberWidget(id, pWeldWidget.get());
+
+return pWeldWidget;
+}
+
 weld::MessageDialog* JSInstanceBuilder::CreateMessageDialog(weld::Widget* 
pParent,
 VclMessageType 
eMessageType,
  

[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/opengl vcl/source

2016-11-28 Thread David Tardon
 include/vcl/opengl/OpenGLContext.hxx |4 +-
 vcl/inc/opengl/RenderState.hxx   |2 -
 vcl/opengl/gdiimpl.cxx   |   48 +--
 vcl/opengl/program.cxx   |   11 +++-
 vcl/opengl/salbmp.cxx|   16 +--
 vcl/opengl/scale.cxx |4 +-
 vcl/opengl/texture.cxx   |   24 -
 vcl/opengl/x11/gdiimpl.cxx   |2 -
 vcl/source/opengl/OpenGLContext.cxx  |2 -
 9 files changed, 54 insertions(+), 59 deletions(-)

New commits:
commit 83288089d5efd2cd1d5c76b05a4ba3f782641e88
Author: David Tardon 
Date:   Mon Nov 28 16:47:23 2016 +0100

tdf#104139 keep the current OpenGL state

This hopefully fixes tdf#104139, which I cannot reproduce on my system.

Change-Id: I903f479a1f401804481b9645c9377c4aaeec13f7

diff --git a/vcl/inc/opengl/RenderState.hxx b/vcl/inc/opengl/RenderState.hxx
index 1f526ba..25dd837 100644
--- a/vcl/inc/opengl/RenderState.hxx
+++ b/vcl/inc/opengl/RenderState.hxx
@@ -22,8 +22,6 @@ protected:
 GenericCapabilityState()
 : mbTest(readState())
 {
-if (mbTest)
-disable();
 }
 
 static bool readState()
commit c03090c97dddbeecf477b4832c3b0a78a68220a3
Author: David Tardon 
Date:   Mon Nov 28 16:39:26 2016 +0100

don't leak impl. details

Also, returning std::unique_ptr<>& doesn't make any sense.

Change-Id: Iefb2a0bfe614264bc7b5d15652fcc15243df3d06

diff --git a/include/vcl/opengl/OpenGLContext.hxx 
b/include/vcl/opengl/OpenGLContext.hxx
index e3e9ce0..e77a6e9 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -98,9 +98,9 @@ public:
 OpenGLProgram*  UseProgram( const OUString& rVertexShader, const 
OUString& rFragmentShader, const OString& preamble = "" );
 voidUseNoProgram();
 
-std::unique_ptr& state()
+RenderState& state()
 {
-return mpRenderState;
+return *mpRenderState;
 }
 
 OpenGLCapabilitySwitch& getOpenGLCapabilitySwitch()
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 58f03f3..006b5c6 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -215,7 +215,7 @@ void 
OpenGLSalGraphicsImpl::InitializePreDrawState(XOROption eOpt)
 CheckOffscreenTexture();
 CHECK_GL_ERROR();
 
-mpContext->state()->viewport(Rectangle(Point(0, 0), Size(GetWidth(), 
GetHeight(;
+mpContext->state().viewport(Rectangle(Point(0, 0), Size(GetWidth(), 
GetHeight(;
 
 ImplInitClipRegion();
 CHECK_GL_ERROR();
@@ -290,8 +290,8 @@ void OpenGLSalGraphicsImpl::freeResources()
 
 void OpenGLSalGraphicsImpl::ImplSetClipBit( const vcl::Region& rClip, GLuint 
nMask )
 {
-mpContext->state()->scissor().disable();
-mpContext->state()->stencil().enable();
+mpContext->state().scissor().disable();
+mpContext->state().stencil().enable();
 
 VCL_GL_INFO( "Adding complex clip / stencil" );
 GLuint nStencil = maOffscreenTex.StencilId();
@@ -331,7 +331,7 @@ void OpenGLSalGraphicsImpl::ImplSetClipBit( const 
vcl::Region& rClip, GLuint nMa
 glStencilMask( 0x00 );
 CHECK_GL_ERROR();
 
-mpContext->state()->stencil().disable();
+mpContext->state().stencil().disable();
 }
 
 void OpenGLSalGraphicsImpl::ImplInitClipRegion()
@@ -349,23 +349,23 @@ void OpenGLSalGraphicsImpl::ImplInitClipRegion()
 if (mbUseScissor)
 {
 Rectangle aRect(maClipRegion.GetBoundRect());
-mpContext->state()->scissor().set(aRect.Left(), GetHeight() - 
aRect.Bottom() - 1, aRect.GetWidth(), aRect.GetHeight());
-mpContext->state()->scissor().enable();
+mpContext->state().scissor().set(aRect.Left(), GetHeight() - 
aRect.Bottom() - 1, aRect.GetWidth(), aRect.GetHeight());
+mpContext->state().scissor().enable();
 }
 else
 {
-mpContext->state()->scissor().disable();
+mpContext->state().scissor().disable();
 }
 
 if (mbUseStencil)
 {
 glStencilFunc( GL_EQUAL, 1, 0x1 );
 CHECK_GL_ERROR();
-mpContext->state()->stencil().enable();
+mpContext->state().stencil().enable();
 }
 else
 {
-mpContext->state()->stencil().disable();
+mpContext->state().stencil().disable();
 }
 }
 
@@ -543,8 +543,8 @@ bool OpenGLSalGraphicsImpl::CheckOffscreenTexture()
 // TODO: lfrb: User GL_ARB_copy_image?
 OpenGLTexture aNewTex = OpenGLTexture( GetWidth(), GetHeight() );
 
-mpContext->state()->scissor().disable();
-mpContext->state()->stencil().disable();
+mpContext->state().scissor().disable();
+mpContext->state().stencil().disable();
 
 mpContext->AcquireFramebuffer( aNewTex );
 DrawTexture( maOffscreenTex, aPosAry );
@@ -1096,8 +1096,8 @@ void OpenGLSalGraphicsImpl::DrawTransformedTexture(
 // The scissor area is set to the 

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

2016-01-13 Thread Tor Lillqvist
 include/vcl/opengl/glxtest.hxx  |   23 ---
 vcl/inc/opengl/framebuffer.hxx  |1 -
 vcl/inc/opengl/x11/glxtest.hxx  |   23 +++
 vcl/opengl/framebuffer.cxx  |3 +--
 vcl/opengl/x11/X11DeviceInfo.cxx|2 +-
 vcl/source/opengl/OpenGLContext.cxx |1 -
 vcl/source/salmain/salmain.cxx  |2 +-
 vcl/unx/glxtest.cxx |2 +-
 8 files changed, 27 insertions(+), 30 deletions(-)

New commits:
commit 5fdb9cd64cfb48949a8c15292eda9266155a62ea
Author: Tor Lillqvist 
Date:   Wed Jan 13 15:01:35 2016 +0200

This stuff is private to vcl

Change-Id: I623da89ea390a07bd6a3236b5c099be094a7acde

diff --git a/include/vcl/opengl/glxtest.hxx b/vcl/inc/opengl/x11/glxtest.hxx
similarity index 84%
rename from include/vcl/opengl/glxtest.hxx
rename to vcl/inc/opengl/x11/glxtest.hxx
index 687038f..979f795 100644
--- a/include/vcl/opengl/glxtest.hxx
+++ b/vcl/inc/opengl/x11/glxtest.hxx
@@ -7,8 +7,8 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_VCL_OPENGL_GLXTEST_HXX
-#define INCLUDED_VCL_OPENGL_GLXTEST_HXX
+#ifndef INCLUDED_VCL_INC_OPENGL_X11_GLXTEST_HXX
+#define INCLUDED_VCL_INC_OPENGL_X11_GLXTEST_HXX
 
 #include 
 
diff --git a/vcl/opengl/x11/X11DeviceInfo.cxx b/vcl/opengl/x11/X11DeviceInfo.cxx
index e9754ea..49593c7 100644
--- a/vcl/opengl/x11/X11DeviceInfo.cxx
+++ b/vcl/opengl/x11/X11DeviceInfo.cxx
@@ -8,8 +8,8 @@
  */
 
 #include "opengl/x11/X11DeviceInfo.hxx"
+#include "opengl/x11//glxtest.hxx"
 
-#include 
 #include 
 
 #include 
diff --git a/vcl/source/salmain/salmain.cxx b/vcl/source/salmain/salmain.cxx
index ee9ed69..32d5737 100644
--- a/vcl/source/salmain/salmain.cxx
+++ b/vcl/source/salmain/salmain.cxx
@@ -29,7 +29,7 @@
 #include "salinst.hxx"
 
 #if defined( UNX ) && !defined MACOSX && !defined IOS && !defined ANDROID && 
!defined LIBO_HEADLESS
-#include 
+#include "opengl/x11/glxtest.hxx"
 #endif
 
 SAL_IMPLEMENT_MAIN() {
diff --git a/vcl/unx/glxtest.cxx b/vcl/unx/glxtest.cxx
index 12811e8..efe5591 100644
--- a/vcl/unx/glxtest.cxx
+++ b/vcl/unx/glxtest.cxx
@@ -26,7 +26,7 @@
 #include "stdint.h"
 #include 
 
-#include 
+#include "opengl/x11/glxtest.hxx"
 
 #ifdef __SUNPRO_CC
 #include 
commit 4a846b9b93b89152b8f74f3dfc893441ae1347b8
Author: Tor Lillqvist 
Date:   Wed Jan 13 14:52:05 2016 +0200

We only use the prev pointer

(Why not use a std::list? Maybe there is some reason.)

Change-Id: I09010726e9fe45cfa0f530a085c48ec8d3d02cfb

diff --git a/vcl/inc/opengl/framebuffer.hxx b/vcl/inc/opengl/framebuffer.hxx
index 7acd710..9f94a8f 100644
--- a/vcl/inc/opengl/framebuffer.hxx
+++ b/vcl/inc/opengl/framebuffer.hxx
@@ -41,7 +41,6 @@ public:
 
 public:
 OpenGLFramebuffer* mpPrevFramebuffer;
-OpenGLFramebuffer* mpNextFramebuffer;
 };
 
 #endif // INCLUDED_VCL_INC_OPENGL_FRAMEBUFFER_H
diff --git a/vcl/opengl/framebuffer.cxx b/vcl/opengl/framebuffer.cxx
index 215eadf..aa20a93 100644
--- a/vcl/opengl/framebuffer.cxx
+++ b/vcl/opengl/framebuffer.cxx
@@ -18,8 +18,7 @@ OpenGLFramebuffer::OpenGLFramebuffer() :
 mnWidth( 0 ),
 mnHeight( 0 ),
 mnAttachedTexture( 0 ),
-mpPrevFramebuffer( nullptr ),
-mpNextFramebuffer( nullptr )
+mpPrevFramebuffer( nullptr )
 {
 glGenFramebuffers( 1,  );
 CHECK_GL_ERROR();
diff --git a/vcl/source/opengl/OpenGLContext.cxx 
b/vcl/source/opengl/OpenGLContext.cxx
index d70d27e..f409bec 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -1649,7 +1649,6 @@ OpenGLFramebuffer* OpenGLContext::AcquireFramebuffer( 
const OpenGLTexture& rText
 if( mpLastFramebuffer )
 {
 pFramebuffer->mpPrevFramebuffer = mpLastFramebuffer;
-mpLastFramebuffer->mpNextFramebuffer = pFramebuffer;
 mpLastFramebuffer = pFramebuffer;
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[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
--- 

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

2016-01-13 Thread Chris Sherlock
 include/vcl/metric.hxx |3 +-
 vcl/inc/impfontmetric.hxx  |   22 +++--
 vcl/source/gdi/metric.cxx  |   29 +---
 vcl/source/outdev/font.cxx |   46 ++---
 4 files changed, 51 insertions(+), 49 deletions(-)

New commits:
commit 27c4cf76a189b546daf14797773517655f24c81d
Author: Chris Sherlock 
Date:   Thu Jan 14 13:54:55 2016 +1100

vcl: change from pFontAttributes to pFontMetric

Change-Id: I777fd9ee93402c9af026f1ebef6fe960bd8c7c8c

diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index a38af4a..f85fcc8 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -189,40 +189,40 @@ FontMetric OutputDevice::GetFontMetric() const
 return aMetric;
 
 LogicalFontInstance* pFontInstance = mpFontInstance;
-ImplFontMetricData* pFontAttributes = &(pFontInstance->maFontMetric);
+ImplFontMetricData* pFontMetric = &(pFontInstance->maFontMetric);
 
 // prepare metric
 aMetric.Font::operator=( maFont );
 
 // set aMetric with info from font
 aMetric.SetName( maFont.GetName() );
-aMetric.SetStyleName( pFontAttributes->GetStyleName() );
-aMetric.SetSize( PixelToLogic( Size( pFontAttributes->GetWidth(), 
pFontAttributes->GetAscent() + pFontAttributes->GetDescent() - 
pFontAttributes->GetInternalLeading() ) ) );
-aMetric.SetCharSet( pFontAttributes->IsSymbolFont() ? 
RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UNICODE );
-aMetric.SetFamily( pFontAttributes->GetFamilyType() );
-aMetric.SetPitch( pFontAttributes->GetPitch() );
-aMetric.SetWeight( pFontAttributes->GetWeight() );
-aMetric.SetItalic( pFontAttributes->GetSlantType() );
-aMetric.SetWidthType( pFontAttributes->GetWidthType() );
+aMetric.SetStyleName( pFontMetric->GetStyleName() );
+aMetric.SetSize( PixelToLogic( Size( pFontMetric->GetWidth(), 
pFontMetric->GetAscent() + pFontMetric->GetDescent() - 
pFontMetric->GetInternalLeading() ) ) );
+aMetric.SetCharSet( pFontMetric->IsSymbolFont() ? RTL_TEXTENCODING_SYMBOL 
: RTL_TEXTENCODING_UNICODE );
+aMetric.SetFamily( pFontMetric->GetFamilyType() );
+aMetric.SetPitch( pFontMetric->GetPitch() );
+aMetric.SetWeight( pFontMetric->GetWeight() );
+aMetric.SetItalic( pFontMetric->GetSlantType() );
+aMetric.SetWidthType( pFontMetric->GetWidthType() );
 if ( pFontInstance->mnOwnOrientation )
 aMetric.SetOrientation( pFontInstance->mnOwnOrientation );
 else
-aMetric.SetOrientation( pFontAttributes->GetOrientation() );
+aMetric.SetOrientation( pFontMetric->GetOrientation() );
 if( !pFontInstance->maFontMetric.IsKernable() )
  aMetric.SetKerning( maFont.GetKerning() & ~FontKerning::FontSpecific 
);
 
 // set remaining metric fields
-aMetric.SetBuiltInFontFlag( pFontAttributes->IsBuiltInFont() );
-aMetric.SetScalableFlag( pFontAttributes->IsScalable() );
-aMetric.SetFullstopCenteredFlag( pFontAttributes->IsFullstopCentered() );
-aMetric.SetBulletOffset( pFontAttributes->GetBulletOffset() );
-aMetric.SetAscent( ImplDevicePixelToLogicHeight( 
pFontAttributes->GetAscent() + mnEmphasisAscent ) );
-aMetric.SetDescent( ImplDevicePixelToLogicHeight( 
pFontAttributes->GetDescent() + mnEmphasisDescent ) );
-aMetric.SetInternalLeading( ImplDevicePixelToLogicHeight( 
pFontAttributes->GetInternalLeading() + mnEmphasisAscent ) );
+aMetric.SetBuiltInFontFlag( pFontMetric->IsBuiltInFont() );
+aMetric.SetScalableFlag( pFontMetric->IsScalable() );
+aMetric.SetFullstopCenteredFlag( pFontMetric->IsFullstopCentered() );
+aMetric.SetBulletOffset( pFontMetric->GetBulletOffset() );
+aMetric.SetAscent( ImplDevicePixelToLogicHeight( pFontMetric->GetAscent() 
+ mnEmphasisAscent ) );
+aMetric.SetDescent( ImplDevicePixelToLogicHeight( 
pFontMetric->GetDescent() + mnEmphasisDescent ) );
+aMetric.SetInternalLeading( ImplDevicePixelToLogicHeight( 
pFontMetric->GetInternalLeading() + mnEmphasisAscent ) );
 // OutputDevice has its own external leading function due to #i60945#
 aMetric.SetExternalLeading( ImplDevicePixelToLogicHeight( 
GetFontExtLeading() ) );
-aMetric.SetLineHeight( ImplDevicePixelToLogicHeight( 
pFontAttributes->GetAscent() + pFontAttributes->GetDescent() + mnEmphasisAscent 
+ mnEmphasisDescent ) );
-aMetric.SetSlant( ImplDevicePixelToLogicHeight( 
pFontAttributes->GetSlant() ) );
+aMetric.SetLineHeight( ImplDevicePixelToLogicHeight( 
pFontMetric->GetAscent() + pFontMetric->GetDescent() + mnEmphasisAscent + 
mnEmphasisDescent ) );
+aMetric.SetSlant( ImplDevicePixelToLogicHeight( pFontMetric->GetSlant() ) 
);
 
 SAL_INFO("vcl.gdi.fontmetric", "OutputDevice::GetFontMetric:" << aMetric);
 
@@ -482,9 +482,9 @@ FontEmphasisMark OutputDevice::ImplGetEmphasisMarkStyle( 
const vcl::Font& rFont
 long OutputDevice::GetFontExtLeading() const
 {
 LogicalFontInstance* 

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

2016-01-07 Thread Chris Sherlock
 include/vcl/wrkwin.hxx |3 ++-
 vcl/inc/sft.hxx|6 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 42f57eacb163beda6d7042b44a9e1808ca3da401
Author: Chris Sherlock 
Date:   Fri Jan 8 14:19:02 2016 +1100

vcl: document parameters in vcl/inc/sft.hxx

Change-Id: I191ff94acf201714cb96d4e2ea6a9b0cd0632372

diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx
index e383c03..c3708f0 100644
--- a/vcl/inc/sft.hxx
+++ b/vcl/inc/sft.hxx
@@ -246,8 +246,11 @@ namespace vcl
 /**
  * TrueTypeFont constructor.
  * The font file has to be provided as a memory buffer and length
+ * @param  pBuffer - memory buffer
+ * @param  nLen- size of memory buffer
  * @param  facenum - logical font number within a TTC file. This value is 
ignored
  *   for TrueType fonts
+ * @param  ttf - array of TrueTypeFonts
  * @return value of SFErrCodes enum
  * @ingroup sft
  */
@@ -257,8 +260,10 @@ namespace vcl
  * TrueTypeFont constructor.
  * Reads the font file and allocates the memory for the structure.
  * on WIN32 the font has to be provided as a memory buffer and length
+ * @param  fname   - name of TrueType font file
  * @param  facenum - logical font number within a TTC file. This value is 
ignored
  *   for TrueType fonts
+ * @param  ttf - array of TrueTypeFonts
  * @return value of SFErrCodes enum
  * @ingroup sft
  */
@@ -457,6 +462,7 @@ namespace vcl
  * @param str pointer to a UCS-2 string
  * @param nchars  number of characters in str
  * @param glyphArray  pointer to the glyph array where glyph IDs are to be 
recorded.
+ * @param bvertical   vertical text
  *
  * @return MapString() returns -1 if the TrueType font has no usable 'cmap' 
tables.
  * Otherwise it returns the number of characters processed: 
nChars
commit 74cd24b588f3a7ac6bd7ed14727d8f829a1a91c4
Author: Chris Sherlock 
Date:   Fri Jan 8 14:13:13 2016 +1100

vcl: silence doxygen warning

Change-Id: Ia29146ce50144d8ed3ee9a3daaed221a1e2f056b

diff --git a/include/vcl/wrkwin.hxx b/include/vcl/wrkwin.hxx
index 467b530..5f05238 100644
--- a/include/vcl/wrkwin.hxx
+++ b/include/vcl/wrkwin.hxx
@@ -40,6 +40,7 @@ enum class PresentationFlags
 NoFullScreen   = 0x0002,
 NoAutoShow = 0x0004,
 };
+
 namespace o3tl
 {
 template<> struct typed_flags : 
is_typed_flags {};
@@ -92,7 +93,7 @@ public:
PresentationFlags nFlags,
sal_uInt32  nDisplayScreen );
 /**
- @overload void StartPresentationMode( bool bPresentation, sal_uInt16 
nFlags, sal_uInt32 nDisplayScreen)
+ @overload void StartPresentationMode( bool bPresentation, 
PresentationFlags nFlags, sal_uInt32 nDisplayScreen)
 */
 voidStartPresentationMode( bool   bPresentation = true,
PresentationFlags nFlags = 
PresentationFlags::NONE );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-08-31 Thread Michael Meeks
 include/vcl/opengl/OpenGLContext.hxx |1 +
 vcl/inc/opengl/framebuffer.hxx   |1 +
 vcl/opengl/framebuffer.cxx   |9 +++--
 vcl/opengl/texture.cxx   |   10 ++
 vcl/source/opengl/OpenGLContext.cxx  |   20 
 vcl/source/opengl/OpenGLHelper.cxx   |1 +
 vcl/source/window/paint.cxx  |8 
 7 files changed, 48 insertions(+), 2 deletions(-)

New commits:
commit 18dd07ba4fd9ede98ce576e6024831658bbd5401
Author: Michael Meeks 
Date:   Mon Aug 31 12:11:50 2015 +0100

tdf#93751 - ensure textures are unbound from framebuffers post destroy.

Change-Id: I81aec0e6f8db57905826c54c3442528be6068700

diff --git a/include/vcl/opengl/OpenGLContext.hxx 
b/include/vcl/opengl/OpenGLContext.hxx
index 2f14762..96abe49 100644
--- a/include/vcl/opengl/OpenGLContext.hxx
+++ b/include/vcl/opengl/OpenGLContext.hxx
@@ -191,6 +191,7 @@ public:
 bool   AcquireDefaultFramebuffer();
 OpenGLFramebuffer* AcquireFramebuffer( const OpenGLTexture& rTexture );
 static voidReleaseFramebuffer( OpenGLFramebuffer* pFramebuffer );
+void UnbindTextureFromFramebuffers( GLuint nTexture );
 #ifdef DBG_UTIL
 void AddRef(SalGraphicsImpl*);
 void DeRef(SalGraphicsImpl*);
diff --git a/vcl/inc/opengl/framebuffer.hxx b/vcl/inc/opengl/framebuffer.hxx
index 385b11a..5d5e870 100644
--- a/vcl/inc/opengl/framebuffer.hxx
+++ b/vcl/inc/opengl/framebuffer.hxx
@@ -34,6 +34,7 @@ public:
 static void Unbind();
 
 boolIsFree() const;
+boolIsAttached( GLuint nTexture ) const;
 boolIsAttached( const OpenGLTexture& rTexture ) const;
 voidAttachTexture( const OpenGLTexture& rTexture );
 voidDetachTexture();
diff --git a/vcl/opengl/framebuffer.cxx b/vcl/opengl/framebuffer.cxx
index 87af985..7e19981 100644
--- a/vcl/opengl/framebuffer.cxx
+++ b/vcl/opengl/framebuffer.cxx
@@ -46,12 +46,17 @@ void OpenGLFramebuffer::Unbind()
 
 bool OpenGLFramebuffer::IsFree() const
 {
-return (!mnAttachedTexture);
+return !mnAttachedTexture;
+}
+
+bool OpenGLFramebuffer::IsAttached( GLuint nTexture ) const
+{
+return mnAttachedTexture == nTexture;
 }
 
 bool OpenGLFramebuffer::IsAttached( const OpenGLTexture& rTexture ) const
 {
-return ( mnAttachedTexture == rTexture.Id() );
+return mnAttachedTexture == rTexture.Id();
 }
 
 void OpenGLFramebuffer::AttachTexture( const OpenGLTexture& rTexture )
diff --git a/vcl/opengl/texture.cxx b/vcl/opengl/texture.cxx
index 4e62915..217b8bf 100644
--- a/vcl/opengl/texture.cxx
+++ b/vcl/opengl/texture.cxx
@@ -108,7 +108,17 @@ ImplOpenGLTexture::~ImplOpenGLTexture()
 {
 VCL_GL_INFO( "vcl.opengl", "~OpenGLTexture " << mnTexture );
 if( mnTexture != 0 )
+{
+// FIXME: this is really not optimal performance-wise.
+
+// Check we have been correctly un-bound from all framebuffers.
+ImplSVData* pSVData = ImplGetSVData();
+OpenGLContext* pContext = pSVData->maGDIData.mpLastContext;
+if (pContext)
+pContext->UnbindTextureFromFramebuffers( mnTexture );
+
 glDeleteTextures( 1,  );
+}
 }
 
 bool ImplOpenGLTexture::InsertBuffer(int nX, int nY, int nWidth, int nHeight, 
int nFormat, int nType, sal_uInt8* pData)
diff --git a/vcl/source/opengl/OpenGLContext.cxx 
b/vcl/source/opengl/OpenGLContext.cxx
index 8253241..cb05356 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -1537,6 +1537,26 @@ OpenGLFramebuffer* OpenGLContext::AcquireFramebuffer( 
const OpenGLTexture& rText
 return pFramebuffer;
 }
 
+// FIXME: this method is rather grim from a perf. perspective.
+// We should instead (eventually) use pointers to associate the
+// framebuffer and texture cleanly.
+void OpenGLContext::UnbindTextureFromFramebuffers( GLuint nTexture )
+{
+OpenGLFramebuffer* pFramebuffer;
+
+// see if there is a framebuffer attached to that texture
+pFramebuffer = mpLastFramebuffer;
+while( pFramebuffer )
+{
+if (pFramebuffer->IsAttached(nTexture))
+{
+BindFramebuffer(pFramebuffer);
+pFramebuffer->DetachTexture();
+}
+pFramebuffer = pFramebuffer->mpPrevFramebuffer;
+}
+}
+
 void OpenGLContext::ReleaseFramebuffer( OpenGLFramebuffer* pFramebuffer )
 {
 if( pFramebuffer )
commit 6cf43cf6b98866401702d3275a7a026d8fa01edf
Author: Michael Meeks 
Date:   Sat Aug 29 20:54:21 2015 +0100

Extended GL painting debug tracing.

Change-Id: I52158729d240ca3cb9e7977bc6d1f5acb14437ad

diff --git a/vcl/source/opengl/OpenGLHelper.cxx 
b/vcl/source/opengl/OpenGLHelper.cxx
index 68b8d50..3eb8514 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -138,6 +138,7 @@ GLint OpenGLHelper::LoadShaders(const OUString& 
rVertexShaderName,const OUString
 {
 OpenGLZone aZone;
 
+VCL_GL_INFO("vcl.opengl", "Load 

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

2015-07-02 Thread Tor Lillqvist
 include/vcl/outdev.hxx  |6 --
 vcl/inc/impbmp.hxx  |6 ++
 vcl/source/outdev/mask.cxx  |6 --
 vcl/source/outdev/pixel.cxx |6 --
 4 files changed, 6 insertions(+), 18 deletions(-)

New commits:
commit 9645435e3f408cf7877466c240522fb65acb8519
Author: Tor Lillqvist t...@collabora.com
Date:   Thu Jul 2 12:46:09 2015 +0300

No need for these declarations to be public

Change-Id: I101269defce2cdbbb686c0ac0bb4bcb8c9a23846

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 279cb1e..e357fcf 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -300,12 +300,6 @@ typedef boost::intrusive_ptr FontCharMap  FontCharMapPtr;
 BmpMirrorFlags AdjustTwoRect( SalTwoRect rTwoRect, const Size rSizePix );
 void AdjustTwoRect( SalTwoRect rTwoRect, const Rectangle rValidSrcRect );
 
-extern const sal_uLong nVCLRLut[ 6 ];
-extern const sal_uLong nVCLGLut[ 6 ];
-extern const sal_uLong nVCLBLut[ 6 ];
-extern const sal_uLong nVCLDitherLut[ 256 ];
-extern const sal_uLong nVCLLut[ 256 ];
-
 class OutputDevice;
 
 namespace vcl {
diff --git a/vcl/inc/impbmp.hxx b/vcl/inc/impbmp.hxx
index 0dc9ec8..1fa17f8 100644
--- a/vcl/inc/impbmp.hxx
+++ b/vcl/inc/impbmp.hxx
@@ -24,6 +24,12 @@
 #include tools/gen.hxx
 #include tools/solar.h
 
+extern const sal_uLong nVCLRLut[ 6 ];
+extern const sal_uLong nVCLGLut[ 6 ];
+extern const sal_uLong nVCLBLut[ 6 ];
+extern const sal_uLong nVCLDitherLut[ 256 ];
+extern const sal_uLong nVCLLut[ 256 ];
+
 struct BitmapBuffer;
 class SalBitmap;
 class BitmapPalette;
commit feec4bfb9df7bc33a6093a397614d085e63cc708
Author: Tor Lillqvist t...@collabora.com
Date:   Thu Jul 2 12:42:25 2015 +0300

Bin unused declarations

Change-Id: I0ebedfdefee4ba452b42eb695d949aeff24a5df0

diff --git a/vcl/source/outdev/mask.cxx b/vcl/source/outdev/mask.cxx
index ed69b48..6223de1 100644
--- a/vcl/source/outdev/mask.cxx
+++ b/vcl/source/outdev/mask.cxx
@@ -27,12 +27,6 @@
 #include impbmp.hxx
 #include outdata.hxx
 
-extern const sal_uLong nVCLRLut[ 6 ];
-extern const sal_uLong nVCLGLut[ 6 ];
-extern const sal_uLong nVCLBLut[ 6 ];
-extern const sal_uLong nVCLDitherLut[ 256 ];
-extern const sal_uLong nVCLLut[ 256 ];
-
 void OutputDevice::DrawMask( const Point rDestPt,
  const Bitmap rBitmap, const Color rMaskColor )
 {
diff --git a/vcl/source/outdev/pixel.cxx b/vcl/source/outdev/pixel.cxx
index b031ef4..bfa8384 100644
--- a/vcl/source/outdev/pixel.cxx
+++ b/vcl/source/outdev/pixel.cxx
@@ -29,12 +29,6 @@
 #include outdata.hxx
 #include salgdi.hxx
 
-extern const sal_uLong nVCLRLut[ 6 ];
-extern const sal_uLong nVCLGLut[ 6 ];
-extern const sal_uLong nVCLBLut[ 6 ];
-extern const sal_uLong nVCLDitherLut[ 256 ];
-extern const sal_uLong nVCLLut[ 256 ];
-
 Color OutputDevice::GetPixel( const Point rPt ) const
 {
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2015-05-15 Thread Caolán McNamara
 include/vcl/settings.hxx  |3 +
 vcl/inc/unx/gtk/gtkgdi.hxx|1 
 vcl/osx/salframe.cxx  |1 
 vcl/source/app/settings.cxx   |   16 +
 vcl/source/window/menu.cxx|   16 -
 vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx  |1 
 vcl/unx/gtk3/gdi/gtk3salnativewidgets-gtk.cxx |   76 ++
 vcl/unx/kde/salnativewidgets-kde.cxx  |1 
 vcl/unx/kde4/KDESalFrame.cxx  |1 
 vcl/win/source/window/salframe.cxx|1 
 10 files changed, 90 insertions(+), 27 deletions(-)

New commits:
commit 186eefd7e2020c65db32dacc3a9389573e7cddeb
Author: Caolán McNamara caol...@redhat.com
Date:   Fri May 15 17:19:24 2015 +0100

gtk3: render native menubar and menubaritems

this needs the addition of a new MenuBarHighlightTextColor
which defaults to MenuHighlightTextColor on other platforms

Change-Id: Id0550294f1778229cbbe154857ba16c629dc5a87

diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx
index 445bb5a..c60aa64 100644
--- a/include/vcl/settings.hxx
+++ b/include/vcl/settings.hxx
@@ -328,6 +328,9 @@ public:
 voidSetMenuBarRolloverTextColor( const Color 
rColor );
 const ColorGetMenuBarRolloverTextColor() const;
 
+voidSetMenuBarHighlightTextColor( const Color 
rColor );
+const ColorGetMenuBarHighlightTextColor() const;
+
 voidSetMenuHighlightColor( const Color rColor 
);
 const ColorGetMenuHighlightColor() const;
 
diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx
index 0403b59..656c1ac 100644
--- a/vcl/inc/unx/gtk/gtkgdi.hxx
+++ b/vcl/inc/unx/gtk/gtkgdi.hxx
@@ -73,6 +73,7 @@ private:
 static GtkStyleContext *mpToolbarSeperatorStyle;
 static GtkStyleContext *mpCheckButtonStyle;
 static GtkStyleContext *mpMenuBarStyle;
+static GtkStyleContext *mpMenuBarItemStyle;
 static GtkStyleContext *mpMenuStyle;
 static GtkStyleContext *mpMenuItemStyle;
 static GtkStyleContext *mpSpinStyle;
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index af1327f..98b49e8 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1199,6 +1199,7 @@ void AquaSalFrame::UpdateSettings( AllSettings rSettings 
)
 aStyleSettings.SetMenuTextColor( aMenuTextColor );
 aStyleSettings.SetMenuBarTextColor( aMenuTextColor );
 aStyleSettings.SetMenuBarRolloverTextColor( aMenuTextColor );
+
aStyleSettings.SetMenuBarHighlightTextColor(aStyleSettings.GetMenuHighlightTextColor());
 
 aStyleSettings.SetCursorBlinkTime( 500 );
 
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 5d59336..ff49e02 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -125,6 +125,7 @@ struct ImplStyleData
 Color   maMenuTextColor;
 Color   maMenuBarTextColor;
 Color   maMenuBarRolloverTextColor;
+Color   maMenuBarHighlightTextColor;
 Color   maMonoColor;
 Color   maRadioCheckTextColor;
 Color   maShadowColor;
@@ -600,6 +601,7 @@ ImplStyleData::ImplStyleData( const ImplStyleData rData ) :
 maMenuTextColor( rData.maMenuTextColor ),
 maMenuBarTextColor( rData.maMenuBarTextColor ),
 maMenuBarRolloverTextColor( rData.maMenuBarRolloverTextColor ),
+maMenuBarHighlightTextColor( rData.maMenuBarHighlightTextColor ),
 maMonoColor( rData.maMonoColor ),
 maRadioCheckTextColor( rData.maRadioCheckTextColor ),
 maShadowColor( rData.maShadowColor ),
@@ -734,6 +736,7 @@ void ImplStyleData::SetStandardStyles()
 maMenuTextColor = Color( COL_BLACK );
 maMenuBarTextColor  = Color( COL_BLACK );
 maMenuBarRolloverTextColor  = Color( COL_WHITE );
+maMenuBarHighlightTextColor = Color( COL_BLUE );
 maMenuHighlightColor= Color( COL_BLUE );
 maMenuHighlightTextColor= Color( COL_WHITE );
 maHighlightColor= Color( COL_BLUE );
@@ -1271,6 +1274,19 @@ StyleSettings::GetMenuBarRolloverTextColor() const
 }
 
 void
+StyleSettings::SetMenuBarHighlightTextColor( const Color rColor )
+{
+CopyData();
+mxData-maMenuBarHighlightTextColor = rColor;
+}
+
+const Color
+StyleSettings::GetMenuBarHighlightTextColor() const
+{
+return mxData-maMenuBarHighlightTextColor;
+}
+
+void
 StyleSettings::SetMenuHighlightColor( const Color rColor )
 {
 CopyData();
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 7c99003..d43c3cf 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1857,10 +1857,18 @@ void Menu::ImplPaint(vcl::Window* pWin, sal_uInt16 
nBorder, long nStartY, MenuIt
 

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

2015-01-27 Thread Luboš Luňák
 include/vcl/opengl/OpenGLContext.hxx|   14 --
 include/vcl/opengl/OpenGLHelper.hxx |2 
 vcl/inc/opengl/program.hxx  |2 
 vcl/inc/openglgdiimpl.hxx   |2 
 vcl/opengl/areaScaleFastFragmentShader.glsl |   13 +
 vcl/opengl/areaScaleFragmentShader.glsl |   13 +
 vcl/opengl/gdiimpl.cxx  |   63 ++--
 vcl/opengl/program.cxx  |4 -
 vcl/opengl/scale.cxx|1 
 vcl/source/opengl/OpenGLContext.cxx |   26 +--
 vcl/source/opengl/OpenGLHelper.cxx  |6 ++
 11 files changed, 127 insertions(+), 19 deletions(-)

New commits:
commit c44ee2beb3d8bbe932dd8799f818a2c61a078810
Author: Luboš Luňák l.lu...@collabora.com
Date:   Tue Jan 20 15:41:51 2015 +0100

when drawing a transformed bitmap in opengl backend, scale it better

The plain scaling is rather rough, and in fact drawing a scaled bitmap
the normal way gives much better results (because OutputDevice pre-scales
the bitmap before it's drawn). This one may be a bit slow perhaps,
but hopefully nobody there's no code that'd extensively use bitmap
drawing with custom transformations (wishful thinking).

Change-Id: I83e05307adfaeac0ed0757f1a0b2603f64caf8f8

diff --git a/vcl/opengl/areaScaleFastFragmentShader.glsl 
b/vcl/opengl/areaScaleFastFragmentShader.glsl
index b8874d1..10ce9f5 100644
--- a/vcl/opengl/areaScaleFastFragmentShader.glsl
+++ b/vcl/opengl/areaScaleFastFragmentShader.glsl
@@ -18,6 +18,12 @@ uniform float ratio; // = 1.0/(xscale*yscale)
 
 varying vec2 tex_coord;
 
+// This mode makes the scaling work like maskedTextureFragmentShader.glsl
+// (instead of like plain textureVertexShader.glsl).
+#ifdef MASKED
+uniform sampler2D mask;
+#endif
+
 /*
  Just make the resulting color the average of all the source pixels
  (which is an area (xscale)x(yscale) ).
@@ -30,7 +36,14 @@ void main(void)
 {
 for( int x = 0; x  xscale; ++x )
 {
+#ifndef MASKED
 sum += texture2D( sampler, tex_coord.st + offset );
+#else
+vec4 texel;
+texel = texture2D( sampler, tex_coord.st + offset );
+texel.a = 1.0 - texture2D( mask, tex_coord.st + offset ).r;
+sum += texel;
+#endif
 offset.x += xstep;
 }
 offset.y += ystep;
diff --git a/vcl/opengl/areaScaleFragmentShader.glsl 
b/vcl/opengl/areaScaleFragmentShader.glsl
index 498b0b5..d72184c 100644
--- a/vcl/opengl/areaScaleFragmentShader.glsl
+++ b/vcl/opengl/areaScaleFragmentShader.glsl
@@ -27,6 +27,12 @@ uniform float ydestconvert;
 
 varying vec2 tex_coord;
 
+// This mode makes the scaling work like maskedTextureFragmentShader.glsl
+// (instead of like plain textureVertexShader.glsl).
+#ifdef MASKED
+uniform sampler2D mask;
+#endif
+
 void main(void)
 {
 // Convert to pixel coordinates again.
@@ -126,7 +132,14 @@ void main(void)
 for( int x = xstart; x = xend; ++x, ++xpos )
 {
 vec2 offset = vec2( x * xsrcconvert, y * ysrcconvert );
+#ifndef MASKED
 tmp += texture2D( sampler, offset ) * xratio[ xpos ];
+#else
+vec4 texel;
+texel = texture2D( sampler, offset );
+texel.a = 1.0 - texture2D( mask, offset ).r;
+tmp += texel * xratio[ xpos ];
+#endif
 }
 sum += tmp * yratio[ ypos ];
 }
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index a120d81..854c090 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -894,9 +894,34 @@ void OpenGLSalGraphicsImpl::DrawTransformedTexture(
 (float) rTexture.GetWidth(), 0, (float) rTexture.GetWidth(), (float) 
rTexture.GetHeight() };
 GLfloat aTexCoord[8];
 
+// If downscaling at a higher scale ratio, use the area scaling algorithm 
rather
+// than plain OpenGL's scaling, for better results.
+// See OpenGLSalBitmap::ImplScaleArea().
+double ixscale = rTexture.GetWidth() / fabs( rX.getX() - rNull.getX());
+double iyscale = rTexture.GetHeight() / fabs( rY.getY() - rNull.getY());
+bool areaScaling = false;
+bool fastAreaScaling = false;
+OUString textureFragmentShader;
+if( ixscale = 2  iyscale = 2 ) // Downscaling to 50% or less? 
(inverted scale ratios)
+{
+areaScaling = true;
+fastAreaScaling = ( ixscale == int( ixscale )  iyscale == int( 
iyscale ));
+// The generic case has arrays only up to 100 ratio downscaling, which 
is hopefully enough
+// in practice, but protect against buffer overflows in case such an 
extreme case happens
+// (and in such case the precision of the generic algorithm probably 
doesn't matter anyway).
+if( ixscale  100 || iyscale  100 )
+fastAreaScaling = true;
+if( fastAreaScaling )
+textureFragmentShader = areaScaleFastFragmentShader;
+else
+textureFragmentShader 

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

2014-11-20 Thread Jan Holesovsky
 include/vcl/salgtype.hxx |7 +++
 vcl/inc/win/salgdi.h |   44 ++-
 vcl/source/outdev/bitmap.cxx |6 +-
 vcl/win/source/gdi/salgdi.cxx|   55 +++
 vcl/win/source/gdi/salnativewidgets-luna.cxx |   54 +++
 vcl/win/source/gdi/salvd.cxx |6 +-
 vcl/win/source/gdi/winlayout.cxx |   62 +++
 7 files changed, 175 insertions(+), 59 deletions(-)

New commits:
commit 57d6b92b69a31260dea0d84fcd1fc5866ada7adb
Author: Jan Holesovsky ke...@collabora.com
Date:   Thu Nov 20 18:49:03 2014 +0100

windows opengl: Implement the native theming with OpenGL.

Change-Id: If8eb5cef228f4eb28e16de3e3135742282403cdc

diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index 831a703..8d88784 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -39,6 +39,7 @@
 class FontSelectPattern;
 class ImplWinFontEntry;
 class ImplFontAttrCache;
+class OpenGLTexture;
 class PhysicalFontCollection;
 class SalGraphicsImpl;
 class WinOpenGLSalGraphicsImpl;
@@ -154,7 +155,7 @@ private:
 HBITMAP mhBitmap;
 
 /// DIBSection data.
-sal_uInt8 *mpData;
+sal_uInt32 *mpData;
 
 /// Mapping between the GDI position and OpenGL, to use for OpenGL drawing.
 SalTwoRect maRects;
@@ -168,8 +169,13 @@ public:
 
 HDC getCompatibleHDC() { return mhCompatibleDC; }
 
-/// Call the WinOpenGLSalGraphicsImpl's DrawMask().
-void DrawMask(SalColor color);
+SalTwoRect getTwoRect() { return maRects; }
+
+/// Reset the DC with the defined color.
+void fill(sal_uInt32 color);
+
+/// Obtain the texture; the caller must delete it after use.
+OpenGLTexture* getTexture();
 };
 
 class WinSalGraphics : public SalGraphics
@@ -177,9 +183,12 @@ class WinSalGraphics : public SalGraphics
 friend class WinSalGraphicsImpl;
 friend class ScopedFont;
 friend class OpenGLCompatibleDC;
-private:
+friend class WinLayout;
+
+protected:
 boost::scoped_ptrSalGraphicsImpl mpImpl;
 
+private:
 HDC mhLocalDC;  // HDC
 boolmbPrinter : 1;  // is Printer
 boolmbVirDev : 1;   // is VirDev
diff --git a/vcl/win/source/gdi/salgdi.cxx b/vcl/win/source/gdi/salgdi.cxx
index d011f31..678067d 100644
--- a/vcl/win/source/gdi/salgdi.cxx
+++ b/vcl/win/source/gdi/salgdi.cxx
@@ -601,18 +601,23 @@ OpenGLCompatibleDC::~OpenGLCompatibleDC()
 }
 }
 
-void OpenGLCompatibleDC::DrawMask(SalColor color)
+void OpenGLCompatibleDC::fill(sal_uInt32 color)
 {
-if (!mpImpl)
+if (!mpData)
 return;
 
-// turn what's in the mpData into a texture
-OpenGLTexture aTexture(maRects.mnSrcWidth, maRects.mnSrcHeight, GL_RGBA, 
GL_UNSIGNED_BYTE, mpData);
-CHECK_GL_ERROR();
+sal_uInt32 *p = mpData;
+for (int i = maRects.mnSrcWidth * maRects.mnSrcHeight; i  0; --i)
+*p++ = color;
+}
 
-mpImpl-PreDraw();
-mpImpl-DrawMask(aTexture, color, maRects);
-mpImpl-PostDraw();
+OpenGLTexture* OpenGLCompatibleDC::getTexture()
+{
+if (!mpImpl)
+return NULL;
+
+// turn what's in the mpData into a texture
+return new OpenGLTexture(maRects.mnSrcWidth, maRects.mnSrcHeight, GL_RGBA, 
GL_UNSIGNED_BYTE, reinterpret_castsal_uInt8*(mpData));
 }
 
 WinSalGraphics::WinSalGraphics(WinSalGraphics::Type eType, bool bScreen, HWND 
hWnd):
diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx 
b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index 8fcc16e..8c87710 100644
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -35,6 +35,7 @@
 
 #include osl/module.h
 
+#include opengl/win/gdiimpl.hxx
 #include vcl/svapp.hxx
 #include vcl/settings.hxx
 
@@ -1260,18 +1261,53 @@ bool WinSalGraphics::drawNativeControl( ControlType 
nType,
 rc.top= buttonRect.Top();
 rc.bottom = buttonRect.Bottom()+1;
 
-// set default text alignment
-int ta = SetTextAlign( getHDC(), TA_LEFT|TA_TOP|TA_NOUPDATECP );
+OUString aCaptionStr(aCaption.replace('~', '')); // translate mnemonics
 
-OUString aCaptionStr( aCaption.replace('~', '') ); // translate mnemonics
-bOk = ImplDrawNativeControl(getHDC(), hTheme, rc,
-nType, nPart, nState, aValue,
-aCaptionStr );
+WinOpenGLSalGraphicsImpl *pImpl = 
dynamic_castWinOpenGLSalGraphicsImpl*(mpImpl.get());
+if (pImpl == NULL)
+{
+// set default text alignment
+int ta = SetTextAlign(getHDC(), TA_LEFT|TA_TOP|TA_NOUPDATECP);
+
+bOk = ImplDrawNativeControl(getHDC(), hTheme, rc, nType, nPart, 
nState, aValue, aCaptionStr);
+
+// restore alignment
+SetTextAlign(getHDC(), ta);
+}
+else
+{
+// We can do OpenGL
+OpenGLCompatibleDC aBlackDC(*this, buttonRect.Left(), 
buttonRect.Top(), 

[Libreoffice-commits] core.git: 2 commits - include/vcl vcl/inc vcl/source vcl/uiconfig vcl/UIConfig_vcl.mk

2013-12-23 Thread Caolán McNamara
 include/vcl/prgsbar.hxx|3 
 vcl/UIConfig_vcl.mk|3 
 vcl/inc/printdlg.hxx   |   15 +---
 vcl/inc/svids.hrc  |4 -
 vcl/source/control/prgsbar.cxx |7 +-
 vcl/source/src/print.src   |   25 ---
 vcl/source/window/printdlg.cxx |  108 +++--
 vcl/uiconfig/ui/printprogressdialog.ui |   87 ++
 8 files changed, 127 insertions(+), 125 deletions(-)

New commits:
commit 3e978fc21f2d924dab3d714956944a27e70d606f
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Dec 23 19:25:30 2013 +

convert print progress dialog to .ui

use an actual ProgressBar rather than direct drawing
into the dialog window

Change-Id: I13a17970055980e0e248f60058cd4d5ef91f1d7d

diff --git a/vcl/UIConfig_vcl.mk b/vcl/UIConfig_vcl.mk
index d3e901e..d37c985 100644
--- a/vcl/UIConfig_vcl.mk
+++ b/vcl/UIConfig_vcl.mk
@@ -10,9 +10,10 @@
 $(eval $(call gb_UIConfig_UIConfig,vcl))
 
 $(eval $(call gb_UIConfig_add_uifiles,vcl,\
-   vcl/uiconfig/ui/printdialog \
vcl/uiconfig/ui/errornocontentdialog \
vcl/uiconfig/ui/errornoprinterdialog \
+   vcl/uiconfig/ui/printdialog \
+   vcl/uiconfig/ui/printprogressdialog \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/vcl/inc/printdlg.hxx b/vcl/inc/printdlg.hxx
index 3b07b6b..e142f0a 100644
--- a/vcl/inc/printdlg.hxx
+++ b/vcl/inc/printdlg.hxx
@@ -30,6 +30,7 @@
 #include vcl/button.hxx
 #include vcl/gdimtf.hxx
 #include vcl/lstbox.hxx
+#include vcl/prgsbar.hxx
 #include vcl/field.hxx
 #include vcl/tabctrl.hxx
 #include vcl/tabpage.hxx
@@ -271,29 +272,23 @@ namespace vcl
 class PrintProgressDialog : public ModelessDialog
 {
 OUStringmaStr;
-FixedText   maText;
-CancelButtonmaButton;
+FixedText*  mpText;
+ProgressBar*mpProgress;
+CancelButton*   mpButton;
 
 boolmbCanceled;
 sal_Int32   mnCur;
 sal_Int32   mnMax;
-longmnProgressHeight;
-Rectangle   maProgressRect;
-boolmbNativeProgress;
 
 DECL_LINK( ClickHdl, Button* );
 
-void implCalcProgressRect();
 public:
-PrintProgressDialog( Window* i_pParent, int i_nMax );
-~PrintProgressDialog();
+PrintProgressDialog(Window* i_pParent, int i_nMax);
 
 bool isCanceled() const { return mbCanceled; }
 void setProgress( int i_nCurrent, int i_nMax = -1 );
 void tick();
 void reset();
-
-virtual void Paint( const Rectangle );
 };
 }
 
diff --git a/vcl/inc/svids.hrc b/vcl/inc/svids.hrc
index eb16740..f3c3f4d 100644
--- a/vcl/inc/svids.hrc
+++ b/vcl/inc/svids.hrc
@@ -115,10 +115,6 @@
 #define SV_PRINT_OPT_TOFILE 2
 #define SV_PRINT_OPT_SINGLEJOBS 3
 
-#define SV_DLG_PRINT_PROGRESS 2049
-#define SV_PRINT_PROGRESS_CANCEL1
-#define SV_PRINT_PROGRESS_TEXT  2
-
 #define SV_PRINT_NATIVE_STRINGS   2050
 
 #define SV_HELPTEXT_CLOSE   1
diff --git a/vcl/source/src/print.src b/vcl/source/src/print.src
index 0d2f9c1..4bfa750 100644
--- a/vcl/source/src/print.src
+++ b/vcl/source/src/print.src
@@ -19,31 +19,6 @@
 
 #include svids.hrc
 
-ModelessDialog SV_DLG_PRINT_PROGRESS
-{
-HelpID = vcl:ModelessDialog:SV_DLG_PRINT_PROGRESS;
-Text [en-US] = Printing;
-Closeable = FALSE;
-Sizeable = FALSE;
-Moveable = TRUE;
-SVLook = TRUE;
-
-Size = MAP_APPFONT( 120, 70 );
-
-CancelButton SV_PRINT_PROGRESS_CANCEL
-{
-Pos = MAP_APPFONT( 35, 50 );
-Size = MAP_APPFONT( 50, 15 );
-};
-FixedText SV_PRINT_PROGRESS_TEXT
-{
-Pos = MAP_APPFONT( 5,10 );
-Size = MAP_APPFONT( 110, 10 );
-Text [ en-US ] = Page %p of %n;
-Center = TRUE;
-};
-};
-
 StringArray SV_PRINT_NATIVE_STRINGS
 {
 ItemList [en-US] =
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 21941ca..c44dee7 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -1842,63 +1842,46 @@ void PrintDialog::previewBackward()
 //
 // 
-
 
-PrintProgressDialog::PrintProgressDialog( Window* i_pParent, int i_nMax ) :
-ModelessDialog( i_pParent, VclResId( SV_DLG_PRINT_PROGRESS ) ),
-maText( this, VclResId( SV_PRINT_PROGRESS_TEXT ) ),
-maButton( this, VclResId( SV_PRINT_PROGRESS_CANCEL ) ),
-mbCanceled( false ),
-mnCur( 0 ),
-mnMax( i_nMax ),
-mnProgressHeight( 15 ),
-mbNativeProgress( false )
-{
-FreeResource();
+PrintProgressDialog::PrintProgressDialog(Window* i_pParent, int i_nMax)
+: ModelessDialog(i_pParent, PrintProgressDialog,
+vcl/ui/printprogressdialog.ui)

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

2013-11-25 Thread Steve Yin
 include/vcl/combobox.hxx|5 ++--
 include/vcl/lstbox.hxx  |4 ++-
 include/vcl/menu.hxx|9 +++
 vcl/inc/ilstbox.hxx |   14 ++-
 vcl/source/control/combobox.cxx |   12 +-
 vcl/source/control/edit.cxx |   31 -
 vcl/source/control/ilstbox.cxx  |   21 +
 vcl/source/control/lstbox.cxx   |   33 +++
 vcl/source/control/morebtn.cxx  |5 +---
 vcl/source/control/tabctrl.cxx  |3 --
 vcl/source/window/btndlg.cxx|7 +
 vcl/source/window/dlgctrl.cxx   |   10 ++--
 vcl/source/window/menu.cxx  |   48 +++-
 vcl/source/window/toolbox.cxx   |5 +++-
 vcl/source/window/toolbox2.cxx  |3 +-
 15 files changed, 177 insertions(+), 33 deletions(-)

New commits:
commit 79c0027c88fb64ffa7bbefcab2e291852733c223
Author: Steve Yin stev...@apache.org
Date:   Mon Nov 25 13:15:27 2013 +

Integrate branch of IAccessible2

Change-Id: I8c2fea0367ebfa53ce5e109ef48fd661cbfb78b3

diff --git a/include/vcl/combobox.hxx b/include/vcl/combobox.hxx
index 6f9c534..76533ab 100644
--- a/include/vcl/combobox.hxx
+++ b/include/vcl/combobox.hxx
@@ -74,6 +74,7 @@ private:
 DECL_DLLPRIVATE_LINK(   ImplSelectionChangedHdl, void* );
 DECL_DLLPRIVATE_LINK(   ImplUserDrawHdl, UserDrawEvent* );
 DECL_DLLPRIVATE_LINK(   ImplAutocompleteHdl, Edit* );
+DECL_DLLPRIVATE_LINK( ImplListItemSelectHdl , void* );
 
 protected:
 using Window::ImplInit;
@@ -178,8 +179,8 @@ public:
 voidSetMRUEntries( const OUString rEntries, sal_Unicode cSep 
= ';' );
 OUStringGetMRUEntries( sal_Unicode cSep = ';' ) const;
 voidSetMaxMRUCount( sal_uInt16 n );
-sal_uInt16  GetMaxMRUCount() const;
-
+sal_uInt16  GetMaxMRUCount() const;
+sal_uInt16  GetMRUCount() const;
 voidSetEntryData( sal_uInt16 nPos, void* pNewData );
 void*   GetEntryData( sal_uInt16 nPos ) const;
 
diff --git a/include/vcl/lstbox.hxx b/include/vcl/lstbox.hxx
index 6b3ab8c..cc63c2f 100644
--- a/include/vcl/lstbox.hxx
+++ b/include/vcl/lstbox.hxx
@@ -63,7 +63,8 @@ private:
 DECL_DLLPRIVATE_LINK(  ImplPopupModeEndHdl, void* );
 DECL_DLLPRIVATE_LINK(  ImplSelectionChangedHdl, void* );
 DECL_DLLPRIVATE_LINK(  ImplUserDrawHdl, UserDrawEvent* );
-
+DECL_DLLPRIVATE_LINK(  ImplFocusHdl, void* );
+DECL_DLLPRIVATE_LINK(  ImplListItemSelectHdl, void* );
 protected:
 using Window::ImplInit;
 SAL_DLLPRIVATE voidImplInit( Window* pParent, WinBits nStyle );
@@ -198,6 +199,7 @@ public:
 SizeCalcSize( sal_uInt16 nColumns, sal_uInt16 nLines ) 
const;
 voidGetMaxVisColumnsAndLines( sal_uInt16 rnCols, 
sal_uInt16 rnLines ) const;
 
+sal_uInt16  GetMRUCount() const;
 sal_uInt16  GetDisplayLineCount() const;
 
 voidEnableMirroring();
diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx
index 637c701..5131872 100644
--- a/include/vcl/menu.hxx
+++ b/include/vcl/menu.hxx
@@ -134,6 +134,8 @@ private:
 sal_uInt16  nDefaultItem;   // Id of default item
 sal_uInt16  nSelectedId;
 
+sal_uInt16  nHighlightedItem;
+
 // for output:
 sal_uInt16  nImgOrChkPos;
 sal_uInt16  nTextPos;
@@ -234,6 +236,13 @@ public:
 sal_uInt16  GetCurItemId() const;
 OString GetCurItemIdent() const;
 
+voidSetHightlightItem(sal_uInt16 nHighlightedItem);
+sal_uInt16  GetHighlightItem() const;
+
+OUStringGetItemAccKeyStrFromPos(sal_uInt16 nPos) const;
+
+sal_BoolIsTemporaryItemFromPos(sal_uInt16 nPos) const;
+
 voidSetDefaultItem( sal_uInt16 nItemId ){ nDefaultItem 
= nItemId; }
 sal_uInt16  GetDefaultItem() const  { return 
nDefaultItem; }
 
diff --git a/vcl/inc/ilstbox.hxx b/vcl/inc/ilstbox.hxx
index 315f4ce..18dfee8 100644
--- a/vcl/inc/ilstbox.hxx
+++ b/vcl/inc/ilstbox.hxx
@@ -253,6 +253,8 @@ private:
 LinkmaDoubleClickHdl;
 LinkmaUserDrawHdl;
 LinkmaMRUChangedHdl;
+LinkmaFocusHdl;
+LinkmaListItemSelectHdl;
 
 ::vcl::QuickSelectionEngine maQuickSelectionEngine;
 
@@ -266,7 +268,7 @@ protected:
 virtual voidGetFocus();
 virtual voidLoseFocus();
 
-sal_BoolSelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLET, 
sal_Bool bShift = sal_False, sal_Bool bCtrl = sal_False );
+sal_BoolSelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLET, 
sal_Bool bShift = sal_False, sal_Bool bCtrl = sal_False, sal_Bool 
bSelectPosChange = sal_False );
 voidImplPaint( sal_uInt16 nPos, sal_Bool bErase = sal_False, 
bool bLayout = false );
 voidImplDoPaint( const Rectangle rRect, 

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

2013-07-11 Thread Stephan Bergmann
 include/vcl/salctype.hxx |8 -
 vcl/Library_vcl.mk   |1 
 vcl/inc/unx/salinst.h|2 
 vcl/source/gdi/bmpconv.cxx   |  209 ---
 vcl/source/window/window.cxx |   15 --
 vcl/unx/generic/dtrans/X11_selection.cxx |   34 -
 vcl/unx/generic/dtrans/X11_selection.hxx |3 
 vcl/unx/generic/dtrans/X11_service.cxx   |   52 ++-
 vcl/unx/generic/dtrans/bmp.cxx   |   87 ++--
 vcl/unx/generic/dtrans/bmp.hxx   |   20 --
 10 files changed, 74 insertions(+), 357 deletions(-)

New commits:
commit 31144904919cf386f7ef6941a2932bc00497ed13
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu Jul 11 13:22:02 2013 +0200

X11SalInstance::CreateClipboard is only ever used with the default $DISPLAY

Change-Id: Id9a407b9ee4419fc6342931b249eb00e70addfad

diff --git a/vcl/inc/unx/salinst.h b/vcl/inc/unx/salinst.h
index 3f8d06e..afe8e84 100644
--- a/vcl/inc/unx/salinst.h
+++ b/vcl/inc/unx/salinst.h
@@ -39,7 +39,7 @@ class SalXLib;
 class VCLPLUG_GEN_PUBLIC X11SalInstance : public SalGenericInstance
 {
 private:
-boost::unordered_map OUString, boost::unordered_map Atom, 
com::sun::star::uno::Reference 
com::sun::star::datatransfer::clipboard::XClipboard  , OUStringHash  
m_aInstances;
+boost::unordered_map Atom, com::sun::star::uno::Reference 
com::sun::star::datatransfer::clipboard::XClipboard   m_aInstances;
 
 protected:
 SalXLib *mpXLib;
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index dc450e3..2125cda 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -8508,11 +8508,10 @@ uno::Reference XClipboard  
Window::GetPrimarySelection()
 uno::Reference XComponentContext  xContext( 
comphelper::getProcessComponentContext() );
 
 #if defined(UNX)  !defined(MACOSX)
-// A hack, making the primary selection available as an 
instance of
-// the SystemClipboard service on X11:
-css::uno::Sequencecss::uno::Any args(2);
-args[0] = Application::GetDisplayConnection();
-args[1] = OUString(PRIMARY);
+// A hack, making the primary selection available as an 
instance
+// of the SystemClipboard service on X11:
+css::uno::Sequencecss::uno::Any args(1);
+args[0] = OUString(PRIMARY);
 mpWindowImpl-mpFrameData-mxSelection.set(
 (xContext-getServiceManager()-
  createInstanceWithArgumentsAndContext(
diff --git a/vcl/unx/generic/dtrans/X11_service.cxx 
b/vcl/unx/generic/dtrans/X11_service.cxx
index 2e8e0cd..59d7e45 100644
--- a/vcl/unx/generic/dtrans/X11_service.cxx
+++ b/vcl/unx/generic/dtrans/X11_service.cxx
@@ -61,47 +61,27 @@ Sequence OUString  SAL_CALL 
x11::Xdnd_dropTarget_getSupportedServiceNames()
 
 css::uno::Reference XInterface  X11SalInstance::CreateClipboard( const 
Sequence Any  arguments )
 {
-OUString aDisplayName;
-Atom nSelection;
-
-// extract display name from connection argument. An exception is thrown
-// by SelectionManager.initialize() if no display connection is given.
-if( arguments.getLength()  0 )
-{
-css::uno::Reference XDisplayConnection  xConn;
-arguments.getConstArray()[0] = xConn;
-
-if( xConn.is() )
-{
-Any aIdentifier = xConn-getIdentifier();
-aIdentifier = aDisplayName;
-}
+SelectionManager rManager = SelectionManager::get();
+css::uno::Sequencecss::uno::Any mgrArgs(1);
+mgrArgs[0] = Application::GetDisplayConnection();
+rManager.initialize(mgrArgs);
+
+OUString sel;
+if (arguments.getLength() == 0) {
+sel = CLIPBOARD;
+} else if (arguments.getLength() != 1 || !(arguments[0] = sel)) {
+throw css::lang::IllegalArgumentException(
+bad X11SalInstance::CreateClipboard arguments,
+css::uno::Referencecss::uno::XInterface(), -1);
 }
+Atom nSelection = rManager.getAtom(sel);
 
-SelectionManager rManager = SelectionManager::get( aDisplayName );
-rManager.initialize( arguments );
-
-// check if any other selection than clipboard selection is specified
-if( arguments.getLength()  1 )
-{
-OUString aSelectionName;
-
-arguments.getConstArray()[1] = aSelectionName;
-nSelection = rManager.getAtom( aSelectionName );
-}
-else
-{
-// default atom is clipboard selection
-nSelection = rManager.getAtom( OUString(CLIPBOARD) );
-}
-
-::boost::unordered_map Atom, css::uno::Reference XClipboard   rMap( 
m_aInstances[ aDisplayName ] );
-::boost::unordered_map Atom, css::uno::Reference XClipboard  
::iterator it = rMap.find( nSelection );
-if( it != rMap.end() )
+::boost::unordered_map Atom, css::uno::Reference XClipboard  
::iterator it =