Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 4750 → Rev 4751

/branches/Version13x/Scribus/scribus/scpainterex_gdi.h
68,8 → 68,9
ScPainterEx_GDI( HDC hDC, QRect& rect, bool gray );
virtual ~ScPainterEx_GDI();
 
virtual int supportedModes() { return (int) rgbMode; }
virtual ColorMode preferredMode() { return rgbMode; }
virtual int supportedColorModes() { return (int) rgbMode; }
virtual ColorMode preferredColorMode() { return rgbMode; }
virtual ImageMode imageMode() { return rgbImages; }
 
virtual void begin();
virtual void end();
/branches/Version13x/Scribus/scribus/scwinprint.cpp
462,7 → 462,7
#endif
// Create the GDI painter
pageOutput = new ScPageOutput(doc, true, ScPageOutput::loadImagesAsRGBProof, 300, options.useICC);
pageOutput = new ScPageOutput(doc, true, 300, options.useICC);
pageOutput->setScale( 1.0 );
QRect drawRect( 0, 0, physicalWidth, physicalHeight);
574,9 → 574,26
if( ExtEscape( printerDC, escape, sizeof(sps), (LPCSTR) &sps, 0, NULL) <= 0 )
return false;
 
// Set some necessary stuff for embedding ps into ps
QString eBegin = "/b4_Inc_state save def\n";
eBegin += "/dict_count countdictstack def\n";
eBegin += "/op_count count 1 sub def\n";
eBegin += "userdict begin\n";
eBegin += "/showpage { } def\n";
eBegin += "0 setgray 0 setlinecap\n";
eBegin += "1 setlinewidth 0 setlinejoin\n";
eBegin += "10 setmiterlimit [ ] 0 setdash newpath\n";
eBegin += "/languagelevel where\n";
eBegin += "{pop languagelevel\n";
eBegin += "1 ne\n";
eBegin += "{false setstrokeadjust false setoverprint\n";
eBegin += "} if } if\n";
sprintf( (char*) sps.data, "%s", eBegin.latin1() );
sps.numBytes = strlen( (char*) sps.data );
if( ExtEscape( printerDC, escape, sizeof(sps), (LPCSTR) &sps, 0, NULL) <= 0 )
return false;
 
// Center the printed page in paper zone
//transx = 0;
//transy = -pageHeight;
transx = ( physicalWidth - pageWidth ) / 2.0;
transy = ( pageHeight - physicalHeight ) / 2.0 - pageHeight;
sprintf( (char*) sps.data, "%0.3f %0.3f translate\n", transx, transy );
587,7 → 604,6
if ( !file.open( IO_ReadOnly ) )
return false;
fileSize = file.size();
 
bw = 0; // bytes written
br = file.readBlock( (char*) sps.data, sizeof( sps.data ) );
while( br > 0 )
599,9 → 615,17
break;
br = file.readBlock( (char*) sps.data, sizeof( sps.data ) );
}
 
file.close();
 
// Set some necessary stuff for embedding ps into ps
QString eEnd = "count op_count sub {pop} repeat\n";
eEnd += "countdictstack dict_count sub {end} repeat\n";
eEnd += "b4_Inc_state restore\n";
sprintf( (char*) sps.data, "%s", eEnd.latin1() );
sps.numBytes = strlen( (char*) sps.data );
if( ExtEscape( printerDC, escape, sizeof(sps), (LPCSTR) &sps, 0, NULL) <= 0 )
return false;
 
return ( (fileSize == bw) && ( br >= 0 ) );
}
 
/branches/Version13x/Scribus/scribus/scpageoutput.h
23,16 → 23,6
 
