[Libreoffice-commits] core.git: 3 commits - sw/source vcl/headless vcl/unx
Caolán McNamara
caolanm at redhat.com
Sat Dec 5 12:43:40 PST 2015
sw/source/uibase/docvw/edtwin.cxx | 3 +
vcl/headless/svpgdi.cxx | 76 ++++++++++++++++++++------------------
vcl/unx/gtk3/gtk3gtkinst.cxx | 17 +++++---
3 files changed, 53 insertions(+), 43 deletions(-)
New commits:
commit 8dea939d65cd3cdd744d21a9f60444a97e45962b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Dec 4 15:15:06 2015 +0000
implement SAL_INVERT_TRACKFRAME invert via cairo
this gives the same (terrible?) pattern as quartz for dragging toolbars around
Change-Id: I439826c41f9d4d13d6e0b13859b6fb34899b6494
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index ad8888a..e610ad4 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -1195,34 +1195,47 @@ namespace
void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags )
{
- // FIXME: handle SAL_INVERT_TRACKFRAME
- if ( nFlags & SAL_INVERT_TRACKFRAME )
+ if (m_aDrawMode != basebmp::DrawMode::XOR)
{
- SAL_WARN("vcl.gdi", "SvpSalGraphics::invert, unhandled SAL_INVERT_TRACKFRAME");
- }
- else
- {
- if (m_aDrawMode == basebmp::DrawMode::XOR)
- SAL_WARN("vcl.gdi", "SvpSalGraphics::invert unhandled XOR (?)");
+ cairo_t* cr = getCairoContext();
+ assert(cr && m_aDevice->isTopDown());
+
+ clipRegion(cr);
+
+ cairo_rectangle_int_t extents = {0, 0, 0, 0};
+ basebmp::IBitmapDeviceDamageTrackerSharedPtr xDamageTracker(m_aDevice->getDamageTracker());
+
+ cairo_rectangle(cr, nX, nY, nWidth, nHeight);
+
+ cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
+
+ if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 10, 0))
+ {
+ cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE);
+ }
else
{
- cairo_t* cr = getCairoContext();
- assert(cr && m_aDevice->isTopDown());
-
- clipRegion(cr);
+ SAL_WARN("vcl.gdi", "SvpSalGraphics::invert, archaic cairo");
+ }
- cairo_rectangle_int_t extents = {0, 0, 0, 0};
- basebmp::IBitmapDeviceDamageTrackerSharedPtr xDamageTracker(m_aDevice->getDamageTracker());
+ if (nFlags & SAL_INVERT_TRACKFRAME)
+ {
+ cairo_set_line_width(cr, 2.0);
+ const double dashLengths[2] = { 4.0, 4.0 };
+ cairo_set_dash(cr, dashLengths, 2, 0);
- cairo_rectangle(cr, nX, nY, nWidth, nHeight);
+ if (xDamageTracker)
+ extents = getStrokeDamage(cr);
+ cairo_stroke(cr);
+ }
+ else
+ {
if (xDamageTracker)
extents = getFillDamage(cr);
cairo_clip(cr);
- cairo_set_source_rgb(cr, 1.0, 1.0, 1.0);
-
if (nFlags & SAL_INVERT_50)
{
cairo_pattern_t *pattern = create_stipple();
@@ -1231,31 +1244,24 @@ void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv
}
else
{
- if (cairo_version() >= CAIRO_VERSION_ENCODE(1, 10, 0))
- {
- cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE);
- }
- else
- {
- SAL_WARN("vcl.gdi", "SvpSalGraphics::invert, archaic cairo");
- cairo_set_source_rgb(cr, 0.0, 0.0, 0.0);
- }
cairo_paint(cr);
}
+ }
- cairo_surface_flush(cairo_get_target(cr));
- cairo_destroy(cr); // unref
-
- if (xDamageTracker)
- {
- xDamageTracker->damaged(basegfx::B2IBox(extents.x, extents.y, extents.x + extents.width,
- extents.y + extents.height));
- }
+ cairo_surface_flush(cairo_get_target(cr));
+ cairo_destroy(cr); // unref
- return;
+ if (xDamageTracker)
+ {
+ xDamageTracker->damaged(basegfx::B2IBox(extents.x, extents.y, extents.x + extents.width,
+ extents.y + extents.height));
}
+
+ return;
}
+ SAL_WARN("vcl.gdi", "SvpSalGraphics::invert unhandled XOR (?)");
+
basegfx::B2DPolygon aRect = basegfx::tools::createPolygonFromRect( basegfx::B2DRectangle( nX, nY, nX+nWidth, nY+nHeight ) );
basegfx::B2DPolyPolygon aPolyPoly( aRect );
basegfx::B2IBox aDestRange( nX, nY, nX + nWidth, nY + nHeight );
commit cfc119c4322e36283ffc4bebfb0757e8e0039a5a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Dec 4 14:11:35 2015 +0000
silence vcl release mouse warning
Change-Id: I12eb894d88c7b96f92e3d080ac3cf24ff2e025ec
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 277934b..8c9b13f 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -4391,7 +4391,8 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt)
m_rView.GetDrawFuncPtr()->BreakCreate(); // abort drawing
g_bNoInterrupt = false;
- ReleaseMouse();
+ if (IsMouseCaptured())
+ ReleaseMouse();
return;
}
bool bPopMode = false;
commit 66fedc0966ad0c732cada974ea910d7a98beca15
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Dec 4 14:11:24 2015 +0000
gtk3: avoid empty target clipboard warning
Change-Id: Ic6b46eb2c81398f0ab2e7539e5cdb27a508c8893
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 9f15db0..e9210d0 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -572,13 +572,16 @@ void VclGtkClipboard::setContents(
aGtkTargets.push_back(makeGtkTargetEntry(aFlavor));
}
- //if there was a previous gtk_clipboard_set_with_data call then
- //ClipboardClearFunc will be called now
- GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection);
- //use with_owner with m_pOwner so we can distinguish in handle_owner_change
- //if we have gained or lost ownership of the clipboard
- gtk_clipboard_set_with_owner(clipboard, aGtkTargets.data(), aGtkTargets.size(),
- ClipboardGetFunc, ClipboardClearFunc, G_OBJECT(m_pOwner));
+ if (!aGtkTargets.empty())
+ {
+ //if there was a previous gtk_clipboard_set_with_data call then
+ //ClipboardClearFunc will be called now
+ GtkClipboard* clipboard = gtk_clipboard_get(m_nSelection);
+ //use with_owner with m_pOwner so we can distinguish in handle_owner_change
+ //if we have gained or lost ownership of the clipboard
+ gtk_clipboard_set_with_owner(clipboard, aGtkTargets.data(), aGtkTargets.size(),
+ ClipboardGetFunc, ClipboardClearFunc, G_OBJECT(m_pOwner));
+ }
m_aGtkTargets = aGtkTargets;
}
More information about the Libreoffice-commits
mailing list