[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]
[XaraXtreme-commits] Commit Complete
Commit by : alex
Repository : xara
Revision : 1328
Date : Thu Jun 15 20:23:53 BST 2006
Changed paths:
M /Trunk/XaraLX/Kernel/Makefile.am
M /Trunk/XaraLX/Kernel/app.cpp
M /Trunk/XaraLX/Kernel/bmpalint.cpp
M /Trunk/XaraLX/Kernel/camfiltr.cpp
M /Trunk/XaraLX/Kernel/fthrattr.cpp
M /Trunk/XaraLX/Kernel/main3.cpp
M /Trunk/XaraLX/Kernel/native.cpp
M /Trunk/XaraLX/Kernel/ndmldgrp.cpp
M /Trunk/XaraLX/Kernel/node.cpp
M /Trunk/XaraLX/Kernel/nodebev.cpp
M /Trunk/XaraLX/Kernel/noderend.cpp
M /Trunk/XaraLX/Kernel/nodeshad.cpp
M /Trunk/XaraLX/Kernel/nodetext.cpp
M /Trunk/XaraLX/Kernel/nodetxts.cpp
M /Trunk/XaraLX/Kernel/ppbrush.cpp
M /Trunk/XaraLX/Kernel/princomp.cpp
M /Trunk/XaraLX/Kernel/rgnlist.cpp
M /Trunk/XaraLX/Kernel/rndrgn.cpp
M /Trunk/XaraLX/Kernel/xarprefs.cpp
M /Trunk/XaraLX/Scripts/all.sh
M /Trunk/XaraLX/Scripts/normaliseall.sh
M /Trunk/XaraLX/wxOil/dragtrgt.cpp
A /Trunk/XaraLX/wxOil/grndprnt.cpp
A /Trunk/XaraLX/wxOil/grndprnt.h
M /Trunk/XaraLX/wxOil/grndrgn.cpp
M /Trunk/XaraLX/wxOil/grndrgn.h
M /Trunk/XaraLX/wxOil/oilbitmap.cpp
More printing work
Diff:
Index: Trunk/XaraLX/Kernel/xarprefs.cpp
===================================================================
--- Trunk/XaraLX/Kernel/xarprefs.cpp (revision 1327)
+++ Trunk/XaraLX/Kernel/xarprefs.cpp (revision 1328)
@@ -1,8 +1,5 @@
// $Id$
// XarPrefs.cpp
-//
-// This file implements the dialogue box that allows the user to set the export native file
-// preferences.
/* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
================================XARAHEADERSTART===========================
@@ -103,6 +100,10 @@
/*
*/
+//
+// This file implements the dialogue box that allows the user to set the export native file
+// preferences.
+
#include "camtypes.h"
//#include "app.h" - in camtypes.h [AUTOMATICALLY REMOVED]
//#include "spread.h" - in camtypes.h [AUTOMATICALLY REMOVED]
@@ -349,8 +350,6 @@
MsgResult Result;
- BOOL EndDialog = FALSE; // TRUE if we should quit the dialog
-
// Should now handle the required messages that we respond to
switch (Msg->DlgMsg)
{
@@ -378,7 +377,6 @@
ERROR3 ( "mpParams is not set!" );
}
- EndDialog = TRUE; // Flag to close and end
}
}
break;
@@ -394,8 +392,10 @@
ERROR3 ( "mpParams is not set!" );
}
- EndDialog = TRUE; // Flag to close and end
break;
+
+ default:
+ break;
}
// Allow the base class access to the message, it will do the
@@ -403,13 +403,6 @@
// Must do this before the Close and End
Result = DialogOp::Message ( Message );
- // End dialog here
- if ( EndDialog )
- {
- Close (); // Hide the dialog box
- End (); // Finish the operation
- }
-
// The message was for our dialog box so return that we have handled it, if necessary
return Result;
}
Index: Trunk/XaraLX/Kernel/native.cpp
===================================================================
--- Trunk/XaraLX/Kernel/native.cpp (revision 1327)
+++ Trunk/XaraLX/Kernel/native.cpp (revision 1328)
@@ -225,14 +225,11 @@
#ifdef DO_EXPORT
-PORTNOTE("PrefsDlg", "Removed use of PrefsDlg")
-#ifndef EXCLUDE_FROM_XARALX
// Initialise the native file export options dialog.
if ( ok )
{
ok = NativePrefsDlg::Init ();
}
-#endif
#endif
Index: Trunk/XaraLX/Kernel/app.cpp
===================================================================
--- Trunk/XaraLX/Kernel/app.cpp (revision 1327)
+++ Trunk/XaraLX/Kernel/app.cpp (revision 1328)
@@ -128,7 +128,7 @@
#include "fontman.h"
#include "coldlog.h"
//#include "xaracms.h"
-//#include "prnmks.h"
+#include "prnmks.h"
#include "camelot.h"
//#include "ralphcri.h"
#include "ralphdoc.h"
@@ -392,7 +392,7 @@
if (!FontMgr->Init())
return FALSE;
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
#ifndef STANDALONE
#ifndef WEBSTER
// Do not do do on Webster as this conflicts with the CleanUpAfterExport code in BaseCamelotFilter
@@ -402,7 +402,11 @@
if (TheMarksManager == NULL)
return FALSE;
#endif // WEBSTER
+#endif
+#endif
+#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#ifndef STANDALONE
#ifdef FREEHANDPLUGINS
// Only add in if required - general plug-in removal at present
// Create the external (Freehand Xtra) API object
@@ -748,7 +752,7 @@
FontMgr = NULL;
}
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
#ifndef STANDALONE
#ifndef WEBSTER
// Do not do do on Webster as this conflicts with the CleanUpAfterExport code in BaseCamelotFilter
Index: Trunk/XaraLX/Kernel/nodeshad.cpp
===================================================================
--- Trunk/XaraLX/Kernel/nodeshad.cpp (revision 1327)
+++ Trunk/XaraLX/Kernel/nodeshad.cpp (revision 1328)
@@ -135,9 +135,9 @@
#include "cxftags.h" // TAG_SHADOW
//#include "cxfrec.h" // CXaraFileRecord - in camtypes.h [AUTOMATICALLY REMOVED]
//#include "camfiltr.h" // BaseCamelotFilter - in camtypes.h [AUTOMATICALLY REMOVED]
-//#include "swfrndr.h" // FlashRenderRegion
+#include "swfrndr.h" // FlashRenderRegion
#include "cmxrendr.h" // CMXRenderRegion
-//#include "ai_epsrr.h" // AIEPSRenderRegion
+#include "ai_epsrr.h" // AIEPSRenderRegion
//#include "dibutil.h" - in camtypes.h [AUTOMATICALLY REMOVED]
#include "lineattr.h"
@@ -1713,8 +1713,6 @@
********************************************************************************************/
BOOL NodeShadow::ExportRender( RenderRegion *pRegion )
{
- PORTNOTETRACE("other","NodeShadow::ExportRender - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
enum ShadowFilterType
{
NONE,
@@ -1723,7 +1721,10 @@
AIEPS
};
ShadowFilterType ftExportFilter = pRegion->IS_KIND_OF(FlashRenderRegion) ? FLASH :
+PORTNOTE("cmx","NodeShadow::ExportRender - ignore CMX ")
+#ifndef EXCLUDE_FROM_XARALX
pRegion->IS_KIND_OF(CMXRenderRegion) ? CMX :
+#endif
pRegion->IS_KIND_OF(AIEPSRenderRegion) ? AIEPS :
NONE;
@@ -1751,6 +1752,8 @@
}
break;
+PORTNOTE("cmx","NodeShadow::ExportRender - ignore CMX ")
+#ifndef EXCLUDE_FROM_XARALX
// CMX export.
case CMX:
{
@@ -1760,14 +1763,16 @@
GetBoundingRect () );
}
break;
+#endif
// AI EPS export.
case AIEPS:
{
+ DocRect brect = GetBoundingRect();
AIEPSRenderRegion *pAIEPS = static_cast<AIEPSRenderRegion*> ( pRegion );
bResult = pAIEPS->ExportShadow( m_ShadowBitmap->GetActualBitmap (),
GetTransp(),
- GetBoundingRect () );
+ brect );
}
break;
@@ -1778,9 +1783,6 @@
}
return bResult;
-#else
- return FALSE;
-#endif
}
Index: Trunk/XaraLX/Kernel/Makefile.am
===================================================================
--- Trunk/XaraLX/Kernel/Makefile.am (revision 1327)
+++ Trunk/XaraLX/Kernel/Makefile.am (revision 1328)
@@ -76,7 +76,7 @@
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 pmaskrgn.cpp printctl.cpp prnmkcom.cpp prnmks.cpp \
- xsepsops.cpp
+ xsepsops.cpp xarprefs.cpp
AM_CXXFLAGS = $(XARAFLAGS)
Index: Trunk/XaraLX/Kernel/rndrgn.cpp
===================================================================
--- Trunk/XaraLX/Kernel/rndrgn.cpp (revision 1327)
+++ Trunk/XaraLX/Kernel/rndrgn.cpp (revision 1328)
@@ -6688,8 +6688,6 @@
256, *Palette, Fill->GetProfile());
return;
}
-PORTNOTE("other", "RenderRegion: no colour correction for paletted bitmaps");
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
// --- If it's a paletted bitmap, then we just colour-correct the palette
if (Info->bmiHeader.biBitCount <= 8)
{
@@ -6723,7 +6721,6 @@
}
return;
}
-#endif
}
Index: Trunk/XaraLX/Kernel/nodebev.cpp
===================================================================
--- Trunk/XaraLX/Kernel/nodebev.cpp (revision 1327)
+++ Trunk/XaraLX/Kernel/nodebev.cpp (revision 1328)
@@ -135,9 +135,9 @@
#include "nodetxts.h"
//#include "mario.h" // _R(IDE_NOMORE_MEMORY)
#include "extender.h" // for Extender code
-//#include "swfrndr.h" // For the FlashRenderRegion custom export code.
+#include "swfrndr.h" // For the FlashRenderRegion custom export code.
#include "cmxrendr.h" // For the CMXRenderRegion custom export code.
-//#include "ai_epsrr.h" // For the AIEPSRenderRegion custom export code.
+#include "ai_epsrr.h" // For the AIEPSRenderRegion custom export code.
#include "rsmooth.h"
#include "contmenu.h"
#include "blndhelp.h"
@@ -151,7 +151,7 @@
#include "brshattr.h"
#include "fthrattr.h" // for AttrFeather
//#include "filtirr.h"
-//#include "pmaskrgn.h"
+#include "pmaskrgn.h"
#include "ophist.h"
#include "objchge.h"
#include "attrmap.h"
@@ -1203,8 +1203,6 @@
return;
}
}
- PORTNOTETRACE("other","NodeBevel::Render - removed Flash support");
-#ifndef EXCLUDE_FROM_XARALX
else if(pRender->IsKindOf(CC_RUNTIME_CLASS(FlashRenderRegion)))
{
INT32 NewDPI = 96;
@@ -1217,7 +1215,6 @@
RenderBitmapForDisplay(pRender);
m_AmConvertingToShapes = OldFlag;
}
-#endif
}
// Now set up the palette (depending on contrast)
@@ -1314,12 +1311,9 @@
if(pRegion)
m_LastPixelSize = pRegion->GetScaledPixelWidth();
- PORTNOTETRACE("other","NodeBevel::RenderBitmapForDisplay - removed printing support");
-#ifndef EXCLUDE_FROM_XARALX
if (pRegion && pRegion->IS_KIND_OF(PrintingMaskedRenderRegion))
CalculateBitmapSize(&m_BitmapWidth, &m_BitmapHeight, pRegion);
else
-#endif
CalculateBitmapSize(&m_BitmapWidth, &m_BitmapHeight, NULL);
// Get the pixel size of the current clipping rect! SHOULD be pixel alligned.
@@ -1845,9 +1839,7 @@
PORTNOTETRACE("other","NodeBevel::CalculateBitmapSize - removed printing support");
if(Document::GetCurrent() && Document::GetCurrent()->GetFirstDocView()
-#ifndef EXCLUDE_FROM_XARALX
&& !(pRegion && pRegion->IS_KIND_OF(PrintingMaskedRenderRegion))
-#endif
)
PixSize = (MILLIPOINT)((double)PixSize / (Document::GetCurrent()->GetFirstDocView())->GetViewScale().MakeDouble());
@@ -1859,13 +1851,8 @@
double lHeight = dr.Height() / PixSize;
// Check to see if we`re not printing and then Scale up the values!
- PORTNOTETRACE("other","NodeBevel::CalculateBitmapSize - removed printing support");
-#ifndef EXCLUDE_FROM_XARALX
if ((!pControl->IsPrinting() && !m_AmConvertingToShapes) ||
(pRegion && pRegion->IS_KIND_OF(PrintingMaskedRenderRegion)))
-#else
- if (!m_AmConvertingToShapes)
-#endif
{
// If the current render regions scale value is greater than 0 do the following
if (pRegion && PixSize > 0 )
@@ -3499,8 +3486,6 @@
********************************************************************************************/
void NodeBevel::RenderNodesForPrinting(RenderRegion * pRender)
{
- PORTNOTETRACE("other","NodeBevel::RenderNodesForPrinting - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
// first, save the context
pRender->SaveContext();
@@ -3522,7 +3507,6 @@
}
pRender->RestoreContext();
-#endif
}
/********************************************************************************************
@@ -3847,11 +3831,9 @@
********************************************************************************************/
BOOL NodeBevel::ExportRender( RenderRegion *pRegion )
{
- PORTNOTETRACE("other","NodeBevel::ExportRender - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
BOOL bResult = FALSE;
- NodeBevelController * pController = (NodeBevelController *)FindParent();
+// NodeBevelController * pController = (NodeBevelController *)FindParent();
// Step 1: If the RenderRegion is a FlashRenderRegion, use custom Flash export code.
if ( pRegion->IsKindOf ( CC_RUNTIME_CLASS ( FlashRenderRegion ) ) )
@@ -3864,7 +3846,8 @@
// This is where all the hard work is done.
bResult = pFlash->ExportBevel ( this );
}
-
+PORTNOTE("cmx", "Removed CMX Support")
+#ifndef EXCLUDE_FROM_XARALX
// Step 2: Otherwise check whether it's a CMXRenderRegion.
else if ( pRegion->IsKindOf ( CC_RUNTIME_CLASS ( CMXRenderRegion ) ) )
{
@@ -3875,7 +3858,7 @@
// This is where all the hard work is done.
bResult = pCMX->ExportBevel ( this );
}
-
+#endif
// Step 3: Otherwise check whether it's an AIEPSRenderRegion.
else if ( pRegion->IsKindOf ( CC_RUNTIME_CLASS ( AIEPSRenderRegion ) ) )
{
@@ -3891,9 +3874,6 @@
// from rendering the character out as paths as well as text. (If there's
// been an error, bResult will have been set to FALSE.)
return bResult;
-#else
- return FALSE;
-#endif
}
/********************************************************************************************
@@ -4177,11 +4157,9 @@
BOOL NodeBevelBegin::ExportRender ( RenderRegion *pRegion )
{
- PORTNOTETRACE("other","NodeBevelBegin::ExportRender - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
BOOL bResult = FALSE;
- NodeBevelController * pController = (NodeBevelController *)FindParent();
+// NodeBevelController * pController = (NodeBevelController *)FindParent();
// Step 1: Test whether the render region is a Flash one. If so, invoke it's custom
// export code.
@@ -4197,6 +4175,8 @@
}
// Step 2: Test whether the render region is a CMX one. If so, invoke it's custom
// export code.
+PORTNOTE("cmx", "Removed CMX Support")
+#ifndef EXCLUDE_FROM_XARALX
else if ( pRegion->IsKindOf ( CC_RUNTIME_CLASS ( CMXRenderRegion ) ) )
{
// Step 2a: Cast the pRegion pointer to be a CMXRenderRegion pointer, so that
@@ -4206,6 +4186,7 @@
// Step 2b: Invoke the stub function within the CMX render region.
bResult = pCMX->ExportBevelBegin ( this );
}
+#endif
// render bitmap stuff
else
{
@@ -4219,9 +4200,6 @@
// from rendering the character out as paths as well as text. (If there's
// been an error, bResult will have been set to FALSE.)
return bResult;
-#else
- return FALSE;
-#endif
}
//#endif
Index: Trunk/XaraLX/Kernel/bmpalint.cpp
===================================================================
--- Trunk/XaraLX/Kernel/bmpalint.cpp (revision 1327)
+++ Trunk/XaraLX/Kernel/bmpalint.cpp (revision 1328)
@@ -163,8 +163,6 @@
INT32 BitmapExportPaletteInterface::GetNumberOfColours()
{
-PORTNOTE("BmpPrevDlg", "Removed use of Bitmap Preview dialog")
-#ifndef EXCLUDE_FROM_XARALX
if (BmapPrevDlg::m_pExportOptions->GetSupportsPalette())
{
ExtendedPalette *palette = BmapPrevDlg::m_pExportOptions->GetExtendedPalette();
@@ -172,7 +170,6 @@
return palette->NumberOfColours;
}
else
-#endif
return 0;
}
@@ -182,14 +179,9 @@
ERROR3IF(index == -1, "Function called with an invalid palette index");
-PORTNOTE("BmpPrevDlg", "Removed use of Bitmap Preview dialog")
-#ifndef EXCLUDE_FROM_XARALX
ExtendedPalette *palette = BmapPrevDlg::m_pExportOptions->GetExtendedPalette();
ERROR3IF(!palette, "There is no palette - This should never happen");
return palette->Data[m_PaletteSortedToReal[index]].Red;
-#else
- return 0;
-#endif
}
BYTE BitmapExportPaletteInterface::GetGreen(INT32 index)
@@ -198,14 +190,9 @@
ERROR3IF(index == -1, "Function called with an invalid palette index");
-PORTNOTE("BmpPrevDlg", "Removed use of Bitmap Preview dialog")
-#ifndef EXCLUDE_FROM_XARALX
ExtendedPalette *palette = BmapPrevDlg::m_pExportOptions->GetExtendedPalette();
ERROR3IF(!palette, "There is no palette - This should never happen");
return palette->Data[m_PaletteSortedToReal[index]].Green;
-#else
- return 0;
-#endif
}
BYTE BitmapExportPaletteInterface::GetBlue(INT32 index)
@@ -214,14 +201,9 @@
ERROR3IF(index == -1, "Function called with an invalid palette index");
-PORTNOTE("BmpPrevDlg", "Removed use of Bitmap Preview dialog")
-#ifndef EXCLUDE_FROM_XARALX
ExtendedPalette *palette = BmapPrevDlg::m_pExportOptions->GetExtendedPalette();
ERROR3IF(!palette, "There is no palette - This should never happen");
return palette->Data[m_PaletteSortedToReal[index]].Blue;
-#else
- return 0;
-#endif
}
INT32 BitmapExportPaletteInterface::GetFlags(INT32 index)
@@ -230,14 +212,9 @@
ERROR3IF(index == -1, "Function called with an invalid palette index");
-PORTNOTE("BmpPrevDlg", "Removed use of Bitmap Preview dialog")
-#ifndef EXCLUDE_FROM_XARALX
ExtendedPalette *palette = BmapPrevDlg::m_pExportOptions->GetExtendedPalette();
ERROR3IF(!palette, "There is no palette - This should never happen");
return palette->Data[m_PaletteSortedToReal[index]].Flags;
-#else
- return 0;
-#endif
}
void BitmapExportPaletteInterface::SetRed(INT32 index, BYTE red)
@@ -246,13 +223,10 @@
ERROR3IF(index == -1, "Function called with an invalid palette index");
-PORTNOTE("BmpPrevDlg", "Removed use of Bitmap Preview dialog")
-#ifndef EXCLUDE_FROM_XARALX
ExtendedPalette *palette = BmapPrevDlg::m_pExportOptions->GetExtendedPalette();
ERROR3IF(!palette, "There is no palette - This should never happen");
palette->Data[m_PaletteSortedToReal[index]].Red = red;
palette->Data[m_PaletteSortedToReal[index]].Flags &= LOCKED_COLOUR;
-#endif
}
void BitmapExportPaletteInterface::SetGreen(INT32 index, BYTE green)
@@ -261,13 +235,10 @@
ERROR3IF(index == -1, "Function called with an invalid palette index");
-PORTNOTE("BmpPrevDlg", "Removed use of Bitmap Preview dialog")
-#ifndef EXCLUDE_FROM_XARALX
ExtendedPalette *palette = BmapPrevDlg::m_pExportOptions->GetExtendedPalette();
ERROR3IF(!palette, "There is no palette - This should never happen");
palette->Data[m_PaletteSortedToReal[index]].Green = green;
palette->Data[m_PaletteSortedToReal[index]].Flags &= LOCKED_COLOUR;
-#endif
}
void BitmapExportPaletteInterface::SetBlue(INT32 index, BYTE blue)
@@ -276,13 +247,10 @@
ERROR3IF(index == -1, "Function called with an invalid palette index");
-PORTNOTE("BmpPrevDlg", "Removed use of Bitmap Preview dialog")
-#ifndef EXCLUDE_FROM_XARALX
ExtendedPalette *palette = BmapPrevDlg::m_pExportOptions->GetExtendedPalette();
ERROR3IF(!palette, "There is no palette - This should never happen");
palette->Data[m_PaletteSortedToReal[index]].Blue = blue;
palette->Data[m_PaletteSortedToReal[index]].Flags &= LOCKED_COLOUR;
-#endif
}
void BitmapExportPaletteInterface::SetFlags(INT32 index, INT32 flags)
@@ -291,12 +259,9 @@
ERROR3IF(index == -1, "Function called with an invalid palette index");
-PORTNOTE("BmpPrevDlg", "Removed use of Bitmap Preview dialog")
-#ifndef EXCLUDE_FROM_XARALX
ExtendedPalette *palette = BmapPrevDlg::m_pExportOptions->GetExtendedPalette();
ERROR3IF(!palette, "There is no palette - This should never happen");
palette->Data[m_PaletteSortedToReal[index]].Flags = flags;
-#endif
}
void BitmapExportPaletteInterface::ValidateSortedPalette()
@@ -371,11 +336,9 @@
******************************************************************************************/
INT32 BitmapExportPaletteInterface::LuminanceComparisonFn(const INT32 *arg1, const INT32 *arg2)
{
-// INT32 paletteIndex1 = *arg1;
-// INT32 paletteIndex2 = *arg2;
+ INT32 paletteIndex1 = *arg1;
+ INT32 paletteIndex2 = *arg2;
-PORTNOTE("BmpPrevDlg", "Removed use of Bitmap Preview dialog")
-#ifndef EXCLUDE_FROM_XARALX
ExtendedPalette *palette = BmapPrevDlg::m_pExportOptions->GetExtendedPalette();
ERROR3IF(!palette, "There is no palette - This should never happen");
@@ -425,9 +388,6 @@
ERROR3IF(blue1 != blue2, "This is not possible!");
return 0; // The red, green and blue are equal
-#else
- return -1;
-#endif
}
/******************************************************************************************
@@ -442,11 +402,9 @@
******************************************************************************************/
INT32 BitmapExportPaletteInterface::HueComparisonFn(const INT32 *arg1, const INT32 *arg2)
{
-// INT32 paletteIndex1 = *arg1;
-// INT32 paletteIndex2 = *arg2;
+ INT32 paletteIndex1 = *arg1;
+ INT32 paletteIndex2 = *arg2;
-PORTNOTE("BmpPrevDlg", "Removed use of Bitmap Preview dialog")
-#ifndef EXCLUDE_FROM_XARALX
ExtendedPalette *palette = BmapPrevDlg::m_pExportOptions->GetExtendedPalette();
ERROR3IF(!palette, "There is no palette - This should never happen");
@@ -496,7 +454,4 @@
return 0; // Everything is eqaul
-#else
- return -1;
-#endif
}
Index: Trunk/XaraLX/Kernel/princomp.cpp
===================================================================
--- Trunk/XaraLX/Kernel/princomp.cpp (revision 1327)
+++ Trunk/XaraLX/Kernel/princomp.cpp (revision 1328)
@@ -925,7 +925,7 @@
if (ok)
pFilter->Write(&Rec);
-#endif // EXCLUDE_FROM_RALPH, EXCLUDE_FROM_XARALX
+#endif // EXCLUDE_FROM_RALPH
return(ok);
}
@@ -999,7 +999,7 @@
if (ok)
pFilter->Write(&Rec);
-#endif // EXCLUDE_FROM_RALPH, EXCLUDE_FROM_XARALX
+#endif // EXCLUDE_FROM_RALPH
return(ok);
}
Index: Trunk/XaraLX/Kernel/ndmldgrp.cpp
===================================================================
--- Trunk/XaraLX/Kernel/ndmldgrp.cpp (revision 1327)
+++ Trunk/XaraLX/Kernel/ndmldgrp.cpp (revision 1328)
@@ -624,7 +624,7 @@
if (pRender==NULL)
return TRUE;
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
// only export to native documents!
if (pRender->GetRuntimeClass() == CC_RUNTIME_CLASS(NativeRenderRegion))
return TRUE;
@@ -651,7 +651,7 @@
void NodeMouldGroup::PreExportRender(RenderRegion* pRegion)
{
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
if (pRegion->IS_KIND_OF(NativeRenderRegion))
{
PreExportNATEPS(pRegion);
@@ -684,7 +684,7 @@
BOOL NodeMouldGroup::ExportRender(RenderRegion* pRegion)
{
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
if (pRegion->IS_KIND_OF(NativeRenderRegion))
return PostExportNATEPS(pRegion);
@@ -711,7 +711,7 @@
void NodeMouldGroup::PreExportNATEPS(RenderRegion* pRegion)
{
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
EPSExportDC *pDC = (EPSExportDC *) pRegion->GetRenderDC();
pDC->OutputToken(_T("csso")); // Camelot "start mould source" token
pDC->OutputNewLine();
@@ -721,7 +721,7 @@
BOOL NodeMouldGroup::PostExportNATEPS(RenderRegion* pRegion)
{
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
EPSExportDC *pDC = (EPSExportDC *) pRegion->GetRenderDC();
pDC->OutputToken(_T("ceso")); // Camelot "end mould source" token
pDC->OutputNewLine();
Index: Trunk/XaraLX/Kernel/rgnlist.cpp
===================================================================
--- Trunk/XaraLX/Kernel/rgnlist.cpp (revision 1327)
+++ Trunk/XaraLX/Kernel/rgnlist.cpp (revision 1328)
@@ -113,8 +113,8 @@
//#include "ctrlhelp.h"
//#include "app.h" - in camtypes.h [AUTOMATICALLY REMOVED]
#include "statline.h"
-//#include "dragmgr.h"
-//#include "prncamvw.h"
+#include "dragmgr.h"
+#include "prncamvw.h"
#include "menuops.h"
DECLARE_SOURCE("$Revision$");
@@ -1035,8 +1035,6 @@
// print monitor not present on viewer
// Make sure printing is ok.
-PORTNOTE("print","RenderRegionList::BackgroundRender - removed printing code")
-#ifndef EXCLUDE_FROM_XARALX
if (!PrintMonitor::IsPrintStatusOK())
{
// No - a print job has gone wrong, so we delete all printing render regions
@@ -1059,7 +1057,7 @@
// Reset the last rendered render region
LastRendered = NULL;
}
-#endif
+
if (GetCount() == 0)
{
// TRACE( wxT("BGR - No regions
") );
@@ -1147,8 +1145,6 @@
if ( CCamApp::IsDisabled() )
return; // If he has got the system disabled, ignore
-PORTNOTE("other","RenderRegionList::ImmediateRender - removed printing code")
-#ifndef EXCLUDE_FROM_XARALX
#ifndef STANDALONE
// Make sure printing is ok.
if (!PrintMonitor::IsPrintStatusOK())
@@ -1174,18 +1170,18 @@
LastRendered = NULL;
}
#endif
-#endif
if (GetCount() == 0)
return;
-PORTNOTE("other","RenderRegionList::ImmediateRender - removed code")
+PORTNOTE("other", "Disabled ControlHelper")
#ifndef EXCLUDE_FROM_XARALX
if (ControlHelper::IsUserInterfaceCaptured())
return; // No bg rendering if UI is captured (e.g. menu is up)
+#endif
if (DragManagerOp::IsDragActive())
return; // No bg rendering if a DragManager op is active (NB this is for
// colour/bitmap/bar drags only - not doc operation drags)
-#endif
+
if(ViewOps::IsFullScreenPending()) // no bg rendering if we are about to enter full screen mode
return;
Index: Trunk/XaraLX/Kernel/camfiltr.cpp
===================================================================
--- Trunk/XaraLX/Kernel/camfiltr.cpp (revision 1327)
+++ Trunk/XaraLX/Kernel/camfiltr.cpp (revision 1328)
@@ -139,7 +139,7 @@
#include "unitcomp.h" // units component, record handling classes for units
#include "infocomp.h" // doc info component, record handling classes for document information
#include "viewcomp.h" // view component, record handling classes for view records
-//#include "princomp.h" // print component, record handling classes for font records
+#include "princomp.h" // print component, record handling classes for font records
#include "fontcomp.h" // font component, record handling classes for font records
#include "cxfile.h" // The core v2 format class
@@ -177,7 +177,7 @@
#include "rechshad.h" // ShadowRecordHandler
#include "nodebev.h" // BevelRecordHandler
-//#include "xarprefs.h" // The base Xara file preferences dialogue.
+#include "xarprefs.h" // The base Xara file preferences dialogue.
//#include "webprefs.h" // Web options dialog handler
#include "webparam.h" // WebPrefsDlgParam class
#include "prvwflt.h" // for PreviewBitmap::PreviewBitmapSize
@@ -3471,9 +3471,8 @@
// All work has been completed.
//EndSlowJob();
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
// Ensure all the bars are updated to reflect the new document
-PORTNOTE("other","Removed DialogBarOp usage")
DialogBarOp::UpdateStateOfAllBars();
#endif
@@ -3670,13 +3669,8 @@
OpDescriptor* BaseCamelotFilter::GetDialogueOp ( void )
{
- PORTNOTETRACE("other","BaseCamelotFilter::GetDialogueOp - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
// Just return the found OpDescriptor.
return OpDescriptor::FindOpDescriptor( CC_RUNTIME_CLASS( NativePrefsDlg ) );
-#else
- return NULL;
-#endif
}
/********************************************************************************************
@@ -3805,8 +3799,7 @@
pInfoComponent = (DocInfoComponent*)pComponent;
else if (pComponent->IS_KIND_OF(ViewComponent))
pViewComponent = (ViewComponent*)pComponent;
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
-PORTNOTE("print","Removed PrintComponent usage")
+#if !defined(EXCLUDE_FROM_RALPH)
else if (pComponent->IS_KIND_OF(PrintComponent))
pPrintComponent = (PrintComponent*)pComponent;
#endif
@@ -3822,9 +3815,7 @@
pUnitsComponent == NULL ||
pInfoComponent == NULL ||
pViewComponent == NULL ||
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
pPrintComponent == NULL ||
-#endif
pFontComponent == NULL)
{
ERROR3("Unable to find ptrs to all the objects required for import/export");
Index: Trunk/XaraLX/Kernel/nodetxts.cpp
===================================================================
--- Trunk/XaraLX/Kernel/nodetxts.cpp (revision 1327)
+++ Trunk/XaraLX/Kernel/nodetxts.cpp (revision 1328)
@@ -148,7 +148,7 @@
#include "ralphcri.h" // For RalphCriticalSection
#endif
-//#include "opbevel.h" // For determining if a gradient fill is used in a TextStory.
+#include "opbevel.h" // For determining if a gradient fill is used in a TextStory.
DECLARE_SOURCE("$Revision$")
@@ -5405,8 +5405,6 @@
********************************************************************************************/
BOOL TextStory::IsGradientFilled ()
{
- PORTNOTETRACE("text","TextStory::IsGradientFilled - do nothing");
-#ifndef EXCLUDE_FROM_XARALX
ListItem *pItem = NULL;
List GradientList;
BOOL filled = FALSE;
@@ -5437,7 +5435,4 @@
GradientList.DeleteAll();
return filled;
-#else
- return true;
-#endif
}
Index: Trunk/XaraLX/Kernel/main3.cpp
===================================================================
--- Trunk/XaraLX/Kernel/main3.cpp (revision 1327)
+++ Trunk/XaraLX/Kernel/main3.cpp (revision 1328)
@@ -287,15 +287,8 @@
AttrFillGeometry::Init() && // Initialise the fill editing operations
-PORTNOTE("other","Removed another lot of initialization")
-#ifndef EXCLUDE_FROM_XARALX
-// This has been moved to CCamApp::InitCamelotApp so that it happens after MFC's document templates
-// are set up.
- // ===================
-
EPSFilter::InitPrefs() && // Initialise default font mappings and
// EPS export prefs
-#endif
#ifndef DISABLE_TEXT_RENDERING
FontCache::Init() &&
#endif
Index: Trunk/XaraLX/Kernel/noderend.cpp
===================================================================
--- Trunk/XaraLX/Kernel/noderend.cpp (revision 1327)
+++ Trunk/XaraLX/Kernel/noderend.cpp (revision 1328)
@@ -153,7 +153,7 @@
#include "attrmap.h"
#include "ralphdoc.h"
#include "extender.h" // for ExtendParams
-//#include "swfrndr.h"
+#include "swfrndr.h"
//#include "bitmapcache.h"
//#include "capturemanager.h" - in camtypes.h [AUTOMATICALLY REMOVED]
#include "nodeliveeffect.h"
@@ -4740,8 +4740,6 @@
// The return value.
BOOL Result = FALSE;
- PORTNOTETRACE("other","NodeRenderableInk::ExportRender - ignore FlashRenderRegion");
-#ifndef EXCLUDE_FROM_XARALX
// Is this a FlashRenderRegion?
if ( pRender->IsKindOf ( CC_RUNTIME_CLASS ( FlashRenderRegion ) ) )
{
@@ -4751,7 +4749,6 @@
// Call the appropriate method in the vector file render region class.
Result = pFlash->ExportRenderableNode ( this );
}
-#endif
return Result;
}
Index: Trunk/XaraLX/Kernel/fthrattr.cpp
===================================================================
--- Trunk/XaraLX/Kernel/fthrattr.cpp (revision 1327)
+++ Trunk/XaraLX/Kernel/fthrattr.cpp (revision 1328)
@@ -119,7 +119,7 @@
#include "oilbitmap.h"
// Caching contour path and updating on pseudo AllowOps
-//#include "opfeathr.h" // RegenerateFeatherContourAction
+#include "opfeathr.h" // RegenerateFeatherContourAction
#include "objchge.h" // ObjChange and AllowOp stuff
#include "transop.h" // TransOperation - optimise which operations trigger recontour
@@ -1491,8 +1491,6 @@
{
if (pOp != NULL)
{
-PORTNOTE("other","Removed RegenerateFeatherContourAction usage")
-#ifndef EXCLUDE_FROM_XARALX
// make this undoable
RegenerateFeatherContourAction* pAct = NULL;
if (RegenerateFeatherContourAction::Init(pOp, pOp->GetUndoActionList(), this, m_pOuterContour, &pAct) == AC_FAIL)
@@ -1500,7 +1498,6 @@
TRACEALL( _T("FeatherAttrValue::RegenerateOuterContourOnNextRedraw; Could not record undo information.
"));
return FALSE;
}
-#endif
}
// don't actually delete the old outer contour
// if it's been saved via the undoable operation.
Index: Trunk/XaraLX/Kernel/nodetext.cpp
===================================================================
--- Trunk/XaraLX/Kernel/nodetext.cpp (revision 1327)
+++ Trunk/XaraLX/Kernel/nodetext.cpp (revision 1328)
@@ -2031,8 +2031,6 @@
// render the character through the matrix with current attributes in RenderRegion
-PORTNOTE("printing", "printing deactivated")
-#ifndef EXCLUDE_FROM_XARALX
// If the render region is a printing region then maybe print as shapes.
if (pRenderRegion->IsPrinting())
{
@@ -2044,7 +2042,6 @@
return pRenderRegion->RenderRegion::RenderChar(GetUnicodeValue(), &matrix);
}
}
-#endif
// if we're exporting to illustrator, make the text position relative to
// the page.
@@ -2318,9 +2315,10 @@
BOOL TextChar::SupportsClipboardFormat(InternalClipboardFormat *Format) const
{
-#if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX)
+#if !defined(EXCLUDE_FROM_RALPH)
// TextChars can be exported as either "vector" or "text" data
- return(Format->IsSameFormat(InternalClipboardFormat(CLIPTYPE_TEXT)));
+ InternalClipboardFormat textformat(CLIPTYPE_TEXT);
+ return(Format->IsSameFormat(textformat));
#else
return FALSE;
#endif
Index: Trunk/XaraLX/Kernel/node.cpp
===================================================================
--- Trunk/XaraLX/Kernel/node.cpp (revision 1327)
+++ Trunk/XaraLX/Kernel/node.cpp (revision 1328)
@@ -1116,12 +1116,10 @@
pOwnerDoc->DecNodeCount();
// Inform classes that may be holding pointers to this node
-PORTNOTE("other","Removed RenderRegionList usage")
-#ifndef EXCLUDE_FROM_XARALX
RenderRegionList* pRList = GetApplication()->GetRegionList();
if (pRList)
pRList->HandleNodeDeletion(this);
-#endif
+
if (pOwnerDoc && pOwnerDoc->IsKindOf(CC_RUNTIME_CLASS(Document)))
((Document*)pOwnerDoc)->HandleNodeDeletion(this);
Index: Trunk/XaraLX/Kernel/ppbrush.cpp
===================================================================
--- Trunk/XaraLX/Kernel/ppbrush.cpp (revision 1327)
+++ Trunk/XaraLX/Kernel/ppbrush.cpp (revision 1328)
@@ -137,8 +137,8 @@
//#include "group.h" - in camtypes.h [AUTOMATICALLY REMOVED]
#include "ophist.h"
+#include "vectrndr.h"
-
DECLARE_SOURCE("$Revision$");
CC_IMPLEMENT_DYNAMIC(PathProcessorBrush, PathProcessor);
@@ -587,11 +587,8 @@
m_LastScalingRendered = m_CurrentScaling;
// If we are printing or exporting then don't do the clip test
- BOOL bScan = pRender->IsKindOf(CC_RUNTIME_CLASS(ScanningRenderRegion));
- PORTNOTETRACE("other","PathProcessorBrush::ProcessPath - removed printing/exporting test");
-#ifndef EXCLUDE_FROM_XARALX
+ BOOL bScan = pRender->IsKindOf(CC_RUNTIME_CLASS(ScanningRenderRegion))
|| pRender->IsKindOf(CC_RUNTIME_CLASS(VectorFileRenderRegion));
-#endif
BOOL bContinue = TRUE;
Index: Trunk/XaraLX/Scripts/all.sh
===================================================================
--- Trunk/XaraLX/Scripts/all.sh (revision 1327)
+++ Trunk/XaraLX/Scripts/all.sh (revision 1328)
@@ -3,4 +3,4 @@
# This runs the command line on all files
DIRS="GDraw Kernel PreComp tools wxOil wxXtra"
-find $DIRS -name '*.cpp' -or -name '*.c' -or -name '*.h'
+find $DIRS -name '*.cpp' -or -name '*.c' -or -name '*.h' | sort
Index: Trunk/XaraLX/Scripts/normaliseall.sh
===================================================================
--- Trunk/XaraLX/Scripts/normaliseall.sh (revision 1327)
+++ Trunk/XaraLX/Scripts/normaliseall.sh (revision 1328)
@@ -3,4 +3,4 @@
# This runs normalise on all files
DIRS="GDraw Kernel PreComp tools wxOil wxXtra"
-find $DIRS -name '*.cpp' -or -name '*.c' -or -name '*.h' | egrep -v "wxOil/(xrc/)?(resources|winresources).cpp" | xargs Scripts/normalise.pl $*
+find $DIRS -name '*.cpp' -or -name '*.c' -or -name '*.h' | sort | egrep -v "wxOil/(xrc/)?(resources|winresources).cpp" | xargs Scripts/normalise.pl $*
Index: Trunk/XaraLX/wxOil/grndprnt.h
===================================================================
--- Trunk/XaraLX/wxOil/grndprnt.h (revision 0)
+++ Trunk/XaraLX/wxOil/grndprnt.h (revision 1328)
@@ -0,0 +1,146 @@
+// $Id: wxOil/grndprnt.h, 1, 01-Jan-2006, Anonymous $
+/* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
+================================XARAHEADERSTART===========================
+
+ Xara LX, a vector drawing and manipulation program.
+ Copyright (C) 1993-2006 Xara Group Ltd.
+ Copyright on certain contributions may be held in joint with their
+ respective authors. See AUTHORS file for details.
+
+LICENSE TO USE AND MODIFY SOFTWARE
+----------------------------------
+
+This file is part of Xara LX.
+
+Xara LX is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 2 as published
+by the Free Software Foundation.
+
+Xara LX and its component source files are distributed in the hope
+that it will be useful, but WITHOUT ANY WARRANTY; without even the
+implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with Xara LX (see the file GPL in the root directory of the
+distribution); if not, write to the Free Software Foundation, Inc., 51
+Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+ADDITIONAL RIGHTS
+-----------------
+
+Conditional upon your continuing compliance with the GNU General Public
+License described above, Xara Group Ltd grants to you certain additional
+rights.
+
+The additional rights are to use, modify, and distribute the software
+together with the wxWidgets library, the wxXtra library, and the "CDraw"
+library and any other such library that any version of Xara LX relased
+by Xara Group Ltd requires in order to compile and execute, including
+the static linking of that library to XaraLX. In the case of the
+"CDraw" library, you may satisfy obligation under the GNU General Public
+License to provide source code by providing a binary copy of the library
+concerned and a copy of the license accompanying it.
+
+Nothing in this section restricts any of the rights you have under
+the GNU General Public License.
+
+
+SCOPE OF LICENSE
+----------------
+
+This license applies to this program (XaraLX) and its constituent source
+files only, and does not necessarily apply to other Xara products which may
+in part share the same code base, and are subject to their own licensing
+terms.
+
+This license does not apply to files in the wxXtra directory, which
+are built into a separate library, and are subject to the wxWindows
+license contained within that directory in the file "WXXTRA-LICENSE".
+
+This license does not apply to the binary libraries (if any) within
+the "libs" directory, which are subject to a separate license contained
+within that directory in the file "LIBS-LICENSE".
+
+
+ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
+----------------------------------------------
+
+Subject to the terms of the GNU Public License (see above), you are
+free to do whatever you like with your modifications. However, you may
+(at your option) wish contribute them to Xara's source tree. You can
+find details of how to do this at:
+ http://www.xaraxtreme.org/developers/
+
+Prior to contributing your modifications, you will need to complete our
+contributor agreement. This can be found at:
+ http://www.xaraxtreme.org/developers/contribute/
+
+Please note that Xara will not accept modifications which modify any of
+the text between the start and end of this header (marked
+XARAHEADERSTART and XARAHEADEREND).
+
+
+MARKS
+-----
+
+Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
+designs are registered or unregistered trademarks, design-marks, and/or
+service marks of Xara Group Ltd. All rights in these marks are reserved.
+
+
+ Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
+ http://www.xara.com/
+
+=================================XARAHEADEREND============================
+ */
+
+// A GDraw render region for printing.
+
+#ifndef INC_GRNDPRNT
+#define INC_GRNDPRNT
+
+#include "grnddib.h"
+
+/********************************************************************************************
+
+> class GRenderPrint : public GRenderDIB
+
+ Author: Andy_Pennell (Xara Group Ltd) <camelotdev@xxxxxxxx>
+ Created: 2/6/94
+ Purpose: A GDraw render region that uses normal DIBs for the bitmap and can output
+ the result to a printer.
+
+********************************************************************************************/
+
+class GRenderPrint : public GRenderDIB
+{
+ CC_DECLARE_DYNAMIC(GRenderPrint)
+
+public:
+ GRenderPrint(DocRect ClipRegion, Matrix ConvertMatrix, FIXED16 ViewScale, UINT32 Depth, double dpi);
+ ~GRenderPrint();
+
+ virtual BOOL StartRender();
+ virtual BOOL StopRender();
+
+ virtual BOOL InitDevice();
+
+ // banding functions
+ virtual BOOL SetFirstBand();
+ virtual BOOL GetNextBand();
+
+protected:
+ BOOL OldPlateDisabledState;
+ BOOL HaveDisabledPlate;
+
+protected:
+ LPBITMAPINFO GetLPBits( INT32 Width, INT32 Height, INT32 Depth, LPBYTE*);
+ void FreeLPBits( LPBITMAPINFO, LPBYTE );
+ BOOL DisplayBits(LPBITMAPINFO lpDisplayBitmapInfo = NULL, LPBYTE lpDisplayBits = NULL);
+};
+
+#endif // INC_GRNDPRNT
+
+
Index: Trunk/XaraLX/wxOil/grndrgn.h
===================================================================
--- Trunk/XaraLX/wxOil/grndrgn.h (revision 1327)
+++ Trunk/XaraLX/wxOil/grndrgn.h (revision 1328)
@@ -156,7 +156,7 @@
CC_DECLARE_DYNAMIC( GRenderRegion )
friend class GBrush; // so it can get to our vars etc
-// friend class OpGDraw;
+ friend class OpGDraw;
// friend class OpGFPU;
friend class GRenderRegionWrapper;
friend class ConcurrentRenderer;
@@ -425,7 +425,7 @@
protected:
// don't make these into bitfields, as they get setup by the preferences code which
// won't be able to cope
-// static BOOL WantDoGDraw; // TRUE if user wants it
+ static BOOL WantDoGDraw; // TRUE if user wants it
static UINT32 WantGDrawDepth; // desired depth of off-screen bitmap
// static BOOL WantNoPalette; // TRUE if palette switching not wanted
// static UINT32 WantBlitMode; // 0=auto, 1=Stretch, 2=SetDIB, 3=BitBlt
@@ -437,7 +437,7 @@
static INT32 WhichTransparency;
static INT32 ViewDither; // GDraw dither style used for Views
-// static BOOL CanDoGDraw; // TRUE if it is physically permitted
+ static BOOL CanDoGDraw; // TRUE if it is physically permitted
// GAT: Set if GDraw initialises OK.
static BOOL CanDoPalIndices; // TRUE if GDI does DIB_PAL_INDICES
static BOOL CanSetPalette; // TRUE if screen has palette support
@@ -628,7 +628,7 @@
Notes: Will be on a dialog somewhere eventually
********************************************************************************************/
-/*
+
class OpGDraw : public Operation
{
CC_DECLARE_DYNCREATE( OpGDraw )
@@ -643,7 +643,7 @@
};
#define OPTOKEN_GDRAW _T("GDrawToggle")
-*/
+
// We now always have CDraw (which pretends to be GDraw)
//#define REAL_GDRAW 1
Index: Trunk/XaraLX/wxOil/oilbitmap.cpp
===================================================================
--- Trunk/XaraLX/wxOil/oilbitmap.cpp (revision 1327)
+++ Trunk/XaraLX/wxOil/oilbitmap.cpp (revision 1328)
@@ -1757,14 +1757,14 @@
if (Renderable)
{
-PORTNOTE("printing", "Disabled printing")
-#ifndef EXCLUDE_FROM_XARALX
// WEBSTER-ranbirr-12/11/96
#ifndef WEBSTER
if (pRegion->IsPrinting())
{
#ifndef STANDALONE
+PORTNOTE("printing", "Disabled printing")
+#ifndef EXCLUDE_FROM_XARALX
// Get the print info for this job.
CCPrintInfo *pInfo = CCPrintInfo::GetCurrent();
if (pInfo != NULL)
@@ -1775,12 +1775,15 @@
UseLevel2 = TRUE;
}
#else
+ UseLevel2 = TRUE;
+#endif // EXCLUDE_FROM_XARALX
+
+#else
ERROR2(FALSE,"CWxBitmap::ExportBitmapData trying to print on Viewer version!");
#endif
}
else
#endif //webster
-#endif // EXCLUDE_FROM_XARALX
{
// Use the EPS preference.
if (EPSFilter::XSEPSExportPSType == 2)
@@ -2007,12 +2010,12 @@
if (Renderable)
{
-PORTNOTE("printing", "Disabled printing")
-#ifndef EXCLUDE_FROM_XARALX
// WEBSTER-ranbirr-12/11/96
#ifndef WEBSTER
if (pRegion->IsPrinting())
{
+PORTNOTE("printing", "Disabled printing")
+#ifndef EXCLUDE_FROM_XARALX
// Get the print info for this job.
CCPrintInfo *pInfo = CCPrintInfo::GetCurrent();
if (pInfo != NULL)
@@ -2020,10 +2023,13 @@
PrintControl *pPrCtrl = pInfo->GetPrintControl();
UseLevel2 = (pPrCtrl->GetPSLevel() == PSLEVEL_2);
}
+#else
+ UseLevel2 = TRUE;
+#endif
}
else
#endif //webster
-#endif
+
UseLevel2 = (EPSFilter::XSEPSExportPSType == 2); // Use the EPS preference.
}
Index: Trunk/XaraLX/wxOil/dragtrgt.cpp
===================================================================
--- Trunk/XaraLX/wxOil/dragtrgt.cpp (revision 1327)
+++ Trunk/XaraLX/wxOil/dragtrgt.cpp (revision 1328)
@@ -157,13 +157,10 @@
DragTarget::~DragTarget()
{
-// PORTNOTE("other", "Removed DragManagerOp usage")
-//#ifndef EXCLUDE_FROM_XARALX
// Just ensure that this target is not still registered with the manager
DragManagerOp *Mgr = DragManagerOp::GetCurrentManager();
if (Mgr != NULL)
Mgr->DeregisterTarget(this);
-//#endif
}
Index: Trunk/XaraLX/wxOil/grndprnt.cpp
===================================================================
--- Trunk/XaraLX/wxOil/grndprnt.cpp (revision 0)
+++ Trunk/XaraLX/wxOil/grndprnt.cpp (revision 1328)
@@ -0,0 +1,568 @@
+// $Id: wxOil/grndprnt.cpp, 1, 01-Jan-2006, Anonymous $
+/* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
+================================XARAHEADERSTART===========================
+
+ Xara LX, a vector drawing and manipulation program.
+ Copyright (C) 1993-2006 Xara Group Ltd.
+ Copyright on certain contributions may be held in joint with their
+ respective authors. See AUTHORS file for details.
+
+LICENSE TO USE AND MODIFY SOFTWARE
+----------------------------------
+
+This file is part of Xara LX.
+
+Xara LX is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License version 2 as published
+by the Free Software Foundation.
+
+Xara LX and its component source files are distributed in the hope
+that it will be useful, but WITHOUT ANY WARRANTY; without even the
+implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with Xara LX (see the file GPL in the root directory of the
+distribution); if not, write to the Free Software Foundation, Inc., 51
+Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+ADDITIONAL RIGHTS
+-----------------
+
+Conditional upon your continuing compliance with the GNU General Public
+License described above, Xara Group Ltd grants to you certain additional
+rights.
+
+The additional rights are to use, modify, and distribute the software
+together with the wxWidgets library, the wxXtra library, and the "CDraw"
+library and any other such library that any version of Xara LX relased
+by Xara Group Ltd requires in order to compile and execute, including
+the static linking of that library to XaraLX. In the case of the
+"CDraw" library, you may satisfy obligation under the GNU General Public
+License to provide source code by providing a binary copy of the library
+concerned and a copy of the license accompanying it.
+
+Nothing in this section restricts any of the rights you have under
+the GNU General Public License.
+
+
+SCOPE OF LICENSE
+----------------
+
+This license applies to this program (XaraLX) and its constituent source
+files only, and does not necessarily apply to other Xara products which may
+in part share the same code base, and are subject to their own licensing
+terms.
+
+This license does not apply to files in the wxXtra directory, which
+are built into a separate library, and are subject to the wxWindows
+license contained within that directory in the file "WXXTRA-LICENSE".
+
+This license does not apply to the binary libraries (if any) within
+the "libs" directory, which are subject to a separate license contained
+within that directory in the file "LIBS-LICENSE".
+
+
+ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
+----------------------------------------------
+
+Subject to the terms of the GNU Public License (see above), you are
+free to do whatever you like with your modifications. However, you may
+(at your option) wish contribute them to Xara's source tree. You can
+find details of how to do this at:
+ http://www.xaraxtreme.org/developers/
+
+Prior to contributing your modifications, you will need to complete our
+contributor agreement. This can be found at:
+ http://www.xaraxtreme.org/developers/contribute/
+
+Please note that Xara will not accept modifications which modify any of
+the text between the start and end of this header (marked
+XARAHEADERSTART and XARAHEADEREND).
+
+
+MARKS
+-----
+
+Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
+designs are registered or unregistered trademarks, design-marks, and/or
+service marks of Xara Group Ltd. All rights in these marks are reserved.
+
+
+ Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
+ http://www.xara.com/
+
+=================================XARAHEADEREND============================
+ */
+
+// A GDraw render region for printing.
+
+/*
+*/
+
+#include "camtypes.h"
+
+#include "grndprnt.h"
+
+#include "colcontx.h"
+#include "colplate.h"
+#include "dibutil.h"
+#include "fixmem.h"
+#include "osrndrgn.h"
+#include "view.h"
+#include "wbitmap.h"
+
+CC_IMPLEMENT_DYNAMIC(GRenderPrint, GRenderDIB)
+
+DECLARE_SOURCE("$Revision: 3 $");
+
+// This will get Camelot to display the filename and linenumber of any memory allocations
+// that are not released at program exit
+#define new CAM_DEBUG_NEW
+
+
+/********************************************************************************************
+
+> GRenderPrint::GRenderPrint(DocRect ClipRegion, Matrix ConvertMatrix, FIXED16 ViewScale,
+ UINT32 Depth, double dpi)
+
+ Author: Tim_Browse (Xara Group Ltd) <camelotdev@xxxxxxxx>
+ Created: 18/3/95
+ Inputs: -
+ Purpose: GRenderPrint constructor. Doesn't do anything actually, just calls base class.
+ INT32 dpi changed to double dpi (12/12/95) to improve the range of values allowed
+ at the < 1000dpi settings that we will be using.
+ SeeAlso: GRenderRegion::GRenderRegion
+
+********************************************************************************************/
+
+GRenderPrint::GRenderPrint(DocRect ClipRegion, Matrix ConvertMatrix, FIXED16 ViewScale,
+ UINT32 Depth, double dpi)
+ : GRenderDIB( ClipRegion, ConvertMatrix, ViewScale, Depth, dpi)
+{
+ // If nobody has found us a sensible colour context yet, we'll just go for a global
+ // default context
+ if (CurrentColContext == NULL)
+ CurrentColContext = ColourContext::GetGlobalDefault(COLOURMODEL_RGBT);
+
+ // We are printing
+ RenderFlags.Printing = TRUE;
+
+ // We have not poked about in the RenderView's ColourPlates (yet)
+ OldPlateDisabledState = FALSE;
+ HaveDisabledPlate = FALSE;
+
+ TRACEUSER( "Tim", _T("ClipRegion = (%ld, %ld), (%ld, %ld)
"),
+ ClipRegion.lo.x, ClipRegion.lo.y,
+ ClipRegion.hi.x, ClipRegion.hi.y);
+}
+
+
+
+/********************************************************************************************
+
+> virtual BOOL GRenderPrint::StartRender()
+
+ Author: Tim_Browse (Xara Group Ltd) <camelotdev@xxxxxxxx>
+ Created: 18/3/95
+ Returns: TRUE if worked, FALSE if failed
+
+ Purpose: Calls GRenderDIB::StartRender
+ Initialises the bitmap to white (0xff)
+ Disables colour separation (this is done as a post-process on the
+ final bitmap in DisplayBits())
+
+ SeeAlso: GRenderDIB::StartRender
+
+********************************************************************************************/
+
+BOOL GRenderPrint::StartRender()
+{
+ // call base class first
+ const BOOL ok = GRenderDIB::StartRender();
+ if (!ok)
+ return FALSE;
+
+ // we need a white background, which on non-palette devices (all we can cope
+ // with currently) is 0xFF a lot.
+ memset( lpBits, 0xFF, lpBitmapInfo->bmiHeader.biSizeImage );
+
+ // If we're colour separating then we want to DISABLE separations for the entire
+ // rendering-to-a-bitmap process, and we will then colour separate the resultant
+ // bitmap as it is output. We remember the previous ColourPlate disabled state
+ // so that we can restore it in StopRender (well, in DisplayBits() in fact)
+ ERROR3IF(RenderView != NULL && RenderView->GetColourPlate() != NULL &&
+ HaveDisabledPlate && !RenderView->GetColourPlate()->IsDisabled(),
+ "ColourPlate seems to have myseteriously become re-enabled in GRenderPrint");
+ if (!HaveDisabledPlate && RenderView != NULL && RenderView->GetColourPlate() != NULL)
+ {
+ // We must disable all colour plates for colour contexts attached to this view.
+ // We find all the currently cached contexts for this view, and disable their ColourPlates.
+ // These will be re-enabled in StopRender. Note that we assume that nobody outside this
+ // rendering loop will be disabling/enabling colour plates for specific contexts - they
+ // should be setting the state more globally by changing the View's ColourPlate.
+ // (We should be as well, with a proper access function in view to make this possible
+ // but I'm being a bit lazy here. If you're reading this and swearing right now, then
+ // I apologise for any incovenience caused)
+ for (INT32 i = 0; i < MAX_COLOURMODELS; i++)
+ {
+ ColourContext *Bob = RenderView->GetColourContext((ColourModel) i, TRUE);
+ if (Bob != NULL && Bob->GetColourPlate() != NULL)
+ Bob->GetColourPlate()->SetDisabled(TRUE);
+ }
+
+ // And poke the View's main ColourPlate (so that any new contexts created during
+ // rendering use the new state)
+ OldPlateDisabledState = RenderView->GetColourPlate()->IsDisabled();
+ RenderView->GetColourPlate()->SetDisabled(TRUE);
+
+ // Remember that we've poked at the ColourPlate so we can re-enable it in StopRender
+ HaveDisabledPlate = TRUE;
+ }
+
+ // done OK
+ return TRUE;
+}
+
+
+
+/********************************************************************************************
+
+> virtual BOOL GRenderPrint::StopRender()
+
+ Author: Jason_Williams (Xara Group Ltd) <camelotdev@xxxxxxxx>
+ Created: 8/7/96
+ Returns: TRUE if worked, FALSE if failed
+ Purpose: Stops rendering in this RR
+ Restores the ColourPlate separation options and calls GRenderDIB::StopRender
+ SeeAlso: GRenderDIB::StopRender
+
+********************************************************************************************/
+
+BOOL GRenderPrint::StopRender()
+{
+ // When colour separating we must restore the colour plate disabled state.
+ // We assume that all contexts attached to the view should be using the same state as the
+ // View's ColourPlate was, so we only store the one previous state for restoring from.
+ if (HaveDisabledPlate && RenderView != NULL && RenderView->GetColourPlate() != NULL)
+ {
+ for (INT32 i = 0; i < MAX_COLOURMODELS; i++)
+ {
+ ColourContext *Bob = RenderView->GetColourContext((ColourModel) i, TRUE);
+ if (Bob != NULL && Bob->GetColourPlate() != NULL)
+ Bob->GetColourPlate()->SetDisabled(OldPlateDisabledState);
+ }
+
+ // And restore the main View's ColourPlate
+ RenderView->GetColourPlate()->SetDisabled(OldPlateDisabledState);
+ OldPlateDisabledState = FALSE;
+ HaveDisabledPlate = FALSE;
+ }
+
+ // call base class *last*
+ return GRenderDIB::StopRender();
+}
+
+
+
+/********************************************************************************************
+
+> GRenderPrint::~GRenderPrint()
+
+ Author: Tim_Browse (Xara Group Ltd) <camelotdev@xxxxxxxx>
+ Created: 18/3/95
+ Purpose: GRenderPrint destructor. Frees up the bitmap.
+
+********************************************************************************************/
+
+GRenderPrint::~GRenderPrint()
+{
+ // we should NOT delete the CurrentColContext cos we didn't alloc it - we just
+ // got a pointer to something allocated by somebody else
+
+ // Free up the bitmap here, as the call to FreeLPBits in the
+ // GRenderDIB will not call the correct version (the virtual-ness will be
+ // broken as it is called from a destructor
+ if (lpBitmapInfo!=NULL)
+ {
+// FreeLPBits( lpBitmapInfo, lpBits );
+ FreeOffscreenState();
+ lpBitmapInfo = NULL;
+ lpBits = NULL;
+ }
+}
+
+
+
+/********************************************************************************************
+
+> BOOL GRenderPrint::InitDevice()
+
+ Author: Tim_Browse (Xara Group Ltd) <camelotdev@xxxxxxxx>
+ Created: 23/03/95
+ Returns: TRUE if initialised ok;
+ FALSE if not.
+ Purpose: Initialise the device specific mechanisms for this render region.
+ For a print region, it makes sure the StretchBlt mode is set up correctly
+ so we get half-toning.
+ Errors: Same as base class.
+ SeeAlso: RenderRegion::InitDevice; GRenderRegion::AttachDevice;
+ GRenderRegion::InitDevice
+
+********************************************************************************************/
+
+BOOL GRenderPrint::InitDevice()
+{
+ // Call the base class *first*
+ BOOL Worked = GRenderDIB::InitDevice();
+
+ if (!Worked)
+ return FALSE;
+
+ // if we don't do this, bitmaps printed at the same DPI as the printer come
+ // out completely crap on NT drivers
+ // Note: although this is claimed to be a Win32s-compatible function,
+ // GDI16 generates an error for it (invalid value 4)
+ // Note2: The MFC version of this function looks like the 16-bit API call,
+ // so we call the API directly here.
+ ::SetStretchBltMode(RenderDC->m_hDC, HALFTONE);
+
+ return TRUE;
+}
+
+
+
+/********************************************************************************************
+
+> BOOL GRenderPrint::DisplayBits(LPBITMAPINFO lpDisplayBitmapInfo = NULL, LPBYTE lpDisplayBits = NULL)
+
+ Author: Tim_Browse (Xara Group Ltd) <camelotdev@xxxxxxxx>
+ Created: 18/3/95
+ Returns: TRUE if worked, FALSE if failed.
+ Purpose: Output the bitmap in a printer-friendly way.
+
+********************************************************************************************/
+
+BOOL GRenderPrint::DisplayBits(LPBITMAPINFO lpDisplayBitmapInfo, LPBYTE lpDisplayBits)
+{
+ INT32 BitmapWidth = lpBitmapInfo->bmiHeader.biWidth;
+ INT32 BitmapHeight = lpBitmapInfo->bmiHeader.biHeight;
+
+ if (RenderView != NULL && RenderView->GetColourPlate() != NULL &&
+ !RenderView->GetColourPlate()->IsDisabled())
+ {
+ // We currently can't handle anything less than 8bpp bitmaps here, as we
+ // write the output data to our bitmap in 8bpp format.
+ ERROR2IF(BitmapDepth < 8, FALSE, "Unexpectedly low BPP in GRenderPrint::DisplayBits");
+
+ // We're colour separating. We must separate the entire bitmap down to
+ // an 8bpp greyscale format
+ WinBitmap Bitmap(lpBitmapInfo, lpBits);
+
+ // We are doing a colour separation - find the separation tables
+ BYTE *SepTables = NULL;
+ ColourContextCMYK *cc = (ColourContextCMYK *)RenderView->GetColourContext(COLOURMODEL_CMYK);
+ if (cc != NULL)
+ {
+ SepTables = (BYTE *) CCMalloc(5 * 256 * sizeof(BYTE));
+ if (SepTables != NULL)
+ {
+ if (!cc->GetProfileTables(SepTables))
+ {
+ CCFree(SepTables);
+ SepTables = NULL;
+ }
+ }
+ }
+ ERROR2IF(SepTables == NULL, FALSE, "Can't generate separation tables in GRenderPrint::DisplayBits");
+
+ ColourContext *OutputContext = RenderView->GetColourContext(COLOURMODEL_RGBT);
+ ERROR2IF(OutputContext == NULL, FALSE, "No RGB rendering ColourContext in GRenderPrint::DisplayBits");
+
+ // Get a temporary 32bpp scanline
+ const INT32 PixelWidth = Bitmap.GetWidth();
+ const INT32 PixelHeight = Bitmap.GetHeight();
+
+ const INT32 ByteWidth = DIBUtil::ScanlineSize(PixelWidth, 8); // Width of 8bit scanline including padding
+
+ Pixel32bpp *TempScanline = (Pixel32bpp *) CCMalloc(PixelWidth * sizeof(Pixel32bpp));
+ if (TempScanline == NULL)
+ {
+ ERROR3("No memory for temp scanline");
+ return(FALSE);
+ }
+
+ BYTE *pOutputBuffer = lpBits; // We'll overwrite our bitmap with the separated data
+ for (INT32 y = 0; y < PixelHeight; y++)
+ {
+ // Get this scanline as a 32bpp generic structure
+ Bitmap.GetScanline32bpp(y, TRUE, TempScanline);
+
+ Bitmap.ColourSeparateScanline32to8(OutputContext, SepTables, pOutputBuffer, TempScanline, PixelWidth);
+ pOutputBuffer += ByteWidth;
+ }
+
+ // Make sure that the new 8bpp bitmap has a greyscale palette on it - if it was not 8bpp,
+ // then we must realloc the header info to get enough room in it for a 256 colour palette.
+ if (lpBitmapInfo->bmiHeader.biBitCount != 8)
+ {
+ FreeDIB(lpBitmapInfo, NULL, NULL, FALSE); // Free the info (ONLY)
+ lpBitmapInfo = AllocDIB(PixelWidth, PixelHeight, 8, NULL, NULL, FALSE); // Realloc the info
+ }
+
+ // And fill in the palette to a greyscale
+ for (INT32 i = 0; i < 256; i++)
+ {
+ lpBitmapInfo->bmiColors[i].rgbRed =
+ lpBitmapInfo->bmiColors[i].rgbGreen =
+ lpBitmapInfo->bmiColors[i].rgbBlue = i;
+
+ lpBitmapInfo->bmiColors[i].rgbReserved = 0;
+ }
+
+ // Free our separation tables and temporary scanline
+ CCFree(SepTables);
+ CCFree(TempScanline);
+
+ // Finally, poke the WinBitmap we created so that it doesn't delete OUR
+ // bitmap info and bytes (which we only lent it) when it is deleted
+ Bitmap.BMInfo = NULL;
+ Bitmap.BMBytes = NULL;
+ }
+ else
+ {
+ // Not colour separating, but if it's a 32bpp bitmap, we need to convert to something
+ // that StretchDIBits (below) can understand
+ if (BitmapDepth == 32)
+ {
+ // Can't plot 32bpp bitmaps to GDI as 16-bit GDI doesn't understand them,
+ // so we convert to 24bpp bitmap in-situ and render that...
+
+ // How many bytes to a source scanline?
+ const INT32 ScanlineBytes = DIBUtil::ScanlineSize(BitmapWidth, BitmapDepth );
+
+ // How many bytes to a destination scanline
+ const INT32 DestlineBytes = DIBUtil::ScanlineSize(BitmapWidth, 24);
+
+ // Now convert the bitmap in-situ
+ LPBYTE OriginalBuffer = lpBits;
+ LPBYTE ConvertedBuffer = lpBits;
+
+ for (INT32 i = 0; i < BitmapHeight; i++)
+ {
+ DIBUtil::Convert32to24(BitmapWidth, OriginalBuffer, ConvertedBuffer);
+ OriginalBuffer += ScanlineBytes;
+ ConvertedBuffer += DestlineBytes;
+ }
+
+ // Update bitmap info to show it is now a 24bpp bitmap...
+ lpBitmapInfo->bmiHeader.biBitCount = 24;
+ lpBitmapInfo->bmiHeader.biSizeImage = DestlineBytes * BitmapHeight;
+ }
+ }
+
+ WinRect clip;
+ //RenderDC->GetClipBox(&clip);
+ clip = OSRenderRegion::DocRectToWin(RenderView, RenderMatrix, CurrentClipRect, 0, 0, 0, 0);
+
+ INT32 Scanlines = StretchDIBits(RenderDC->m_hDC,
+ clip.left, clip.top,
+ clip.Width(), clip.Height(),
+ 0, 0,
+ BitmapWidth, BitmapHeight,
+ lpBits,
+ lpBitmapInfo,
+ DIB_RGB_COLORS,
+ SRCCOPY);
+
+ ERROR3IF(Scanlines == GDI_ERROR, "No scanlines copied in GRenderPrint::DisplayBits()!");
+
+ return TRUE;
+}
+
+
+
+/********************************************************************************************
+
+> virtual BOOL GRenderPrint::SetFirstBand()
+
+ Author: Rik_Heywood (Xara Group Ltd) <camelotdev@xxxxxxxx>
+ Created: 5/5/95
+ Returns: TRUE
+ Purpose: Sets up for banded rendering. This class does not do banded rendering as yet.
+ This just sets things up to indicate that everything will be done in one band.
+
+********************************************************************************************/
+
+BOOL GRenderPrint::SetFirstBand()
+{
+ // No Banding needed
+ IsRegionBanded = FALSE;
+ IsWaitingForRAM = FALSE;
+ IsLastBand = TRUE;
+ return TRUE;
+}
+
+
+
+/********************************************************************************************
+
+> virtual BOOL GRenderPrint::GetNextBand()
+
+ Author: Rik_Heywood (Xara Group Ltd) <camelotdev@xxxxxxxx>
+ Created: 5/5/95
+ Returns: FALSE
+ Purpose: Since this class does not do banded rendering, there are never any more bands
+
+********************************************************************************************/
+
+BOOL GRenderPrint::GetNextBand()
+{
+ // No banding
+ return FALSE;
+}
+
+
+
+/********************************************************************************************
+
+> LPBITMAPINFO GRenderPrint::GetLPBits( INT32 Width, INT32 Height, INT32 Depth, LPBYTE*)
+
+ Author: Rik_Heywood (Xara Group Ltd) <camelotdev@xxxxxxxx>
+ Created: 5/5/95
+ Inputs: Width, Height - the width and height of the required bitmap
+ Depth - the bpp of the bitmap
+ Returns: Pointer to a bitmap header block
+ Purpose: Allocates a bitmap from the CCMalloc heap
+
+********************************************************************************************/
+
+LPBITMAPINFO GRenderPrint::GetLPBits( INT32 Width, INT32 Height, INT32 Depth, LPBYTE* lplpBits)
+{
+ // Get a DIB out of the CCMalloc heap
+ LPBITMAPINFO bmInfo = NULL;
+ bmInfo = AllocDIB( Width, Height, Depth, lplpBits, NULL, FALSE);
+
+ // return it.
+ return bmInfo;
+}
+
+
+
+
+/********************************************************************************************
+
+> void GRenderPrint::FreeLPBits( LPBITMAPINFO, LPBYTE )
+
+ Author: Rik_Heywood (Xara Group Ltd) <camelotdev@xxxxxxxx>
+ Created: 5/5/95
+ Purpose: Frees the memory allocated in GetLPBits.
+
+********************************************************************************************/
+
+void GRenderPrint::FreeLPBits( LPBITMAPINFO lpBMI, LPBYTE lpB )
+{
+ // Free up the memory. Not from Limited Heap
+ FreeDIB(lpBMI, lpB, NULL, FALSE);
+}
Index: Trunk/XaraLX/wxOil/grndrgn.cpp
===================================================================
--- Trunk/XaraLX/wxOil/grndrgn.cpp (revision 1327)
+++ Trunk/XaraLX/wxOil/grndrgn.cpp (revision 1328)
@@ -200,7 +200,7 @@
// Declare all the classes in this file and ask for memory tracking
CC_IMPLEMENT_DYNAMIC( GRenderRegion, RenderRegion )
-//CC_IMPLEMENT_DYNCREATE(OpGDraw, Operation)
+CC_IMPLEMENT_DYNCREATE(OpGDraw, Operation)
#define new CAM_DEBUG_NEW
@@ -218,7 +218,7 @@
#endif
-//BOOL GRenderRegion::WantDoGDraw = TRUE; // TRUE if user wants it
+BOOL GRenderRegion::WantDoGDraw = TRUE; // TRUE if user wants it
UINT32 GRenderRegion::WantGDrawDepth; // desired depth of off-screen bitmap
//BOOL GRenderRegion::WantNoPalette; // TRUE if palette switching not wanted
//UINT32 GRenderRegion::WantBlitMode; // 0=auto, 1=Streth, 2=SetDIB, 3=BitBlt, 4=BadDDB
@@ -227,7 +227,7 @@
//BOOL GRenderRegion::WantWinG; // TRUE for WinG rendering
INT32 GRenderRegion::WhichTransparency = 0; // type of transparency
-//BOOL GRenderRegion::CanDoGDraw; // TRUE if it is physically permitted
+BOOL GRenderRegion::CanDoGDraw; // TRUE if it is physically permitted
//BOOL GRenderRegion::CanDoPalIndices; // TRUE if GDI does DIB_PAL_INDICES
//BOOL GRenderRegion::CanSetPalette; // TRUE if screen has palette support
//BOOL GRenderRegion::CanDoDeepDIBs; // TRUE if understands 16- and 32-bpp DIBs
@@ -522,11 +522,11 @@
if (bFirstTime)
{
-// CanDoGDraw = FALSE;
+ CanDoGDraw = FALSE;
if (Camelot.DeclareSection( _T("DebugFlags"), 20))
{
-// Camelot.DeclarePref( NULL, "UseGdraw", &WantDoGDraw, FALSE, TRUE );
+ Camelot.DeclarePref( NULL, _T("UseGdraw"), &WantDoGDraw, FALSE, TRUE );
Camelot.DeclarePref( NULL, _T("GDrawDepth"), &WantGDrawDepth, 0, 32 );
// Camelot.DeclarePref( NULL, "DontUsePalette", &WantNoPalette, FALSE, TRUE );
// Camelot.DeclarePref( NULL, "BlitMode", &WantBlitMode, 0, 4 );
@@ -585,7 +585,7 @@
if (!pRealGD->Init()) // checks version etc
{
GDrawImpossible = TRUE;
-// CanDoGDraw = FALSE;
+ CanDoGDraw = FALSE;
Error::SetError( _R(IDW_BADGDRAW), NULL, 0 );
InformWarning(); // tell the user his DLL is wrong
Error::ClearError(); // else we won't start up
@@ -646,7 +646,7 @@
)
)
{
-// CanDoGDraw = TRUE;
+ CanDoGDraw = TRUE;
/*
// DIB_PAL_INDICES is not available on Win32s or Chicago
// or on 256 colour fixed palette devices
@@ -750,8 +750,6 @@
// if (WantWinG)
// GRenderWinG::Init( bFirstTime );
-PORTNOTE("other","GRenderRegion::Init - Removed OpGDraw registration")
-#ifndef EXCLUDE_FROM_XARALX
if (!Operation::RegisterOpDescriptor(
0,
_R(IDS_GDRAW),
@@ -763,7 +761,6 @@
0 // bitmap ID
))
return FALSE;
-#endif
if (!GBrush::InitGBrush( bFirstTime ))
return FALSE;
@@ -3642,8 +3639,6 @@
// --- Add Separation Style bits as approriate to the current colour separation mode
// Currently, the only "separation" option we use is composite print preview
// SepStyle for the SetBitmapFill functions are always in the MS byte of Style
-PORTNOTE("other","GRenderRegion::RenderBitmapFill - removed separation code")
-#ifndef EXCLUDE_FROM_XARALX
if (bpp > 8) // Only needed for deep bitmaps
{
// If we've got a valid colour plate and it is a composite preview
@@ -3655,6 +3650,8 @@
{
// Find the colour manager (if there is one), and ask it for the 15-bit RGB
// printer colour matching lookup table
+PORTNOTE("cms", "DisabledXaraCMS")
+#ifndef EXCLUDE_FROM_XARALX
XaraCMS* lpCMSMan = GetApplication()->GetCMSManager();
if (lpCMSMan != NULL)
{
@@ -3675,6 +3672,7 @@
// BitmapBits = WinBM->BMBytes; // And make sure we update this
}
}
+#endif
}
else if (CurrentColContext->GetColourPlate()->GetType() == COLOURPLATE_SPOT)
{
@@ -3686,10 +3684,13 @@
pSepTables = (BYTE *) CCMalloc(5 * 256 * sizeof(BYTE));
if (pSepTables != NULL)
{
+ String_256 PrintProfile;
+PORTNOTE("cms", "DisabledXaraCMS")
+#ifndef EXCLUDE_FROM_XARALX
XaraCMS* lpCMSMan = GetApplication()->GetCMSManager();
- String_256 PrintProfile;
if (lpCMSMan)
lpCMSMan->GetPrinterProfile(&PrintProfile);
+#endif
ColourContextCMYK *cc = new ColourContextCMYK(RenderView, &PrintProfile);
if (cc->GetProfileTables(pSepTables))
{
@@ -3704,7 +3705,7 @@
}
}
}
-#endif
+
BOOL Result = FALSE; // function working correctly
if (bDoBitmapFill)
@@ -4768,8 +4769,7 @@
// --- Add Separation Style bits as approriate to the current colour separation mode
// Currently, the only "separation" option we use is composite print preview
// SepStyle for the SetBitmapFill functions are always in the MS byte of Style
-PORTNOTE("other","GRenderRegion::DrawBitmap - removed separation code")
-#ifndef EXCLUDE_FROM_XARALX
+
if (WinBM->GetBPP() > 8) // Only needed for deep bitmaps
{
// If we've got a valid colour plate and it is a composite preview
@@ -4779,6 +4779,8 @@
{
// Find the colour manager (if there is one), and ask it for the 15-bit RGB
// printer colour matching lookup table
+PORTNOTE("cms", "DisabledXaraCMS")
+#ifndef EXCLUDE_FROM_XARALX
XaraCMS* lpCMSMan = GetApplication()->GetCMSManager();
if (lpCMSMan != NULL)
{
@@ -4793,9 +4795,10 @@
Style |= (BitmapConversion & 3) << 27;
}
}
+#endif
}
}
-#endif
+
BYTE *BitmapBits = WinBM->BMBytes;
// Plot the Bitmap
@@ -4879,8 +4882,6 @@
// --- Add Separation Style bits as approriate to the current colour separation mode
// Currently, the only "separation" option we use is composite print preview
// SepStyle for the SetBitmapFill functions are always in the MS byte of Style
-PORTNOTE("other","GRenderRegion::DrawBitmap - removed separation code")
-#ifndef EXCLUDE_FROM_XARALX
if (WinBM->GetBPP() > 8) // Only needed for deep bitmaps
{
// If we've got a valid colour plate and it is a composite preview
@@ -4890,6 +4891,8 @@
{
// Find the colour manager (if there is one), and ask it for the 15-bit RGB
// printer colour matching lookup table
+PORTNOTE("cms", "DisabledXaraCMS")
+#ifndef EXCLUDE_FROM_XARALX
XaraCMS* lpCMSMan = GetApplication()->GetCMSManager();
if (lpCMSMan != NULL)
{
@@ -4904,9 +4907,9 @@
Style |= (BitmapConversion & 3) << 27;
}
}
+#endif
}
}
-#endif
BYTE *BitmapBits = WinBM->BMBytes;
// Plot the Bitmap
@@ -5751,8 +5754,8 @@
RenderRegion* GRenderRegion::Create(DocRect ClipRegion, Matrix ConvertMatrix, FIXED16 ViewScale,
RenderType rType, View* pView, BOOL bForce32BPP)
{
-// if (CanDoGDraw && WantDoGDraw)
-// {
+ if (CanDoGDraw && WantDoGDraw)
+ {
if (rType==RENDERTYPE_SCREEN)
{
PORTNOTE("other","We no longer handle less than 32bit per pixel")
@@ -5807,8 +5810,6 @@
// Now check for separated rendering and alter the RRCaps of the new region
// to simulate a printing render region
-PORTNOTE("other","GRenderRegion::Create - removed separation code")
-#ifndef EXCLUDE_FROM_XARALX
if (pView->GetColourPlate() != NULL && !pView->GetColourPlate()->IsDisabled())
{
ColourPlateType PlateType = pView->GetColourPlate()->GetType();
@@ -5816,6 +5817,8 @@
{
// First try to set this view to using a printing colour context
// so the separations appear the same on screen as on the printer
+PORTNOTE("cms", "DisabledXaraCMS")
+#ifndef EXCLUDE_FROM_XARALX
XaraCMS* ptheCMS=GetApplication()->GetCMSManager();
if (ptheCMS != NULL)
{
@@ -5825,13 +5828,17 @@
if (pContext)
pView->SetColourContext(COLOURMODEL_CMYK, pContext);
}
-
+#endif
// Now check what sort of printer we have to get the RenderRegion Caps correct
+PORTNOTE("printing", "Assume postscript")
+#ifndef EXCLUDE_FROM_XARALX
UINT32 PrintType = CCPrintDialog::IsPostscript() ? 2 : 1;
+#else
+ UINT32 PrintType = 2;
+#endif
pRegion->SetSimulatePrinting(PrintType);
}
}
-#endif
}
// return the region pointer
@@ -5839,8 +5846,8 @@
}
else if ((rType==RENDERTYPE_PRINTER) || (rType==RENDERTYPE_PRINTER_PS))
{
-PORTNOTE("other","GRenderRegion::Create - removed separation code")
-#if !defined(STANDALONE) && !defined(EXCLUDE_FROM_XARALX) // GAT
+PORTNOTE("printing", "Disabled GRenderPrint")
+#ifndef EXCLUDE_FROM_XARALX
// Always use 24 bit for printers, which means 32bit because Gavin can't do
// 24-bit bitmaps.
UINT32 BitmapDepth = 32;
@@ -5863,10 +5870,11 @@
return new GRenderPrint(ClipRegion, ConvertMatrix, ViewScale,
BitmapDepth, PrintDPI);
#else
+ ERROR3("Can't create a GRenderPrint because we haven't ported it yet");
return NULL;
#endif
}
-// }
+ }
return NULL;
}
@@ -6772,8 +6780,8 @@
BOOL GRenderRegion::StrokePathAvailable()
{
-// return CanDoGDraw;
- return TRUE;
+ return CanDoGDraw;
+// return TRUE;
}
/********************************************************************************************
@@ -6819,8 +6827,8 @@
JointType LineJoin,
CONST DashType *Dash)
{
-// if (!CanDoGDraw)
-// return -1;
+ if (!CanDoGDraw)
+ return -1;
CapStyles CapS = (LineCaps==LineCapButt) ? CAPS_BUTT : (LineCaps==LineCapRound) ? CAPS_ROUND : CAPS_SQUARE;
JoinStyles JoinS = (LineJoin==MitreJoin) ? JOIN_MITER : (LineJoin==RoundJoin) ? JOIN_ROUND : JOIN_BEVEL;
@@ -7446,8 +7454,6 @@
// --- Add Separation Style bits as approriate to the current colour separation mode
// Currently, the only "separation" option we use is composite print preview
// SepStyle for the SetBitmapFill functions are always in the MS byte of Style
-PORTNOTE("other","GRenderRegion::DrawMaskedBitmap - removed separation code")
-#ifndef EXCLUDE_FROM_XARALX
if (WinBM->GetBPP() > 8) // Only needed for deep bitmaps
{
// If we've got a valid colour plate and it is a composite preview
@@ -7458,6 +7464,8 @@
{
// Find the colour manager (if there is one), and ask it for the 15-bit RGB
// printer colour matching lookup table
+PORTNOTE("cms", "Disabled XaraCMS")
+#ifndef EXCLUDE_FROM_XARALX
XaraCMS* lpCMSMan = GetApplication()->GetCMSManager();
if (lpCMSMan != NULL)
{
@@ -7472,6 +7480,7 @@
Style |= (BitmapConversion & 3) << 19;
}
}
+#endif
}
else if (RenderView->GetColourPlate()->GetType() == COLOURPLATE_SPOT)
{
@@ -7479,14 +7488,17 @@
}
else if (RenderView->GetColourPlate()->GetType() != COLOURPLATE_NONE)
{
- DWORD Plate = RenderView->GetColourPlate()->GetType() - COLOURPLATE_CYAN;
+// DWORD Plate = RenderView->GetColourPlate()->GetType() - COLOURPLATE_CYAN;
pSepTables = (BYTE *) CCMalloc(5 * 256 * sizeof(BYTE));
if (pSepTables != NULL)
{
+ String_256 PrintProfile;
+PORTNOTE("cms", "Disabled XaraCMS")
+#ifndef EXCLUDE_FROM_XARALX
XaraCMS* lpCMSMan = GetApplication()->GetCMSManager();
- String_256 PrintProfile;
if (lpCMSMan)
lpCMSMan->GetPrinterProfile(&PrintProfile);
+#endif
ColourContextCMYK *cc = new ColourContextCMYK(RenderView, &PrintProfile);
if (cc->GetProfileTables(pSepTables))
{
@@ -7497,7 +7509,7 @@
}
}
}
-#endif
+
if (bForceToWhite)
{
// First we need to set all the pixels as transparent white
@@ -8984,7 +8996,7 @@
Errors: None
*******************************************************************/
-/*
+
void OpGDraw::Do(OpDescriptor*)
{
GRenderRegion::WantDoGDraw ^= TRUE;
@@ -8999,7 +9011,6 @@
End();
}
-*/
/*******************************************************************
@@ -9015,11 +9026,10 @@
Errors: None
*******************************************************************/
-/*
+
OpGDraw::OpGDraw()
{
}
-*/
/*******************************************************************
@@ -9035,7 +9045,7 @@
Errors: None
*******************************************************************/
-/*
+
OpState OpGDraw::GetState(String_256*, OpDescriptor*)
{
OpState OpSt;
@@ -9051,4 +9061,3 @@
return OpSt;
}
-*/
Xara