r20630 by jghali -
scribus-commit
scribus-commit at lists.scribus.net
Wed Dec 23 23:28:35 UTC 2015
Author: jghali
Date: Wed Dec 23 23:28:35 2015
New Revision: 20630
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20630
Log:
allow tables to be printed on Windows
Added:
trunk/Scribus/scribus/collapsedtablepainterex.cpp
trunk/Scribus/scribus/collapsedtablepainterex.h
Modified:
trunk/Scribus/scribus/CMakeLists.txt
trunk/Scribus/scribus/pageitem_textframe.cpp
trunk/Scribus/scribus/scpageoutput.cpp
trunk/Scribus/scribus/scpageoutput.h
trunk/Scribus/scribus/scpageoutput_ps2.h
trunk/Scribus/scribus/scpainterex_cairo.cpp
trunk/Scribus/scribus/scpainterex_cairo.h
trunk/Scribus/scribus/scpainterex_ps2.cpp
trunk/Scribus/scribus/scpainterex_ps2.h
trunk/Scribus/scribus/scpainterexbase.h
trunk/Scribus/win32/vc11/scribus-main/Scribus.vcxproj
trunk/Scribus/win32/vc11/scribus-main/Scribus.vcxproj.filters
Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20630&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt (original)
+++ trunk/Scribus/scribus/CMakeLists.txt Wed Dec 23 23:28:35 2015
@@ -583,6 +583,7 @@
cmserrorhandling.cpp
cmsettings.cpp
collapsedtablepainter.cpp
+ collapsedtablepainterex.cpp
collect4output.cpp
colorblind.cpp
colorsetmanager.cpp
Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20630&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp Wed Dec 23 23:28:35 2015
@@ -3226,19 +3226,11 @@
double desc, asce;
// tTabValues.clear();
p->save(); //SA1
- // QRect e2;
- if (isEmbedded)
- {
- // e2 = cullingArea;
- }
- else
- {
- // e2 = QRect(qRound(cullingArea.x() / sc + m_Doc->minCanvasCoordinate.x()), qRound(cullingArea.y() / sc + m_Doc->minCanvasCoordinate.y()),
- // qRound(cullingArea.width() / sc), qRound(cullingArea.height() / sc));
+
+ if (!isEmbedded)
pf2.translate(m_xPos, m_yPos);
- }
-
pf2.rotate(m_rotation);
+
if (!m_Doc->layerOutline(LayerID))
{
if ((fillColor() != CommonStrings::None) || (GrType != 0))
Modified: trunk/Scribus/scribus/scpageoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20630&path=/trunk/Scribus/scribus/scpageoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/scpageoutput.cpp (original)
+++ trunk/Scribus/scribus/scpageoutput.cpp Wed Dec 23 23:28:35 2015
@@ -12,6 +12,7 @@
#include <QStack>
#include "cmsettings.h"
+#include "collapsedtablepainterex.h"
#include "commonstrings.h"
#include "pageitem.h"
#include "pageitem_arc.h"
@@ -23,6 +24,7 @@
#include "pageitem_polyline.h"
#include "pageitem_regularpolygon.h"
#include "pageitem_spiral.h"
+#include "pageitem_table.h"
#include "pageitem_textframe.h"
#include "prefsmanager.h"
#include "scfonts.h"
@@ -105,7 +107,7 @@
drawMarks(page, painter, m_marksOptions);
}
-void ScPageOutput::drawMasterItems(ScPainterExBase *painter, ScPage *page, ScLayer& layer, const QRect& clip)
+void ScPageOutput::drawMasterItems(ScPainterExBase *painter, ScPage *page, ScLayer& layer, QRect clip)
{
PageItem* currItem;
if (page->MPageNam.isEmpty())
@@ -157,7 +159,7 @@
}
}
-void ScPageOutput::drawPageItems(ScPainterExBase *painter, ScPage *page, ScLayer& layer, const QRect& clip)
+void ScPageOutput::drawPageItems(ScPainterExBase *painter, ScPage *page, ScLayer& layer, QRect clip)
{
PageItem *currItem;
if (m_doc->Items->count() <= 0)
@@ -187,8 +189,14 @@
}
}
-void ScPageOutput::drawItem( PageItem* item, ScPainterExBase* painter, const QRect& clip )
-{
+void ScPageOutput::drawItem( PageItem* item, ScPainterExBase* painter, QRect clip )
+{
+ if (clip.isNull())
+ {
+ clip = QRectF(QPointF(m_doc->minCanvasCoordinate.x(), m_doc->minCanvasCoordinate.y()),
+ QPointF(m_doc->maxCanvasCoordinate.x(), m_doc->maxCanvasCoordinate.y())).toAlignedRect();
+ }
+
drawItem_Pre(item, painter);
PageItem::ItemType itemType = item->itemType();
if (itemType == PageItem::Arc)
@@ -209,6 +217,8 @@
drawItem_RegularPolygon( (PageItem_RegularPolygon*) item, painter, clip);
else if (itemType == PageItem::Spiral)
drawItem_Spiral( (PageItem_Spiral*) item, painter, clip);
+ else if (itemType == PageItem::Table)
+ drawItem_Table( (PageItem_Table*) item, painter, clip);
else if (itemType == PageItem::TextFrame)
drawItem_TextFrame( (PageItem_TextFrame*) item, painter, clip);
drawItem_Post(item, painter);
@@ -496,7 +506,7 @@
painter->restore();
}
-void ScPageOutput::drawGlyphs(PageItem* item, ScPainterExBase *painter, const CharStyle& style, GlyphLayout& glyphs, const QRect& clip)
+void ScPageOutput::drawGlyphs(PageItem* item, ScPainterExBase *painter, const CharStyle& style, GlyphLayout& glyphs, QRect clip)
{
uint glyph = glyphs.glyph;
if (glyph == (ScFace::CONTROL_GLYPHS + SpecialChars::NBSPACE.unicode())) // NBSPACE
@@ -649,7 +659,7 @@
}
}
-void ScPageOutput::drawItem_Embedded( PageItem* item, ScPainterExBase *p, const QRect& clip, const CharStyle& style, PageItem* cembedded)
+void ScPageOutput::drawItem_Embedded( PageItem* item, ScPainterExBase *p, QRect clip, const CharStyle& style, PageItem* cembedded)
{
if (!cembedded)
return;
@@ -702,7 +712,7 @@
}
}
-void ScPageOutput::drawPattern( PageItem* item, ScPainterExBase* painter, const QRect& clip)
+void ScPageOutput::drawPattern( PageItem* item, ScPainterExBase* painter, QRect clip)
{
double x1, x2, y1, y2;
ScPattern& pattern = m_doc->docPatterns[item->pattern()];
@@ -798,13 +808,13 @@
}
-void ScPageOutput::drawItem_Arc ( PageItem_Arc* item , ScPainterExBase* painter, const QRect& clip )
+void ScPageOutput::drawItem_Arc ( PageItem_Arc* item , ScPainterExBase* painter, QRect clip )
{
painter->setupPolygon(&item->PoLine);
fillPath(item, painter, clip);
}
-void ScPageOutput::drawItem_Group( PageItem_Group* item, ScPainterExBase* painter, const QRect& clip )
+void ScPageOutput::drawItem_Group( PageItem_Group* item, ScPainterExBase* painter, QRect clip )
{
if (item->groupItemList.isEmpty())
return;
@@ -876,7 +886,7 @@
painter->restore();
}
-void ScPageOutput::drawItem_ImageFrame( PageItem_ImageFrame* item, ScPainterExBase* painter, const QRect& clip )
+void ScPageOutput::drawItem_ImageFrame( PageItem_ImageFrame* item, ScPainterExBase* painter, QRect clip )
{
ScPainterExBase::ImageMode mode = ScPainterExBase::rgbImages;
if ((item->fillColor() != CommonStrings::None) || (item->GrType != 0))
@@ -964,7 +974,7 @@
}
}
-void ScPageOutput::drawItem_Line( PageItem_Line* item, ScPainterExBase* painter, const QRect& clip )
+void ScPageOutput::drawItem_Line( PageItem_Line* item, ScPainterExBase* painter, QRect clip )
{
if (item->PoLine.size() < 4)
return;
@@ -1065,7 +1075,7 @@
}
}
-void ScPageOutput::drawItem_PathText( PageItem_PathText* item, ScPainterExBase* painter, const QRect& clip )
+void ScPageOutput::drawItem_PathText( PageItem_PathText* item, ScPainterExBase* painter, QRect clip )
{
QString chstr;
//ScText *hl;
@@ -1246,13 +1256,13 @@
}
}
-void ScPageOutput::drawItem_Polygon ( PageItem_Polygon* item , ScPainterExBase* painter, const QRect& clip )
+void ScPageOutput::drawItem_Polygon ( PageItem_Polygon* item , ScPainterExBase* painter, QRect clip )
{
painter->setupPolygon(&item->PoLine);
fillPath(item, painter, clip);
}
-void ScPageOutput::drawItem_PolyLine( PageItem_PolyLine* item, ScPainterExBase* painter, const QRect& clip )
+void ScPageOutput::drawItem_PolyLine( PageItem_PolyLine* item, ScPainterExBase* painter, QRect clip )
{
if (item->PoLine.size() < 4)
return;
@@ -1412,13 +1422,13 @@
}
}
-void ScPageOutput::drawItem_RegularPolygon( PageItem_RegularPolygon* item, ScPainterExBase* painter, const QRect& clip )
+void ScPageOutput::drawItem_RegularPolygon( PageItem_RegularPolygon* item, ScPainterExBase* painter, QRect clip )
{
painter->setupPolygon(&item->PoLine);
painter->fillPath();
}
-void ScPageOutput::drawItem_Spiral( PageItem_Spiral* item, ScPainterExBase* painter, const QRect& clip )
+void ScPageOutput::drawItem_Spiral( PageItem_Spiral* item, ScPainterExBase* painter, QRect clip )
{
if (item->PoLine.size() < 4)
return;
@@ -1578,7 +1588,22 @@
}
}
-void ScPageOutput::drawItem_TextFrame( PageItem_TextFrame* item, ScPainterExBase* painter, const QRect& clip )
+void ScPageOutput::drawItem_Table( PageItem_Table* item, ScPainterExBase* painter, QRect clip )
+{
+ painter->save();
+
+ // Set the clip path.
+ painter->setupPolygon(&item->PoLine);
+ painter->setClipPath();
+
+ // Paint the table.
+ CollapsedTablePainterEx tablePainter(this, item);
+ tablePainter.paintTable(painter);
+
+ painter->restore();
+}
+
+void ScPageOutput::drawItem_TextFrame( PageItem_TextFrame* item, ScPainterExBase* painter, QRect cullingArea )
{
QTransform wm;
QPoint pt1, pt2;
@@ -1587,20 +1612,15 @@
int a;
double desc, asce;
- QRect e2;
painter->save();
- if (item->isEmbedded)
- e2 = clip;
- else
- {
- e2 = QRect(qRound(clip.x() + m_doc->minCanvasCoordinate.x()), qRound(clip.y() + m_doc->minCanvasCoordinate.y()), clip.width(), clip.height());
+ if (!item->isEmbedded)
wm.translate(item->xPos(), item->yPos());
- }
wm.rotate(item->rotation());
+
if ((item->fillColor() != CommonStrings::None) || (item->GrType != 0))
{
painter->setupPolygon(&item->PoLine);
- fillPath(item, painter, clip);
+ fillPath(item, painter, cullingArea);
}
if ((item->isAnnotation()) && (item->annotation().Type() == Annotation::Button) && (!item->Pfile.isEmpty()) && (item->imageIsAvailable) && (item->imageVisible()) && (item->annotation().UseIcons()))
{
@@ -1619,11 +1639,15 @@
{
painter->translate(item->width(), 0);
painter->scale(-1, 1);
+ wm.translate(item->width(), 0);
+ wm.scale(-1, 1);
}
if (item->imageFlippedV())
{
painter->translate(0, item->height());
painter->scale(1, -1);
+ wm.translate(0, item->height());
+ wm.scale(1, -1);
}
for (uint ll=0; ll < item->textLayout.lines(); ++ll)
@@ -1632,23 +1656,23 @@
double CurX = ls.x;
for (a = ls.firstItem; a <= ls.lastItem; ++a)
{
- GlyphLayout* glyphs = item->itemText.getGlyphs(a);
+ GlyphLayout* glyphs = item->itemText.getGlyphs(a);
const CharStyle& charStyle = item->itemText.charStyle(a);
if (charStyle.fillColor() != CommonStrings::None)
{
- ScColorShade tmp(m_doc->PageColors[charStyle.fillColor()], (int) charStyle.fillShade());
+ ScColorShade tmp(m_doc->PageColors[charStyle.fillColor()], (int) charStyle.fillShade());
painter->setBrush(tmp);
}
if (charStyle.strokeColor() != CommonStrings::None)
{
- ScColorShade tmp(m_doc->PageColors[charStyle.strokeColor()], (int) charStyle.strokeShade());
+ ScColorShade tmp(m_doc->PageColors[charStyle.strokeColor()], (int) charStyle.strokeShade());
painter->setPen(tmp, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
}
//if (!m_doc->RePos)
{
- //double xcoZli = CurX + glyphs->xoffset;
+ //double xcoZli = CurX + glyphs->xoffset;
desc = - charStyle.font().descent(charStyle.fontSize() / 10.0);
asce = charStyle.font().ascent(charStyle.fontSize() / 10.0);
if (charStyle.strokeColor() != CommonStrings::None)
@@ -1656,21 +1680,21 @@
ScColorShade tmp(m_doc->PageColors[charStyle.strokeColor()], (int) charStyle.strokeShade());
painter->setPen(tmp, 1, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
}
- if (e2.intersects(wm.mapRect(QRect(qRound(CurX + glyphs->xoffset),qRound(ls.y + glyphs->yoffset-asce), qRound(glyphs->xadvance+1), qRound(asce+desc)))))
+ if (item->isEmbedded || cullingArea.intersects(wm.mapRect(QRect(qRound(CurX + glyphs->xoffset),qRound(ls.y + glyphs->yoffset-asce), qRound(glyphs->xadvance+1), qRound(asce+desc)))))
{
painter->save();
painter->translate(CurX, ls.y);
- if (item->itemText.hasObject(a))
- drawItem_Embedded(item, painter, clip, charStyle, item->itemText.object(a));
+ if (item->itemText.hasObject(a))
+ drawItem_Embedded(item, painter, cullingArea, charStyle, item->itemText.object(a));
else
- drawGlyphs(item, painter, charStyle, *glyphs, clip);
+ drawGlyphs(item, painter, charStyle, *glyphs, cullingArea);
painter->restore();
}
// Unneeded now that glyph xadvance is set appropriately for inline objects by PageItem_TextFrame::layout() - JG
/*if (hl->hasObject())
CurX += (hl->embedded.getItem()->gWidth + hl->embedded.getItem()->lineWidth());
else*/
- CurX += glyphs->wide();
+ CurX += glyphs->wide();
}
}
}
@@ -1928,7 +1952,7 @@
painter->restore();
}
-void ScPageOutput::fillPath( PageItem* item, ScPainterExBase* painter, const QRect& clip )
+void ScPageOutput::fillPath( PageItem* item, ScPainterExBase* painter, QRect clip )
{
if( painter->fillMode() == ScPainterExBase::Pattern && !painter->hasCapability(ScPainterExBase::patterns) )
drawPattern( item, painter, clip );
@@ -1936,7 +1960,7 @@
painter->fillPath();
}
-void ScPageOutput::strokePath( PageItem* item, ScPainterExBase* painter, const QRect& clip )
+void ScPageOutput::strokePath( PageItem* item, ScPainterExBase* painter, QRect clip )
{
painter->strokePath();
}
Modified: trunk/Scribus/scribus/scpageoutput.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20630&path=/trunk/Scribus/scribus/scpageoutput.h
==============================================================================
--- trunk/Scribus/scribus/scpageoutput.h (original)
+++ trunk/Scribus/scribus/scpageoutput.h Wed Dec 23 23:28:35 2015
@@ -28,6 +28,7 @@
class PageItem_PolyLine;
class PageItem_Spiral;
class PageItem_RegularPolygon;
+class PageItem_Table;
class PageItem_TextFrame;
class ScLayer;
class ScribusDoc;
@@ -52,8 +53,18 @@
class SCRIBUS_API ScPageOutput
{
+public:
+ ScPageOutput(ScribusDoc* doc, bool reloadImages = false, int resolution = 72, bool useProfiles = false);
+ virtual ~ScPageOutput() { }
+
+ virtual void begin(void) {};
+ virtual void drawPage( ScPage* page ) {};
+ virtual void drawPage( ScPage* page, ScPainterExBase* painter);
+ virtual void end(void) {};
+
+ void setMarksOptions(const MarksOptions& opt) { m_marksOptions = opt; }
+
protected:
-
ScribusDoc* m_doc;
bool m_reloadImages;
@@ -61,31 +72,32 @@
bool m_useProfiles;
MarksOptions m_marksOptions;
- virtual void fillPath( PageItem* item, ScPainterExBase* painter, const QRect& clip );
- virtual void strokePath( PageItem* item, ScPainterExBase* painter, const QRect& clip );
+ virtual void fillPath( PageItem* item, ScPainterExBase* painter, QRect clip );
+ virtual void strokePath( PageItem* item, ScPainterExBase* painter, QRect clip );
- virtual void drawMasterItems( ScPainterExBase *painter, ScPage *page, ScLayer& layer, const QRect& clip);
- virtual void drawPageItems( ScPainterExBase *painter, ScPage *page, ScLayer& layer, const QRect& clip);
+ virtual void drawMasterItems( ScPainterExBase *painter, ScPage *page, ScLayer& layer, QRect clip);
+ virtual void drawPageItems( ScPainterExBase *painter, ScPage *page, ScLayer& layer, QRect clip);
- virtual void drawItem( PageItem* item, ScPainterExBase* painter, const QRect& clip );
+ virtual void drawItem( PageItem* item, ScPainterExBase* painter, QRect clip );
virtual void drawItem_Pre( PageItem* item, ScPainterExBase* painter );
virtual void drawItem_Post( PageItem* item, ScPainterExBase* painter );
- virtual void drawGlyphs(PageItem* item, ScPainterExBase *painter, const CharStyle& style, GlyphLayout& glyphs, const QRect& clip);
- virtual void drawItem_Embedded( PageItem* item, ScPainterExBase *p, const QRect& clip, const CharStyle& style, PageItem* cembedded);
- virtual void drawPattern(PageItem* item, ScPainterExBase* painter, const QRect& clip);
+ virtual void drawGlyphs(PageItem* item, ScPainterExBase *painter, const CharStyle& style, GlyphLayout& glyphs, QRect clip);
+ virtual void drawItem_Embedded( PageItem* item, ScPainterExBase *p, QRect clip, const CharStyle& style, PageItem* cembedded);
+ virtual void drawPattern(PageItem* item, ScPainterExBase* painter, QRect clip);
virtual void drawStrokePattern(PageItem* item, ScPainterExBase* painter, const QPainterPath& path);
- virtual void drawItem_Arc( PageItem_Arc* item, ScPainterExBase* painter, const QRect& clip );
- virtual void drawItem_Group( PageItem_Group* item, ScPainterExBase* painter, const QRect& clip );
- virtual void drawItem_ImageFrame( PageItem_ImageFrame* item, ScPainterExBase* painter, const QRect& clip );
- virtual void drawItem_Line( PageItem_Line* item, ScPainterExBase* painter, const QRect& clip);
- virtual void drawItem_PathText( PageItem_PathText* item, ScPainterExBase* painter, const QRect& clip );
- virtual void drawItem_Polygon ( PageItem_Polygon* item , ScPainterExBase* painter, const QRect& clip );
- virtual void drawItem_PolyLine( PageItem_PolyLine* item, ScPainterExBase* painte, const QRect& clip );
- virtual void drawItem_RegularPolygon( PageItem_RegularPolygon* item, ScPainterExBase* painte, const QRect& clip );
- virtual void drawItem_Spiral( PageItem_Spiral* item, ScPainterExBase* painter, const QRect& clip );
- virtual void drawItem_TextFrame( PageItem_TextFrame* item, ScPainterExBase* painter, const QRect& clip );
+ virtual void drawItem_Arc( PageItem_Arc* item, ScPainterExBase* painter, QRect clip );
+ virtual void drawItem_Group( PageItem_Group* item, ScPainterExBase* painter, QRect clip );
+ virtual void drawItem_ImageFrame( PageItem_ImageFrame* item, ScPainterExBase* painter, QRect clip );
+ virtual void drawItem_Line( PageItem_Line* item, ScPainterExBase* painter, QRect clip);
+ virtual void drawItem_PathText( PageItem_PathText* item, ScPainterExBase* painter, QRect clip );
+ virtual void drawItem_Polygon ( PageItem_Polygon* item , ScPainterExBase* painter, QRect clip );
+ virtual void drawItem_PolyLine( PageItem_PolyLine* item, ScPainterExBase* painte, QRect clip );
+ virtual void drawItem_RegularPolygon( PageItem_RegularPolygon* item, ScPainterExBase* painte, QRect clip );
+ virtual void drawItem_Spiral( PageItem_Spiral* item, ScPainterExBase* painter, QRect clip );
+ virtual void drawItem_Table( PageItem_Table* item, ScPainterExBase* painter, QRect clip );
+ virtual void drawItem_TextFrame( PageItem_TextFrame* item, ScPainterExBase* painter, QRect clip );
virtual void drawArrow(ScPainterExBase* painter, PageItem* item, QTransform &arrowTrans, int arrowIndex);
virtual void drawMarks( ScPage* page, ScPainterExBase* painter, const MarksOptions& options );
@@ -94,17 +106,7 @@
ScImage::RequestType translateImageModeToRequest( ScPainterExBase::ImageMode mode);
-public:
- virtual ~ScPageOutput() { }
-
- ScPageOutput(ScribusDoc* doc, bool reloadImages = false, int resolution = 72, bool useProfiles = false);
-
- virtual void begin(void) {};
- virtual void drawPage( ScPage* page ) {};
- virtual void drawPage( ScPage* page, ScPainterExBase* painter);
- virtual void end(void) {};
-
- void setMarksOptions(const MarksOptions& opt) { m_marksOptions = opt; }
+ friend class CollapsedTablePainterEx;
};
#endif
Modified: trunk/Scribus/scribus/scpageoutput_ps2.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20630&path=/trunk/Scribus/scribus/scpageoutput_ps2.h
==============================================================================
--- trunk/Scribus/scribus/scpageoutput_ps2.h (original)
+++ trunk/Scribus/scribus/scpageoutput_ps2.h Wed Dec 23 23:28:35 2015
@@ -21,19 +21,7 @@
class SCRIBUS_API ScPageOutput_Ps2 : public ScPageOutput
{
-protected:
-
- QRect m_clip;
- QIODevice* m_device;
- QTextStream m_stream;
- ScPs2OutputParams m_options;
-
- int m_pageIndex;
-
- virtual void initStream(QIODevice* dev);
-
public:
-
ScPageOutput_Ps2(QIODevice* dev, ScribusDoc* doc, int pageIndex, ScPs2OutputParams& options);
virtual ~ScPageOutput_Ps2();
@@ -43,6 +31,16 @@
const QRect clip(void);
void setClip(const QRect& rect) { m_clip = rect; }
+
+protected:
+ QRect m_clip;
+ QIODevice* m_device;
+ QTextStream m_stream;
+ ScPs2OutputParams m_options;
+
+ int m_pageIndex;
+
+ virtual void initStream(QIODevice* dev);
};
#endif
Modified: trunk/Scribus/scribus/scpainterex_cairo.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20630&path=/trunk/Scribus/scribus/scpainterex_cairo.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainterex_cairo.cpp (original)
+++ trunk/Scribus/scribus/scpainterex_cairo.cpp Wed Dec 23 23:28:35 2015
@@ -118,6 +118,11 @@
void ScPainterEx_Cairo::translate( double x, double y )
{
cairo_translate(m_cr, x, y);
+}
+
+void ScPainterEx_Cairo::translate( const QPointF& offset )
+{
+ cairo_translate(m_cr, offset.x(), offset.y());
}
void ScPainterEx_Cairo::rotate( double r )
@@ -598,6 +603,14 @@
}
void ScPainterEx_Cairo::drawLine(FPoint start, FPoint end)
+{
+ newPath();
+ moveTo(start.x(), start.y());
+ lineTo(end.x(), end.y());
+ strokePath();
+}
+
+void ScPainterEx_Cairo::drawLine(const QPointF& start, const QPointF& end)
{
newPath();
moveTo(start.x(), start.y());
Modified: trunk/Scribus/scribus/scpainterex_cairo.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20630&path=/trunk/Scribus/scribus/scpainterex_cairo.h
==============================================================================
--- trunk/Scribus/scribus/scpainterex_cairo.h (original)
+++ trunk/Scribus/scribus/scpainterex_cairo.h Wed Dec 23 23:28:35 2015
@@ -34,6 +34,7 @@
virtual void setWorldMatrix( const QTransform & );
virtual const QTransform worldMatrix();
virtual void translate( double, double );
+ virtual void translate( const QPointF& offset );
virtual void rotate( double );
virtual void scale( double, double );
@@ -71,6 +72,7 @@
virtual void drawPolygon();
virtual void drawPolyLine();
virtual void drawLine(FPoint start, FPoint end);
+ virtual void drawLine(const QPointF& start, const QPointF& end);
virtual void drawRect(double, double, double, double);
// pen + brush
Modified: trunk/Scribus/scribus/scpainterex_ps2.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20630&path=/trunk/Scribus/scribus/scpainterex_ps2.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainterex_ps2.cpp (original)
+++ trunk/Scribus/scribus/scpainterex_ps2.cpp Wed Dec 23 23:28:35 2015
@@ -184,6 +184,11 @@
void ScPainterEx_Ps2::translate( double x, double y )
{
m_matrix.translate(x, y);
+}
+
+void ScPainterEx_Ps2::translate( const QPointF& offset )
+{
+ m_matrix.translate(offset.x(), offset.y());
}
void ScPainterEx_Ps2::rotate( double r )
@@ -927,6 +932,14 @@
}
void ScPainterEx_Ps2::drawLine(FPoint start, FPoint end)
+{
+ newPath();
+ moveTo(start.x(), start.y());
+ lineTo(end.x(), end.y());
+ strokePath();
+}
+
+void ScPainterEx_Ps2::drawLine(const QPointF& start, const QPointF& end)
{
newPath();
moveTo(start.x(), start.y());
Modified: trunk/Scribus/scribus/scpainterex_ps2.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20630&path=/trunk/Scribus/scribus/scpainterex_ps2.h
==============================================================================
--- trunk/Scribus/scribus/scpainterex_ps2.h (original)
+++ trunk/Scribus/scribus/scpainterex_ps2.h Wed Dec 23 23:28:35 2015
@@ -90,6 +90,7 @@
virtual void setWorldMatrix( const QTransform & );
virtual const QTransform worldMatrix();
virtual void translate( double, double );
+ virtual void translate( const QPointF& offset );
virtual void rotate( double );
virtual void scale( double, double );
@@ -132,6 +133,7 @@
virtual void drawPolygon();
virtual void drawPolyLine();
virtual void drawLine(FPoint start, FPoint end);
+ virtual void drawLine(const QPointF& start, const QPointF& end);
virtual void drawRect(double, double, double, double);
// pen + brush
Modified: trunk/Scribus/scribus/scpainterexbase.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20630&path=/trunk/Scribus/scribus/scpainterexbase.h
==============================================================================
--- trunk/Scribus/scribus/scpainterexbase.h (original)
+++ trunk/Scribus/scribus/scpainterexbase.h Wed Dec 23 23:28:35 2015
@@ -34,6 +34,7 @@
#include <QList>
#include <QTransform>
#include <QPixmap>
+#include <QPointF>
#include <QStack>
#include "scribusapi.h"
@@ -49,12 +50,9 @@
class SCRIBUS_API ScPainterExBase
{
-protected:
- int m_capabilities;
- ScPainterExBase(void);
public:
+ virtual ~ScPainterExBase() {};
- virtual ~ScPainterExBase() {};
enum FillMode { None, Solid, Gradient, Pattern };
enum ColorMode { rgbMode = 1, cmykMode = 2 };
enum ImageMode { cmykImages, rgbImages, rawImages };
@@ -76,6 +74,7 @@
virtual void setWorldMatrix( const QTransform & ) = 0;
virtual const QTransform worldMatrix() = 0;
virtual void translate( double, double ) = 0;
+ virtual void translate( const QPointF& offset ) = 0;
virtual void rotate( double ) = 0;
virtual void scale( double, double ) = 0;
@@ -112,6 +111,7 @@
virtual void drawPolygon() = 0;
virtual void drawPolyLine() = 0;
virtual void drawLine(FPoint start, FPoint end) = 0;
+ virtual void drawLine(const QPointF& start, const QPointF& end) = 0;
virtual void drawRect(double, double, double, double) = 0;
// pen + brush
@@ -142,6 +142,10 @@
ScPattern* m_pattern;
ScPattern* m_maskPattern;
QTransform m_patternTransform;
+
+protected:
+ int m_capabilities;
+ ScPainterExBase(void);
};
#endif
Modified: trunk/Scribus/win32/vc11/scribus-main/Scribus.vcxproj
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20630&path=/trunk/Scribus/win32/vc11/scribus-main/Scribus.vcxproj
==============================================================================
--- trunk/Scribus/win32/vc11/scribus-main/Scribus.vcxproj (original)
+++ trunk/Scribus/win32/vc11/scribus-main/Scribus.vcxproj Wed Dec 23 23:28:35 2015
@@ -237,6 +237,7 @@
<ItemGroup>
<moc Include="..\..\..\scribus\appmodehelper.h" />
<ClInclude Include="..\..\..\scribus\appmodes.h" />
+ <ClInclude Include="..\..\..\scribus\collapsedtablepainterex.h" />
<ClInclude Include="..\..\..\scribus\colormgmt\sccolorspacedata_labdbl.h" />
<ClInclude Include="..\..\..\scribus\desaxe\actions.h" />
<ClInclude Include="..\..\..\scribus\desaxe\automata.h" />
@@ -894,6 +895,7 @@
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\scribus\appmodehelper.cpp" />
+ <ClCompile Include="..\..\..\scribus\collapsedtablepainterex.cpp" />
<ClCompile Include="..\..\..\scribus\desaxe\digester.cpp" />
<ClCompile Include="..\..\..\scribus\desaxe\digester_parse.cpp" />
<ClCompile Include="..\..\..\scribus\desaxe\saxfilter.cpp" />
Modified: trunk/Scribus/win32/vc11/scribus-main/Scribus.vcxproj.filters
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20630&path=/trunk/Scribus/win32/vc11/scribus-main/Scribus.vcxproj.filters
==============================================================================
--- trunk/Scribus/win32/vc11/scribus-main/Scribus.vcxproj.filters (original)
+++ trunk/Scribus/win32/vc11/scribus-main/Scribus.vcxproj.filters Wed Dec 23 23:28:35 2015
@@ -1022,6 +1022,9 @@
<ClInclude Include="..\..\..\scribus\ui\ui_resourcemanagerlicensebase.h">
<Filter>Generated Form Files</Filter>
</ClInclude>
+ <ClInclude Include="..\..\..\scribus\collapsedtablepainterex.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\..\scribus\desaxe\digester.cpp">
@@ -2552,6 +2555,9 @@
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\scribus\marks.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\..\..\scribus\collapsedtablepainterex.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
More information about the scribus-commit
mailing list