[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]
[XaraXtreme-commits] Commit Complete
Commit by : alex
Repository : xara
Revision : 1320
Date : Wed Jun 14 15:39:35 BST 2006
Changed paths:
M /Trunk/XaraLX/Kernel/Makefile.am
M /Trunk/XaraLX/Kernel/princomp.cpp
M /Trunk/XaraLX/Kernel/printctl.cpp
M /Trunk/XaraLX/Kernel/prnmks.cpp
M /Trunk/XaraLX/Kernel/view.cpp
M /Trunk/XaraLX/Kernel/view.h
M /Trunk/XaraLX/wxOil/Makefile.am
M /Trunk/XaraLX/wxOil/cctime.cpp
M /Trunk/XaraLX/wxOil/compatdef.h
M /Trunk/XaraLX/wxOil/lddirect.cpp
M /Trunk/XaraLX/wxOil/prdlgctl.h
M /Trunk/XaraLX/wxOil/prncamvw.cpp
M /Trunk/XaraLX/wxOil/prncamvw.h
Printing work
Diff:
Index: Trunk/XaraLX/Kernel/view.h
===================================================================
--- Trunk/XaraLX/Kernel/view.h (revision 1319)
+++ Trunk/XaraLX/Kernel/view.h (revision 1320)
@@ -283,10 +283,7 @@
// get/set numeric value
// Functions to render complex shapes into simple render regions
-PORTNOTE("other","Removed View render functions")
-#ifndef EXCLUDE_FROM_XARALX
RenderViewResult RenderOptimalView(RenderRegion*r, Matrix&, Spread*, BOOL);
-#endif
SlowJobResult RenderOptimalBitmapPhase(DocRect& ClipRect, Matrix&, Spread*, RenderRegion*, Node*, Node*,
BOOL RenderAllObjects, BOOL bPrintPaper, INT32&, ProgressDisplay* pProgress, INT32 TotalProgress);
@@ -303,13 +300,10 @@
protected:
virtual void RenderPaper(RenderRegion*, Spread*);
-PORTNOTE("other","Removed View render functions")
SlowJobResult RenderSimpleNodes(Node *pNode, RenderRegion *pRender,
ProgressDisplay& Progress, Node *pLastComplexNode = NULL);
-#ifndef EXCLUDE_FROM_XARALX
SlowJobResult RenderSimpleNodesUnclipped(Node *pNode, RenderRegion *pRender,
ProgressDisplay& Progress, Node *pLastComplexNode = NULL);
-#endif
private:
static PaperRenderRegion* pPaperRegion; // Region to use when rendering paper only
Index: Trunk/XaraLX/Kernel/prnmks.cpp
===================================================================
--- Trunk/XaraLX/Kernel/prnmks.cpp (revision 1319)
+++ Trunk/XaraLX/Kernel/prnmks.cpp (revision 1320)
@@ -134,6 +134,7 @@
#include "psrndrgn.h"
#include "psdc.h"
//#include "printstr.h"
+#include <stdlib.h>
CC_IMPLEMENT_MEMDUMP(LoadPrintMarks, LoadDirect);
CC_IMPLEMENT_MEMDUMP(PrintMarksMan, CC_CLASS_MEMDUMP);
@@ -339,7 +340,7 @@
PrintMark::~PrintMark()
{
MarkPosition* pMarkPos;
- while (pMarkPos=(MarkPosition*)MarkPositions.RemoveTail())
+ while ((pMarkPos=(MarkPosition*)MarkPositions.RemoveTail()))
delete pMarkPos;
}
@@ -752,7 +753,7 @@
{
// destroy all marks in the cache.
PrintMarkItem* pItem;
- while (pItem=(PrintMarkItem*)PrintMarkCache.RemoveTail())
+ while ((pItem=(PrintMarkItem*)PrintMarkCache.RemoveTail())) // assignment
delete pItem;
// Make sure the crop and text info handles don't reference anything
CropMarkHandle=0;
@@ -935,10 +936,10 @@
BOOL IsValid = FALSE;
BOOL IsCustomMark = FALSE;
- if (Token == String_16("%PRINTMARK")) // This text must not be internationalised
+ if (Token == String_16(_T("%PRINTMARK"))) // This text must not be internationalised
IsValid = TRUE;
- if (!IsValid && Token == String_16("%CUSTOMMAR")) // This text must not be internationalised
+ if (!IsValid && Token == String_16(_T("%CUSTOMMAR"))) // This text must not be internationalised
{
IsValid = TRUE;
IsCustomMark = TRUE;
@@ -1077,7 +1078,7 @@
MarkOrient NewOrient;
const TCHAR COMMA = TEXT(','); // This text must not be internationalised
- const TCHAR EQUALS = TEXT('=');
+// const TCHAR EQUALS = TEXT('=');
const TCHAR QUOTES = TEXT('"');
const TCHAR PLUS = TEXT('+');
const TCHAR SPACE = TEXT(' ');
@@ -1090,7 +1091,7 @@
// Turn on the exceptions function in the string reading class
StringBase::EnableExceptionHandler();
- TRY
+ //try
{
// toast everything up to the first quote
pos = Name.FindNextChar(QUOTES);
@@ -1143,8 +1144,8 @@
pMark->SetDefaultState(Enabled);
// The remainder of this string is a format list
- BOOL format=FALSE;
- BOOL eos=FALSE;
+// BOOL format=FALSE;
+// BOOL eos=FALSE;
// Turn our exception handler off but don't pop it.
StringBase::DisableExceptionHandler(FALSE);
@@ -1219,13 +1220,15 @@
}
}
}
- CATCH (CUserException, e)
+PORTNOTE("other", "Disabled random use of MFC CUserException in Kernel code")
+#ifndef EXCLUDE_FROM_XARALX
+ catch (CUserException)
{
// An exception has been thrown which means
// we failed to parse this string, so simply report failure
AllIsWell = FALSE;
}
- END_CATCH
+#endif
// Switch off the exception state finally, (and of course pop it)!
StringBase::DisableExceptionHandler();
@@ -1253,12 +1256,12 @@
{
ERROR2IF(Name == NULL, MarkType_Unknown, "NULL pointer passed to DecodeToMarkType");
- if ((*Name)==String_16("_R(ID_NONE)")) return MarkType_Unknown;
- if ((*Name)==String_16("_R(ID_STAR)")) return MarkType_Star;
- if ((*Name)==String_16("_R(ID_REGM)")) return MarkType_Registration;
- if ((*Name)==String_16("_R(ID_CBAR)")) return MarkType_ColourBar;
- if ((*Name)==String_16("_R(ID_GBAR)")) return MarkType_GreyBar;
- if ((*Name)==String_16("_R(ID_INFO)")) return MarkType_Information;
+ if ((*Name)==String_16(_T("ID_NONE"))) return MarkType_Unknown; /*NORESOURCEFIX*/
+ if ((*Name)==String_16(_T("ID_STAR"))) return MarkType_Star; /*NORESOURCEFIX*/
+ if ((*Name)==String_16(_T("ID_REGM"))) return MarkType_Registration; /*NORESOURCEFIX*/
+ if ((*Name)==String_16(_T("ID_CBAR"))) return MarkType_ColourBar; /*NORESOURCEFIX*/
+ if ((*Name)==String_16(_T("ID_GBAR"))) return MarkType_GreyBar; /*NORESOURCEFIX*/
+ if ((*Name)==String_16(_T("ID_INFO"))) return MarkType_Information; /*NORESOURCEFIX*/
return MarkType_Unknown;
}
@@ -1451,13 +1454,17 @@
Style.lfPitchAndFamily =0x12;
camStrncpy(Style.lfFaceName, TEXT("Times New Roman
*/
- String_64 FontName("Courier New");
+ String_64 FontName(_T("Courier New"));
MILLIPOINT FontSize = 9*1000;
// now create the text story to put in the mark.
TextStory *pStory;
DocColour TextCol(COLOUR_BLACK);
- pStory = TextStory::CreateFromChars(DocCoord(0,0), (TCHAR *)TextInfo, NULL, pDocument, NULL, FALSE, &TextCol);
+#ifdef _UNICODE
+ pStory = TextStory::CreateFromChars(DocCoord(0,0), NULL, (TCHAR *)TextInfo, pDocument, NULL, FALSE, &TextCol);
+#else
+ pStory = TextStory::CreateFromChars(DocCoord(0,0), (char *)TextInfo, NULL, pDocument, NULL, FALSE, &TextCol);
+#endif
if (pStory==NULL)
{
// deleting this will delete the mark position
@@ -1716,7 +1723,7 @@
void PageRectList::DeleteAll()
{
PageRect* pItem;
- while (pItem=((PageRect*)RemoveTail()))
+ while ((pItem=((PageRect*)RemoveTail()))) // assignment
delete pItem;
}
@@ -1848,21 +1855,25 @@
BOOL ok=FALSE;
// otherwise do some serious stuff.
- TCHAR SearchFile[] = "mrktmpl.xar";
- TCHAR *OutputBuff = new TCHAR[_MAX_PATH];
- if (OutputBuff)
+ TCHAR SearchFile[] = _T("mrktmpl.xar");
+// TCHAR *OutputBuff = new TCHAR[_MAX_PATH];
+ if (1 /*OutputBuff*/)
{
LoadPrintMarks LdPrintMark;
// try to find the search file...
+ StringVar s(CamResource::GetResourceFilePath(SearchFile));
+PORTNOTE("other", "Disabled printmark resource file finding")
+#ifndef EXCLUDE_FROM_XARALX
ok = FileUtil::FindResourceFile(SearchFile, OutputBuff);
+#endif
// Add a crop mark bits.
ok = ok && PMMCache.CreateCropMark();
// Add a text info mark too.
ok = ok && PMMCache.CreateTextInfoMark();
// Get the winoil level direct loader to do its stuff
- ok = ok && LdPrintMark.Execute(OutputBuff);
+ ok = ok && LdPrintMark.Execute(s);
// delete the allocated buffer
- delete OutputBuff;
+// delete OutputBuff;
}
// return all is well/not well
return (TemplateCached=ok);
@@ -2185,7 +2196,7 @@
// now cache the print time
CCTime MyTime;
PMMCache.CachedTime.Empty();
- String_64 TimeFormat("%dy/%mt/%yr %th.%mn %pm");
+ String_64 TimeFormat(_T("%dy/%mt/%yr %th.%mn %pm"));
MyTime.ConvertStandardDateAndTime(&TimeFormat, &PMMCache.CachedTime);
}
@@ -2428,8 +2439,10 @@
MILLIPOINT adjbleed = AdjustedBleed();
// is this region a postscript render region?
+PORTNOTE("printing", "disabled print mark generation use of PrintPSRenderRegion")
+#ifndef EXCLUDE_FROM_XARALX
+ BOOL OldClipState = FALSE;
BOOL IsPostScript = pRRegion->IS_KIND_OF(PrintPSRenderRegion);
- BOOL OldClipState = FALSE;
PSPrintDC *pPrintDC = NULL;
// configure the postscript clipping region
@@ -2443,7 +2456,8 @@
// Disable the print clipping for the moment
OldClipState = pPrintDC->SetClipping(FALSE);
}
-
+#endif
+
// check for any user doc marks
DocPrintMark* pDocMark = pComp->GetFirstMark();
if (pDocMark!=NULL)
@@ -2464,6 +2478,8 @@
}
}
+PORTNOTE("printing", "disabled print mark generation use of PrintPSRenderRegion")
+#ifndef EXCLUDE_FROM_XARALX
// finalise any bleed area clipping in PostScript
if (IsPostScript)
{
@@ -2476,6 +2492,7 @@
// ClipToBleed(pRRegion,pSpread);
}
}
+#endif
}
@@ -2509,6 +2526,8 @@
if ( !ShowPrintMarks( (Document *) (pSpread->FindOwnerDoc()) ) )
return;
+PORTNOTE("printing", "disabled print mark generation use of PrintPSRenderRegion")
+#ifndef EXCLUDE_FROM_XARALX
// dont render to a none postscript region
if ( !IS_A(pRRegion, PrintPSRenderRegion) )
return;
@@ -2526,6 +2545,7 @@
// BODGE ALERT
// Mike 02/09/96 - We should be performing stacked clipping. This is not the place
// to alter the postscript clip region but if will suffice for now.
+#endif
}
@@ -2807,19 +2827,19 @@
if (pPrevPage)
{
- sl=(PrevPageRect.hix==CurrPageRect.lox);
- sr=(PrevPageRect.lox==CurrPageRect.hix);
- sb=(PrevPageRect.hiy==CurrPageRect.loy);
- st=(PrevPageRect.loy==CurrPageRect.hiy);
+ sl=(PrevPageRect.hi.x==CurrPageRect.lo.x);
+ sr=(PrevPageRect.lo.x==CurrPageRect.hi.x);
+ sb=(PrevPageRect.hi.y==CurrPageRect.lo.y);
+ st=(PrevPageRect.lo.y==CurrPageRect.hi.y);
}
if (pNextPage)
{
NextPageRect=pNextPage->GetPageRect();
- sl=sl || (NextPageRect.hix==CurrPageRect.lox);
- sr=sr || (NextPageRect.lox==CurrPageRect.hix);
- sb=sb || (NextPageRect.hiy==CurrPageRect.loy);
- st=st || (NextPageRect.loy==CurrPageRect.hiy);
+ sl=sl || (NextPageRect.hi.x==CurrPageRect.lo.x);
+ sr=sr || (NextPageRect.lo.x==CurrPageRect.hi.x);
+ sb=sb || (NextPageRect.hi.y==CurrPageRect.lo.y);
+ st=st || (NextPageRect.lo.y==CurrPageRect.hi.y);
}
@@ -2944,51 +2964,51 @@
INT32 blox,bloy,bhix,bhiy;
// calculate the bleed bbox
- blox = page.lox-bleed;
- bloy = page.loy-bleed;
- bhix = page.hix+bleed;
- bhiy = page.hiy+bleed;
+ blox = page.lo.x-bleed;
+ bloy = page.lo.y-bleed;
+ bhix = page.hi.x+bleed;
+ bhiy = page.hi.y+bleed;
INT32 hi = CROPAREA_SIZE;
INT32 spc = CROPAREA_SIZE/4;
- INT32 slenx = (page.hix-page.lox-4*spc)/10;
- INT32 sleny = (page.hiy-page.loy-4*spc)/10;
+ INT32 slenx = (page.hi.x-page.lo.x-4*spc)/10;
+ INT32 sleny = (page.hi.y-page.lo.y-4*spc)/10;
INT32 wlenx = 8*slenx;
INT32 wleny = 8*sleny;
- INT32 cx=(page.lox+page.hix)>>1;
- INT32 cy=(page.loy+page.hiy)>>1;
+ INT32 cx=(page.lo.x+page.hi.x)>>1;
+ INT32 cy=(page.lo.y+page.hi.y)>>1;
// top left corner
Region[0].Pos = DocRect(blox-hi, bhiy, blox, bhiy+hi);
// 3 along top edge
- Region[1].Pos = DocRect(page.lox+spc, bhiy, page.lox+spc+slenx, bhiy+hi);
+ Region[1].Pos = DocRect(page.lo.x+spc, bhiy, page.lo.x+spc+slenx, bhiy+hi);
Region[2].Pos = DocRect(cx-(wlenx>>1), bhiy, cx+(wlenx>>1), bhiy+hi);
- Region[3].Pos = DocRect(page.hix-spc-slenx, bhiy, page.hix-spc, bhiy+hi);
+ Region[3].Pos = DocRect(page.hi.x-spc-slenx, bhiy, page.hi.x-spc, bhiy+hi);
// top right corner
Region[4].Pos = DocRect(bhix, bhiy, bhix+hi, bhiy+hi);
// 3 down right edge
- Region[5].Pos = DocRect(bhix, page.hiy-spc-sleny, bhix+hi, page.hiy-spc);
+ Region[5].Pos = DocRect(bhix, page.hi.y-spc-sleny, bhix+hi, page.hi.y-spc);
Region[6].Pos = DocRect(bhix, cy-(wleny>>1), bhix+hi, cy+(wleny>>1));
- Region[7].Pos = DocRect(bhix, page.loy+spc, bhix+hi, page.loy+spc+sleny);
+ Region[7].Pos = DocRect(bhix, page.lo.y+spc, bhix+hi, page.lo.y+spc+sleny);
// bottom right corner
Region[8].Pos = DocRect(bhix, bloy-hi, bhix+hi, bloy);
// 3 along bottom edge
- Region[9].Pos = DocRect(page.hix-spc-slenx, bloy-hi, page.hix-spc, bloy);
+ Region[9].Pos = DocRect(page.hi.x-spc-slenx, bloy-hi, page.hi.x-spc, bloy);
Region[10].Pos = DocRect(cx-(wlenx>>1), bloy-hi, cx+(wlenx>>1), bloy);
- Region[11].Pos = DocRect(page.lox+spc, bloy-hi, page.lox+spc+slenx, bloy);
+ Region[11].Pos = DocRect(page.lo.x+spc, bloy-hi, page.lo.x+spc+slenx, bloy);
// bottom left corner
Region[12].Pos = DocRect(blox-hi, bloy-hi, blox, bloy);
// 3 up left edge
- Region[13].Pos = DocRect(blox-hi, page.loy+spc, blox, page.loy+spc+sleny);
+ Region[13].Pos = DocRect(blox-hi, page.lo.y+spc, blox, page.lo.y+spc+sleny);
Region[14].Pos = DocRect(blox-hi, cy-(wleny>>1), blox, cy+(wleny>>1));
- Region[15].Pos = DocRect(blox-hi, page.hiy-spc-sleny, blox, page.hiy-spc);
+ Region[15].Pos = DocRect(blox-hi, page.hi.y-spc-sleny, blox, page.hi.y-spc);
for (INT32 i=0; i<16; i++)
Region[i].Valid=Region[i].OrientX=TRUE;
@@ -3156,8 +3176,8 @@
void MarkFormatRegion::SetPosition(const DocRect &Position)
{
TheBounds = Position;
- MkCx = (TheBounds.lox + TheBounds.hix)>>1;
- MkCy = (TheBounds.loy + TheBounds.hiy)>>1;
+ MkCx = (TheBounds.lo.x + TheBounds.hi.x)>>1;
+ MkCy = (TheBounds.lo.y + TheBounds.hi.y)>>1;
}
@@ -3206,19 +3226,19 @@
{
if (pForm->Top)
{
- DocCoord anchor = DocCoord(TheBounds.lox,TheBounds.hiy);
+ DocCoord anchor = DocCoord(TheBounds.lo.x,TheBounds.hi.y);
ok = MakeMark(pMark, anchor, FALSE, FALSE, TRUE, FALSE, 0, h, rt, &TLeft);
}
if (pForm->Middle)
{
- DocCoord anchor = DocCoord(TheBounds.lox,MkCy);
+ DocCoord anchor = DocCoord(TheBounds.lo.x,MkCy);
ok = MakeMark(pMark, anchor, FALSE, TRUE, TRUE, TRUE, 0, h>>1, rt, &MLeft);
}
if (pForm->Bottom)
{
- DocCoord anchor = DocCoord(TheBounds.lox,TheBounds.loy);
+ DocCoord anchor = DocCoord(TheBounds.lo.x,TheBounds.lo.y);
ok = MakeMark(pMark, anchor, FALSE, FALSE, TRUE, TRUE, 0, 0, rt, &BLeft);
}
}
@@ -3227,7 +3247,7 @@
{
if (pForm->Top)
{
- DocCoord anchor = DocCoord(MkCx,TheBounds.hiy);
+ DocCoord anchor = DocCoord(MkCx,TheBounds.hi.y);
ok = MakeMark(pMark, anchor, TRUE, FALSE, TRUE, FALSE, w>>1, h, rt, &TCentre);
}
@@ -3239,7 +3259,7 @@
if (pForm->Bottom)
{
- DocCoord anchor = DocCoord(MkCx,TheBounds.loy);
+ DocCoord anchor = DocCoord(MkCx,TheBounds.lo.y);
ok = MakeMark(pMark, anchor, TRUE, FALSE, TRUE, TRUE, w>>1, 0, rt, &BCentre);
}
}
@@ -3248,19 +3268,19 @@
{
if (pForm->Top)
{
- DocCoord anchor = DocCoord(TheBounds.hix,TheBounds.hiy);
+ DocCoord anchor = DocCoord(TheBounds.hi.x,TheBounds.hi.y);
ok = MakeMark(pMark, anchor, FALSE, FALSE, FALSE, FALSE, w, h, rt, &TRight);
}
if (pForm->Middle)
{
- DocCoord anchor = DocCoord(TheBounds.hix,MkCy);
+ DocCoord anchor = DocCoord(TheBounds.hi.x,MkCy);
ok = MakeMark(pMark, anchor, FALSE, TRUE, FALSE, TRUE, w, h>>1, rt, &MRight);
}
if (pForm->Bottom)
{
- DocCoord anchor = DocCoord(TheBounds.hix,TheBounds.loy);
+ DocCoord anchor = DocCoord(TheBounds.hi.x,TheBounds.lo.y);
ok = MakeMark(pMark, anchor, FALSE, FALSE, FALSE, TRUE, w, 0, rt, &BRight);
}
}
Index: Trunk/XaraLX/Kernel/Makefile.am
===================================================================
--- Trunk/XaraLX/Kernel/Makefile.am (revision 1319)
+++ Trunk/XaraLX/Kernel/Makefile.am (revision 1320)
@@ -75,7 +75,7 @@
release.cpp ai_eps.cpp ai8_eps.cpp ai5_eps.cpp ai_epsrr.cpp ai_layer.cpp \
ai_bmp.cpp ai_grad.cpp freeeps.cpp swffiltr.cpp swfrndr.cpp swfbitmp.cpp \
swfbuttn.cpp swffont.cpp swfplace.cpp swfrndr.cpp swfshape.cpp swfsprit.cpp \
- swfexpdc.cpp swftext.cpp
+ swfexpdc.cpp swftext.cpp pmaskrgn.cpp printctl.cpp prnmkcom.cpp prnmks.cpp
AM_CXXFLAGS = $(XARAFLAGS)
Index: Trunk/XaraLX/Kernel/princomp.cpp
===================================================================
--- Trunk/XaraLX/Kernel/princomp.cpp (revision 1319)
+++ Trunk/XaraLX/Kernel/princomp.cpp (revision 1320)
@@ -107,12 +107,12 @@
//#include "app.h" - in camtypes.h [AUTOMATICALLY REMOVED]
//#include "camfiltr.h" - in camtypes.h [AUTOMATICALLY REMOVED]
-//#include "colourix.h"
+#include "colourix.h"
//#include "cxfrec.h" - in camtypes.h [AUTOMATICALLY REMOVED]
//#include "cxfrech.h" - in camtypes.h [AUTOMATICALLY REMOVED]
#include "cxftags.h"
//#include "epsfiltr.h" - in camtypes.h [AUTOMATICALLY REMOVED]
-//#include "printctl.h"
+#include "printctl.h"
#include "saveeps.h"
DECLARE_SOURCE("$Revision$");
@@ -151,11 +151,9 @@
// Register it
GetApplication()->RegisterDocComponent(pClass);
-PORTNOTE("print","Removed PrintControl usage")
-#ifndef EXCLUDE_FROM_XARALX
- if (Camelot.DeclareSection("Printing",1))
- Camelot.DeclarePref("Printing", "AppPrintMethod", (INT32*)(&PrintControl::AppPrintMethod)); */
-#endif
+ if (Camelot.DeclareSection(_T("Printing"),1))
+ Camelot.DeclarePref(_T("Printing"), _T("AppPrintMethod"), (INT32*)(&PrintControl::AppPrintMethod));
+
// All ok
return TRUE;
}
@@ -178,8 +176,6 @@
BOOL PrintComponentClass::AddComponent(BaseDocument *pDocument)
{
- PORTNOTETRACE("print","PrintComponentClass::AddComponent - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
// Check to see if this document already has a print component; if so, leave it alone.
if (pDocument->GetDocComponent(CC_RUNTIME_CLASS(PrintComponent)) != NULL)
return TRUE;
@@ -202,7 +198,7 @@
// All ok - add the component to the document.
pDocument->AddDocComponent(pComponent);
-#endif
+
return TRUE;
}
@@ -273,10 +269,7 @@
// Delete our print control object
if (pPrCtrl != NULL)
{
- PORTNOTETRACE("print","PrintComponent::~PrintComponent - pPrCtrl NOT deleted");
-#ifndef EXCLUDE_FROM_XARALX
delete pPrCtrl;
-#endif
pPrCtrl = NULL;
}
}
@@ -467,12 +460,9 @@
BOOL ok = TRUE;
- PORTNOTETRACE("print","PrintComponentClass::OutputValue - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
if (ok) ok = pExportDC->OutputToken(PCTokenStr[Token]);
if (ok) ok = pExportDC->OutputValue(Value);
if (ok) ok = pExportDC->OutputNewLine();
-#endif
return ok;
}
@@ -485,12 +475,9 @@
BOOL ok = TRUE;
- PORTNOTETRACE("print","PrintComponentClass::OutputValue - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
if (ok) ok = pExportDC->OutputToken(PCTokenStr[Token]);
if (ok) ok = pExportDC->OutputReal(Value.MakeDouble());
if (ok) ok = pExportDC->OutputNewLine();
-#endif
return ok;
}
@@ -531,8 +518,6 @@
BOOL ok = TRUE;
- PORTNOTETRACE("print","PrintComponentClass::WriteEPSComments - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
if (ok) ok = OutputValue(PCTOKEN_SECTIONNAME, PC_SECTION_VERSION);
if (ok) ok = OutputValue(PCTOKEN_WHOLESPREAD, pPrCtrl->IsWholeSpread());
@@ -572,7 +557,7 @@
// reset the DC ptr to NULL (ready for next time)
pExportDC = NULL;
-#endif
+
return ok;
}
@@ -610,8 +595,6 @@
ProcessEPSResult Result = EPSCommentUnknown;
- PORTNOTETRACE("print","PrintComponentClass::ProcessEPSComment - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
PCToken Token = GetToken(pComment);
if (Token != PCTOKEN_UNKNOWN)
@@ -657,12 +640,13 @@
case PCTOKEN_DPSPRINTRANGE: pPrCtrl->SetDPSPrintRange(PrintRangeDPS(n)); break;
case PCTOKEN_ALLTEXTASSHAPES: pPrCtrl->SetTextOptions((PrintTextOptions) n); break;
// case PCTOKEN_PRINTMETHOD: pPrCtrl->SetPrintMethod(PrintMethodType(n)); break;
+ default:
+ break;
}
// Let the print control object know we have finished importing (for the moment at least)
pPrCtrl->EndImport();
}
-#endif
return Result;
}
@@ -695,7 +679,7 @@
// WEBSTER - markn 14/2/97
// No print records needed in Webster
#ifndef WEBSTER
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
if (pFilter == NULL)
{
ERROR3("PrintComponent::EndExport filter is null!");
@@ -721,8 +705,8 @@
}
}
-#endif
#endif // WEBSTER
+#endif
return(ok);
}
@@ -748,7 +732,7 @@
{
BOOL ok = TRUE;
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
// --- Write the record
CXaraFileRecord Rec(TAG_PRINTERSETTINGS, TAG_PRINTERSETTINGS_SIZE);
@@ -866,7 +850,7 @@
#undef OutputValueU
#undef OutputValueS
#undef OutputValue16
-#endif // EXCLUDE_FROM_RALPH, EXCLUDE_FROM_XARALX
+#endif // EXCLUDE_FROM_RALPH
return(ok);
}
@@ -893,7 +877,7 @@
{
BOOL ok = TRUE;
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
TypesetInfo *TInfo = GetPrintControl()->GetTypesetInfo();
if (TInfo == NULL)
@@ -920,6 +904,8 @@
case SCRTYPE_MEZZOTINT: Func = 8; break;
case SCRTYPE_SQUARE: Func = 9; break;
case SCRTYPE_DITHER: Func = 10; break;
+ default:
+ break;
}
ok = Rec.WriteUINT16(Func);
}
@@ -968,7 +954,7 @@
ERROR3IF(pPlate == NULL, "Illegal NULL params");
BOOL ok = TRUE;
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
// --- Save any referenced spot colour
IndexedColour *pCol = pPlate->GetSpotColour();
@@ -993,6 +979,8 @@
case COLOURPLATE_YELLOW: Type = 3; break;
case COLOURPLATE_KEY: Type = 4; break;
case COLOURPLATE_SPOT: Type = 5; break;
+ default:
+ break;
}
// Size Total
if (ok) ok = Rec.WriteBYTE(Type); // 1 1
@@ -1033,7 +1021,7 @@
void PrintComponent::ImportPrintSettings(CXaraFileRecord* Rec)
{
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
BOOL ok = TRUE;
PORTNOTETRACE("print","PrintComponent::ImportPrintSettings - do nothing");
@@ -1206,7 +1194,7 @@
void PrintComponent::ImportImagesetting(CXaraFileRecord* Rec)
{
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
PORTNOTETRACE("print","PrintComponent::ImportImagesetting - do nothing");
TypesetInfo *TInfo = GetPrintControl()->GetTypesetInfo();
if (TInfo == NULL)
@@ -1296,7 +1284,7 @@
void PrintComponent::ImportColourPlate(CXaraFileRecord* Rec, CamelotRecordHandler *pHandler)
{
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
BOOL ok = TRUE;
PORTNOTETRACE("print","PrintComponent::ImportColourPlate - do nothing");
Index: Trunk/XaraLX/Kernel/view.cpp
===================================================================
--- Trunk/XaraLX/Kernel/view.cpp (revision 1319)
+++ Trunk/XaraLX/Kernel/view.cpp (revision 1320)
@@ -82,7 +82,7 @@
XARAHEADERSTART and XARAHEADEREND).
-MARKS
+ MARKS
-----
Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
@@ -121,26 +121,27 @@
#include "grndbmp.h"
#include "maskedrr.h"
#include "oilbitmap.h"
-//#include "princomp.h"
+#include "princomp.h"
#include "printctl.h"
//#include "prncamvw.h"
//#include "prdlgctl.h"
#include "cameleps.h"
//#include "tim.h"
-//#include "progress.h"
+#include "progress.h"
//#include "prdlgctl.h"
#include "qualattr.h"
-//#include "pmaskrgn.h"
+#include "pmaskrgn.h"
#include "layer.h"
#include "colcontx.h"
#include "colormgr.h"
//#include "colplate.h"
//#include "ndcchbmp.h"
#include "nodebev.h"
+#include "prncamvw.h"
//#include "app.h" - in camtypes.h [AUTOMATICALLY REMOVED]
-//#include "prnmks.h"
-//#include "prnmkcom.h"
+#include "prnmks.h"
+#include "prnmkcom.h"
#ifdef RALPH
#include "ralphdoc.h"
@@ -225,7 +226,6 @@
if (this == Current)
SetNoCurrent();
-//#pragma message( __LOCMSG__ "Removed ColourContextList usage" )
// Decommission all colour contexts that we own
ColourContextList *cclist = ColourContextList::GetList();
ERROR3IF( cclist == NULL, "No ColourContextList? What's up?" );
@@ -736,8 +736,6 @@
{
if (pDocView->GetShowPrintBorders())
{
- PORTNOTETRACE("other","View::RenderPaper - removed print borders");
-#ifndef EXCLUDE_FROM_XARALX
PrintComponent* pPrComp = (PrintComponent*)pDoc->GetDocComponent(CC_RUNTIME_CLASS(PrintComponent));
if (pPrComp != NULL)
{
@@ -745,7 +743,6 @@
if (pPrCtrl != NULL)
pPrCtrl->RenderPrintBorder(pRRegion);
}
-#endif
}
}
}
@@ -782,7 +779,7 @@
BOOL View::RenderPageMarks(RenderRegion *pCurrRegion, Matrix &ViewTrans, DocRect &ClipRect, Spread *pSpread)
{
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
#ifndef STANDALONE
/*
@@ -844,12 +841,9 @@
if (pMarksMan!=NULL)
{
// find this documents print mark component.
-PORTNOTE("other","Removed PrintMarksComponent usage")
-#ifndef EXCLUDE_FROM_XARALX
PrintMarksComponent* pMarksComp = (PrintMarksComponent*)pDoc->GetDocComponent(CC_RUNTIME_CLASS(PrintMarksComponent));
if (pMarksComp != NULL)
pMarksMan->RenderPrintMarks(pMarksComp, pCurrRegion, ViewTrans, ClipRect, pSpread);
-#endif
}
}
}
@@ -887,7 +881,6 @@
void View::OnDraw( CNativeDC *pDevContext, OilRect OilClipRect )
{
-//#pragma message( __LOCMSG__ "View::OnDraw - do nothing" )
if (CCamApp::IsDisabled())
return; // If the system is disabled, ignore
@@ -1160,9 +1153,6 @@
********************************************************************************************/
Matrix View::ConstructScaledRenderingMatrix(Spread *pSpread, double ScaleFactor)
{
-//#pragma message( __LOCMSG__ "View::ConstructScaledRenderingMatrix - do nothing" )
-// TRACE( _T("Warning - View::ConstructScaledRenderingMatrix called
") );
-// return Matrix();
// Get the PIXELISED origin of spread coordinates, in document coords
DocCoord SpreadCoordOrigin = pSpread->GetSpreadCoordOrigin(TRUE, this);
@@ -1399,9 +1389,6 @@
ColourContext *View::GetColourContext(ColourModel Model, BOOL ReturnNULLIfNone)
{
-//#pragma message( __LOCMSG__ "View::GetColourContext - do nothing" )
-// TRACE( _T("Warning - View::GetColourContext called
") );
-// return NULL;
// If our internal flag is set, we will return a default global colour context
// This allows View::RenderOptimalBitmapPhase to create RenderRegions which will
// not colour spearate or correct (as we want to do the correction as a post process
@@ -1520,8 +1507,6 @@
void View::SetColourPlate(ColourPlate *NewPlate, BOOL bSendContextChanged)
{
- PORTNOTETRACE("other","View::SetColourPlate - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
if (ColPlate != NULL)
{
delete ColPlate;
@@ -1559,7 +1544,6 @@
// the selected view have been changed
if (bSendContextChanged && this == DocView::GetSelected())
ColourManager::SelViewContextHasChanged();
-#endif
}
@@ -1611,8 +1595,6 @@
void View::SetColourContext(ColourModel Model, ColourContext *NewContext)
{
- PORTNOTETRACE("other","View::SetColourContext - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
ColourContextList *cclist = ColourContextList::GetList();
ERROR3IF(cclist == NULL, "No ColourContextList? What's up?");
@@ -1643,7 +1625,6 @@
ShouldDeleteContext[Model] = FALSE;
}
}
-#endif
}
/********************************************************************************************
@@ -1658,7 +1639,7 @@
ProgressDisplay::ProgressDisplay()
{
- PORTNOTETRACE("other","ProgressDisplay::ProgressDisplay - do nothing");
+ PORTNOTETRACE("printing","Disabled CCPrintInfo");
#ifndef EXCLUDE_FROM_XARALX
// WEBSTER-ranbirr-13/11/96
#ifndef WEBSTER
@@ -1668,8 +1649,9 @@
pPrintInfo = NULL;
#endif
#endif //webster
+#endif
DoProgressDisplay = FALSE;
- BOOL IsPrinting = FALSE;
+ IsPrinting = FALSE;
NumNodesRendered = 0;
LastProgressUpdate = 0;
ProgressInterval = 1;
@@ -1679,7 +1661,6 @@
// when exporting only a few nodes that have lots of transparency.
// We use 256 (a power of 2) so that muls and divs are fast.
ProgressScaleFactor = 256;
-#endif
}
@@ -1699,8 +1680,6 @@
void ProgressDisplay::SetUp(RenderRegion *pRender, ScanningRenderRegion *pScanner)
{
- PORTNOTETRACE("other","ProgressDisplay::SetUp - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
#ifndef STANDALONE
// Work out if we need a progress display
IsPrinting = pRender->IsPrinting();
@@ -1730,6 +1709,8 @@
// Work out whether to count just selected objects, or all of them.
BOOL CountAllObjects = TRUE;
+PORTNOTE("printing","Disabled CCPrintInfo")
+#ifndef EXCLUDE_FROM_XARALX
// WEBSTER-ranbirr-13/11/96
#ifndef WEBSTER
if (IsPrinting && pPrintInfo != NULL)
@@ -1739,7 +1720,7 @@
CountAllObjects = (pPrCtrl->GetObjPrintRange() == PRINTRANGEOBJ_ALL);
}
#endif //webster
-
+#endif
if (CountAllObjects)
{
// Count *all* objects
@@ -1802,7 +1783,13 @@
// Check to see if we do not do the first stage, - if not then we do the whole
// thing as a bitmap without bothering with the mask (becuase it's too much for
// most printer drivers to cope with).
- if ((PrintMonitor::PrintMaskType==PrintMonitor::MASK_SIMPLE) &&
+ if (
+PORTNOTE("printing", "Force optimal mask")
+#ifndef EXCLUDE_FROM_XARALX
+ (PrintMonitor::PrintMaskType==PrintMonitor::MASK_SIMPLE) &&
+#else
+ (0) &&
+#endif
(CCDC::GetType(pRender->GetRenderDC(), TRUE) != RENDERTYPE_PRINTER_PS))
{
FirstStageCount = 0;
@@ -1810,6 +1797,8 @@
}
INT32 Range = FirstStageCount + SecondStageCount + ThirdStageCount;
+PORTNOTE("printing","Disabled CCPrintInfo")
+#ifndef EXCLUDE_FROM_XARALX
// WEBSTER-ranbirr-13/11/96
#ifndef WEBSTER
if (IsPrinting)
@@ -1829,6 +1818,7 @@
}
else
#endif //wesbter
+#endif
{
// Start progress display (with no initial delay) for Camelot EPS export
String_64 ExportMsg(_R(IDT_EXPORTMSG_CAMEPS));
@@ -1841,7 +1831,6 @@
// Do nothing as not required on standalone viewer
return;
#endif
-#endif
}
@@ -1863,8 +1852,6 @@
BOOL ProgressDisplay::IncProgress(INT32 NumNodes)
{
- PORTNOTETRACE("other","ProgressDisplay::IncProgress - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
#ifndef STANDALONE
NumNodesRendered++;
@@ -1872,16 +1859,21 @@
if (!DoProgressDisplay)
// No progress display needed.
return TRUE;
+PORTNOTE("printing","Disabled CCPrintInfo")
+#ifndef EXCLUDE_FROM_XARALX
// WEBSTER-ranbirr-13/11/96
#ifndef WEBSTER
if (IsPrinting && (pPrintInfo != NULL) && (pPrintInfo->m_bContinuePrinting == FALSE))
// User has cancelled job
return FALSE;
#endif //webster
+#endif
if ((NumNodesRendered * ProgressScaleFactor) > (LastProgressUpdate + ProgressInterval))
{
// Time to update the progress display.
LastProgressUpdate = NumNodesRendered * ProgressScaleFactor;
+PORTNOTE("printing","Disabled CCPrintInfo")
+#ifndef EXCLUDE_FROM_XARALX
// WEBSTER-ranbirr-13/11/96
#ifndef WEBSTER
if (IsPrinting && pPrintInfo != NULL)
@@ -1895,6 +1887,7 @@
}
else
#endif //webster
+#endif
return ContinueSlowJob(LastProgressUpdate);
}
@@ -1902,9 +1895,6 @@
// All ok
return TRUE;
-#else
- return FALSE;
-#endif
}
@@ -1923,8 +1913,6 @@
BOOL ProgressDisplay::FirstStageDone()
{
- PORTNOTETRACE("other","ProgressDisplay::FirstStageDone - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
#ifndef STANDALONE
NumNodesRendered = FirstStageCount;
@@ -1932,21 +1920,21 @@
if (!DoProgressDisplay)
// No progress display needed.
return TRUE;
+PORTNOTE("printing","Disabled CCPrintInfo")
+#ifndef EXCLUDE_FROM_XARALX
// WEBSTER-ranbirr-13/11/96
#ifndef WEBSTER
if (IsPrinting && pPrintInfo != NULL)
pPrintInfo->SetSliderSubRangePos(NumNodesRendered * ProgressScaleFactor);
else
#endif //webster
+#endif
return ContinueSlowJob(NumNodesRendered * ProgressScaleFactor);
#endif
// All ok
return TRUE;
-#else
- return FALSE;
-#endif
}
@@ -1965,8 +1953,6 @@
BOOL ProgressDisplay::SecondStageDone()
{
- PORTNOTETRACE("other","ProgressDisplay::SecondStageDone - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
#ifndef STANDALONE
NumNodesRendered = FirstStageCount + SecondStageCount;
@@ -1974,6 +1960,8 @@
if (!DoProgressDisplay)
// No progress display needed.
return TRUE;
+PORTNOTE("printing","Disabled CCPrintInfo")
+#ifndef EXCLUDE_FROM_XARALX
// WEBSTER-ranbirr-13/11/96
#ifndef WEBSTER
if (IsPrinting && pPrintInfo != NULL)
@@ -1987,15 +1975,13 @@
}
else
#endif //webster
+#endif
return ContinueSlowJob(NumNodesRendered * ProgressScaleFactor);
#endif
// All ok
return TRUE;
-#else
- return false;
-#endif
}
/********************************************************************************************
@@ -2012,14 +1998,11 @@
void ProgressDisplay::AllStagesDone()
{
- PORTNOTETRACE("other","ProgressDisplay::AllStagesDone - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
#ifndef STANDALONE
// If we are exporting EPS, end the progress indicator as we're all done.
if (DoProgressDisplay && !IsPrinting)
EndSlowJob();
#endif
-#endif
}
@@ -2086,8 +2069,6 @@
BOOL ProgressDisplay::BitmapPhaseBandRenderedTo(INT32 ScanlinesRendered)
{
- PORTNOTETRACE("other","ProgressDisplay::AllStagesDone - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
#ifndef STANDALONE
if (!DoProgressDisplay)
@@ -2100,6 +2081,8 @@
BandOffset = BandSize;
INT32 ProgressPos = (NumNodesRendered * ProgressScaleFactor) + BandOffset;
+PORTNOTE("printing","Disabled CCPrintInfo")
+#ifndef EXCLUDE_FROM_XARALX
// WEBSTER-ranbirr-13/11/96
#ifndef WEBSTER
// Update progress indicators
@@ -2114,15 +2097,13 @@
}
else
#endif //webster
+#endif
return ContinueSlowJob(ProgressPos);
#endif
// All ok
return TRUE;
-#else
- return FALSE;
-#endif
}
@@ -2141,8 +2122,6 @@
BOOL ProgressDisplay::EndBitmapPhaseBand()
{
- PORTNOTETRACE("other","ProgressDisplay::EndBitmapPhaseBand - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
#ifndef STANDALONE
if (!DoProgressDisplay)
@@ -2152,6 +2131,8 @@
NumNodesRendered += (BandSize / ProgressScaleFactor);
if (NumNodesRendered > (FirstStageCount + SecondStageCount))
NumNodesRendered = (FirstStageCount + SecondStageCount);
+PORTNOTE("printing","Disabled CCPrintInfo")
+#ifndef EXCLUDE_FROM_XARALX
// WEBSTER-ranbirr-13/11/96
#ifndef WEBSTER
if (IsPrinting && pPrintInfo != NULL)
@@ -2165,13 +2146,11 @@
}
else
#endif //webster
+#endif
return ContinueSlowJob(NumNodesRendered * ProgressScaleFactor);
#endif
// All ok
return TRUE;
-#else
- return FALSE;
-#endif
}
@@ -2197,7 +2176,6 @@
********************************************************************************************/
-//#pragma message( __LOCMSG__ "Removed View render functions" )
SlowJobResult View::RenderSimpleNodes(Node *pNode, RenderRegion *pRender,
ProgressDisplay& Progress, Node *pLastComplexNode)
{
@@ -2208,7 +2186,7 @@
BOOL RenderAllObjects = TRUE;
// WEBSTER-ranbirr-13/11/96
#ifndef WEBSTER
- PORTNOTETRACE("print","View::RenderSimpleNodes - removed printing code");
+ PORTNOTETRACE("print","Disabled CCPrintInfo");
#ifndef EXCLUDE_FROM_XARALX
if (pRender->IsPrinting())
{
@@ -2421,12 +2399,12 @@
if (!m_bCount && pNode == m_pNextAction)
{
BOOL bIsComplex = m_bNextComplex;
- TRACE( _T("OPRC# BeforeSubtree 0x%08x - %s
"), pNode, pNode->GetRuntimeClass()->GetClassName());
- TRACE( _T("Hit Start of %s span
"), bIsComplex ? "complex" : "simple" );
+ TRACEUSER("noone", _T("OPRC# BeforeSubtree 0x%08x - %s
"), pNode, pNode->GetRuntimeClass()->GetClassName());
+ TRACEUSER("noone", _T("Hit Start of %s span
"), bIsComplex ? "complex" : "simple" );
// If we have been doing a complex span then we need to render it now
if (m_bDoingComplex)
{
- TRACE( _T("Try to render the last complex span NumNodes = %d
"), m_ComplexCount);
+ TRACEUSER("noone", _T("Try to render the last complex span NumNodes = %d
"), m_ComplexCount);
RenderLastComplexSpan(pRegion, pNode);
}
@@ -2434,9 +2412,9 @@
m_pNextAction = m_pScanRR->FindNextFromList();
m_bNextComplex = m_pScanRR->IsThisNodeComplex();
m_NextBoundsRect = m_pScanRR->GetSpanBounds();
- TRACE( _T("NextBounds = (%d, %d) - (%d, %d)
"), m_NextBoundsRect.lo.x, m_NextBoundsRect.lo.y,
+ TRACEUSER("noone", _T("NextBounds = (%d, %d) - (%d, %d)
"), m_NextBoundsRect.lo.x, m_NextBoundsRect.lo.y,
m_NextBoundsRect.hi.x, m_NextBoundsRect.hi.y );
- TRACE( _T("NextAction is %s 0x%08x - %s
"), m_bNextComplex ? _T("complex") : _T("simple"), m_pNextAction,
+ TRACEUSER("noone", _T("NextAction is %s 0x%08x - %s
"), m_bNextComplex ? _T("complex") : _T("simple"), m_pNextAction,
m_pNextAction ? m_pNextAction->GetRuntimeClass()->GetClassName() : _T("") );
m_ComplexCount = 0;
m_pComplexStart = bIsComplex ? pNode : NULL;
@@ -2461,9 +2439,6 @@
protected:
BOOL RenderLastComplexSpan(RenderRegion* pRegion, Node* pNextSpanStart)
{
-// #pragma message( __LOCMSG__ "OptimalPrintRenderCallback::RenderLastComplexSpan - do nothing" )
-// TRACE( _T("Warning - OptimalPrintRenderCallback::RenderLastComplexSpan called
") );
-// return false;
// Call RenderOptimalBitmapPhase to handle this
SlowJobResult BitmapResult;
DocRect ClipRect = pRegion->GetClipRect();
@@ -2633,8 +2608,6 @@
virtual BOOL BeforeSubtree(RenderRegion* pRegion, Node* pNode, Node** ppNextNode, BOOL bClip, SubtreeRenderState* pState)
{
- PORTNOTETRACE("other","OptimalBitmapRenderCallback::BeforeSubtree - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
// if (!m_bCount)
// {
// TRACE( _T("OBRC%s# BeforeSubtree 0x%08x - %s
", m_bRenderMask?"M":"B"), pNode, pNode->GetRuntimeClass()->GetClassName());
@@ -2687,7 +2660,6 @@
TRACE( _T("OBRC# Bad RenderState in BeforeSubtree
"));
break;
}
-#endif
return(FALSE);
}
@@ -2743,13 +2715,14 @@
********************************************************************************************/
-PORTNOTE("other","Removed View render functions")
-#ifndef EXCLUDE_FROM_XARALX
RenderViewResult View::RenderOptimalView(RenderRegion* pRender, Matrix& ViewTrans, Spread* pSpread,
BOOL PrintPaper)
{
// TRACEUSER( "Gerry", _T("View::RenderOptimalView
"));
+PORTNOTE("printing", "Force optimal mask")
+#ifndef EXCLUDE_FROM_XARALX
ERROR3IF(PrintMonitor::PrintMaskType!=PrintMonitor::MASK_OPTIMAL, "PrintMaskType must be OPTIMAL here
");
+#endif
// Find out what the host render region is capable of
RRCaps Caps;
@@ -2768,7 +2741,7 @@
// Attach a device to the scanning render region
// Since this rr does no real rendering, it does not need a Device context
- Scanner.AttachDevice(this, NULL, pSpread);
+ Scanner.AttachDevice(this, (CNativeDC*) NULL, pSpread);
// Get it ready to render
Scanner.SetMatrix(ViewTrans);
@@ -2782,6 +2755,8 @@
// Work out whether we need to render all objects, or just the selected ones.
BOOL RenderAllObjects = TRUE;
+PORTNOTE("printing", "Disabled printing")
+#ifndef EXCLUDE_FROM_XARALX
CCPrintInfo *pPrintInfo = NULL;
if (Printing)
{
@@ -2798,6 +2773,7 @@
// We going to analyse the document
if (pPrintInfo != NULL)
pPrintInfo->SetAnalysing();
+#endif
ScannerRenderCallback ScanCallback(this, RenderAllObjects, &Scanner);
@@ -2813,9 +2789,12 @@
// Scanner.DumpNodeRuns();
#endif
+PORTNOTE("printing", "Disabled printing")
+#ifndef EXCLUDE_FROM_XARALX
// We going to print the document now
if (pPrintInfo != NULL)
pPrintInfo->SetPrinting();
+#endif
// Set up the matrix and clipping rect
pRender->SetMatrix(ViewTrans);
@@ -2896,7 +2875,6 @@
return Result;
}
-#endif
/********************************************************************************************
@@ -2943,8 +2921,6 @@
BOOL bPrintPaper, INT32& NodesSoFar, ProgressDisplay* pProgress,
INT32 TotalProgress)
{
- PORTNOTETRACE("other","View::RenderOptimalBitmapPhase - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
TRACEUSER( "Gerry", _T("View::RenderOptimalBitmapPhase TotalProgress = %d
"), TotalProgress);
INT32 EndProgress = NodesSoFar + TotalProgress;
@@ -2991,15 +2967,15 @@
{
TRACE( _T("Very small rectangle
"));
}
- TempPixels = (INT32)(((double)BitmapClipRect.lox) / dPixelWidth);
- BitmapClipRect.lox = (INT32)(((double)TempPixels) * dPixelWidth);
+ TempPixels = (INT32)(((double)BitmapClipRect.lo.x) / dPixelWidth);
+ BitmapClipRect.lo.x = (INT32)(((double)TempPixels) * dPixelWidth);
if (BitmapClipRect.Width() < dPixelWidth)
- BitmapClipRect.hix = BitmapClipRect.lox + dPixelWidth;
+ BitmapClipRect.hi.x = (INT32)(BitmapClipRect.lo.x + dPixelWidth);
- TempPixels = (INT32)(((double)BitmapClipRect.loy) / dPixelWidth);
- BitmapClipRect.loy = (INT32)(((double)TempPixels) * dPixelWidth);
+ TempPixels = (INT32)(((double)BitmapClipRect.lo.y) / dPixelWidth);
+ BitmapClipRect.lo.y = (INT32)(((double)TempPixels) * dPixelWidth);
if (BitmapClipRect.Height() < dPixelWidth)
- BitmapClipRect.hiy = BitmapClipRect.loy + dPixelWidth;
+ BitmapClipRect.hi.y = INT32(BitmapClipRect.lo.y + dPixelWidth);
// Markn 26/10/95
// Find out if this render region is printing or not.
@@ -3055,7 +3031,7 @@
}
// Count the nodes in this complex run
- BOOL StartCounting = FALSE;
+// BOOL StartCounting = FALSE;
INT32 TotalBands = MaskedBitmap.GetNumBands();
// Count the nodes to be rendered so we can calculate the increment to use
@@ -3125,7 +3101,8 @@
MaskedBitmap.SetMaskDrawingMode(FALSE);
MaskedBitmap.SaveContext();
- MaskedBitmap.SetFillColour(DocColour(255,255,255));
+ DocColour white(255,255,255);
+ MaskedBitmap.SetFillColour(white);
MaskedBitmap.DrawRect(&DrawRect);
MaskedBitmap.RestoreContext();
@@ -3182,7 +3159,8 @@
else
{
BitmapRR.SaveContext();
- BitmapRR.SetFillColour(DocColour(255,255,255));
+ DocColour white(255,255,255);
+ BitmapRR.SetFillColour(white);
BitmapRR.DrawRect(&DrawRect);
BitmapRR.RestoreContext();
}
@@ -3286,9 +3264,9 @@
// Get the next bands ready
BOOL MoreMaskedBands = MaskedBitmap.GetNextBand();
-TRACEUSER( "Phil", _T("GetNextBand (Before) %d, %d
"), BitmapRR.GetClipRect().loy, BitmapRR.GetClipRect().hiy);
+TRACEUSER( "Phil", _T("GetNextBand (Before) %d, %d
"), BitmapRR.GetClipRect().lo.y, BitmapRR.GetClipRect().hi.y);
MoreBands = BitmapRR.GetNextBand();
-TRACEUSER( "Phil", _T("GetNextBand (After) %d, %d
"), BitmapRR.GetClipRect().loy, BitmapRR.GetClipRect().hiy);
+TRACEUSER( "Phil", _T("GetNextBand (After) %d, %d
"), BitmapRR.GetClipRect().lo.y, BitmapRR.GetClipRect().hi.y);
ERROR3IF(MoreMaskedBands!=MoreBands, "Bands don't match");
if (MoreMaskedBands!=MoreBands)
MoreBands = FALSE;
@@ -3311,7 +3289,6 @@
pProgress->SetNodesRendered(NodesSoFar);
TRACEUSER( "Gerry", _T("End of View::RenderOptimalBitmapPhase
"));
-#endif
return SLOWJOB_SUCCESS;
}
@@ -3345,7 +3322,6 @@
virtual BOOL BeforeSubtree(RenderRegion* pRegion, Node* pNode, Node** ppNextNode, BOOL bClip, SubtreeRenderState* pState)
{
-// #pragma message( __LOCMSG__ "SimplePrintRenderCallback::BeforeSubtree - do nothing" )
// TRACE( _T("Warning - SimplePrintRenderCallback::BeforeSubtree called
") );
// TRACE( _T("SPRC# BeforeSubtree 0x%08x - %s
"), pNode, pNode->GetRuntimeClass()->GetClassName());
@@ -3521,7 +3497,6 @@
render all remaining shapes (may be all the shapes, if there were no complex ones)
*/
-//#pragma message( __LOCMSG__ "Removed View render functions" )
RenderViewResult View::RenderSimpleView(RenderRegion* pRender, Matrix& ViewTrans, Spread* pSpread,
BOOL PrintPaper)
{
@@ -3531,11 +3506,15 @@
BOOL bIsOnScreen = pRender->IS_KIND_OF(GRenderRegion);
// if the preference says we should not be in this function then call the other function
- PORTNOTETRACE("print","View::RenderSimpleView - removed printing code");
+ if (!bIsOnScreen &&
+PORTNOTE("printing", "Force optimal mask")
#ifndef EXCLUDE_FROM_XARALX
- if (!bIsOnScreen && PrintMonitor::PrintMaskType==PrintMonitor::MASK_OPTIMAL)
- return RenderOptimalView(pRender, ViewTrans, pSpread, PrintPaper);
+ PrintMonitor::PrintMaskType==PrintMonitor::MASK_OPTIMAL
+#else
+ (1)
#endif
+ )
+ return RenderOptimalView(pRender, ViewTrans, pSpread, PrintPaper);
// Find out what the host render region is capable of
RRCaps Caps;
@@ -3794,25 +3773,29 @@
This means we don't render too much in each band, and we stop rendering when we should.
*/
-//#pragma message( __LOCMSG__ "Removed View render functions" )
SlowJobResult View::RenderBitmapPhase(DocRect& ComplexClipRect, Matrix& ViewTrans, Spread* pSpread,
RenderRegion* pHostRegion, Node* pFirstComplex, Node* pLastComplex,
BOOL bRenderAll, BOOL bPrintPaper, ProgressDisplay& Progress)
{
- PORTNOTETRACE("other","View::RenderBitmapPhase - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
#ifndef STANDALONE
// TRACEUSER( "Gerry", _T("View::RenderBitmapPhase
"));
BOOL bIsOnScreen = pHostRegion->IS_KIND_OF(GRenderRegion);
- ERROR3IF(!bIsOnScreen && PrintMonitor::PrintMaskType==PrintMonitor::MASK_OPTIMAL, "PrintMaskType must be SIMPLE or MASKED here
");
+ ERROR3IF(!bIsOnScreen &&
+PORTNOTE("printing", "Force optimal mask")
+#ifndef EXCLUDE_FROM_XARALX
+ PrintMonitor::PrintMaskType==PrintMonitor::MASK_OPTIMAL,
+#else
+ 1,
+#endif
+ "PrintMaskType must be SIMPLE or MASKED here
");
// This needs to be done in 2 phases - one to create the bitmap we will blit into the
// host render region and one to create the mask to show us which parts of the bitmap
// need to be blitted. First we will create the bitmap to blit into the host.
// create the bitmap render region
- CDC* pDC = pHostRegion->GetRenderDC();
+ // CDC* pDC = pHostRegion->GetRenderDC();
double Dpi;
if (bIsOnScreen)
@@ -3865,7 +3848,12 @@
BOOL DoMaskedBlit = FALSE;
if (//IsWin32NT() ||
bIsOnScreen ||
+PORTNOTE("printing", "Force optimal mask")
+#ifndef EXCLUDE_FROM_XARALX
(PrintMonitor::PrintMaskType==PrintMonitor::MASK_MASKED) ||
+#else
+ (0) ||
+#endif
(CCDC::GetType(pHostRegion->GetRenderDC(), TRUE) == RENDERTYPE_PRINTER_PS) ||
IS_A(pHostRegion, CamelotEPSRenderRegion))
{
@@ -3972,7 +3960,8 @@
{
// Draw it into the real bitmap
BitmapRR.SaveContext();
- BitmapRR.SetFillColour(DocColour(255,255,255));
+ DocColour white(255,255,255);
+ BitmapRR.SetFillColour(white);
BitmapRR.DrawRect(&DrawRect);
BitmapRR.RestoreContext();
}
@@ -4020,7 +4009,8 @@
// Fill the mask in "simple"
MaskedBitmap.SaveContext();
- MaskedBitmap.SetFillColour(DocColour(255,255,255));
+ DocColour white(255,255,255);
+ MaskedBitmap.SetFillColour(white);
MaskedBitmap.DrawRect(&DrawRect);
MaskedBitmap.RestoreContext();
@@ -4144,7 +4134,6 @@
// TRACEUSER( "Gerry", _T("End of View::RenderBitmapPhase
"));
// all worked
-#endif
return SLOWJOB_SUCCESS;
}
@@ -4171,8 +4160,6 @@
********************************************************************************************/
-PORTNOTE("other","Removed View render functions")
-#ifndef EXCLUDE_FROM_XARALX
SlowJobResult View::RenderSimpleNodesUnclipped(Node *pNode, RenderRegion *pRender,
ProgressDisplay& Progress, Node *pLastComplexNode)
{
@@ -4181,6 +4168,8 @@
BOOL RenderAllObjects = TRUE;
// WEBSTER-ranbirr-13/11/96
#ifndef WEBSTER
+PORTNOTE("printing", "Disabled printing")
+#ifndef EXCLUDE_FROM_XARALX
if (pRender->IsPrinting())
{
CCPrintInfo *pPrintInfo = CCPrintInfo::GetCurrent();
@@ -4191,6 +4180,7 @@
RenderAllObjects = (pPrCtrl->GetObjPrintRange() == PRINTRANGEOBJ_ALL);
}
}
+#endif
#endif //webster
// Render nodes into specified render region
while ((pNode!=NULL) && (pNode != pLastComplexNode))
@@ -4215,7 +4205,6 @@
return SLOWJOB_FAILURE;
#endif
}
-#endif
/********************************************************************************************
@@ -4234,8 +4223,6 @@
PrintControl *View::GetPrintControl()
{
- PORTNOTE("other","View::GetPrintControl - do nothing")
-#ifndef EXCLUDE_FROM_XARALX
#ifndef STANDALONE
if (pDoc == NULL)
@@ -4258,9 +4245,6 @@
#else
return NULL;
#endif
-#endif
-
- return NULL;
}
@@ -4281,8 +4265,6 @@
void ProgressDisplay::SetUpOptimal(RenderRegion *pRender, ScanningRenderRegion* pScanner)
{
- PORTNOTETRACE("other","ProgressDisplay::SetUpOptimal - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
#ifndef STANDALONE
// Work out if we need a progress display
IsPrinting = pRender->IsPrinting();
@@ -4299,6 +4281,8 @@
// Work out whether to count just selected objects, or all of them.
BOOL CountAllObjects = TRUE;
+PORTNOTE("printing","Disabled CCPrintInfo")
+#ifndef EXCLUDE_FROM_XARALX
// WEBSTER-ranbirr-13/11/96
#ifndef WEBSTER
if ((IsPrinting) && (pPrintInfo!=NULL))
@@ -4307,12 +4291,15 @@
CountAllObjects = (pPrCtrl->GetObjPrintRange() == PRINTRANGEOBJ_ALL);
}
#endif //webster
+#endif
OptimalPrintRenderCallback MyCallback(pRender->GetRenderView(), pSpread, CountAllObjects, pScanner, FALSE, &TotalNodes, NULL, TRUE);
pRender->RenderTree(pSpread, FALSE, FALSE, &MyCallback);
TRACE( _T("TotalNodes = %d
"), TotalNodes);
+PORTNOTE("printing","Disabled CCPrintInfo")
+#ifndef EXCLUDE_FROM_XARALX
// WEBSTER-ranbirr-13/11/96
#ifndef WEBSTER
// Set up the slider according to the printing flag
@@ -4335,6 +4322,7 @@
}
else
#endif //webster
+#endif
{
// Start progress display (with no initial delay) for Camelot EPS export
String_64 ExportMsg(_R(IDT_EXPORTMSG_CAMEPS));
@@ -4345,7 +4333,6 @@
ProgressInterval = (TotalNodes * ProgressScaleFactor) / 100;
TRACE( _T("ProgressInterval = %d
"), ProgressInterval);
#endif
-#endif
}
@@ -4365,8 +4352,6 @@
BOOL ProgressDisplay::SetNodesRendered(INT32 NumNodes)
{
- PORTNOTETRACE("other","ProgressDisplay::SetUpOptimal - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
#ifndef STANDALONE
// If we have advanced a node, then update
if (NumNodes>NumNodesRendered)
@@ -4378,18 +4363,23 @@
if (!DoProgressDisplay)
// No progress display needed.
return TRUE;
+PORTNOTE("printing","Disabled CCPrintInfo")
+#ifndef EXCLUDE_FROM_XARALX
// WEBSTER-ranbirr-13/11/96
#ifndef WEBSTER
if (IsPrinting && (pPrintInfo != NULL) && (pPrintInfo->m_bContinuePrinting == FALSE))
// User has cancelled job
return FALSE;
#endif //webster
+#endif
if ((NumNodesRendered * ProgressScaleFactor) > (LastProgressUpdate + ProgressInterval))
{
// Time to update the progress display.
LastProgressUpdate = NumNodesRendered * ProgressScaleFactor;
// WEBSTER-ranbirr-13/11/96
- #ifndef WEBSTER
+PORTNOTE("printing","Disabled CCPrintInfo")
+#ifndef EXCLUDE_FROM_XARALX
+#ifndef WEBSTER
if (IsPrinting && pPrintInfo != NULL)
{
// Update slider
@@ -4400,7 +4390,8 @@
return FALSE;
}
else
- #endif //webster
+#endif //webster
+#endif
return ContinueSlowJob(LastProgressUpdate);
}
@@ -4408,7 +4399,5 @@
// All ok
return TRUE;
-#endif
- return false;
}
Index: Trunk/XaraLX/Kernel/printctl.cpp
===================================================================
--- Trunk/XaraLX/Kernel/printctl.cpp (revision 1319)
+++ Trunk/XaraLX/Kernel/printctl.cpp (revision 1320)
@@ -114,7 +114,7 @@
//#include "justin2.h"
//#include "markn.h"
#include "osrndrgn.h"
-#include "prdlgctl.h"
+//#include "prdlgctl.h"
#include "princomp.h"
#include "printctl.h"
#include "prntview.h"
@@ -290,17 +290,17 @@
default: ERROR3_PF(("Unknown fit type (%d)",FitType)); break;
}
- char* format = "%.2lf%%";
+ TCHAR* format = _T("%.2lf%%");
double fScale = Scale.MakeDouble();
INT32 n = INT32((fScale*100)+0.5);
if (n % 100 == 0)
- format = "%.0lf%%";
+ format = _T("%.0lf%%");
else if (n % 10 == 0)
- format = "%.1lf%%";
+ format = _T("%.1lf%%");
- char s[100];
- _stprintf(s,format,fScale);
+ TCHAR s[100];
+ camSprintf(s,format,fScale);
Str += s;
switch (Orient)
@@ -347,11 +347,11 @@
if (PatchInfo.Rotate)
{ INT32 t = w; w = h; h = t; }
- Rect.lox = PatchInfo.XTrans;
- Rect.loy = PatchInfo.YTrans;
+ Rect.lo.x = PatchInfo.XTrans;
+ Rect.lo.y = PatchInfo.YTrans;
- Rect.hix = Rect.lox + (INT32((double(w) * ScaleFactor)+0.5));
- Rect.hiy = Rect.loy + (INT32((double(h) * ScaleFactor)+0.5));
+ Rect.hi.x = Rect.lo.x + (INT32((double(w) * ScaleFactor)+0.5));
+ Rect.hi.y = Rect.lo.y + (INT32((double(h) * ScaleFactor)+0.5));
if (PrintableArea.ContainsRect(Rect))
NumPages++;
@@ -382,7 +382,7 @@
if (NumPages >= 1)
{
- wsprintf(s, TEXT("%ld") ,NumPages);
+ camSprintf(s, TEXT("%ld") ,NumPages);
Str += s;
if (NumPages == 1)
@@ -439,6 +439,8 @@
Str += TempStr;
// WEBSTER-ranbirr-13/11/96
#ifndef WEBSTER
+PORTNOTE("printing", "Disabled Use of CCPrintDialog")
+#ifndef EXCLUDE_FROM_XARALX
INT32 PrScale;
if (CCPrintDialog::GetScale(&PrScale))
{
@@ -448,10 +450,11 @@
TCHAR s[100];
String_32 jcf(_R(IDS_PERCENT_FORMAT));
- wsprintf(s, jcf, (INT32) PrScale);
+ camSprintf(s, jcf, (INT32) PrScale);
Str += s;
}
}
+#endif
#endif //webster
pDimScale->SetActiveState(ActiveState);
}
@@ -618,9 +621,11 @@
BOOL PrintControl::CalcPrintAreaVars(BOOL RedrawPrintBorders)
{
+PORTNOTE("printing", "Disabled Use of CCPrintDialog")
+#ifndef EXCLUDE_FROM_XARALX
// Calc the print area origin
- Origin.x = TotalPrintArea.lox;
- Origin.y = TotalPrintArea.hiy;
+ Origin.x = TotalPrintArea.lo.x;
+ Origin.y = TotalPrintArea.hi.y;
//-------------------------
// Find out the dimensions of the printer's paper (in MILLIPOINTS)
@@ -645,8 +650,8 @@
#endif //webster
//-------------------------
// Calc the width and height of the print area
- PageWidth = TotalPrintArea.hix - TotalPrintArea.lox;
- PageHeight = TotalPrintArea.hiy - TotalPrintArea.loy;
+ PageWidth = TotalPrintArea.hi.x - TotalPrintArea.lo.x;
+ PageHeight = TotalPrintArea.hi.y - TotalPrintArea.lo.y;
// If double page spread AND printing single pages, half the width for each page printed
if (DPS && !WholeSpread)
@@ -660,6 +665,7 @@
if (Orient == PRINTORIENTATION_SIDEWAYS)
Swap(PageWidth,PageHeight);
+#endif
return TRUE;
}
@@ -1582,9 +1588,12 @@
// Set up the local variable to the max auto dpi!
INT32 PrinterDPI = MAXAUTOBITMAPDPI;
+PORTNOTE("printing", "Disabled Use of CCPrintDialog")
+#ifndef EXCLUDE_FROM_XARALX
// Get the printer resolution (if this fails, choose the maximum setting)
if (!CCPrintDialog::GetResolution(&PrinterDPI))
PrinterDPI = MAXAUTOBITMAPDPI; // Failing could change the variable so reset it!
+#endif
// Make the DPI half the printer res
DotsPerInch = PrinterDPI >> 1;
@@ -1753,12 +1762,15 @@
BOOL PrintControl::CalcNumPaper()
{
BOOL CanMultiCopy;
+PORTNOTE("printing", "Disabled Use of CCPrintDialog")
+#ifndef EXCLUDE_FROM_XARALX
// WEBSTER-ranbirr-13/11/96
#ifndef WEBSTER
// Can the printer do multiple copies?
if (!CCPrintDialog::CanMultiCopy(&CanMultiCopy))
return FALSE;
#endif //webster
+#endif
INT32 NumActualPiecesOfPaper = NumPrintablePages * NumCopies; // Num pieces of paper that will come out of printer
// NumPaper will be the number of pieces of paper we will print to
@@ -1983,8 +1995,8 @@
m = (PaperNumber-1) / (MaxPaperNumber / NumPrintablePages);
}
- PatchClipRect.lox += (OrigPageWidth*m);
- PatchClipRect.hix = PatchClipRect.lox + OrigPageWidth;
+ PatchClipRect.lo.x += (OrigPageWidth*m);
+ PatchClipRect.hi.x = PatchClipRect.lo.x + OrigPageWidth;
}
else
{
@@ -1993,13 +2005,13 @@
// Here we have a DPS, we are printing individual pages, but we are either
// printing left-only or right-only pages
//
- // So if right only, add the page width to the lox coord to move the area to the right hand side.
- // In either case, the patch clip rect hix will be lox+OrigPageWidth.
+ // So if right only, add the page width to the lo.x coord to move the area to the right hand side.
+ // In either case, the patch clip rect hi.x will be lo.x+OrigPageWidth.
if (DPSPrintRange == PRINTRANGEDPS_RIGHTPAGES)
- PatchClipRect.lox += OrigPageWidth;
+ PatchClipRect.lo.x += OrigPageWidth;
- PatchClipRect.hix = PatchClipRect.lox + OrigPageWidth;
+ PatchClipRect.hi.x = PatchClipRect.lo.x + OrigPageWidth;
}
}
@@ -2202,14 +2214,16 @@
// If there's no view, drawing will be rather tricky
if (pPrintView == NULL)
{
- ERROR3("Sanity check, The view is NULL during StartPlatePrinting!")
+ ERROR3("Sanity check, The view is NULL during StartPlatePrinting!");
return FALSE;
}
// Get hold of the resident colour management system
ColourContext *pContext;
+
+PORTNOTE("cms", "Disabled XaraCMS");
+#ifndef EXCLUDE_FROM_XARALX
XaraCMS* ptheCMS=GetApplication()->GetCMSManager();
-
if (ptheCMS!=NULL)
{
// First try to set the printer context specified in the ini file read
@@ -2269,6 +2283,7 @@
}
}
else
+#endif
{
// Create a logical colour context. This isn't strictly necessary, as the view will default to
// using the global default (logical) context anyway, but we might as well be safe
@@ -2318,7 +2333,7 @@
// If there's no view, drawing will be rather tricky
if (pPrintView == NULL)
{
- ERROR3("Sanity check, The view is NULL during StartPlatePrinting!")
+ ERROR3("Sanity check, The view is NULL during StartPlatePrinting!");
return;
}
@@ -2525,9 +2540,9 @@
// PagePrintArea defines the portion of the spread that is printable (this
// is either the whole spread, or a single page when printing DPS & individual pages)
DocRect PagePrintArea = TotalPrintArea;
- PagePrintArea.lox += OrigPageWidth*PageNum;
- PagePrintArea.hix = PagePrintArea.lox + OrigPageWidth;
- PagePrintArea.hiy = PagePrintArea.loy + OrigPageHeight;
+ PagePrintArea.lo.x += OrigPageWidth*PageNum;
+ PagePrintArea.hi.x = PagePrintArea.lo.x + OrigPageWidth;
+ PagePrintArea.hi.y = PagePrintArea.lo.y + OrigPageHeight;
// PrbleArea will define the printable area in relation to the current spread
DocRect PrbleArea = PagePrintArea;
@@ -2538,27 +2553,27 @@
// If printing sideways, the width and height of the printable area should be swapped
if (Orient == PRINTORIENTATION_SIDEWAYS)
{
- PrbleArea.hix = PrbleArea.lox+ScaledPAHeight;
- PrbleArea.hiy = PrbleArea.loy+ScaledPAWidth;
+ PrbleArea.hi.x = PrbleArea.lo.x+ScaledPAHeight;
+ PrbleArea.hi.y = PrbleArea.lo.y+ScaledPAWidth;
PrbleArea.Translate(ScaledPATopMargin,ScaledPALeftMargin);
PrbleArea.Translate(-ScaledTopMargin,-ScaledLeftMargin);
PaperArea = PrbleArea;
PaperArea.Translate(-ScaledPATopMargin,-ScaledPALeftMargin);
- PaperArea.hix = PaperArea.lox + ScaledPaperHeight;
- PaperArea.hiy = PaperArea.loy + ScaledPaperWidth;
+ PaperArea.hi.x = PaperArea.lo.x + ScaledPaperHeight;
+ PaperArea.hi.y = PaperArea.lo.y + ScaledPaperWidth;
}
else
{
- PrbleArea.hix = PrbleArea.lox+ScaledPAWidth;
- PrbleArea.loy = PrbleArea.hiy-ScaledPAHeight;
+ PrbleArea.hi.x = PrbleArea.lo.x+ScaledPAWidth;
+ PrbleArea.lo.y = PrbleArea.hi.y-ScaledPAHeight;
PrbleArea.Translate(ScaledPALeftMargin,-ScaledPATopMargin);
PrbleArea.Translate(-ScaledLeftMargin,ScaledTopMargin);
PaperArea = PrbleArea;
PaperArea.Translate(-ScaledPALeftMargin,ScaledPATopMargin);
- PaperArea.hix = PaperArea.lox + ScaledPaperWidth;
- PaperArea.loy = PaperArea.hiy - ScaledPaperHeight;
+ PaperArea.hi.x = PaperArea.lo.x + ScaledPaperWidth;
+ PaperArea.lo.y = PaperArea.hi.y - ScaledPaperHeight;
}
// We need to draw four grey slabs that show the areas on the page that will
@@ -2568,19 +2583,19 @@
pRRegion->SetFillColour(COLOUR_MIDGREY);
DocRect Slab = PagePrintArea;
- Slab.hix = PrbleArea.lox;
+ Slab.hi.x = PrbleArea.lo.x;
RenderRect(pRRegion,Slab,TRUE);
Slab = PagePrintArea;
- Slab.lox = PrbleArea.hix;
+ Slab.lo.x = PrbleArea.hi.x;
RenderRect(pRRegion,Slab,TRUE);
Slab = PagePrintArea;
- Slab.hiy = PrbleArea.loy;
+ Slab.hi.y = PrbleArea.lo.y;
RenderRect(pRRegion,Slab,TRUE);
Slab = PagePrintArea;
- Slab.loy = PrbleArea.hiy;
+ Slab.lo.y = PrbleArea.hi.y;
RenderRect(pRRegion,Slab,TRUE);
pRRegion->SetFillColour(COLOUR_BLACK);
@@ -3525,7 +3540,7 @@
void TypesetInfo::DestroyPlateList()
{
ColourPlate *pPlate;
- while (pPlate=(ColourPlate*)PrintingPlates.RemoveTail())
+ while ((pPlate=(ColourPlate*)PrintingPlates.RemoveTail())) // Assignment
delete pPlate;
// We have no plates, so it's best to vape our current pointers
Index: Trunk/XaraLX/wxOil/compatdef.h
===================================================================
--- Trunk/XaraLX/wxOil/compatdef.h (revision 1319)
+++ Trunk/XaraLX/wxOil/compatdef.h (revision 1320)
@@ -695,6 +695,10 @@
inline double camAtof(TCHAR * s) { double r=0.0; camScanf(s, "%f", &r); return r;}
inline INT32 camAtol(TCHAR * s) { INT32 r=0; camScanf(s, "%d", &r); return r;}
+#ifndef _MAX_PATH
+#define _MAX_PATH _POSIX_PATH_MAX
+#endif
+
// The following line makes normalize.pl stop skipping this file
// Leave it at the end
/* SKIPFIXTYPES: END */
Index: Trunk/XaraLX/wxOil/Makefile.am
===================================================================
--- Trunk/XaraLX/wxOil/Makefile.am (revision 1319)
+++ Trunk/XaraLX/wxOil/Makefile.am (revision 1320)
@@ -35,7 +35,8 @@
outptdib.cpp outptpng.cpp outptgif.cpp gpalopt.cpp bmpfiltr.cpp giffiltr.cpp \
fontbase.cpp ftfonts.cpp textfuns.cpp dragbmp.cpp xpoilflt.cpp xmlutils.cpp \
camprocess.cpp dropdown.cpp coldrop.cpp fontdrop.cpp bfxalu.cpp bfxpixop.cpp \
- binreloc.c exceptio.cpp colpick.cpp dragpick.cpp sgldrag.cpp \
+ binreloc.c exceptio.cpp colpick.cpp dragpick.cpp sgldrag.cpp cctime.cpp \
+ lddirect.cpp \
resources.cpp
# Keep resources.cpp on a separate line as it is odd
Index: Trunk/XaraLX/wxOil/prdlgctl.h
===================================================================
--- Trunk/XaraLX/wxOil/prdlgctl.h (revision 1319)
+++ Trunk/XaraLX/wxOil/prdlgctl.h (revision 1320)
@@ -100,7 +100,7 @@
#ifndef INC_PRDLGCTL
#define INC_PRDLGCTL
-#include <afxdlgs.h> // Contains the def of CPrintDialog
+//#include <afxdlgs.h> // Contains the def of CPrintDialog
#include "printctl.h" // Defines PrintControl
#include "printprg.h" // The print progress dialogue
Index: Trunk/XaraLX/wxOil/lddirect.cpp
===================================================================
--- Trunk/XaraLX/wxOil/lddirect.cpp (revision 1319)
+++ Trunk/XaraLX/wxOil/lddirect.cpp (revision 1320)
@@ -141,7 +141,7 @@
BOOL LoadDirect::Execute(const TCHAR* lpszFilename)
{
// find our main application object
- CCamApp *pApp = (CCamApp*)AfxGetApp();
+ CCamApp *pApp = (CCamApp*)&AfxGetApp();
if (!pApp)
return FALSE;
@@ -179,8 +179,11 @@
BOOL LoadDirect::ExecuteHelper(CCamApp* pApp, const TCHAR* lpszFilename)
{
- BOOL ok;
+ BOOL ok=TRUE;
+ PORTNOTETRACE("other", "Disabled LoadDirect::ExecuteHelper");
+#ifndef EXCLUDE_FROM_XARALX
+
// now call the supporting open document function
CDocument* pLoadDirectDoc = pApp->OpenHiddenDocument(lpszFilename);
if (pLoadDirectDoc==NULL)
@@ -197,6 +200,7 @@
// finally toast the loaded document.
pCamDoc->SetModified(FALSE);
pCamDoc->OnCloseDocument();
+#endif
return ok;
}
Index: Trunk/XaraLX/wxOil/cctime.cpp
===================================================================
--- Trunk/XaraLX/wxOil/cctime.cpp (revision 1319)
+++ Trunk/XaraLX/wxOil/cctime.cpp (revision 1320)
@@ -460,7 +460,7 @@
// Set time zone from TZ environment variable. If TZ is not set,
// operating system default is used, otherwise PST8PDT is used
// (Pacific standard time, daylight savings).
- _tzset();
+// _tzset();
time( &long_time ); // Get time as long integer.
newtime = localtime( &long_time ); // Convert to local time.
@@ -531,11 +531,15 @@
{
time_t osBinaryTime;
time(&osBinaryTime);
- CTime t(osBinaryTime);
+ struct tm *p_tm;
cctime *p_time = GetTimeStruct();
- struct tm *p_tm;
+#ifdef __WXMSW__
+ CTime t(osBinaryTime);
p_tm = t.GetGmtTm(NULL);
+#else
+ p_tm=gmtime( &osBinaryTime ); // Convert to local time.
+#endif
p_time->tm_sec = p_tm->tm_sec;
p_time->tm_min = p_tm->tm_min;
Index: Trunk/XaraLX/wxOil/prncamvw.h
===================================================================
--- Trunk/XaraLX/wxOil/prncamvw.h (revision 1319)
+++ Trunk/XaraLX/wxOil/prncamvw.h (revision 1320)
@@ -119,7 +119,7 @@
class PrintMonitor : public SimpleCCObject
{
public:
- static BOOL StartPrintJob(HDC);
+ static BOOL StartPrintJob(CNativeDC *);
static void EndPrintJob();
static BOOL IsPrintStatusOK();
static BOOL InitPrefs();
@@ -142,7 +142,7 @@
static BOOL FullRedrawNeeded;
protected:
- static HDC CurrentPrintJob;
+ static CNativeDC * CurrentPrintJob;
static INT32 MySeriousErrorCount;
static BOOL PrintingIsActive;
};
Index: Trunk/XaraLX/wxOil/prncamvw.cpp
===================================================================
--- Trunk/XaraLX/wxOil/prncamvw.cpp (revision 1319)
+++ Trunk/XaraLX/wxOil/prncamvw.cpp (revision 1320)
@@ -106,13 +106,12 @@
#include "prncamvw.h"
#include "camdoc.h"
-#include "scrcamvw.h"
//#include "document.h" - in camtypes.h [AUTOMATICALLY REMOVED]
#include "prntview.h"
//#include "docview.h" - in camtypes.h [AUTOMATICALLY REMOVED]
//#include "spread.h" - in camtypes.h [AUTOMATICALLY REMOVED]
//#include "printdlg.h"
-#include "prdlgctl.h"
+//#include "prdlgctl.h"
#include "princomp.h"
#include "printctl.h"
#include "psrndrgn.h"
@@ -128,7 +127,7 @@
#define new CAM_DEBUG_NEW
#define USERNAME "Mike"
-BOOL PrintMonitor::StartPrintJob(HDC PrintJobDC)
+BOOL PrintMonitor::StartPrintJob(CNativeDC * PrintJobDC)
{
// Make sure we don't already have a print job going.
if (CurrentPrintJob != NULL)
@@ -172,7 +171,7 @@
if (CurrentPrintJob != NULL)
{
// Use a semaphore structure here so we don't do this more than once.
- HDC PrintDC = CurrentPrintJob;
+ CNativeDC * PrintDC = CurrentPrintJob;
CurrentPrintJob = NULL;
::AbortDoc(PrintDC);
@@ -265,7 +264,7 @@
// No current print job.
-HDC PrintMonitor::CurrentPrintJob = NULL;
+CNativeDC * PrintMonitor::CurrentPrintJob = NULL;
BOOL PrintMonitor::PrintingIsActive = FALSE;
BOOL PrintMonitor::FullRedrawNeeded = FALSE;
@@ -316,19 +315,19 @@
// get default print info
CCPrintInfo *pPrintInfo;
- TRY
+ try
{
pPrintInfo = new CCPrintInfo(KernelDoc,this);
}
- CATCH(CException, e)
+ catch(CException)
{
// Out of memory - report error and exit.
Error::SetError(_R(IDS_OUT_OF_MEMORY));
InformError();
return;
}
- END_CATCH
+
ASSERT(pPrintInfo->m_pPD != NULL); // must be set
BOOL StartedPrinting = FALSE;
@@ -1274,7 +1273,7 @@
HRGN hBandRgn;
hBandRgn = ::CreateRectRgnIndirect(&pPrintInfo->m_rectDraw);
ERROR2IF(hBandRgn == NULL, FALSE, "CreateRectRgnIndirect() failed!");
- ERROR3IF(pPrintDC->GetSafeHdc() == NULL, "Bad HDC in dcPrint!");
+ ERROR3IF(pPrintDC->GetSafeHdc() == NULL, "Bad CNativeDC * in dcPrint!");
ERROR2IF(::SelectClipRgn(pPrintDC->GetSafeHdc(), hBandRgn) == 0,
FALSE, "SelectClipRgn() failed!");
Xara