class SCRIBUS_API ScPageOutput
{
public:
 
typedef enum
{
loadImagesAsCMYK,
loadImagesAsRGB,
loadImagesAsRGBProof,
loadImagesAsRawData
} imageLoadMode;
 
protected:
 
ScribusDoc* m_doc;
41,7 → 31,6
bool m_reloadImages;
int m_imageRes;
bool m_useProfiles;
imageLoadMode m_imageMode;
 
virtual void DrawMasterItems(ScPainterExBase *painter, Page *page, QRect clip);
virtual void DrawPageItems(ScPainterExBase *painter, Page *page, QRect clip);
62,9 → 51,10
 
public:
 
ScPageOutput(ScribusDoc* doc, bool reloadImages = false, imageLoadMode loadMode = loadImagesAsRGB, int resolution = 72, bool useProfiles = false);
ScPageOutput(ScribusDoc* doc, bool reloadImages = false, int resolution = 72, bool useProfiles = false);
 
virtual void begin(void) {};
virtual void DrawPage( Page* page ) {};
virtual void DrawPage( Page* page, ScPainterExBase* painter);
virtual void end(void) {};
 
/branches/Version13x/Scribus/scribus/scpageoutput.cpp
22,13 → 22,12
 
//extern SCRIBUS_API ScribusMainWindow* ScMW;
 
ScPageOutput::ScPageOutput(ScribusDoc* doc, bool reloadImages, imageLoadMode loadMode, int resolution, bool useProfiles)
ScPageOutput::ScPageOutput(ScribusDoc* doc, bool reloadImages, int resolution, bool useProfiles)
{
m_doc = doc;
m_reloadImages = reloadImages;
m_imageRes = resolution;
m_useProfiles = useProfiles;
m_imageMode = loadMode;
}
 
void ScPageOutput::DrawPage( Page* page, ScPainterExBase* painter)
73,7 → 72,7
continue;
if ((currItem->OwnPage != -1) && (currItem->OwnPage != static_cast<int>(Mp->pageNr())))
continue;
if (!currItem->printable())
if (!currItem->printEnabled())
continue;
int savedOwnPage = currItem->OwnPage;
double OldX = currItem->xPos();
191,7 → 190,7
++docItem;
if (currItem->LayerNr != ll.LNr)
continue;
if (!currItem->printable())
if (!currItem->printEnabled())
continue;
if ((m_doc->masterPageMode()) && ((currItem->OwnPage != -1) && (currItem->OwnPage != docCurrPageNo)))
continue;
669,9 → 668,8
{
bool dummy;
bool useCmyk = false;
int modes = painter->supportedModes();
ScPainterExBase::ColorMode mode = painter->preferredMode();
if ( (modes & ScPainterExBase::cmykMode) && (mode == ScPainterExBase::cmykMode) )
ScPainterExBase::ImageMode imageMode = painter->imageMode();
if ( imageMode == ScPainterExBase::cmykImages )
useCmyk = true;
QFileInfo fInfo(item->Pfile);
QString ext = fInfo.extension(false);
681,7 → 679,7
scImg.imgInfo.layerInfo.clear();
scImg.imgInfo.RequestProps = item->pixm.imgInfo.RequestProps;
scImg.imgInfo.isRequest = item->pixm.imgInfo.isRequest;
scImg.LoadPicture(item->Pfile, item->IProfile, 0, item->UseEmbedded, m_useProfiles, (int) m_imageMode, m_imageRes, &dummy);
scImg.LoadPicture(item->Pfile, item->IProfile, 0, item->UseEmbedded, m_useProfiles, (int) imageMode, m_imageRes, &dummy);
if( ext == "eps" || ext == "pdf" || ext == "ps" )
{
imScaleX *= (72.0 / (double) m_imageRes);
695,9 → 693,11
 
painter->save();
if (item->imageClip.size() != 0)
{
painter->setupPolygon(&item->imageClip);
else
painter->setupPolygon(&item->PoLine);
painter->setClipPath();
}
painter->setupPolygon(&item->PoLine);
painter->setClipPath();
if (item->imageFlippedH())
{
/branches/Version13x/Scribus/scribus/scpainterexbase.h
52,9 → 52,11
virtual ~ScPainterExBase() {};
enum FillMode { None, Solid, Gradient };
enum ColorMode { rgbMode = 1, cmykMode = 2 };
enum ImageMode { cmykImages, rgbImages, rgbProofImages, rawImages };
 
virtual int supportedModes() = 0;
virtual ColorMode preferredMode() = 0;
virtual int supportedColorModes() = 0;
virtual ColorMode preferredColorMode() = 0;
virtual ImageMode imageMode() = 0;
virtual void begin() = 0;
virtual void end() = 0;