[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : gerry
Repository : xara
Revision   : 1453
Date       : Mon Jul 17 12:45:05 BST 2006

Changed paths:
   M /Trunk/XaraLX/Kernel/xpfcaps.h
   M /Trunk/XaraLX/Kernel/xpfilter.cpp
   M /Trunk/XaraLX/Kernel/xpfilter.h
   M /Trunk/XaraLX/wxOil/xpoilflt.cpp

Added support for Options/thumbnail attribute and fixed bug in boundslevel parsing


Diff:
Index: Trunk/XaraLX/Kernel/xpfilter.h
===================================================================
--- Trunk/XaraLX/Kernel/xpfilter.h	(revision 1452)
+++ Trunk/XaraLX/Kernel/xpfilter.h	(revision 1453)
@@ -220,6 +220,7 @@
 
 	UINT32 m_ProgressOffset;
 	BOOL m_bSaveXPEBitmaps;
+	BOOL m_bPreviewBitmap;
 
 	BoundsWriteLevel m_BoundsLevel;
 	INT32 m_BitmapCompression;
Index: Trunk/XaraLX/Kernel/xpfcaps.h
===================================================================
--- Trunk/XaraLX/Kernel/xpfcaps.h	(revision 1452)
+++ Trunk/XaraLX/Kernel/xpfcaps.h	(revision 1453)
@@ -1029,6 +1029,7 @@
 		// Set some sensible defaults (these will result in no conversions at all)
 		m_BoundsLevel = BWL_NONE;
 		m_bSelection = FALSE;
+		m_bPreviewBitmap = FALSE;
 		m_RasteriseDPI = 96.0;
 		m_bRasteriseAlpha = TRUE;
 		m_BitmapCompression = 200;
@@ -1077,6 +1078,7 @@
 
 	void SetSelection(BOOL bSelection) { m_bSelection = bSelection; }
 	void SetBoundsLevel(BoundsWriteLevel Level) { m_BoundsLevel = Level; }
+	void SetPreviewBitmap(BOOL bPreviewBitmap) { m_bPreviewBitmap = bPreviewBitmap; }
 	
 	void SetSpreadType(XPFConvertType Type) { m_SpreadType = Type; }
 
@@ -1111,6 +1113,7 @@
 
 	BOOL GetSelection() { return(m_bSelection); }
 	BoundsWriteLevel GetBoundsLevel() { return(m_BoundsLevel); }
+	BOOL GetPreviewBitmap() { return(m_bPreviewBitmap); }
 
 	double GetRasteriseDPI() { return(m_RasteriseDPI); }
 	BOOL GetRasteriseAlpha() { return(m_bRasteriseAlpha); }
@@ -1131,6 +1134,7 @@
 protected:
 	BoundsWriteLevel m_BoundsLevel;
 	BOOL m_bSelection;
+	BOOL m_bPreviewBitmap;
 
 	double m_RasteriseDPI;
 	BOOL m_bRasteriseAlpha;
Index: Trunk/XaraLX/Kernel/xpfilter.cpp
===================================================================
--- Trunk/XaraLX/Kernel/xpfilter.cpp	(revision 1452)
+++ Trunk/XaraLX/Kernel/xpfilter.cpp	(revision 1453)
@@ -140,6 +140,7 @@
 	m_pNewTree = NULL;
 	m_ProgressOffset = 0;
 	m_bSaveXPEBitmaps = TRUE;	// For now we will default this to saving out the bitmaps
+	m_bPreviewBitmap = FALSE;
 	m_BoundsLevel = BWL_NONE;
 	m_BitmapCompression = 200;      // Default to full PNG quality
 	m_BitmapCount = 0;
@@ -386,6 +387,9 @@
 	// Update our bitmap compression setting
 	m_BitmapCompression = PlugCaps.GetBitmapCompression();
 
+	// Update the preview bitmap setting
+	m_bPreviewBitmap = PlugCaps.GetPreviewBitmap();
+
 	KernelBitmap::SetCreateTracker(&m_BitmapList);
 
 	// Convert the document according to the capabilites
@@ -790,9 +794,7 @@
 BOOL PluginNativeFilter::GetPreviewBitmapExport()
 {
 	// Return TRUE if the plugin wants a preview bitmap and FALSE otherwise
-
-	// For now I'll just return FALSE
-	return FALSE;
+	return m_bPreviewBitmap;
 }
 
 /********************************************************************************************
Index: Trunk/XaraLX/wxOil/xpoilflt.cpp
===================================================================
--- Trunk/XaraLX/wxOil/xpoilflt.cpp	(revision 1452)
+++ Trunk/XaraLX/wxOil/xpoilflt.cpp	(revision 1453)
@@ -699,7 +699,7 @@
 	xmlNodePtr pChild = node->children;
 	INT32 Phase =0;
 
-	// There are 5 phases to the parsing
+	// There are 7 phases to the parsing
 	// We will loop round until we run out of child elements
 	// After parsing a node the phase counter will be set to the phase just parsed
 	// If an element should have already been parsed (using the phase counter)
@@ -807,7 +807,7 @@
 	{
 		Level = BWL_ALL;
 	}
-	else
+	else if (strLevel != _T(""))
 	{
 		ERROR1(FALSE, _R(IDE_XPF_BADXML_OPTIONS_BOUNDSLEVEL));
 	}
@@ -820,6 +820,12 @@
 
 	pCapTree->SetSelection(bSelection);
 
+	BOOL bPreviewBitmap = FALSE;
+	wxString strPreviewBitmap = CXMLUtils::ConvertToWXString(xmlGetProp(pNode, (xmlChar*)"thumbnail"));
+	bPreviewBitmap = (strPreviewBitmap == _T("true"));
+
+	pCapTree->SetPreviewBitmap(bPreviewBitmap);
+
 	return TRUE;
 }
 


Xara