r16729 by fschmid - Initial commit of a popper based pdf importer. This importer needs at least poppler-0.17.1 to work.

scribus-commit scribus-commit at lists.scribus.net
Fri Jul 29 09:02:48 UTC 2011


Author: fschmid
Date: Fri Jul 29 09:02:47 2011
New Revision: 16729

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16729
Log:
Initial commit of a popper based pdf importer. This importer needs at least poppler-0.17.1 to work.
+ fixes for pattern export in pdf and pdf

Added:
    trunk/Scribus/scribus/plugins/import/pdf/
    trunk/Scribus/scribus/plugins/import/pdf/CMakeLists.txt
    trunk/Scribus/scribus/plugins/import/pdf/importpdf.cpp
    trunk/Scribus/scribus/plugins/import/pdf/importpdf.h
    trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp
    trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.h
    trunk/Scribus/scribus/plugins/import/pdf/slaoutput.cpp
    trunk/Scribus/scribus/plugins/import/pdf/slaoutput.h
    trunk/Scribus/scribus/scpage.cpp
      - copied, changed from r16728, trunk/Scribus/scribus/page.cpp
    trunk/Scribus/scribus/scpage.h
      - copied, changed from r16728, trunk/Scribus/scribus/page.h
    trunk/Scribus/scribus/ui/sclistwidgetdelegate.cpp
    trunk/Scribus/scribus/ui/sclistwidgetdelegate.h
Removed:
    trunk/Scribus/scribus/page.cpp
    trunk/Scribus/scribus/page.h
Modified:
    trunk/Scribus/CMakeLists.txt
    trunk/Scribus/config.h.cmake
    trunk/Scribus/scribus/CMakeLists.txt
    trunk/Scribus/scribus/canvas.cpp
    trunk/Scribus/scribus/canvas.h
    trunk/Scribus/scribus/canvasgesture_rulermove.cpp
    trunk/Scribus/scribus/canvasmode_nodeedit.cpp
    trunk/Scribus/scribus/canvasmode_normal.cpp
    trunk/Scribus/scribus/documentchecker.cpp
    trunk/Scribus/scribus/fileloader.cpp
    trunk/Scribus/scribus/fonts/scfontmetrics.cpp
    trunk/Scribus/scribus/guidemanagercore.cpp
    trunk/Scribus/scribus/guidemanagercore.h
    trunk/Scribus/scribus/mesh.cpp
    trunk/Scribus/scribus/mesh.h
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/pageitem.h
    trunk/Scribus/scribus/pageitem_arc.cpp
    trunk/Scribus/scribus/pageitem_group.cpp
    trunk/Scribus/scribus/pageitem_imageframe.cpp
    trunk/Scribus/scribus/pageitem_line.cpp
    trunk/Scribus/scribus/pageitem_pathtext.cpp
    trunk/Scribus/scribus/pageitem_polygon.cpp
    trunk/Scribus/scribus/pageitem_polyline.cpp
    trunk/Scribus/scribus/pageitem_regularpolygon.cpp
    trunk/Scribus/scribus/pageitem_spiral.cpp
    trunk/Scribus/scribus/pageitem_symbol.cpp
    trunk/Scribus/scribus/pageitem_textframe.cpp
    trunk/Scribus/scribus/pdflib_core.cpp
    trunk/Scribus/scribus/pdflib_core.h
    trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
    trunk/Scribus/scribus/plugins/import/CMakeLists.txt
    trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
    trunk/Scribus/scribus/plugins/import/cgm/importcgmplugin.cpp
    trunk/Scribus/scribus/plugins/import/cvg/importcvgplugin.cpp
    trunk/Scribus/scribus/plugins/import/drw/importdrwplugin.cpp
    trunk/Scribus/scribus/plugins/import/idml/importidmlimpl.cpp
    trunk/Scribus/scribus/plugins/import/pct/importpctplugin.cpp
    trunk/Scribus/scribus/plugins/import/ps/importpsplugin.cpp
    trunk/Scribus/scribus/plugins/import/shape/importshapeplugin.cpp
    trunk/Scribus/scribus/plugins/import/sml/importsmlplugin.cpp
    trunk/Scribus/scribus/plugins/import/wpg/importwpgplugin.cpp
    trunk/Scribus/scribus/plugins/import/xar/importxarplugin.cpp
    trunk/Scribus/scribus/plugins/import/xfig/importxfigplugin.cpp
    trunk/Scribus/scribus/plugins/pixmapexport/export.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/cmdutil.cpp
    trunk/Scribus/scribus/plugins/scriptplugin/objimageexport.cpp
    trunk/Scribus/scribus/plugins/short-words/parse.cpp
    trunk/Scribus/scribus/plugins/short-words/shortwords.cpp
    trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
    trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.h
    trunk/Scribus/scribus/pslib.cpp
    trunk/Scribus/scribus/pslib.h
    trunk/Scribus/scribus/scdocoutput.cpp
    trunk/Scribus/scribus/scdocoutput.h
    trunk/Scribus/scribus/scdocoutput_ps2.cpp
    trunk/Scribus/scribus/scdocoutput_ps2.h
    trunk/Scribus/scribus/scpageoutput.cpp
    trunk/Scribus/scribus/scpageoutput.h
    trunk/Scribus/scribus/scpageoutput_ps2.cpp
    trunk/Scribus/scribus/scpageoutput_ps2.h
    trunk/Scribus/scribus/scpainter.cpp
    trunk/Scribus/scribus/scpainter.h
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribus.h
    trunk/Scribus/scribus/scribusXml.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h
    trunk/Scribus/scribus/scribusview.cpp
    trunk/Scribus/scribus/scribusview.h
    trunk/Scribus/scribus/tocgenerator.cpp
    trunk/Scribus/scribus/ui/aligndistribute.cpp
    trunk/Scribus/scribus/ui/annot.cpp
    trunk/Scribus/scribus/ui/annot.h
    trunk/Scribus/scribus/ui/applytemplatedialog.cpp
    trunk/Scribus/scribus/ui/applytemplatedialog.h
    trunk/Scribus/scribus/ui/checkDocument.cpp
    trunk/Scribus/scribus/ui/colorlistbox.cpp
    trunk/Scribus/scribus/ui/colorpalette.ui
    trunk/Scribus/scribus/ui/cpalette.cpp
    trunk/Scribus/scribus/ui/dcolor.cpp
    trunk/Scribus/scribus/ui/effectsdialog.cpp
    trunk/Scribus/scribus/ui/fontcombo.cpp
    trunk/Scribus/scribus/ui/guidemanager.cpp
    trunk/Scribus/scribus/ui/guidemanager.h
    trunk/Scribus/scribus/ui/hruler.cpp
    trunk/Scribus/scribus/ui/inspage.cpp
    trunk/Scribus/scribus/ui/javadocs.cpp
    trunk/Scribus/scribus/ui/margindialog.cpp
    trunk/Scribus/scribus/ui/masterpagepalette.cpp
    trunk/Scribus/scribus/ui/missing.cpp
    trunk/Scribus/scribus/ui/multiprogressdialog.cpp
    trunk/Scribus/scribus/ui/multiprogressdialog.h
    trunk/Scribus/scribus/ui/newtemp.cpp
    trunk/Scribus/scribus/ui/nodeeditpalette.cpp
    trunk/Scribus/scribus/ui/outlinepalette.cpp
    trunk/Scribus/scribus/ui/outlinepalette.h
    trunk/Scribus/scribus/ui/pagepalette.cpp
    trunk/Scribus/scribus/ui/prefs_tableofcontents.cpp
    trunk/Scribus/scribus/ui/preview.cpp
    trunk/Scribus/scribus/ui/propertiespalette.cpp
    trunk/Scribus/scribus/ui/propertiespalette.h
    trunk/Scribus/scribus/ui/propertiespalette_utils.h
    trunk/Scribus/scribus/ui/search.cpp
    trunk/Scribus/scribus/ui/spalette.cpp
    trunk/Scribus/scribus/ui/symbolpalette.cpp
    trunk/Scribus/scribus/ui/symbolpalette.h
    trunk/Scribus/scribus/ui/vruler.cpp
    trunk/Scribus/scribus/undostate.h
    trunk/Scribus/scribus/vgradient.h
    trunk/Scribus/scribus/vgradientex.h

Modified: trunk/Scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/CMakeLists.txt (original)
+++ trunk/Scribus/CMakeLists.txt Fri Jul 29 09:02:47 2011
@@ -660,6 +660,10 @@
 
 #<<LittleCMS
 SET(LCMS_DIR ${CMAKE_MODULE_PATH})
+  FIND_PACKAGE(LCMS)
+  IF(LCMS_FOUND)
+    SET(HAVE_LCMS1 1)
+  ENDIF(LCMS_FOUND)
 FIND_PACKAGE(LCMS2)
 IF(LCMS2_FOUND)
   SET(HAVE_LCMS2 1)
@@ -670,6 +674,7 @@
   FIND_PACKAGE(LCMS REQUIRED)
   IF(LCMS_FOUND)
     SET(HAVE_CMS 1)
+    SET(HAVE_LCMS1 1)
     SET(CMS_INC "\"lcms.h\"")
     MESSAGE("LittleCMS Library Found OK")
   ELSE(LCMS_FOUND)
@@ -745,6 +750,23 @@
   MESSAGE("Building without GraphicksMagick (use -DWANT_GRAPHICSMAGICK=1 to enable)")
 ENDIF (WANT_GRAPHICSMAGICK)
 #>>GraphicksMagick for image import
+
+#<<Poppler for PDF import
+FIND_PACKAGE(POPPLER)
+IF (POPPLER_FOUND)
+	IF (FREETYPE_FOUND)
+		SET( HAVE_POPPLER 1 )
+		MESSAGE(STATUS "Found poppler")
+		MESSAGE(STATUS "Found poppler libs: ${POPPLER_LIBRARY}")
+		MESSAGE(STATUS "Found poppler includes: ${POPPLER_INCLUDE_DIR}")
+	ELSE (FREETYPE_FOUND)
+		MESSAGE("Poppler NOT found - Disabling support for native PDF import")
+	ENDIF (FREETYPE_FOUND)
+ELSE (POPPLER_FOUND)
+	MESSAGE("Poppler NOT found - Disabling support for native PDF import")
+ENDIF (POPPLER_FOUND)
+#>>Poppler for PDF import
+
 
 ##############################################################################################################
 ########## Include Setup                                                                            ##########
@@ -803,6 +825,7 @@
   ${OPENGL_INCLUDE_DIR}
   ${OSG_INCLUDE_DIR}
   ${GSL_INCLUDE_DIR}
+  ${POPPLER_INCLUDE_DIR}
 )
 
 ##############################################################################################################

Modified: trunk/Scribus/config.h.cmake
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/config.h.cmake
==============================================================================
--- trunk/Scribus/config.h.cmake (original)
+++ trunk/Scribus/config.h.cmake Fri Jul 29 09:02:47 2011
@@ -27,6 +27,7 @@
 #cmakedefine HAVE_LIBZ 1
 #cmakedefine HAVE_FONTCONFIG 1
 #cmakedefine HAVE_PODOFO 1
+#cmakedefine HAVE_POPPLER 1
 #cmakedefine HAVE_OSG 1
 #cmakedefine HAVE_BOOST 1
 #cmakedefine HAVE_SINCOS

Modified: trunk/Scribus/scribus/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/CMakeLists.txt (original)
+++ trunk/Scribus/scribus/CMakeLists.txt Fri Jul 29 09:02:47 2011
@@ -17,7 +17,6 @@
   ADD_SUBDIRECTORY(designer)
 ENDIF (WANT_DESIGNER)
 ADD_SUBDIRECTORY(third_party)
-
 
 IF(HAVE_OSG)
   SET(SCRIBUS_OSG_UI_SRC
@@ -373,6 +372,7 @@
   ui/scdockpalette.h
   ui/scfilewidget.h
   ui/scinputdialog.h
+  ui/sclistwidgetdelegate.h
   ui/scmenu.h
   ui/scmessagebox.h
   ui/scrapbookpalette.h
@@ -510,7 +510,6 @@
   nftrcreader.cpp
   nftsettings.cpp
   nfttemplate.cpp
-  page.cpp
   pageitem.cpp
   pageitem_arc.cpp
   pageitem_group.cpp
@@ -572,6 +571,7 @@
   sclayer.cpp
   sclockedfile.cpp
   scmimedata.cpp
+  scpage.cpp
   scpageoutput.cpp
   scpageoutput_ps2.cpp
   scpainter.cpp
@@ -770,6 +770,7 @@
   ui/scdockpalette.cpp
   ui/scfilewidget.cpp
   ui/scinputdialog.cpp
+  ui/sclistwidgetdelegate.cpp
   ui/scmenu.cpp
   ui/scmessagebox.cpp
   ui/scrapbookpalette.cpp

Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp (original)
+++ trunk/Scribus/scribus/canvas.cpp Fri Jul 29 09:02:47 2011
@@ -23,7 +23,7 @@
 
 #include "canvas.h"
 #include "canvasmode.h"
-#include "page.h"
+#include "scpage.h"
 #include "pageitem_textframe.h"
 #include "pageitem_group.h"
 #include "prefsmanager.h"
@@ -416,7 +416,7 @@
 	// look for masterpage items first
 	if (allowMasterItems && !m_doc->masterPageMode() && m_doc->currentPage()->FromMaster.count() != 0)
 	{
-		Page* Mp = m_doc->MasterPages.at(m_doc->MasterNames[m_doc->currentPage()->MPageNam]);
+		ScPage* Mp = m_doc->MasterPages.at(m_doc->MasterNames[m_doc->currentPage()->MPageNam]);
 		// if itemAbove is given, we expect to find it among the masterpage items of this page
 		int currNr = itemAbove? m_doc->currentPage()->FromMaster.indexOf(itemAbove)-1 : m_doc->currentPage()->FromMaster.count()-1;
 		if (currNr < 0)
@@ -1305,7 +1305,7 @@
 /**
   draws masterpage items of a specific layer
  */
-void Canvas::DrawMasterItems(ScPainter *painter, Page *page, ScLayer& layer, QRect clip)
+void Canvas::DrawMasterItems(ScPainter *painter, ScPage *page, ScLayer& layer, QRect clip)
 {
 	if ((m_viewMode.previewMode) && (!layer.isPrintable))
 		return;
@@ -1323,7 +1323,7 @@
 							  qRound(clip.width() / m_viewMode.scale + 0.5), qRound(clip.height() / m_viewMode.scale + 0.5));
 
 	PageItem *currItem;
-	Page* Mp = m_doc->MasterPages.at(m_doc->MasterNames[page->MPageNam]);
+	ScPage* Mp = m_doc->MasterPages.at(m_doc->MasterNames[page->MPageNam]);
 	uint layerCount = m_doc->layerCount();
 	if ((layerCount > 1) && ((layer.blendMode != 0) || (layer.transparency != 1.0)) && (!layer.outlineMode))
 		painter->beginLayer(layer.transparency, layer.blendMode);
@@ -1622,7 +1622,7 @@
 		painter->setAntialiasing(false);
 //		painter->beginLayer(1.0, 0);
 		painter->setPen(Qt::black, 1.0 / m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
-		Page *actPg;
+		ScPage *actPg;
 		MarginStruct pageBleeds;
 		for (int a = 0; a < static_cast<int>(docPagesCount); ++a)
 		{
@@ -1663,7 +1663,7 @@
 		painter->setAntialiasing(true);
 	}
 	painter->setFillMode(ScPainter::Solid);
-	Page *actPg;
+	ScPage *actPg;
 	MarginStruct pageBleeds;
 	for (int a = 0; a < static_cast<int>(docPagesCount); ++a)
 	{
@@ -1721,7 +1721,7 @@
 	PoLine->resize(0);
 	uint docPagesCount=m_doc->Pages->count();
 	bool first = true;
-	Page *actPg;
+	ScPage *actPg;
 	for (int a = 0; a < static_cast<int>(docPagesCount); ++a)
 	{
 		if (!first)
@@ -1747,7 +1747,7 @@
 void Canvas::drawGuides(ScPainter* painter, int clipx, int clipy, int clipw, int cliph)
 {
 	uint docPagesCount=m_doc->Pages->count();
-	Page *actPg;
+	ScPage *actPg;
 	for (uint a = 0; a < docPagesCount; ++a)
 	{
 		actPg = m_doc->Pages->at(a);
@@ -1766,7 +1766,7 @@
 /**
   draws guides, margins, grid and baseline grid
  */
-void Canvas::DrawPageMarks(ScPainter *p, Page *page, QRect clip)
+void Canvas::DrawPageMarks(ScPainter *p, ScPage *page, QRect clip)
 {
 	p->save();
 	p->setAntialiasing(false);

Modified: trunk/Scribus/scribus/canvas.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/canvas.h
==============================================================================
--- trunk/Scribus/scribus/canvas.h (original)
+++ trunk/Scribus/scribus/canvas.h Fri Jul 29 09:02:47 2011
@@ -38,7 +38,7 @@
 #include "pageitempointer.h"
 
 
-class Page;
+class ScPage;
 class PageItem;
 class ScLayer;
 class ScPainter;
@@ -187,7 +187,7 @@
 	int previewVisual() const { return m_viewMode.previewVisual; }
 	void setPreviewVisual(int mode);
 	
-	void DrawMasterItems(ScPainter *painter, Page *page, ScLayer& layer, QRect clip);
+	void DrawMasterItems(ScPainter *painter, ScPage *page, ScLayer& layer, QRect clip);
 	void DrawPageItems(ScPainter *painter, ScLayer& layer, QRect clip);
 	virtual void paintEvent ( QPaintEvent * p );
 	void displayXYHUD(QPoint m);
@@ -201,7 +201,7 @@
 	void setupEditHRuler(PageItem * item, bool forceAndReset = false);
 	
 private:
-	void DrawPageMarks(ScPainter *p, Page* page, QRect clip);
+	void DrawPageMarks(ScPainter *p, ScPage* page, QRect clip);
 	void drawLinkFrameLine(ScPainter* painter, FPoint &start, FPoint &end);
 	void PaintSizeRect(QRect neu);
 	void PaintSizeRect(QPolygon neu);

Modified: trunk/Scribus/scribus/canvasgesture_rulermove.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/canvasgesture_rulermove.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_rulermove.cpp (original)
+++ trunk/Scribus/scribus/canvasgesture_rulermove.cpp Fri Jul 29 09:02:47 2011
@@ -27,7 +27,7 @@
 
 void RulerGesture::drawControls(QPainter* p)
 {
-	Page* page = m_doc->currentPage();
+	ScPage* page = m_doc->currentPage();
 	if (m_haveGuide)
 		page = m_doc->Pages->at(m_page);
 	QColor color(m_doc->guidesPrefs().guideColor);

Modified: trunk/Scribus/scribus/canvasmode_nodeedit.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/canvasmode_nodeedit.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_nodeedit.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_nodeedit.cpp Fri Jul 29 09:02:47 2011
@@ -574,7 +574,7 @@
 		double xposOrig = currItem->xPos();
 		double yposOrig = currItem->yPos();
 
-		ItemState<QPair<FPointArray, FPointArray> > *state = NULL;
+		ScItemState<QPair<FPointArray, FPointArray> > *state = NULL;
 		
 		state = m_doc->nodeEdit.finishTransaction1(currItem);
 		xposOrig = currItem->xPos();

Modified: trunk/Scribus/scribus/canvasmode_normal.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/canvasmode_normal.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_normal.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_normal.cpp Fri Jul 29 09:02:47 2011
@@ -1,1373 +1,1373 @@
-/*
- For general Scribus (>=1.3.2) copyright and licensing information please refer
- to the COPYING file provided with the program. Following this notice may exist
- a copyright and/or license notice that predates the release of Scribus 1.3.2
- for which a new license (GPL+exception) is in place.
- */
-/***************************************************************************
-*                                                                         *
-*   This program is free software; you can redistribute it and/or modify  *
-*   it under the terms of the GNU General Public License as published by  *
-*   the Free Software Foundation; either version 2 of the License, or     *
-*   (at your option) any later version.                                   *
-*                                                                         *
-***************************************************************************/
-
-
-#include "canvasmode_normal.h"
-
-#include <QApplication>
-#include <QButtonGroup>
-#include <QCheckBox>
-#include <QCursor>
-#include <QEvent>
-#include <QMessageBox>
-#include <QMouseEvent>
-#include <QPainterPath>
-#include <QPoint>
-#include <QRect>
-#include <QTimer>
-#include <QWidgetAction>
-#include <QDebug>
-
-#include "canvas.h"
-#include "canvasgesture_linemove.h"
-#include "canvasgesture_resize.h"
-#include "canvasgesture_rulermove.h"
-#include "fileloader.h"
-#include "fpoint.h"
-#include "fpointarray.h"
-#include "hyphenator.h"
-#include "loadsaveplugin.h"
-#include "pageitem_textframe.h"
-#include "pageitem_regularpolygon.h"
-#include "pageitem_arc.h"
-#include "prefscontext.h"
-#include "prefsfile.h"
-#include "prefsmanager.h"
-#include "scmimedata.h"
-#include "scribus.h"
-#include "scribusdoc.h"
-#include "scribusview.h"
-#include "scribusXml.h"
-#include "selection.h"
-#include "undomanager.h"
-#include "util.h"
-#include "util_icon.h"
-#include "util_math.h"
-#include "ui/aligndistribute.h"
-#include "ui/contextmenu.h"
-#include "ui/customfdialog.h"
-#include "ui/insertTable.h"
-#include "ui/pageselector.h"
-#include "ui/polyprops.h"
-#include "ui/propertiespalette.h"
-#include "ui/propertiespalette_line.h"
-#include "ui/propertiespalette_text.h"
-#include "plugins/formatidlist.h"
-
-
-
-CanvasMode_Normal::CanvasMode_Normal(ScribusView* view) : CanvasMode(view), m_ScMW(view->m_ScMW) 
-{
-	frameResizeHandle = -1;
-	shiftSelItems = false;
-	resizeGesture = NULL;
-	lineMoveGesture  = NULL;
-	guideMoveGesture = NULL;
-	m_mousePressPoint.setXY(0, 0);
-	m_mouseCurrentPoint.setXY(0, 0);
-	m_mouseSavedPoint.setXY(0, 0);
-	m_objectDeltaPos.setXY(0,0 );
-}
-
-inline bool CanvasMode_Normal::GetItem(PageItem** pi)
-{ 
-	*pi = m_doc->m_Selection->itemAt(0); 
-	return (*pi) != NULL; 
-}
-
-void CanvasMode_Normal::drawControls(QPainter* p)
-{
-//	qDebug() << "CanvasMode_Normal::drawControls";
-	if (m_canvas->m_viewMode.operItemMoving)
-	{
-		drawOutline(p, 1.0, 1.0, m_objectDeltaPos.x(), m_objectDeltaPos.y());
-	}
-	else
-	{
-		drawSelection(p, true);
-	}
-}
-
-void CanvasMode_Normal::enterEvent(QEvent *)
-{
-	if (!m_canvas->m_viewMode.m_MouseButtonPressed)
-	{
-		setModeCursor();
-	}
-}
-
-void CanvasMode_Normal::leaveEvent(QEvent *e)
-{
-	if (!m_canvas->m_viewMode.m_MouseButtonPressed)
-	{
-		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
-	}
-}
-
-
-void CanvasMode_Normal::activate(bool fromGesture)
-{
-//	qDebug() << "CanvasMode_Normal::activate" << fromGesture;
-	m_canvas->m_viewMode.m_MouseButtonPressed = false;
-	m_canvas->resetRenderMode();
-	m_doc->DragP = false;
-	m_doc->leaveDrag = false;
-	m_canvas->m_viewMode.operItemMoving = false;
-	m_canvas->m_viewMode.operItemResizing = false;
-	m_view->MidButt = false;
-	m_mousePressPoint.setXY(0, 0);
-	m_mouseCurrentPoint.setXY(0, 0);
-	m_mouseSavedPoint.setXY(0, 0);
-	m_objectDeltaPos.setXY(0,0 );
-	frameResizeHandle = -1;
-	shiftSelItems = false;
-	setModeCursor();
-	if (fromGesture)
-	{
-		m_view->update();
-	}
-}
-
-void CanvasMode_Normal::deactivate(bool forGesture)
-{
-//	qDebug() << "CanvasMode_Normal::deactivate" << forGesture;
-	m_view->redrawMarker->hide();
-}
-
-void CanvasMode_Normal::mouseDoubleClickEvent(QMouseEvent *m)
-{
-	m->accept();
-	m_canvas->m_viewMode.m_MouseButtonPressed = false;
-	m_canvas->resetRenderMode();
-//	m_view->stopDragTimer();
-	PageItem *currItem = 0;
-	if (m_doc->m_Selection->isMultipleSelection())
-	{
-		if (GetItem(&currItem))
-		{
-			/* CB: old code, removing this as shift-alt select on an unselected table selects a cell now.
-			//#6789 is closed by sorting this.
-			if (currItem->isTableItem)
-			{
-				m_view->Deselect(false);
-				m_doc->m_Selection->addItem(currItem);
-				currItem->isSingleSel = true;
-				//CB FIXME dont call this if the added item is item 0
-				if (!m_doc->m_Selection->primarySelectionIs(currItem))
-					currItem->emitAllToGUI();
-				m_view->updateContents(currItem->getRedrawBounding(m_canvas->scale()));
-			}*/
-		}
-		return;
-	}
-	if (GetItem(&currItem))
-	{
-		if (currItem->asLatexFrame()) 
-		{
-			if (currItem->locked()) // || (!currItem->ScaleType))
-			{
-				return;
-			}
-			if (currItem->imageShown())
-				m_view->requestMode(modeEdit);
-		}
-#ifdef HAVE_OSG
-		else if (currItem->asOSGFrame())
-		{
-			m_view->requestMode(submodeEditExternal);
-		}
-#endif
-		else if ((currItem->itemType() == PageItem::Polygon) || (currItem->itemType() == PageItem::PolyLine) || (currItem->itemType() == PageItem::Group) || (currItem->itemType() == PageItem::ImageFrame) || (currItem->itemType() == PageItem::PathText))
-		{
-			if (currItem->locked()) //|| (!currItem->ScaleType))
-			{
-				//mousePressEvent(m);
-				return;
-			}
-			//If we double click on an image frame and theres no image assigned, open the
-			//load picture dialog, else put it into edit mode if the frame is set to show the image
-			if (currItem->itemType() == PageItem::ImageFrame)
-			{
-				if (currItem->Pfile.isEmpty())
-					m_view->requestMode(submodeLoadPic);
-				else if (!currItem->PictureIsAvailable)
-					m_view->requestMode(submodeStatusPic);
-				else if (currItem->imageShown())
-					m_view->requestMode(modeEdit);
- 			}
- 			else if (currItem->itemType() == PageItem::TextFrame)
-			{
- 				m_view->requestMode(modeEdit);
-			}
-			else
-				m_view->requestMode(modeEditClip);
-		}
-		else if (currItem->itemType() == PageItem::TextFrame)
-		{
-			//CB old code
-			//emit currItem->isAnnotation() ? AnnotProps() : Amode(modeEdit);
-			//mousePressEvent(m);
-			//CB if annotation, open the annotation dialog
-			if (currItem->isAnnotation())
-			{
-				qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
-				m_view->requestMode(submodeAnnotProps);
-				//mousePressEvent(m);
-			}
-			//else if not in mode edit, set mode edit
-			else if (m_doc->appMode != modeEdit)
-			{
-				m_view->requestMode(modeEdit);
-				m_view->slotSetCurs(m->globalPos().x(), m->globalPos().y());
-				//CB ignore the double click and go with a single one
-				//if we werent in mode edit before.
-				//unsure if this is correct, but its ok given we had no
-				//double click select until now.
-//				mousePressEvent(m);
-			}
-		}
-		else if (currItem->asSymbolFrame())
-		{
-			if (!m_doc->symbolEditMode())
-				m_view->requestMode(submodeEditSymbol);
-		}
-		else if (currItem->asArc())
-		{
-			m_view->requestMode(modeEditArc);
-		}
-		else if (currItem->asRegularPolygon())
-		{
-			m_view->requestMode(modeEditPolygon);
-		}
-		else if (currItem->asSpiral())
-		{
-			m_view->requestMode(modeEditSpiral);
-		}
-	}
-}
-
-
-void CanvasMode_Normal::mouseMoveEvent(QMouseEvent *m)
-{
-// 	qDebug()<<"CanvasMode_Normal::mouseMoveEvent";
-// 	const double mouseX = m->globalX();
-// 	const double mouseY = m->globalY();
-	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
-	
-	m_lastPosWasOverGuide = false;
-	double newX, newY;
-	PageItem *currItem;
-	bool erf = false;
-	m->accept();
-//	qDebug() << "legacy mode move:" << m->x() << m->y() << m_canvas->globalToCanvas(m->globalPos()).x() << m_canvas->globalToCanvas(m->globalPos()).y();
-//	emit MousePos(m->x()/m_canvas->scale(),// + m_doc->minCanvasCoordinate.x(), 
-//				  m->y()/m_canvas->scale()); // + m_doc->minCanvasCoordinate.y());
-
-	if (commonMouseMove(m))
-		return;
-	m_mouseCurrentPoint = mousePointDoc;
-	bool movingOrResizing = (m_canvas->m_viewMode.operItemMoving || m_canvas->m_viewMode.operItemResizing);
-	bool mouseIsOnPage    = (m_doc->OnPage(mousePointDoc.x(), mousePointDoc.y()) != -1);
-	if ((m_doc->guidesPrefs().guidesShown) && (!m_doc->GuideLock) && (!movingOrResizing) && (mouseIsOnPage) )
-	{
-		// #9002: Resize points undraggable when object is aligned to a guide
-		// Allow item resize when guides are aligned to item while preserving
-		// ability to drag guide when guis is in foreground and inside selection
-		bool enableGuideGesture(false);
-		Canvas::FrameHandle frameResizeHandle(Canvas::OUTSIDE);
-		if (m_doc->m_Selection->count() > 0)
-		{
-			double gx(0.0), gy(0.0), gw(0.0), gh(0.0);
-			m_doc->m_Selection->setGroupRect();
-			m_doc->m_Selection->getVisualGroupRect(&gx, &gy, &gw, &gh);
-			frameResizeHandle = m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), QRectF(gx, gy, gw, gh));
-		}
-		enableGuideGesture |= (frameResizeHandle == Canvas::OUTSIDE);
-		enableGuideGesture |= ((!m_doc->guidesPrefs().guidePlacement) && (frameResizeHandle == Canvas::INSIDE));
-		if (enableGuideGesture)
-		{
-			if (!guideMoveGesture)
-			{
-				guideMoveGesture = new RulerGesture(m_view, RulerGesture::HORIZONTAL);
-				connect(guideMoveGesture,SIGNAL(guideInfo(int, qreal)), m_ScMW->alignDistributePalette,SLOT(setGuide(int, qreal)));
-			}
-			if (guideMoveGesture->mouseHitsGuide(mousePointDoc))
-			{
-				m_lastPosWasOverGuide = true;
-				switch (guideMoveGesture->getMode())
-				{
-					case RulerGesture::HORIZONTAL:
-						qApp->changeOverrideCursor(QCursor(Qt::SplitVCursor));
-						break;
-					case RulerGesture::VERTICAL:
-						qApp->changeOverrideCursor(QCursor(Qt::SplitHCursor));
-						break;
-					default:
-						qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
-				}
-				return;
-			}
-			// Here removed a bunch of comments which made reading code difficult,
-			// there is svn for tracking changes after all. pm
-			qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
-		}
-	}
-	else if (!mouseIsOnPage)
-	{
-		QCursor* cursor = qApp->overrideCursor();
-		if (cursor && ((cursor->shape() == Qt::SplitHCursor) || (cursor->shape() == Qt::SplitVCursor)))
-		{
-			qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
-		}
-	}
-	if ((GetItem(&currItem)) && (!shiftSelItems))
-	{
-		newX = qRound(mousePointDoc.x()); //m_view->translateToDoc(m->x(), m->y()).x());
-		newY = qRound(mousePointDoc.y()); //m_view->translateToDoc(m->x(), m->y()).y());
-		// #0007865
-		if (/*(((m_view->dragTimerElapsed()) && (m->buttons() & Qt::LeftButton)) ||*/
-			(m_view->moveTimerElapsed())
-			&& (m->buttons() & Qt::RightButton)
-			&& (m_canvas->m_viewMode.m_MouseButtonPressed)
-			&& (!m_doc->DragP)  
-			&& (!(currItem->isSingleSel)))
-		{
-			// start drag
-//			m_view->stopDragTimer();
-			if ((fabs(m_mousePressPoint.x() - newX) > 10) || (fabs(m_mousePressPoint.y() - newY) > 10))
-			{
-				m_canvas->setRenderMode(Canvas::RENDER_NORMAL);
-//				m_view->resetDragTimer();
-				m_doc->DragP = true;
-				m_doc->leaveDrag = false;
-				m_doc->DraggedElem = currItem;
-				m_doc->DragElements.clear();
-				for (int dre=0; dre<m_doc->m_Selection->count(); ++dre)
-					m_doc->DragElements.append(m_doc->m_Selection->itemAt(dre)->ItemNr);
-				ScriXmlDoc *ss = new ScriXmlDoc();
-				ScElemMimeData* md = new ScElemMimeData();
-				md->setScribusElem(ss->WriteElem(m_doc, m_doc->m_Selection));
-				delete ss;
-				ss = NULL;
-				QDrag* dr = new QDrag(m_view);
-				dr->setMimeData(md);
-				const QPixmap& pm = loadIcon("DragPix.xpm");
-				dr->setPixmap(pm);
-			//	dr->setDragCursor(pm, Qt::CopyAction);
-			//	dr->setDragCursor(pm, Qt::MoveAction);
-			//	dr->setDragCursor(pm, Qt::LinkAction);
-				dr->exec();
-				m_doc->DragP = false;
-				m_doc->leaveDrag = false;
-				m_canvas->m_viewMode.m_MouseButtonPressed = false;
-				m_doc->DraggedElem = 0;
-				m_doc->DragElements.clear();
-				qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
-				m_view->updateContents();
-			}
-			return;
-		}
-		if (m_doc->DragP)
-			return;
-		//Operations run here:
-		//Item resize, esp after creating a new one
-		if (m_view->moveTimerElapsed() && m_canvas->m_viewMode.m_MouseButtonPressed && (m->buttons() & Qt::LeftButton) && 
-			((m_doc->appMode == modeNormal)) && (!currItem->locked()))
-		{
-//			m_view->stopDragTimer();
-			if (!m_canvas->m_viewMode.operItemResizing)
-			{
-				//Dragging an item (plus more?)
-				QRectF newPlace;
-				newX = mousePointDoc.x(); //static_cast<int>(m->x()/sc);
-				newY = mousePointDoc.y(); //static_cast<int>(m->y()/sc);
-				m_canvas->m_viewMode.operItemMoving = true;
-				qApp->changeOverrideCursor(Qt::ClosedHandCursor);
-				erf = false;
-				int dX = qRound(newX - m_mousePressPoint.x()), dY = qRound(newY - m_mousePressPoint.y());
-				if (!m_doc->m_Selection->isMultipleSelection())
-				{
-					erf=true;
-					currItem = m_doc->m_Selection->itemAt(0);
-					//Control Alt drag image in frame without being in edit mode
-					if ((currItem->asImageFrame()) && (m->modifiers() & Qt::ControlModifier) && (m->modifiers() & Qt::AltModifier))
-					{
-						currItem->moveImageInFrame(dX/currItem->imageXScale(),dY/currItem->imageYScale());
-						m_view->updateContents(currItem->getRedrawBounding(m_canvas->scale()));
-					}
-					else
-					{
-						//Dragging orthogonally - Ctrl Drag
-						if ((m->modifiers() & Qt::ControlModifier) && !(m->modifiers() & Qt::ShiftModifier) && !(m->modifiers() & Qt::AltModifier))
-						{
-							if (abs(dX) > abs(dY))
-								dY=0;
-							else
-							if (abs(dY) > abs(dX))
-								dX=0;
-							erf=false;
-							dX+=qRound(dragConstrainInitPtX-currItem->xPos());
-							dY+=qRound(dragConstrainInitPtY-currItem->yPos());
-						}
-						if (!(currItem->isTableItem && currItem->isSingleSel))
-						{
-							double gx, gy, gh, gw;
-							m_objectDeltaPos.setXY(dX, dY);
-							m_doc->m_Selection->setGroupRect();
-							m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-							if (m_doc->SnapGuides)
-							{
-								double nx = gx + m_objectDeltaPos.x();
-								double ny = gy + m_objectDeltaPos.y();
-								double nxo = nx, nyo = ny;
-								m_doc->ApplyGuides(&nx, &ny);
-								m_objectDeltaPos += FPoint(nx - nxo, ny - nyo);
-								nx = nxo = gx + gw + m_objectDeltaPos.x();
-								ny = nyo = gy + gh + m_objectDeltaPos.y();
-								m_doc->ApplyGuides(&nx, &ny);
-								m_objectDeltaPos += FPoint(nx-nxo, ny-nyo);
-							}
-							if (m_doc->useRaster)
-							{
-								m_doc->m_Selection->setGroupRect();
-								double gx, gy, gh, gw, gxo, gyo;
-								m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-								gx += m_objectDeltaPos.x();
-								gy += m_objectDeltaPos.y();
-								gxo = gx;
-								gyo = gy;
-								FPoint npx = m_doc->ApplyGridF(FPoint(gx, gy));
-								FPoint npw = m_doc->ApplyGridF(FPoint(gx+gw, gy+gh));
-								if ((fabs(gx-npx.x())) > (fabs((gx+gw)-npw.x())))
-									gx = npw.x() - gw;
-								else
-									gx = npx.x();
-								if ((fabs(gy-npx.y())) > (fabs((gy+gh)-npw.y())))
-									gy = npw.y() - gh;
-								else
-									gy = npx.y();
-								if ((fabs(gx - gxo) < (m_doc->guidesPrefs().guideRad) / m_canvas->scale()) && (fabs(gy - gyo) < (m_doc->guidesPrefs().guideRad) / m_canvas->scale()))
-									m_objectDeltaPos += FPoint(gx-gxo, gy-gyo);
-							}
-						}
-					}
-				}
-				else
-				{
-					double gx, gy, gh, gw;
-					m_doc->m_Selection->setGroupRect();
-					m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-					int dX=qRound(newX - m_mousePressPoint.x()), dY=qRound(newY - m_mousePressPoint.y());
-					erf = true;
-					if (m->modifiers() & Qt::ControlModifier)
-					{
-						if (abs(dX)>abs(dY))
-							dY=0;
-						else
-						if (abs(dY)>abs(dX))
-							dX=0;
-						erf=false;
-						dX+=dragConstrainInitPtX-qRound(gx);
-						dY+=dragConstrainInitPtY-qRound(gy);
-					}
-					m_objectDeltaPos.setXY(dX, dY);
-					if (m_doc->SnapGuides)
-					{
-						m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-						double nx = gx + m_objectDeltaPos.x();
-						double ny = gy + m_objectDeltaPos.y();
-						double nxo = nx, nyo = ny;
-						m_doc->ApplyGuides(&nx, &ny);
-						m_objectDeltaPos += FPoint(nx-nxo, ny-nyo);
-						nx = nxo = gx + gw + m_objectDeltaPos.x();
-						ny = nyo = gy + gh + m_objectDeltaPos.y();
-						m_doc->ApplyGuides(&nx, &ny);
-						m_objectDeltaPos += FPoint(nx-nxo, ny-nyo);
-					}
-					if (m_doc->useRaster)
-					{
-						double gx, gy, gh, gw, gxo, gyo;
-						m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-						gx += m_objectDeltaPos.x();
-						gy += m_objectDeltaPos.y();
-						gxo = gx;
-						gyo = gy;
-						FPoint npx = m_doc->ApplyGridF(FPoint(gx, gy));
-						FPoint npw = m_doc->ApplyGridF(FPoint(gx+gw, gy+gh));
-						if ((fabs(gx-npx.x())) > (fabs((gx+gw)-npw.x())))
-							gx = npw.x() - gw;
-						else
-							gx = npx.x();
-						if ((fabs(gy-npx.y())) > (fabs((gy+gh)-npw.y())))
-							gy = npw.y() - gh;
-						else
-							gy = npx.y();
-						if ((fabs(gx - gxo) < (m_doc->guidesPrefs().guideRad) / m_canvas->scale()) && (fabs(gy - gyo) < (m_doc->guidesPrefs().guideRad) / m_canvas->scale()))
-							m_objectDeltaPos += FPoint(gx-gxo, gy-gyo);
-					}
-				}
-				if (erf)
-				{
-					m_mouseCurrentPoint.setXY(newX, newY);
-				}
-				
-				{
-					double gx, gy, gh, gw;
-					m_doc->m_Selection->getVisualGroupRect(&gx, &gy, &gw, &gh);
-					m_doc->adjustCanvas(FPoint(gx,gy), FPoint(gx+gw, gy+gh));
-					QPoint selectionCenter = m_canvas->canvasToLocal(QPointF(gx+gw/2, gy+gh/2));
-					QPoint localMousePos = m_canvas->canvasToLocal(mousePointDoc);
-					int localwidth = static_cast<int>(gw * m_canvas->scale());
-					int localheight = static_cast<int>(gh * m_canvas->scale());
-					if (localwidth > 200)
-					{
-						localwidth = 0;
-						selectionCenter.setX(localMousePos.x());
-					}
-					if (localheight > 200)
-					{
-						localheight = 0;
-						selectionCenter.setY(localMousePos.y());
-					}
-					m_view->ensureVisible(selectionCenter.x(), selectionCenter.y(), localwidth/2 + 20, localheight/2 + 20);
-					m_canvas->repaint();
-					m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-					m_canvas->displayCorrectedXYHUD(m->globalPos(), gx + m_objectDeltaPos.x(), gy + m_objectDeltaPos.y());
-				}
-			}
-		}
-		if ((!m_canvas->m_viewMode.m_MouseButtonPressed) && (m_doc->appMode != modeDrawBezierLine))
-		{
-			if (m_doc->m_Selection->isMultipleSelection())
-			{
-//				QRect mpo = QRect(qRound(m->x()/m_canvas->scale())-m_doc->guidesPrefs().grabRad, qRound(m->y()/m_canvas->scale())-m_doc->guidesPrefs().grabRad, m_doc->guidesPrefs().grabRad*2, m_doc->guidesPrefs().grabRad*2);
-//				mpo.moveBy(qRound(m_doc->minCanvasCoordinate.x()), qRound(m_doc->minCanvasCoordinate.y()));
-				double gx, gy, gh, gw;
-				m_doc->m_Selection->getVisualGroupRect(&gx, &gy, &gw, &gh);
-				int how = m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), QRectF(gx, gy, gw, gh));
-//				if ((QRect(static_cast<int>(gx), static_cast<int>(gy), static_cast<int>(gw), static_cast<int>(gh)).intersects(mpo))
-				if (how >= 0)
-				{
-					if (how > 0)
-					{
-						setResizeCursor(how);
-					}
-					else
-					{
-						qApp->changeOverrideCursor(QCursor(Qt::OpenHandCursor));
-					}
-				}
-				else
-				{
-					setModeCursor();
-				}
-				return;
-			}
-			for (int a = 0; a < m_doc->m_Selection->count(); ++a)
-			{
-				currItem = m_doc->m_Selection->itemAt(a);
-				if (currItem->locked())
-					break;
-				QTransform p;
-				m_canvas->Transform(currItem, p);
-				QRect mpo = QRect(m->x()-m_doc->guidesPrefs().grabRadius, m->y()-m_doc->guidesPrefs().grabRadius, m_doc->guidesPrefs().grabRadius*2, m_doc->guidesPrefs().grabRadius*2);
-//				mpo.moveBy(qRound(m_doc->minCanvasCoordinate.x() * m_canvas->scale()), qRound(m_doc->minCanvasCoordinate.y() * m_canvas->scale()));
-				if ((QRegion(p.map(QPolygon(QRect(-3, -3, static_cast<int>(currItem->width()+6), static_cast<int>(currItem->height()+6))))).contains(mpo)))
-				{
-					QRect tx = p.mapRect(QRect(0, 0, static_cast<int>(currItem->width()), static_cast<int>(currItem->height())));
-					if ((tx.intersects(mpo)) && (!currItem->locked()))
-					{
-						qApp->changeOverrideCursor(QCursor(Qt::OpenHandCursor));
-						if (!currItem->sizeLocked())
-							m_view->HandleCurs(currItem, mpo);
-					}
-				}
-				else
-				{
-//					setModeCursor();
-				}
-			}
-			if (GetItem(&currItem) && m_doc->appMode == modeNormal)
-			{
-				int how = m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), currItem);
-				if (how > 0)
-				{
-					if(currItem->asLine())
-						qApp->changeOverrideCursor(QCursor(Qt::SizeAllCursor));
-					else if(!currItem->locked() && !currItem->sizeLocked())
-						setResizeCursor(how, currItem->rotation());
-				}
-				else if (how == 0)
-					qApp->changeOverrideCursor(QCursor(Qt::OpenHandCursor));
-				else
-				{
-					qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
-				}
-			}
-		}
-	}
-	else
-	{
-		if ((m_canvas->m_viewMode.m_MouseButtonPressed) && (m->buttons() & Qt::LeftButton))
-		{
-			newX = qRound(mousePointDoc.x()); //m_view->translateToDoc(m->x(), m->y()).x());
-			newY = qRound(mousePointDoc.y()); //m_view->translateToDoc(m->x(), m->y()).y());
-			m_mouseSavedPoint.setXY(newX, newY);
-			QPoint startP = m_canvas->canvasToGlobal(m_mousePressPoint);
-			m_view->redrawMarker->setGeometry(QRect(startP, m->globalPos()).normalized());
-			if (!m_view->redrawMarker->isVisible())
-				m_view->redrawMarker->show();
-			m_view->HaveSelRect = true;
-			return;
-		}
-	}
-}
-
-void CanvasMode_Normal::mousePressEvent(QMouseEvent *m)
-{
-	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
-	PageItem *currItem;
-
-	m_objectDeltaPos  = FPoint(0, 0);
-	m_mousePressPoint = m_mouseCurrentPoint = mousePointDoc;
-	m_mouseSavedPoint = mousePointDoc;
-	m_canvas->m_viewMode.m_MouseButtonPressed = true;
-	m_canvas->m_viewMode.operItemMoving = false;
-	m_view->HaveSelRect = false;
-	m_doc->DragP = false;
-	m_doc->leaveDrag = false;
-	m->accept();
-	m_view->registerMousePress(m->globalPos());
-	QRect mpo(m->x()-m_doc->guidesPrefs().grabRadius, m->y()-m_doc->guidesPrefs().grabRadius, m_doc->guidesPrefs().grabRadius*2, m_doc->guidesPrefs().grabRadius*2);
-//	mpo.moveBy(qRound(m_doc->minCanvasCoordinate.x() * m_canvas->scale()), qRound(m_doc->minCanvasCoordinate.y() * m_canvas->scale()));
-
-	if (m->button() == Qt::MidButton)
-	{
-		m_view->MidButt = true;
-		if (m->modifiers() & Qt::ControlModifier)
-			m_view->DrawNew();
-		return;
-	}
-
-	if ((GetItem(&currItem)) && (!m_lastPosWasOverGuide))
-	{
-		if ((currItem->asLine()) && (!m_doc->m_Selection->isMultipleSelection()))
-		{
-			if (!lineMoveGesture)
-				lineMoveGesture = new LineMove(this);
-			
-			lineMoveGesture->mousePressEvent(m);
-			if (lineMoveGesture->haveLineItem())
-			{
-				m_view->startGesture(lineMoveGesture);
-				return;
-			}
-		}
-		else
-		{
-			bool isMS=m_doc->m_Selection->isMultipleSelection();
-			if (isMS || (!isMS && (!currItem->locked() && !currItem->sizeLocked())))
-			{
-				if (!resizeGesture)
-					resizeGesture = new ResizeGesture(this);
-
-				resizeGesture->mousePressEvent(m);
-				if (resizeGesture->frameHandle() > 0)
-				{
-					m_view->startGesture(resizeGesture);
-					return;
-				}
-			}
-//#7928			else
-//#7928				return;
-		}
-		
-		qApp->changeOverrideCursor(Qt::ClosedHandCursor);
-#if 1				
-		if (m_doc->m_Selection->isMultipleSelection())
-		{
-			m_canvas->PaintSizeRect(QRect());
-			double gx, gy, gh, gw;
-			bool shiftSel = true;
-			m_doc->m_Selection->getVisualGroupRect(&gx, &gy, &gw, &gh);
-			dragConstrainInitPtX = qRound(gx);
-			dragConstrainInitPtY = qRound(gy);
-			frameResizeHandle = m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), QRectF(gx, gy, gw, gh));
-			if (frameResizeHandle == Canvas::OUTSIDE ||
-				(frameResizeHandle == Canvas::INSIDE && m->modifiers() != Qt::NoModifier))
-			{
-				frameResizeHandle = 0;
-				m_doc->m_Selection->delaySignalsOn();
-				m_view->updatesOn(false);
-				shiftSel = SeleItem(m);
-				m_view->updatesOn(true);
-				m_doc->m_Selection->delaySignalsOff();
-			}
-			if (((m_doc->m_Selection->count() == 0) || (!shiftSel)) && (m->modifiers() == Qt::ShiftModifier))
-			{
-				shiftSelItems = true;
-				m_mouseCurrentPoint = m_mousePressPoint = m_mouseSavedPoint = mousePointDoc;
-			}
-			else
-				shiftSelItems = false;
-			m_canvas->setRenderModeFillBuffer();
-		}
-		else // not multiple selection
-		{
-			dragConstrainInitPtX = qRound(currItem->xPos());
-			dragConstrainInitPtY = qRound(currItem->yPos());
-			
-			// dont call SeleItem() without need here:
-			frameResizeHandle = m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), currItem);
-			//#6797
-			if (frameResizeHandle <= 0 || m->modifiers() != Qt::NoModifier)
-			{
-				m_doc->m_Selection->delaySignalsOn();
-				m_view->updatesOn(false);
-				SeleItem(m); //Where we send the mouse press event to select an item
-				if (GetItem(&currItem))
-					frameResizeHandle = m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), currItem);
-				else
-					frameResizeHandle = 0;
-				m_view->updatesOn(true);
-				m_doc->m_Selection->delaySignalsOff();
-			}
-			if ((currItem && !currItem->locked() && frameResizeHandle > 0) == false)
-			{
-				m_mouseCurrentPoint = m_mousePressPoint = m_mouseSavedPoint = mousePointDoc;
-			}
-		}
-		m_canvas->setRenderModeFillBuffer();
-#endif
-	}
-	else // !GetItem()
-	{
-		SeleItem(m);
-		if (m_doc->m_Selection->count() == 0)
-		{
-			m_mouseCurrentPoint = m_mousePressPoint = m_mouseSavedPoint = mousePointDoc;
-			m_view->redrawMarker->setGeometry(m->globalPos().x(), m->globalPos().y(), 1, 1);
-			m_view->redrawMarker->show();
-		}
-		else
-		{
-			m_canvas->setRenderModeFillBuffer();
-		}
-	}
-/*	if (m->button() == MidButton)
-	{
-		MidButt = true;
-		if (m_doc->m_Selection->count() != 0)
-			m_view->Deselect(true);
-		DrawNew();
-	} */
-	if ((m_doc->m_Selection->count() != 0) && (m->button() == Qt::RightButton))
-	{
-		m_canvas->m_viewMode.m_MouseButtonPressed = true;
-		m_mousePressPoint = m_mouseCurrentPoint;
-	}
-// Commented out to fix bug #7865
-//	if ((m_doc->m_Selection->count() != 0) && (m->button() == Qt::LeftButton) && (frameResizeHandle == 0))
-//	{
-//		m_view->startDragTimer();
-//	}
-	m_canvas->PaintSizeRect(QRect());
-}
-
-
-
-void CanvasMode_Normal::mouseReleaseEvent(QMouseEvent *m)
-{
-// 	qDebug("CanvasMode_Normal::mouseReleaseEvent");
-#ifdef GESTURE_FRAME_PREVIEW
-        clearPixmapCache();
-#endif // GESTURE_FRAME_PREVIEW
-	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
-	PageItem *currItem;
-	m_canvas->m_viewMode.m_MouseButtonPressed = false;
-	m_canvas->resetRenderMode();
-	m->accept();
-	m_view->redrawMarker->hide();
-//	m_view->stopDragTimer();
-	//m_canvas->update(); //ugly in a mouseReleaseEvent!!!!!!!
-	if ((!GetItem(&currItem)) && (m->button() == Qt::RightButton) && (!m_doc->DragP))
-	{
-		createContextMenu(NULL, mousePointDoc.x(), mousePointDoc.y());
-		return;
-	}
-	if ((GetItem(&currItem)) && (m->button() == Qt::RightButton) && (!m_doc->DragP))
-	{
-		createContextMenu(currItem, mousePointDoc.x(), mousePointDoc.y());
-		return;
-	}
-	if (m_view->moveTimerElapsed() && (GetItem(&currItem)))
-	{
-//		m_view->stopDragTimer();
-		m_canvas->setRenderModeUseBuffer(false);
-		if (!m_doc->m_Selection->isMultipleSelection())
-		{
-			m_doc->setRedrawBounding(currItem);
-			currItem->OwnPage = m_doc->OnPage(currItem);
-			m_canvas->m_viewMode.operItemResizing = false;
-			if (currItem->asLine())
-				m_view->updateContents();
-		}
-		if (m_canvas->m_viewMode.operItemMoving)
-		{
-			// we want to invalidate all frames under the moved frame
-			// hm, I will try to be more explicit :) - pm
-			int itemIndex = m_doc->Items->count();
-			PageItem* underItem( m_canvas->itemUnderItem(currItem, itemIndex) );
-			while(underItem)
-			{
-				if(underItem->asTextFrame())
-					underItem->asTextFrame()->invalidateLayout();
-				else
-					underItem->invalidateLayout();
-				
-				underItem =  m_canvas->itemUnderItem(currItem, itemIndex);
-			}
-			
-			m_view->updatesOn(false);
-			if (!m_view->groupTransactionStarted())
-			{
-				m_view->startGroupTransaction(Um::Move, "", Um::IMove);
-			}
-			if (m_doc->m_Selection->isMultipleSelection())
-			{
-				m_doc->moveGroup(m_objectDeltaPos.x(), m_objectDeltaPos.y());
-				m_doc->m_Selection->setGroupRect();
-				double gx, gy, gh, gw;
-				m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-				double nx = gx;
-				double ny = gy;
-				if (!m_doc->ApplyGuides(&nx, &ny))
-				{
-					FPoint npx = m_doc->ApplyGridF(FPoint(gx, gy));
-					FPoint npw = m_doc->ApplyGridF(FPoint(gx+gw, gy+gh));
-					if ((fabs(gx-npx.x())) > (fabs((gx+gw)-npw.x())))
-						nx = npw.x() - gw;
-					else
-						nx = npx.x();
-					if ((fabs(gy-npx.y())) > (fabs((gy+gh)-npw.y())))
-						ny = npw.y() - gh;
-					else
-						ny = npx.y();
-				}
-				m_doc->moveGroup(nx-gx, ny-gy, false);
-				m_doc->m_Selection->setGroupRect();
-				m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-				nx = gx+gw;
-				ny = gy+gh;
-				if (m_doc->ApplyGuides(&nx, &ny))
-					m_doc->moveGroup(nx-(gx+gw), ny-(gy+gh), false);
-				m_doc->m_Selection->setGroupRect();
-			}
-			else
-			{
-				currItem = m_doc->m_Selection->itemAt(0);
-				m_doc->MoveItem(m_objectDeltaPos.x(), m_objectDeltaPos.y(), currItem);
-				if (m_doc->useRaster)
-				{
-					double nx = currItem->xPos();
-					double ny = currItem->yPos();
-					if (!m_doc->ApplyGuides(&nx, &ny))
-					{
-						m_doc->m_Selection->setGroupRect();
-						double gx, gy, gh, gw, gxo, gyo;
-						m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-						gxo = gx;
-						gyo = gy;
-						FPoint npx = m_doc->ApplyGridF(FPoint(gx, gy));
-						FPoint npw = m_doc->ApplyGridF(FPoint(gx+gw, gy+gh));
-						if ((fabs(gx-npx.x())) > (fabs((gx+gw)-npw.x())))
-							gx = npw.x() - gw;
-						else
-							gx = npx.x();
-						if ((fabs(gy-npx.y())) > (fabs((gy+gh)-npw.y())))
-							gy = npw.y() - gh;
-						else
-							gy = npx.y();
-						if ((fabs(gx - gxo) < (m_doc->guidesPrefs().guideRad) / m_canvas->scale()) && (fabs(gy - gyo) < (m_doc->guidesPrefs().guideRad) / m_canvas->scale()))
-						{
-							nx += (gx - gxo);
-							ny += (gy - gyo);
-						}
-					}
-					m_doc->MoveItem(nx-currItem->xPos(), ny-currItem->yPos(), currItem);
-				}
-			}
-			m_canvas->m_viewMode.operItemMoving = false;
-			if (m_doc->m_Selection->isMultipleSelection())
-			{
-				double gx, gy, gh, gw;
-				m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-				FPoint maxSize(gx+gw+m_doc->scratch()->Right, gy+gh+m_doc->scratch()->Bottom);
-				FPoint minSize(gx-m_doc->scratch()->Left, gy-m_doc->scratch()->Top);
-				m_doc->adjustCanvas(minSize, maxSize);
-			}
-			m_doc->setRedrawBounding(currItem);
-			currItem->OwnPage = m_doc->OnPage(currItem);
-			if (currItem->OwnPage != -1)
-			{
-				m_doc->setCurrentPage(m_doc->Pages->at(currItem->OwnPage));
-				m_view->setMenTxt(currItem->OwnPage);
-			}
-			//CB done with emitAllToGUI
-			//emit HaveSel(currItem->itemType());
-			//EmitValues(currItem);
-			//CB need this for? a moved item will send its new data with the new xpos/ypos emits
-			//CB TODO And what if we have dragged to a new page. Items X&Y are not updated anyway now
-			//currItem->emitAllToGUI();
-			m_view->updatesOn(true);
-			m_view->updateContents();
-			m_doc->changed();
-		}
-	}
-	//CB Drag selection performed here
-	if (((m_doc->m_Selection->count() == 0) && (m_view->HaveSelRect) && (!m_view->MidButt)) || ((shiftSelItems) && (m_view->HaveSelRect) && (!m_view->MidButt)))
-	{
-		double dx = m_mouseSavedPoint.x() - m_mousePressPoint.x();
-		double dy = m_mouseSavedPoint.y() - m_mousePressPoint.y();
-		QRectF canvasSele = QRectF(m_mousePressPoint.x(), m_mousePressPoint.y(), dx, dy).normalized();
-		QRectF localSele  = m_canvas->canvasToLocal(canvasSele).normalized();
-		if (!m_doc->masterPageMode())
-		{
-			uint docPagesCount=m_doc->Pages->count();
-			uint docCurrPageNo=m_doc->currentPageNumber();
-			for (uint i = 0; i < docPagesCount; ++i)
-			{
-				Page*  page = m_doc->Pages->at(i);
-				QRectF pageRect(page->xOffset(), page->yOffset(), page->width(), page->height());
-				if (pageRect.intersects(canvasSele))
-				{
-					if (docCurrPageNo != i)
-					{
-						m_doc->setCurrentPage(m_doc->Pages->at(i));
-						m_view->setMenTxt(i);
-					}
-					break;
-				}
-			}
-			m_view->setRulerPos(m_view->contentsX(), m_view->contentsY());
-		}
-		int docItemCount=m_doc->Items->count();
-		if (docItemCount != 0)
-		{
-			m_doc->m_Selection->delaySignalsOn();
-			for (int a = 0; a < docItemCount; ++a)
-			{
-				PageItem* docItem = m_doc->Items->at(a);
-				if ((m_doc->masterPageMode()) && (docItem->OnMasterPage != m_doc->currentPage()->pageName()))
-					continue;
-				QRect  apr2 = m_canvas->canvasToLocal( docItem->getCurrentBoundingRect(docItem->lineWidth()) );
-				if ((localSele.contains(apr2)) && (docItem->LayerID == m_doc->activeLayer()) && (!m_doc->layerLocked(docItem->LayerID)))
-				{
-					bool redrawSelection=false;
-					m_view->SelectItemNr(a, redrawSelection);
-				}
-			}
-			m_doc->m_Selection->delaySignalsOff();
-			if (m_doc->m_Selection->count() > 1)
-			{
-				m_doc->m_Selection->setGroupRect();
-				double x, y, w, h;
-				m_doc->m_Selection->getGroupRect(&x, &y, &w, &h);
-				m_view->getGroupRectScreen(&x, &y, &w, &h);
-			}
-		}
-		m_view->HaveSelRect = false;
-		shiftSelItems = false;
-//		m_view->redrawMarker->hide();
-		m_view->updateContents();
-	}
-	if (m_doc->appMode != modeEdit)
-	{
-		if (!PrefsManager::instance()->appPrefs.uiPrefs.stickyTools)
-			m_view->requestMode(modeNormal);
-		else
-		{
-			int appMode = m_doc->appMode;
-			m_view->requestMode(appMode);
-		}
-	}
-	if (GetItem(&currItem))
-	{
-	//	qApp->changeOverrideCursor(QCursor(Qt::OpenHandCursor));
-		if (m_doc->m_Selection->count() > 1)
-		{
-			m_doc->m_Selection->setGroupRect();
-			double x, y, w, h;
-			m_doc->m_Selection->getGroupRect(&x, &y, &w, &h);
-			m_canvas->m_viewMode.operItemMoving = false;
-			m_canvas->m_viewMode.operItemResizing = false;
-			m_view->updateContents(QRect(static_cast<int>(x-5), static_cast<int>(y-5), static_cast<int>(w+10), static_cast<int>(h+10)));
-			//Now unuseful as PropertiesPalette_XYZ::setCurrentItem() handles multiple selection
-			//m_ScMW->propertiesPalette->setXY(x,y);
-			//m_ScMW->propertiesPalette->setBH(w,h);
-		}
-		/*else
-			currItem->emitAllToGUI();*/
-	}
-	else
-		m_view->Deselect(true);
-	m_canvas->setRenderModeUseBuffer(false);
-	m_doc->DragP = false;
-	m_doc->leaveDrag = false;
-	m_canvas->m_viewMode.operItemMoving = false;
-	m_canvas->m_viewMode.operItemResizing = false;
-	m_view->MidButt = false;
-	shiftSelItems = false;
-	if (m_view->groupTransactionStarted())
-	{
-		for (int i = 0; i < m_doc->m_Selection->count(); ++i)
-			m_doc->m_Selection->itemAt(i)->checkChanges(true);
-		m_view->endGroupTransaction();
-	}
-	for (int i = 0; i < m_doc->m_Selection->count(); ++i)
-		m_doc->m_Selection->itemAt(i)->checkChanges(true);
-	//Commit drag created items to undo manager.
-	if (m_doc->m_Selection->itemAt(0)!=NULL)
-	{
-		m_doc->itemAddCommit(m_doc->m_Selection->itemAt(0)->ItemNr);
-	}
-	//Make sure the Zoom spinbox and page selector dont have focus if we click on the canvas
-	m_view->zoomSpinBox->clearFocus();
-	m_view->pageSelector->clearFocus();
-	if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action
-	{
-		currItem = m_doc->m_Selection->itemAt(0);
-		m_doc->nodeEdit.finishTransaction(currItem);
-	}
-}
-
-void CanvasMode_Normal::keyPressEvent(QKeyEvent *e)
-{
-	commonkeyPressEvent_NormalNodeEdit(e);
-}
-
-void CanvasMode_Normal::keyReleaseEvent(QKeyEvent *e)
-{
-	commonkeyReleaseEvent(e);
-}
-
-//CB-->Doc/Fix
-bool CanvasMode_Normal::SeleItem(QMouseEvent *m)
-{
-	m_canvas->m_viewMode.operItemSelecting = true;
-	const unsigned SELECT_IN_GROUP = Qt::AltModifier; // Qt::MetaModifier;
-	const unsigned SELECT_MULTIPLE = Qt::ShiftModifier;
-	const unsigned SELECT_BENEATH = Qt::ControlModifier;
-	QTransform p;
-	PageItem *currItem;
-	m_canvas->m_viewMode.m_MouseButtonPressed = true;
-	FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
-	m_mouseCurrentPoint  = mousePointDoc;
-	double grabRadius = m_doc->guidesPrefs().grabRadius / m_canvas->scale();
-	int MxpS = static_cast<int>(mousePointDoc.x()); //m->x()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.x());
-	int MypS = static_cast<int>(mousePointDoc.y()); //m->y()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.y());
-	QRectF mpo(m_mouseCurrentPoint.x()-grabRadius, m_mouseCurrentPoint.y()-grabRadius, grabRadius*2, grabRadius*2);
-	m_doc->nodeEdit.deselect();
-
-	if(!m_doc->guidesPrefs().guidePlacement) // guides are on foreground and want to be processed first
-	{
-		if ((m_doc->guidesPrefs().guidesShown) && (m_doc->OnPage(MxpS, MypS) != -1))
-		{
-			// #9002: Resize points undraggable when object is aligned to a guide
-			// Allow item resize when guides are aligned to item while preserving
-			// ability to drag guide when guis is in foreground and inside selection
-			bool enableGuideGesture(true);
-			if (m_doc->m_Selection->count() > 0)
-			{
-				double gx(0.0), gy(0.0), gw(0.0), gh(0.0);
-				m_doc->m_Selection->setGroupRect();
-				m_doc->m_Selection->getVisualGroupRect(&gx, &gy, &gw, &gh);
-				Canvas::FrameHandle frameResizeHandle = m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), QRectF(gx, gy, gw, gh));
-				enableGuideGesture = (frameResizeHandle == Canvas::INSIDE);
-			}
-			if (enableGuideGesture)
-			{
-				if (!guideMoveGesture)
-				{
-					guideMoveGesture = new RulerGesture(m_view, RulerGesture::HORIZONTAL);
-					connect(guideMoveGesture,SIGNAL(guideInfo(int, qreal)), m_ScMW->alignDistributePalette,SLOT(setGuide(int, qreal)));
-				}
-				if ( (!m_doc->GuideLock) && (guideMoveGesture->mouseHitsGuide(mousePointDoc)) )
-				{
-					m_view->startGesture(guideMoveGesture);
-					guideMoveGesture->mouseMoveEvent(m);
-					m_doc->m_Selection->connectItemToGUI();
-				//	qDebug()<<"Out Of SeleItem"<<__LINE__;
-					return true;
-				}
-				else
-				{
-				// If we call startGesture now, a new guide is created each time.
-				// ### could be a weakness to avoid calling it tho.
-	 			//	m_view->startGesture(guideMoveGesture);
-					guideMoveGesture->mouseSelectGuide(m);
-				}
-			}
-		}
-	}
-	bool pageChanged(false);
-	if (!m_doc->masterPageMode())
-	{
-		int pgNum = -1;
-		int docPageCount = static_cast<int>(m_doc->Pages->count() - 1);
-		MarginStruct pageBleeds;
-		bool drawBleed = false;
-		if (m_doc->bleeds()->hasNonZeroValue() && m_doc->guidesPrefs().showBleed)
-			drawBleed = true;
-		for (int a = docPageCount; a > -1; a--)
-		{
-			if (drawBleed)
-				m_doc->getBleeds(a, pageBleeds);
-			int x = static_cast<int>(m_doc->Pages->at(a)->xOffset() - pageBleeds.Left);
-			int y = static_cast<int>(m_doc->Pages->at(a)->yOffset() - pageBleeds.Top);
-			int w = static_cast<int>(m_doc->Pages->at(a)->width() + pageBleeds.Left + pageBleeds.Right);
-			int h = static_cast<int>(m_doc->Pages->at(a)->height() + pageBleeds.Bottom + pageBleeds.Top);
-			if (QRect(x, y, w, h).contains(MxpS, MypS))
-			{
-				pgNum = static_cast<int>(a);
-				if (drawBleed)  // check again if its really on the correct page
-				{
-					for (int a2 = docPageCount; a2 > -1; a2--)
-					{
-						int xn = static_cast<int>(m_doc->Pages->at(a2)->xOffset());
-						int yn = static_cast<int>(m_doc->Pages->at(a2)->yOffset());
-						int wn = static_cast<int>(m_doc->Pages->at(a2)->width());
-						int hn = static_cast<int>(m_doc->Pages->at(a2)->height());
-						if (QRect(xn, yn, wn, hn).contains(MxpS, MypS))
-						{
-							pgNum = static_cast<int>(a2);
-							break;
-						}
-					}
-				}
-				break;
-			}
-		}
-		if (pgNum >= 0)
-		{
-			if (m_doc->currentPageNumber() != pgNum)
-			{
-				m_doc->setCurrentPage(m_doc->Pages->at(unsigned(pgNum)));
-				m_view->setMenTxt(unsigned(pgNum));
-				pageChanged = true;
-			}
-		}
-		m_view->setRulerPos(m_view->contentsX(), m_view->contentsY());
-	}
-	
-	currItem = NULL;
-	if ((m->modifiers() & SELECT_BENEATH) != 0)
-	{
-		for (int i=0; i < m_doc->m_Selection->count(); ++i)
-		{
-			if (m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), m_doc->m_Selection->itemAt(i)) >= 0)
-			{
-				currItem = m_doc->m_Selection->itemAt(i);
-				m_doc->m_Selection->removeItem(currItem);
-				break;
-			}
-		}
-	}
-	else if ( (m->modifiers() & SELECT_MULTIPLE) == Qt::NoModifier)
-	{
-		m_view->Deselect(false);
-	}
-	currItem = m_canvas->itemUnderCursor(m->globalPos(), currItem, (m->modifiers() & SELECT_IN_GROUP));
-	if (currItem)
-	{
-		m_doc->m_Selection->delaySignalsOn();
-		if (m_doc->m_Selection->containsItem(currItem))
-		{
-			m_doc->m_Selection->removeItem(currItem);
-		}
-		else
-		{
-			//CB: If we have a selection but the user clicks with control on another item that is not below the current
-			//then clear and select the new item
-			if ((m->modifiers() == SELECT_BENEATH) && m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), currItem) >= 0)
-				m_doc->m_Selection->clear();
-			//CB: #7186: This was prependItem, does not seem to need to be anymore with current select code
-			m_doc->m_Selection->addItem(currItem);
-			if ( (m->modifiers() & SELECT_IN_GROUP) && (!currItem->isGroup()))
-			{
-				currItem->isSingleSel = true;
-			}
-		}
-		if(pageChanged)
-		{
-			m_canvas->m_viewMode.forceRedraw = true;
-			m_canvas->update();
-		}
-		else
-			m_canvas->update();
-		
-		m_doc->m_Selection->delaySignalsOff();
-		if (m_doc->m_Selection->count() > 1)
-		{
-			m_doc->beginUpdate();
-			for (int aa = 0; aa < m_doc->m_Selection->count(); ++aa)
-			{
-				PageItem *bb = m_doc->m_Selection->itemAt(aa);
-				bb->update();
-			}
-			m_doc->endUpdate();
-			m_doc->m_Selection->setGroupRect();
-			double x, y, w, h;
-			m_doc->m_Selection->getGroupRect(&x, &y, &w, &h);
-			m_view->getGroupRectScreen(&x, &y, &w, &h);
-		}
-		return true;
-	}
-	if ((m_doc->guidesPrefs().guidesShown) /*&& (!m_doc->GuideLock)*/ && (m_doc->OnPage(MxpS, MypS) != -1))
-	{
-		if (!guideMoveGesture)
-		{
-			guideMoveGesture = new RulerGesture(m_view, RulerGesture::HORIZONTAL);
-			connect(guideMoveGesture,SIGNAL(guideInfo(int, qreal)), m_ScMW->alignDistributePalette,SLOT(setGuide(int, qreal)));
-		}
-		if ( (!m_doc->GuideLock) && (guideMoveGesture->mouseHitsGuide(mousePointDoc)) )
-		{
-			m_view->startGesture(guideMoveGesture);
-			guideMoveGesture->mouseMoveEvent(m);
-			m_doc->m_Selection->connectItemToGUI();
-			return true;
-		}
-		else
-		{
-			// If we call startGesture now, a new guide is created each time.
-			// ### could be a weakness to avoid calling it tho.
-// 			m_view->startGesture(guideMoveGesture);
-			guideMoveGesture->mouseSelectGuide(m);
-		}
-	}
-	m_doc->m_Selection->connectItemToGUI();
-	if ( !(m->modifiers() & SELECT_MULTIPLE))
-	{
-		if(m_doc->m_Selection->isEmpty())
-		{
-			m_canvas->m_viewMode.forceRedraw = true;
-			m_canvas->update();
-		}
-		else
-			m_view->Deselect(true);
-	}
-	return false;
-}
-
-void CanvasMode_Normal::importToPage()
-{
-	QString fileName;
-	QString allFormats = tr("All Supported Formats")+" (";
-	QStringList formats;
-	int fmtCode = FORMATID_ODGIMPORT;
-	const FileFormat *fmt = LoadSavePlugin::getFormatById(fmtCode);
-	while (fmt != 0)
-	{
-		if (fmt->load)
-		{
-			formats.append(fmt->filter);
-			int an = fmt->filter.indexOf("(");
-			int en = fmt->filter.indexOf(")");
-			while (an != -1)
-			{
-				allFormats += fmt->filter.mid(an+1, en-an-1)+" ";
-				an = fmt->filter.indexOf("(", en);
-				en = fmt->filter.indexOf(")", an);
-			}
-		}
-		fmtCode++;
-		fmt = LoadSavePlugin::getFormatById(fmtCode);
-	}
-	allFormats += "*.sce *.SCE);;";
-	formats.append("Scribus Objects (*.sce *.SCE)");
-	qSort(formats);
-	allFormats += formats.join(";;");
-	PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs");
-	QString wdir = dirs->get("pastefile", ".");
-	FPoint pastePoint = m_mouseCurrentPoint;
-	CustomFDialog dia(m_view, wdir, tr("Open"), allFormats, fdExistingFiles);
-	if (dia.exec() == QDialog::Accepted)
-		fileName = dia.selectedFile();
-	else
-		return;
-	if (!fileName.isEmpty())
-	{
-		PrefsManager::instance()->prefsFile->getContext("dirs")->set("pastefile", fileName.left(fileName.lastIndexOf("/")));
-		m_doc->setLoading(true);
-		QFileInfo fi(fileName);
-		bool savedAlignGrid = m_doc->useRaster;
-		bool savedAlignGuides = m_doc->SnapGuides;
-		m_doc->useRaster = false;
-		m_doc->SnapGuides = false;
-		if (fi.suffix().toLower() == "sce")
-			m_ScMW->slotElemRead(fileName, pastePoint.x(), pastePoint.y(), true, false, m_doc, m_doc->view());
-		else
-		{
-			FileLoader *fileLoader = new FileLoader(fileName);
-			int testResult = fileLoader->TestFile();
-			delete fileLoader;
-			if ((testResult != -1) && (testResult >= FORMATID_ODGIMPORT))
-			{
-				const FileFormat * fmt = LoadSavePlugin::getFormatById(testResult);
-				if( fmt )
-				{
-					fmt->loadFile(fileName, LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive|LoadSavePlugin::lfScripted);
-				}
-			}
-			if (m_doc->m_Selection->count() > 0)
-			{
-				double x2, y2, w, h;
-				m_doc->m_Selection->getGroupRect(&x2, &y2, &w, &h);
-				m_doc->moveGroup(pastePoint.x() - x2, pastePoint.y() - y2);
-				m_ScMW->requestUpdate(reqColorsUpdate | reqLineStylesUpdate | reqTextStylesUpdate);
-			}
-		}
-		for (int a = 0; a < m_doc->m_Selection->count(); ++a)
-		{
-			PageItem *currItem = m_doc->m_Selection->itemAt(a);
-			currItem->LayerID = m_doc->activeLayer();
-		}
-		m_doc->useRaster = savedAlignGrid;
-		m_doc->SnapGuides = savedAlignGuides;
-		m_doc->setLoading(false);
-		m_doc->view()->DrawNew();
-		if (m_doc->m_Selection->count() > 0)
-		{
-			m_doc->m_Selection->connectItemToGUI();
-			m_ScMW->HaveNewSel(m_doc->m_Selection->itemAt(0)->itemType());
-		}
-	}
-}
-
-void CanvasMode_Normal::createContextMenu(PageItem* currItem, double mx, double my)
-{
-	ContextMenu* cmen=NULL;
-	qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
-	m_view->setObjectUndoMode();
-	m_mouseCurrentPoint.setXY(mx, my);
-	if(currItem!=NULL)
-		cmen = new ContextMenu(*(m_doc->m_Selection), m_ScMW, m_doc);
-	else
-		cmen = new ContextMenu(m_ScMW, m_doc, mx, my);
-	if (cmen)
-		cmen->exec(QCursor::pos());
-	m_view->setGlobalUndoMode();
-	delete cmen;
-}
+/*
+ For general Scribus (>=1.3.2) copyright and licensing information please refer
+ to the COPYING file provided with the program. Following this notice may exist
+ a copyright and/or license notice that predates the release of Scribus 1.3.2
+ for which a new license (GPL+exception) is in place.
+ */
+/***************************************************************************
+*                                                                         *
+*   This program is free software; you can redistribute it and/or modify  *
+*   it under the terms of the GNU General Public License as published by  *
+*   the Free Software Foundation; either version 2 of the License, or     *
+*   (at your option) any later version.                                   *
+*                                                                         *
+***************************************************************************/
+
+
+#include "canvasmode_normal.h"
+
+#include <QApplication>
+#include <QButtonGroup>
+#include <QCheckBox>
+#include <QCursor>
+#include <QEvent>
+#include <QMessageBox>
+#include <QMouseEvent>
+#include <QPainterPath>
+#include <QPoint>
+#include <QRect>
+#include <QTimer>
+#include <QWidgetAction>
+#include <QDebug>
+
+#include "canvas.h"
+#include "canvasgesture_linemove.h"
+#include "canvasgesture_resize.h"
+#include "canvasgesture_rulermove.h"
+#include "fileloader.h"
+#include "fpoint.h"
+#include "fpointarray.h"
+#include "hyphenator.h"
+#include "loadsaveplugin.h"
+#include "pageitem_textframe.h"
+#include "pageitem_regularpolygon.h"
+#include "pageitem_arc.h"
+#include "prefscontext.h"
+#include "prefsfile.h"
+#include "prefsmanager.h"
+#include "scmimedata.h"
+#include "scribus.h"
+#include "scribusdoc.h"
+#include "scribusview.h"
+#include "scribusXml.h"
+#include "selection.h"
+#include "undomanager.h"
+#include "util.h"
+#include "util_icon.h"
+#include "util_math.h"
+#include "ui/aligndistribute.h"
+#include "ui/contextmenu.h"
+#include "ui/customfdialog.h"
+#include "ui/insertTable.h"
+#include "ui/pageselector.h"
+#include "ui/polyprops.h"
+#include "ui/propertiespalette.h"
+#include "ui/propertiespalette_line.h"
+#include "ui/propertiespalette_text.h"
+#include "plugins/formatidlist.h"
+
+
+
+CanvasMode_Normal::CanvasMode_Normal(ScribusView* view) : CanvasMode(view), m_ScMW(view->m_ScMW) 
+{
+	frameResizeHandle = -1;
+	shiftSelItems = false;
+	resizeGesture = NULL;
+	lineMoveGesture  = NULL;
+	guideMoveGesture = NULL;
+	m_mousePressPoint.setXY(0, 0);
+	m_mouseCurrentPoint.setXY(0, 0);
+	m_mouseSavedPoint.setXY(0, 0);
+	m_objectDeltaPos.setXY(0,0 );
+}
+
+inline bool CanvasMode_Normal::GetItem(PageItem** pi)
+{ 
+	*pi = m_doc->m_Selection->itemAt(0); 
+	return (*pi) != NULL; 
+}
+
+void CanvasMode_Normal::drawControls(QPainter* p)
+{
+//	qDebug() << "CanvasMode_Normal::drawControls";
+	if (m_canvas->m_viewMode.operItemMoving)
+	{
+		drawOutline(p, 1.0, 1.0, m_objectDeltaPos.x(), m_objectDeltaPos.y());
+	}
+	else
+	{
+		drawSelection(p, true);
+	}
+}
+
+void CanvasMode_Normal::enterEvent(QEvent *)
+{
+	if (!m_canvas->m_viewMode.m_MouseButtonPressed)
+	{
+		setModeCursor();
+	}
+}
+
+void CanvasMode_Normal::leaveEvent(QEvent *e)
+{
+	if (!m_canvas->m_viewMode.m_MouseButtonPressed)
+	{
+		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
+	}
+}
+
+
+void CanvasMode_Normal::activate(bool fromGesture)
+{
+//	qDebug() << "CanvasMode_Normal::activate" << fromGesture;
+	m_canvas->m_viewMode.m_MouseButtonPressed = false;
+	m_canvas->resetRenderMode();
+	m_doc->DragP = false;
+	m_doc->leaveDrag = false;
+	m_canvas->m_viewMode.operItemMoving = false;
+	m_canvas->m_viewMode.operItemResizing = false;
+	m_view->MidButt = false;
+	m_mousePressPoint.setXY(0, 0);
+	m_mouseCurrentPoint.setXY(0, 0);
+	m_mouseSavedPoint.setXY(0, 0);
+	m_objectDeltaPos.setXY(0,0 );
+	frameResizeHandle = -1;
+	shiftSelItems = false;
+	setModeCursor();
+	if (fromGesture)
+	{
+		m_view->update();
+	}
+}
+
+void CanvasMode_Normal::deactivate(bool forGesture)
+{
+//	qDebug() << "CanvasMode_Normal::deactivate" << forGesture;
+	m_view->redrawMarker->hide();
+}
+
+void CanvasMode_Normal::mouseDoubleClickEvent(QMouseEvent *m)
+{
+	m->accept();
+	m_canvas->m_viewMode.m_MouseButtonPressed = false;
+	m_canvas->resetRenderMode();
+//	m_view->stopDragTimer();
+	PageItem *currItem = 0;
+	if (m_doc->m_Selection->isMultipleSelection())
+	{
+		if (GetItem(&currItem))
+		{
+			/* CB: old code, removing this as shift-alt select on an unselected table selects a cell now.
+			//#6789 is closed by sorting this.
+			if (currItem->isTableItem)
+			{
+				m_view->Deselect(false);
+				m_doc->m_Selection->addItem(currItem);
+				currItem->isSingleSel = true;
+				//CB FIXME dont call this if the added item is item 0
+				if (!m_doc->m_Selection->primarySelectionIs(currItem))
+					currItem->emitAllToGUI();
+				m_view->updateContents(currItem->getRedrawBounding(m_canvas->scale()));
+			}*/
+		}
+		return;
+	}
+	if (GetItem(&currItem))
+	{
+		if (currItem->asLatexFrame()) 
+		{
+			if (currItem->locked()) // || (!currItem->ScaleType))
+			{
+				return;
+			}
+			if (currItem->imageShown())
+				m_view->requestMode(modeEdit);
+		}
+#ifdef HAVE_OSG
+		else if (currItem->asOSGFrame())
+		{
+			m_view->requestMode(submodeEditExternal);
+		}
+#endif
+		else if ((currItem->itemType() == PageItem::Polygon) || (currItem->itemType() == PageItem::PolyLine) || (currItem->itemType() == PageItem::Group) || (currItem->itemType() == PageItem::ImageFrame) || (currItem->itemType() == PageItem::PathText))
+		{
+			if (currItem->locked()) //|| (!currItem->ScaleType))
+			{
+				//mousePressEvent(m);
+				return;
+			}
+			//If we double click on an image frame and theres no image assigned, open the
+			//load picture dialog, else put it into edit mode if the frame is set to show the image
+			if (currItem->itemType() == PageItem::ImageFrame)
+			{
+				if (currItem->Pfile.isEmpty())
+					m_view->requestMode(submodeLoadPic);
+				else if (!currItem->PictureIsAvailable)
+					m_view->requestMode(submodeStatusPic);
+				else if (currItem->imageShown())
+					m_view->requestMode(modeEdit);
+ 			}
+ 			else if (currItem->itemType() == PageItem::TextFrame)
+			{
+ 				m_view->requestMode(modeEdit);
+			}
+			else
+				m_view->requestMode(modeEditClip);
+		}
+		else if (currItem->itemType() == PageItem::TextFrame)
+		{
+			//CB old code
+			//emit currItem->isAnnotation() ? AnnotProps() : Amode(modeEdit);
+			//mousePressEvent(m);
+			//CB if annotation, open the annotation dialog
+			if (currItem->isAnnotation())
+			{
+				qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
+				m_view->requestMode(submodeAnnotProps);
+				//mousePressEvent(m);
+			}
+			//else if not in mode edit, set mode edit
+			else if (m_doc->appMode != modeEdit)
+			{
+				m_view->requestMode(modeEdit);
+				m_view->slotSetCurs(m->globalPos().x(), m->globalPos().y());
+				//CB ignore the double click and go with a single one
+				//if we werent in mode edit before.
+				//unsure if this is correct, but its ok given we had no
+				//double click select until now.
+//				mousePressEvent(m);
+			}
+		}
+		else if (currItem->asSymbolFrame())
+		{
+			if (!m_doc->symbolEditMode())
+				m_view->requestMode(submodeEditSymbol);
+		}
+		else if (currItem->asArc())
+		{
+			m_view->requestMode(modeEditArc);
+		}
+		else if (currItem->asRegularPolygon())
+		{
+			m_view->requestMode(modeEditPolygon);
+		}
+		else if (currItem->asSpiral())
+		{
+			m_view->requestMode(modeEditSpiral);
+		}
+	}
+}
+
+
+void CanvasMode_Normal::mouseMoveEvent(QMouseEvent *m)
+{
+// 	qDebug()<<"CanvasMode_Normal::mouseMoveEvent";
+// 	const double mouseX = m->globalX();
+// 	const double mouseY = m->globalY();
+	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
+	
+	m_lastPosWasOverGuide = false;
+	double newX, newY;
+	PageItem *currItem;
+	bool erf = false;
+	m->accept();
+//	qDebug() << "legacy mode move:" << m->x() << m->y() << m_canvas->globalToCanvas(m->globalPos()).x() << m_canvas->globalToCanvas(m->globalPos()).y();
+//	emit MousePos(m->x()/m_canvas->scale(),// + m_doc->minCanvasCoordinate.x(), 
+//				  m->y()/m_canvas->scale()); // + m_doc->minCanvasCoordinate.y());
+
+	if (commonMouseMove(m))
+		return;
+	m_mouseCurrentPoint = mousePointDoc;
+	bool movingOrResizing = (m_canvas->m_viewMode.operItemMoving || m_canvas->m_viewMode.operItemResizing);
+	bool mouseIsOnPage    = (m_doc->OnPage(mousePointDoc.x(), mousePointDoc.y()) != -1);
+	if ((m_doc->guidesPrefs().guidesShown) && (!m_doc->GuideLock) && (!movingOrResizing) && (mouseIsOnPage) )
+	{
+		// #9002: Resize points undraggable when object is aligned to a guide
+		// Allow item resize when guides are aligned to item while preserving
+		// ability to drag guide when guis is in foreground and inside selection
+		bool enableGuideGesture(false);
+		Canvas::FrameHandle frameResizeHandle(Canvas::OUTSIDE);
+		if (m_doc->m_Selection->count() > 0)
+		{
+			double gx(0.0), gy(0.0), gw(0.0), gh(0.0);
+			m_doc->m_Selection->setGroupRect();
+			m_doc->m_Selection->getVisualGroupRect(&gx, &gy, &gw, &gh);
+			frameResizeHandle = m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), QRectF(gx, gy, gw, gh));
+		}
+		enableGuideGesture |= (frameResizeHandle == Canvas::OUTSIDE);
+		enableGuideGesture |= ((!m_doc->guidesPrefs().guidePlacement) && (frameResizeHandle == Canvas::INSIDE));
+		if (enableGuideGesture)
+		{
+			if (!guideMoveGesture)
+			{
+				guideMoveGesture = new RulerGesture(m_view, RulerGesture::HORIZONTAL);
+				connect(guideMoveGesture,SIGNAL(guideInfo(int, qreal)), m_ScMW->alignDistributePalette,SLOT(setGuide(int, qreal)));
+			}
+			if (guideMoveGesture->mouseHitsGuide(mousePointDoc))
+			{
+				m_lastPosWasOverGuide = true;
+				switch (guideMoveGesture->getMode())
+				{
+					case RulerGesture::HORIZONTAL:
+						qApp->changeOverrideCursor(QCursor(Qt::SplitVCursor));
+						break;
+					case RulerGesture::VERTICAL:
+						qApp->changeOverrideCursor(QCursor(Qt::SplitHCursor));
+						break;
+					default:
+						qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
+				}
+				return;
+			}
+			// Here removed a bunch of comments which made reading code difficult,
+			// there is svn for tracking changes after all. pm
+			qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
+		}
+	}
+	else if (!mouseIsOnPage)
+	{
+		QCursor* cursor = qApp->overrideCursor();
+		if (cursor && ((cursor->shape() == Qt::SplitHCursor) || (cursor->shape() == Qt::SplitVCursor)))
+		{
+			qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
+		}
+	}
+	if ((GetItem(&currItem)) && (!shiftSelItems))
+	{
+		newX = qRound(mousePointDoc.x()); //m_view->translateToDoc(m->x(), m->y()).x());
+		newY = qRound(mousePointDoc.y()); //m_view->translateToDoc(m->x(), m->y()).y());
+		// #0007865
+		if (/*(((m_view->dragTimerElapsed()) && (m->buttons() & Qt::LeftButton)) ||*/
+			(m_view->moveTimerElapsed())
+			&& (m->buttons() & Qt::RightButton)
+			&& (m_canvas->m_viewMode.m_MouseButtonPressed)
+			&& (!m_doc->DragP)  
+			&& (!(currItem->isSingleSel)))
+		{
+			// start drag
+//			m_view->stopDragTimer();
+			if ((fabs(m_mousePressPoint.x() - newX) > 10) || (fabs(m_mousePressPoint.y() - newY) > 10))
+			{
+				m_canvas->setRenderMode(Canvas::RENDER_NORMAL);
+//				m_view->resetDragTimer();
+				m_doc->DragP = true;
+				m_doc->leaveDrag = false;
+				m_doc->DraggedElem = currItem;
+				m_doc->DragElements.clear();
+				for (int dre=0; dre<m_doc->m_Selection->count(); ++dre)
+					m_doc->DragElements.append(m_doc->m_Selection->itemAt(dre)->ItemNr);
+				ScriXmlDoc *ss = new ScriXmlDoc();
+				ScElemMimeData* md = new ScElemMimeData();
+				md->setScribusElem(ss->WriteElem(m_doc, m_doc->m_Selection));
+				delete ss;
+				ss = NULL;
+				QDrag* dr = new QDrag(m_view);
+				dr->setMimeData(md);
+				const QPixmap& pm = loadIcon("DragPix.xpm");
+				dr->setPixmap(pm);
+			//	dr->setDragCursor(pm, Qt::CopyAction);
+			//	dr->setDragCursor(pm, Qt::MoveAction);
+			//	dr->setDragCursor(pm, Qt::LinkAction);
+				dr->exec();
+				m_doc->DragP = false;
+				m_doc->leaveDrag = false;
+				m_canvas->m_viewMode.m_MouseButtonPressed = false;
+				m_doc->DraggedElem = 0;
+				m_doc->DragElements.clear();
+				qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
+				m_view->updateContents();
+			}
+			return;
+		}
+		if (m_doc->DragP)
+			return;
+		//Operations run here:
+		//Item resize, esp after creating a new one
+		if (m_view->moveTimerElapsed() && m_canvas->m_viewMode.m_MouseButtonPressed && (m->buttons() & Qt::LeftButton) && 
+			((m_doc->appMode == modeNormal)) && (!currItem->locked()))
+		{
+//			m_view->stopDragTimer();
+			if (!m_canvas->m_viewMode.operItemResizing)
+			{
+				//Dragging an item (plus more?)
+				QRectF newPlace;
+				newX = mousePointDoc.x(); //static_cast<int>(m->x()/sc);
+				newY = mousePointDoc.y(); //static_cast<int>(m->y()/sc);
+				m_canvas->m_viewMode.operItemMoving = true;
+				qApp->changeOverrideCursor(Qt::ClosedHandCursor);
+				erf = false;
+				int dX = qRound(newX - m_mousePressPoint.x()), dY = qRound(newY - m_mousePressPoint.y());
+				if (!m_doc->m_Selection->isMultipleSelection())
+				{
+					erf=true;
+					currItem = m_doc->m_Selection->itemAt(0);
+					//Control Alt drag image in frame without being in edit mode
+					if ((currItem->asImageFrame()) && (m->modifiers() & Qt::ControlModifier) && (m->modifiers() & Qt::AltModifier))
+					{
+						currItem->moveImageInFrame(dX/currItem->imageXScale(),dY/currItem->imageYScale());
+						m_view->updateContents(currItem->getRedrawBounding(m_canvas->scale()));
+					}
+					else
+					{
+						//Dragging orthogonally - Ctrl Drag
+						if ((m->modifiers() & Qt::ControlModifier) && !(m->modifiers() & Qt::ShiftModifier) && !(m->modifiers() & Qt::AltModifier))
+						{
+							if (abs(dX) > abs(dY))
+								dY=0;
+							else
+							if (abs(dY) > abs(dX))
+								dX=0;
+							erf=false;
+							dX+=qRound(dragConstrainInitPtX-currItem->xPos());
+							dY+=qRound(dragConstrainInitPtY-currItem->yPos());
+						}
+						if (!(currItem->isTableItem && currItem->isSingleSel))
+						{
+							double gx, gy, gh, gw;
+							m_objectDeltaPos.setXY(dX, dY);
+							m_doc->m_Selection->setGroupRect();
+							m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
+							if (m_doc->SnapGuides)
+							{
+								double nx = gx + m_objectDeltaPos.x();
+								double ny = gy + m_objectDeltaPos.y();
+								double nxo = nx, nyo = ny;
+								m_doc->ApplyGuides(&nx, &ny);
+								m_objectDeltaPos += FPoint(nx - nxo, ny - nyo);
+								nx = nxo = gx + gw + m_objectDeltaPos.x();
+								ny = nyo = gy + gh + m_objectDeltaPos.y();
+								m_doc->ApplyGuides(&nx, &ny);
+								m_objectDeltaPos += FPoint(nx-nxo, ny-nyo);
+							}
+							if (m_doc->useRaster)
+							{
+								m_doc->m_Selection->setGroupRect();
+								double gx, gy, gh, gw, gxo, gyo;
+								m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
+								gx += m_objectDeltaPos.x();
+								gy += m_objectDeltaPos.y();
+								gxo = gx;
+								gyo = gy;
+								FPoint npx = m_doc->ApplyGridF(FPoint(gx, gy));
+								FPoint npw = m_doc->ApplyGridF(FPoint(gx+gw, gy+gh));
+								if ((fabs(gx-npx.x())) > (fabs((gx+gw)-npw.x())))
+									gx = npw.x() - gw;
+								else
+									gx = npx.x();
+								if ((fabs(gy-npx.y())) > (fabs((gy+gh)-npw.y())))
+									gy = npw.y() - gh;
+								else
+									gy = npx.y();
+								if ((fabs(gx - gxo) < (m_doc->guidesPrefs().guideRad) / m_canvas->scale()) && (fabs(gy - gyo) < (m_doc->guidesPrefs().guideRad) / m_canvas->scale()))
+									m_objectDeltaPos += FPoint(gx-gxo, gy-gyo);
+							}
+						}
+					}
+				}
+				else
+				{
+					double gx, gy, gh, gw;
+					m_doc->m_Selection->setGroupRect();
+					m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
+					int dX=qRound(newX - m_mousePressPoint.x()), dY=qRound(newY - m_mousePressPoint.y());
+					erf = true;
+					if (m->modifiers() & Qt::ControlModifier)
+					{
+						if (abs(dX)>abs(dY))
+							dY=0;
+						else
+						if (abs(dY)>abs(dX))
+							dX=0;
+						erf=false;
+						dX+=dragConstrainInitPtX-qRound(gx);
+						dY+=dragConstrainInitPtY-qRound(gy);
+					}
+					m_objectDeltaPos.setXY(dX, dY);
+					if (m_doc->SnapGuides)
+					{
+						m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
+						double nx = gx + m_objectDeltaPos.x();
+						double ny = gy + m_objectDeltaPos.y();
+						double nxo = nx, nyo = ny;
+						m_doc->ApplyGuides(&nx, &ny);
+						m_objectDeltaPos += FPoint(nx-nxo, ny-nyo);
+						nx = nxo = gx + gw + m_objectDeltaPos.x();
+						ny = nyo = gy + gh + m_objectDeltaPos.y();
+						m_doc->ApplyGuides(&nx, &ny);
+						m_objectDeltaPos += FPoint(nx-nxo, ny-nyo);
+					}
+					if (m_doc->useRaster)
+					{
+						double gx, gy, gh, gw, gxo, gyo;
+						m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
+						gx += m_objectDeltaPos.x();
+						gy += m_objectDeltaPos.y();
+						gxo = gx;
+						gyo = gy;
+						FPoint npx = m_doc->ApplyGridF(FPoint(gx, gy));
+						FPoint npw = m_doc->ApplyGridF(FPoint(gx+gw, gy+gh));
+						if ((fabs(gx-npx.x())) > (fabs((gx+gw)-npw.x())))
+							gx = npw.x() - gw;
+						else
+							gx = npx.x();
+						if ((fabs(gy-npx.y())) > (fabs((gy+gh)-npw.y())))
+							gy = npw.y() - gh;
+						else
+							gy = npx.y();
+						if ((fabs(gx - gxo) < (m_doc->guidesPrefs().guideRad) / m_canvas->scale()) && (fabs(gy - gyo) < (m_doc->guidesPrefs().guideRad) / m_canvas->scale()))
+							m_objectDeltaPos += FPoint(gx-gxo, gy-gyo);
+					}
+				}
+				if (erf)
+				{
+					m_mouseCurrentPoint.setXY(newX, newY);
+				}
+				
+				{
+					double gx, gy, gh, gw;
+					m_doc->m_Selection->getVisualGroupRect(&gx, &gy, &gw, &gh);
+					m_doc->adjustCanvas(FPoint(gx,gy), FPoint(gx+gw, gy+gh));
+					QPoint selectionCenter = m_canvas->canvasToLocal(QPointF(gx+gw/2, gy+gh/2));
+					QPoint localMousePos = m_canvas->canvasToLocal(mousePointDoc);
+					int localwidth = static_cast<int>(gw * m_canvas->scale());
+					int localheight = static_cast<int>(gh * m_canvas->scale());
+					if (localwidth > 200)
+					{
+						localwidth = 0;
+						selectionCenter.setX(localMousePos.x());
+					}
+					if (localheight > 200)
+					{
+						localheight = 0;
+						selectionCenter.setY(localMousePos.y());
+					}
+					m_view->ensureVisible(selectionCenter.x(), selectionCenter.y(), localwidth/2 + 20, localheight/2 + 20);
+					m_canvas->repaint();
+					m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
+					m_canvas->displayCorrectedXYHUD(m->globalPos(), gx + m_objectDeltaPos.x(), gy + m_objectDeltaPos.y());
+				}
+			}
+		}
+		if ((!m_canvas->m_viewMode.m_MouseButtonPressed) && (m_doc->appMode != modeDrawBezierLine))
+		{
+			if (m_doc->m_Selection->isMultipleSelection())
+			{
+//				QRect mpo = QRect(qRound(m->x()/m_canvas->scale())-m_doc->guidesPrefs().grabRad, qRound(m->y()/m_canvas->scale())-m_doc->guidesPrefs().grabRad, m_doc->guidesPrefs().grabRad*2, m_doc->guidesPrefs().grabRad*2);
+//				mpo.moveBy(qRound(m_doc->minCanvasCoordinate.x()), qRound(m_doc->minCanvasCoordinate.y()));
+				double gx, gy, gh, gw;
+				m_doc->m_Selection->getVisualGroupRect(&gx, &gy, &gw, &gh);
+				int how = m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), QRectF(gx, gy, gw, gh));
+//				if ((QRect(static_cast<int>(gx), static_cast<int>(gy), static_cast<int>(gw), static_cast<int>(gh)).intersects(mpo))
+				if (how >= 0)
+				{
+					if (how > 0)
+					{
+						setResizeCursor(how);
+					}
+					else
+					{
+						qApp->changeOverrideCursor(QCursor(Qt::OpenHandCursor));
+					}
+				}
+				else
+				{
+					setModeCursor();
+				}
+				return;
+			}
+			for (int a = 0; a < m_doc->m_Selection->count(); ++a)
+			{
+				currItem = m_doc->m_Selection->itemAt(a);
+				if (currItem->locked())
+					break;
+				QTransform p;
+				m_canvas->Transform(currItem, p);
+				QRect mpo = QRect(m->x()-m_doc->guidesPrefs().grabRadius, m->y()-m_doc->guidesPrefs().grabRadius, m_doc->guidesPrefs().grabRadius*2, m_doc->guidesPrefs().grabRadius*2);
+//				mpo.moveBy(qRound(m_doc->minCanvasCoordinate.x() * m_canvas->scale()), qRound(m_doc->minCanvasCoordinate.y() * m_canvas->scale()));
+				if ((QRegion(p.map(QPolygon(QRect(-3, -3, static_cast<int>(currItem->width()+6), static_cast<int>(currItem->height()+6))))).contains(mpo)))
+				{
+					QRect tx = p.mapRect(QRect(0, 0, static_cast<int>(currItem->width()), static_cast<int>(currItem->height())));
+					if ((tx.intersects(mpo)) && (!currItem->locked()))
+					{
+						qApp->changeOverrideCursor(QCursor(Qt::OpenHandCursor));
+						if (!currItem->sizeLocked())
+							m_view->HandleCurs(currItem, mpo);
+					}
+				}
+				else
+				{
+//					setModeCursor();
+				}
+			}
+			if (GetItem(&currItem) && m_doc->appMode == modeNormal)
+			{
+				int how = m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), currItem);
+				if (how > 0)
+				{
+					if(currItem->asLine())
+						qApp->changeOverrideCursor(QCursor(Qt::SizeAllCursor));
+					else if(!currItem->locked() && !currItem->sizeLocked())
+						setResizeCursor(how, currItem->rotation());
+				}
+				else if (how == 0)
+					qApp->changeOverrideCursor(QCursor(Qt::OpenHandCursor));
+				else
+				{
+					qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
+				}
+			}
+		}
+	}
+	else
+	{
+		if ((m_canvas->m_viewMode.m_MouseButtonPressed) && (m->buttons() & Qt::LeftButton))
+		{
+			newX = qRound(mousePointDoc.x()); //m_view->translateToDoc(m->x(), m->y()).x());
+			newY = qRound(mousePointDoc.y()); //m_view->translateToDoc(m->x(), m->y()).y());
+			m_mouseSavedPoint.setXY(newX, newY);
+			QPoint startP = m_canvas->canvasToGlobal(m_mousePressPoint);
+			m_view->redrawMarker->setGeometry(QRect(startP, m->globalPos()).normalized());
+			if (!m_view->redrawMarker->isVisible())
+				m_view->redrawMarker->show();
+			m_view->HaveSelRect = true;
+			return;
+		}
+	}
+}
+
+void CanvasMode_Normal::mousePressEvent(QMouseEvent *m)
+{
+	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
+	PageItem *currItem;
+
+	m_objectDeltaPos  = FPoint(0, 0);
+	m_mousePressPoint = m_mouseCurrentPoint = mousePointDoc;
+	m_mouseSavedPoint = mousePointDoc;
+	m_canvas->m_viewMode.m_MouseButtonPressed = true;
+	m_canvas->m_viewMode.operItemMoving = false;
+	m_view->HaveSelRect = false;
+	m_doc->DragP = false;
+	m_doc->leaveDrag = false;
+	m->accept();
+	m_view->registerMousePress(m->globalPos());
+	QRect mpo(m->x()-m_doc->guidesPrefs().grabRadius, m->y()-m_doc->guidesPrefs().grabRadius, m_doc->guidesPrefs().grabRadius*2, m_doc->guidesPrefs().grabRadius*2);
+//	mpo.moveBy(qRound(m_doc->minCanvasCoordinate.x() * m_canvas->scale()), qRound(m_doc->minCanvasCoordinate.y() * m_canvas->scale()));
+
+	if (m->button() == Qt::MidButton)
+	{
+		m_view->MidButt = true;
+		if (m->modifiers() & Qt::ControlModifier)
+			m_view->DrawNew();
+		return;
+	}
+
+	if ((GetItem(&currItem)) && (!m_lastPosWasOverGuide))
+	{
+		if ((currItem->asLine()) && (!m_doc->m_Selection->isMultipleSelection()))
+		{
+			if (!lineMoveGesture)
+				lineMoveGesture = new LineMove(this);
+			
+			lineMoveGesture->mousePressEvent(m);
+			if (lineMoveGesture->haveLineItem())
+			{
+				m_view->startGesture(lineMoveGesture);
+				return;
+			}
+		}
+		else
+		{
+			bool isMS=m_doc->m_Selection->isMultipleSelection();
+			if (isMS || (!isMS && (!currItem->locked() && !currItem->sizeLocked())))
+			{
+				if (!resizeGesture)
+					resizeGesture = new ResizeGesture(this);
+
+				resizeGesture->mousePressEvent(m);
+				if (resizeGesture->frameHandle() > 0)
+				{
+					m_view->startGesture(resizeGesture);
+					return;
+				}
+			}
+//#7928			else
+//#7928				return;
+		}
+		
+		qApp->changeOverrideCursor(Qt::ClosedHandCursor);
+#if 1				
+		if (m_doc->m_Selection->isMultipleSelection())
+		{
+			m_canvas->PaintSizeRect(QRect());
+			double gx, gy, gh, gw;
+			bool shiftSel = true;
+			m_doc->m_Selection->getVisualGroupRect(&gx, &gy, &gw, &gh);
+			dragConstrainInitPtX = qRound(gx);
+			dragConstrainInitPtY = qRound(gy);
+			frameResizeHandle = m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), QRectF(gx, gy, gw, gh));
+			if (frameResizeHandle == Canvas::OUTSIDE ||
+				(frameResizeHandle == Canvas::INSIDE && m->modifiers() != Qt::NoModifier))
+			{
+				frameResizeHandle = 0;
+				m_doc->m_Selection->delaySignalsOn();
+				m_view->updatesOn(false);
+				shiftSel = SeleItem(m);
+				m_view->updatesOn(true);
+				m_doc->m_Selection->delaySignalsOff();
+			}
+			if (((m_doc->m_Selection->count() == 0) || (!shiftSel)) && (m->modifiers() == Qt::ShiftModifier))
+			{
+				shiftSelItems = true;
+				m_mouseCurrentPoint = m_mousePressPoint = m_mouseSavedPoint = mousePointDoc;
+			}
+			else
+				shiftSelItems = false;
+			m_canvas->setRenderModeFillBuffer();
+		}
+		else // not multiple selection
+		{
+			dragConstrainInitPtX = qRound(currItem->xPos());
+			dragConstrainInitPtY = qRound(currItem->yPos());
+			
+			// dont call SeleItem() without need here:
+			frameResizeHandle = m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), currItem);
+			//#6797
+			if (frameResizeHandle <= 0 || m->modifiers() != Qt::NoModifier)
+			{
+				m_doc->m_Selection->delaySignalsOn();
+				m_view->updatesOn(false);
+				SeleItem(m); //Where we send the mouse press event to select an item
+				if (GetItem(&currItem))
+					frameResizeHandle = m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), currItem);
+				else
+					frameResizeHandle = 0;
+				m_view->updatesOn(true);
+				m_doc->m_Selection->delaySignalsOff();
+			}
+			if ((currItem && !currItem->locked() && frameResizeHandle > 0) == false)
+			{
+				m_mouseCurrentPoint = m_mousePressPoint = m_mouseSavedPoint = mousePointDoc;
+			}
+		}
+		m_canvas->setRenderModeFillBuffer();
+#endif
+	}
+	else // !GetItem()
+	{
+		SeleItem(m);
+		if (m_doc->m_Selection->count() == 0)
+		{
+			m_mouseCurrentPoint = m_mousePressPoint = m_mouseSavedPoint = mousePointDoc;
+			m_view->redrawMarker->setGeometry(m->globalPos().x(), m->globalPos().y(), 1, 1);
+			m_view->redrawMarker->show();
+		}
+		else
+		{
+			m_canvas->setRenderModeFillBuffer();
+		}
+	}
+/*	if (m->button() == MidButton)
+	{
+		MidButt = true;
+		if (m_doc->m_Selection->count() != 0)
+			m_view->Deselect(true);
+		DrawNew();
+	} */
+	if ((m_doc->m_Selection->count() != 0) && (m->button() == Qt::RightButton))
+	{
+		m_canvas->m_viewMode.m_MouseButtonPressed = true;
+		m_mousePressPoint = m_mouseCurrentPoint;
+	}
+// Commented out to fix bug #7865
+//	if ((m_doc->m_Selection->count() != 0) && (m->button() == Qt::LeftButton) && (frameResizeHandle == 0))
+//	{
+//		m_view->startDragTimer();
+//	}
+	m_canvas->PaintSizeRect(QRect());
+}
+
+
+
+void CanvasMode_Normal::mouseReleaseEvent(QMouseEvent *m)
+{
+// 	qDebug("CanvasMode_Normal::mouseReleaseEvent");
+#ifdef GESTURE_FRAME_PREVIEW
+        clearPixmapCache();
+#endif // GESTURE_FRAME_PREVIEW
+	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
+	PageItem *currItem;
+	m_canvas->m_viewMode.m_MouseButtonPressed = false;
+	m_canvas->resetRenderMode();
+	m->accept();
+	m_view->redrawMarker->hide();
+//	m_view->stopDragTimer();
+	//m_canvas->update(); //ugly in a mouseReleaseEvent!!!!!!!
+	if ((!GetItem(&currItem)) && (m->button() == Qt::RightButton) && (!m_doc->DragP))
+	{
+		createContextMenu(NULL, mousePointDoc.x(), mousePointDoc.y());
+		return;
+	}
+	if ((GetItem(&currItem)) && (m->button() == Qt::RightButton) && (!m_doc->DragP))
+	{
+		createContextMenu(currItem, mousePointDoc.x(), mousePointDoc.y());
+		return;
+	}
+	if (m_view->moveTimerElapsed() && (GetItem(&currItem)))
+	{
+//		m_view->stopDragTimer();
+		m_canvas->setRenderModeUseBuffer(false);
+		if (!m_doc->m_Selection->isMultipleSelection())
+		{
+			m_doc->setRedrawBounding(currItem);
+			currItem->OwnPage = m_doc->OnPage(currItem);
+			m_canvas->m_viewMode.operItemResizing = false;
+			if (currItem->asLine())
+				m_view->updateContents();
+		}
+		if (m_canvas->m_viewMode.operItemMoving)
+		{
+			// we want to invalidate all frames under the moved frame
+			// hm, I will try to be more explicit :) - pm
+			int itemIndex = m_doc->Items->count();
+			PageItem* underItem( m_canvas->itemUnderItem(currItem, itemIndex) );
+			while(underItem)
+			{
+				if(underItem->asTextFrame())
+					underItem->asTextFrame()->invalidateLayout();
+				else
+					underItem->invalidateLayout();
+				
+				underItem =  m_canvas->itemUnderItem(currItem, itemIndex);
+			}
+			
+			m_view->updatesOn(false);
+			if (!m_view->groupTransactionStarted())
+			{
+				m_view->startGroupTransaction(Um::Move, "", Um::IMove);
+			}
+			if (m_doc->m_Selection->isMultipleSelection())
+			{
+				m_doc->moveGroup(m_objectDeltaPos.x(), m_objectDeltaPos.y());
+				m_doc->m_Selection->setGroupRect();
+				double gx, gy, gh, gw;
+				m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
+				double nx = gx;
+				double ny = gy;
+				if (!m_doc->ApplyGuides(&nx, &ny))
+				{
+					FPoint npx = m_doc->ApplyGridF(FPoint(gx, gy));
+					FPoint npw = m_doc->ApplyGridF(FPoint(gx+gw, gy+gh));
+					if ((fabs(gx-npx.x())) > (fabs((gx+gw)-npw.x())))
+						nx = npw.x() - gw;
+					else
+						nx = npx.x();
+					if ((fabs(gy-npx.y())) > (fabs((gy+gh)-npw.y())))
+						ny = npw.y() - gh;
+					else
+						ny = npx.y();
+				}
+				m_doc->moveGroup(nx-gx, ny-gy, false);
+				m_doc->m_Selection->setGroupRect();
+				m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
+				nx = gx+gw;
+				ny = gy+gh;
+				if (m_doc->ApplyGuides(&nx, &ny))
+					m_doc->moveGroup(nx-(gx+gw), ny-(gy+gh), false);
+				m_doc->m_Selection->setGroupRect();
+			}
+			else
+			{
+				currItem = m_doc->m_Selection->itemAt(0);
+				m_doc->MoveItem(m_objectDeltaPos.x(), m_objectDeltaPos.y(), currItem);
+				if (m_doc->useRaster)
+				{
+					double nx = currItem->xPos();
+					double ny = currItem->yPos();
+					if (!m_doc->ApplyGuides(&nx, &ny))
+					{
+						m_doc->m_Selection->setGroupRect();
+						double gx, gy, gh, gw, gxo, gyo;
+						m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
+						gxo = gx;
+						gyo = gy;
+						FPoint npx = m_doc->ApplyGridF(FPoint(gx, gy));
+						FPoint npw = m_doc->ApplyGridF(FPoint(gx+gw, gy+gh));
+						if ((fabs(gx-npx.x())) > (fabs((gx+gw)-npw.x())))
+							gx = npw.x() - gw;
+						else
+							gx = npx.x();
+						if ((fabs(gy-npx.y())) > (fabs((gy+gh)-npw.y())))
+							gy = npw.y() - gh;
+						else
+							gy = npx.y();
+						if ((fabs(gx - gxo) < (m_doc->guidesPrefs().guideRad) / m_canvas->scale()) && (fabs(gy - gyo) < (m_doc->guidesPrefs().guideRad) / m_canvas->scale()))
+						{
+							nx += (gx - gxo);
+							ny += (gy - gyo);
+						}
+					}
+					m_doc->MoveItem(nx-currItem->xPos(), ny-currItem->yPos(), currItem);
+				}
+			}
+			m_canvas->m_viewMode.operItemMoving = false;
+			if (m_doc->m_Selection->isMultipleSelection())
+			{
+				double gx, gy, gh, gw;
+				m_doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
+				FPoint maxSize(gx+gw+m_doc->scratch()->Right, gy+gh+m_doc->scratch()->Bottom);
+				FPoint minSize(gx-m_doc->scratch()->Left, gy-m_doc->scratch()->Top);
+				m_doc->adjustCanvas(minSize, maxSize);
+			}
+			m_doc->setRedrawBounding(currItem);
+			currItem->OwnPage = m_doc->OnPage(currItem);
+			if (currItem->OwnPage != -1)
+			{
+				m_doc->setCurrentPage(m_doc->Pages->at(currItem->OwnPage));
+				m_view->setMenTxt(currItem->OwnPage);
+			}
+			//CB done with emitAllToGUI
+			//emit HaveSel(currItem->itemType());
+			//EmitValues(currItem);
+			//CB need this for? a moved item will send its new data with the new xpos/ypos emits
+			//CB TODO And what if we have dragged to a new page. Items X&Y are not updated anyway now
+			//currItem->emitAllToGUI();
+			m_view->updatesOn(true);
+			m_view->updateContents();
+			m_doc->changed();
+		}
+	}
+	//CB Drag selection performed here
+	if (((m_doc->m_Selection->count() == 0) && (m_view->HaveSelRect) && (!m_view->MidButt)) || ((shiftSelItems) && (m_view->HaveSelRect) && (!m_view->MidButt)))
+	{
+		double dx = m_mouseSavedPoint.x() - m_mousePressPoint.x();
+		double dy = m_mouseSavedPoint.y() - m_mousePressPoint.y();
+		QRectF canvasSele = QRectF(m_mousePressPoint.x(), m_mousePressPoint.y(), dx, dy).normalized();
+		QRectF localSele  = m_canvas->canvasToLocal(canvasSele).normalized();
+		if (!m_doc->masterPageMode())
+		{
+			uint docPagesCount=m_doc->Pages->count();
+			uint docCurrPageNo=m_doc->currentPageNumber();
+			for (uint i = 0; i < docPagesCount; ++i)
+			{
+				ScPage*  page = m_doc->Pages->at(i);
+				QRectF pageRect(page->xOffset(), page->yOffset(), page->width(), page->height());
+				if (pageRect.intersects(canvasSele))
+				{
+					if (docCurrPageNo != i)
+					{
+						m_doc->setCurrentPage(m_doc->Pages->at(i));
+						m_view->setMenTxt(i);
+					}
+					break;
+				}
+			}
+			m_view->setRulerPos(m_view->contentsX(), m_view->contentsY());
+		}
+		int docItemCount=m_doc->Items->count();
+		if (docItemCount != 0)
+		{
+			m_doc->m_Selection->delaySignalsOn();
+			for (int a = 0; a < docItemCount; ++a)
+			{
+				PageItem* docItem = m_doc->Items->at(a);
+				if ((m_doc->masterPageMode()) && (docItem->OnMasterPage != m_doc->currentPage()->pageName()))
+					continue;
+				QRect  apr2 = m_canvas->canvasToLocal( docItem->getCurrentBoundingRect(docItem->lineWidth()) );
+				if ((localSele.contains(apr2)) && (docItem->LayerID == m_doc->activeLayer()) && (!m_doc->layerLocked(docItem->LayerID)))
+				{
+					bool redrawSelection=false;
+					m_view->SelectItemNr(a, redrawSelection);
+				}
+			}
+			m_doc->m_Selection->delaySignalsOff();
+			if (m_doc->m_Selection->count() > 1)
+			{
+				m_doc->m_Selection->setGroupRect();
+				double x, y, w, h;
+				m_doc->m_Selection->getGroupRect(&x, &y, &w, &h);
+				m_view->getGroupRectScreen(&x, &y, &w, &h);
+			}
+		}
+		m_view->HaveSelRect = false;
+		shiftSelItems = false;
+//		m_view->redrawMarker->hide();
+		m_view->updateContents();
+	}
+	if (m_doc->appMode != modeEdit)
+	{
+		if (!PrefsManager::instance()->appPrefs.uiPrefs.stickyTools)
+			m_view->requestMode(modeNormal);
+		else
+		{
+			int appMode = m_doc->appMode;
+			m_view->requestMode(appMode);
+		}
+	}
+	if (GetItem(&currItem))
+	{
+	//	qApp->changeOverrideCursor(QCursor(Qt::OpenHandCursor));
+		if (m_doc->m_Selection->count() > 1)
+		{
+			m_doc->m_Selection->setGroupRect();
+			double x, y, w, h;
+			m_doc->m_Selection->getGroupRect(&x, &y, &w, &h);
+			m_canvas->m_viewMode.operItemMoving = false;
+			m_canvas->m_viewMode.operItemResizing = false;
+			m_view->updateContents(QRect(static_cast<int>(x-5), static_cast<int>(y-5), static_cast<int>(w+10), static_cast<int>(h+10)));
+			//Now unuseful as PropertiesPalette_XYZ::setCurrentItem() handles multiple selection
+			//m_ScMW->propertiesPalette->setXY(x,y);
+			//m_ScMW->propertiesPalette->setBH(w,h);
+		}
+		/*else
+			currItem->emitAllToGUI();*/
+	}
+	else
+		m_view->Deselect(true);
+	m_canvas->setRenderModeUseBuffer(false);
+	m_doc->DragP = false;
+	m_doc->leaveDrag = false;
+	m_canvas->m_viewMode.operItemMoving = false;
+	m_canvas->m_viewMode.operItemResizing = false;
+	m_view->MidButt = false;
+	shiftSelItems = false;
+	if (m_view->groupTransactionStarted())
+	{
+		for (int i = 0; i < m_doc->m_Selection->count(); ++i)
+			m_doc->m_Selection->itemAt(i)->checkChanges(true);
+		m_view->endGroupTransaction();
+	}
+	for (int i = 0; i < m_doc->m_Selection->count(); ++i)
+		m_doc->m_Selection->itemAt(i)->checkChanges(true);
+	//Commit drag created items to undo manager.
+	if (m_doc->m_Selection->itemAt(0)!=NULL)
+	{
+		m_doc->itemAddCommit(m_doc->m_Selection->itemAt(0)->ItemNr);
+	}
+	//Make sure the Zoom spinbox and page selector dont have focus if we click on the canvas
+	m_view->zoomSpinBox->clearFocus();
+	m_view->pageSelector->clearFocus();
+	if (m_doc->m_Selection->itemAt(0) != 0) // is there the old clip stored for the undo action
+	{
+		currItem = m_doc->m_Selection->itemAt(0);
+		m_doc->nodeEdit.finishTransaction(currItem);
+	}
+}
+
+void CanvasMode_Normal::keyPressEvent(QKeyEvent *e)
+{
+	commonkeyPressEvent_NormalNodeEdit(e);
+}
+
+void CanvasMode_Normal::keyReleaseEvent(QKeyEvent *e)
+{
+	commonkeyReleaseEvent(e);
+}
+
+//CB-->Doc/Fix
+bool CanvasMode_Normal::SeleItem(QMouseEvent *m)
+{
+	m_canvas->m_viewMode.operItemSelecting = true;
+	const unsigned SELECT_IN_GROUP = Qt::AltModifier; // Qt::MetaModifier;
+	const unsigned SELECT_MULTIPLE = Qt::ShiftModifier;
+	const unsigned SELECT_BENEATH = Qt::ControlModifier;
+	QTransform p;
+	PageItem *currItem;
+	m_canvas->m_viewMode.m_MouseButtonPressed = true;
+	FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
+	m_mouseCurrentPoint  = mousePointDoc;
+	double grabRadius = m_doc->guidesPrefs().grabRadius / m_canvas->scale();
+	int MxpS = static_cast<int>(mousePointDoc.x()); //m->x()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.x());
+	int MypS = static_cast<int>(mousePointDoc.y()); //m->y()/m_canvas->scale() + 0*m_doc->minCanvasCoordinate.y());
+	QRectF mpo(m_mouseCurrentPoint.x()-grabRadius, m_mouseCurrentPoint.y()-grabRadius, grabRadius*2, grabRadius*2);
+	m_doc->nodeEdit.deselect();
+
+	if(!m_doc->guidesPrefs().guidePlacement) // guides are on foreground and want to be processed first
+	{
+		if ((m_doc->guidesPrefs().guidesShown) && (m_doc->OnPage(MxpS, MypS) != -1))
+		{
+			// #9002: Resize points undraggable when object is aligned to a guide
+			// Allow item resize when guides are aligned to item while preserving
+			// ability to drag guide when guis is in foreground and inside selection
+			bool enableGuideGesture(true);
+			if (m_doc->m_Selection->count() > 0)
+			{
+				double gx(0.0), gy(0.0), gw(0.0), gh(0.0);
+				m_doc->m_Selection->setGroupRect();
+				m_doc->m_Selection->getVisualGroupRect(&gx, &gy, &gw, &gh);
+				Canvas::FrameHandle frameResizeHandle = m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), QRectF(gx, gy, gw, gh));
+				enableGuideGesture = (frameResizeHandle == Canvas::INSIDE);
+			}
+			if (enableGuideGesture)
+			{
+				if (!guideMoveGesture)
+				{
+					guideMoveGesture = new RulerGesture(m_view, RulerGesture::HORIZONTAL);
+					connect(guideMoveGesture,SIGNAL(guideInfo(int, qreal)), m_ScMW->alignDistributePalette,SLOT(setGuide(int, qreal)));
+				}
+				if ( (!m_doc->GuideLock) && (guideMoveGesture->mouseHitsGuide(mousePointDoc)) )
+				{
+					m_view->startGesture(guideMoveGesture);
+					guideMoveGesture->mouseMoveEvent(m);
+					m_doc->m_Selection->connectItemToGUI();
+				//	qDebug()<<"Out Of SeleItem"<<__LINE__;
+					return true;
+				}
+				else
+				{
+				// If we call startGesture now, a new guide is created each time.
+				// ### could be a weakness to avoid calling it tho.
+	 			//	m_view->startGesture(guideMoveGesture);
+					guideMoveGesture->mouseSelectGuide(m);
+				}
+			}
+		}
+	}
+	bool pageChanged(false);
+	if (!m_doc->masterPageMode())
+	{
+		int pgNum = -1;
+		int docPageCount = static_cast<int>(m_doc->Pages->count() - 1);
+		MarginStruct pageBleeds;
+		bool drawBleed = false;
+		if (m_doc->bleeds()->hasNonZeroValue() && m_doc->guidesPrefs().showBleed)
+			drawBleed = true;
+		for (int a = docPageCount; a > -1; a--)
+		{
+			if (drawBleed)
+				m_doc->getBleeds(a, pageBleeds);
+			int x = static_cast<int>(m_doc->Pages->at(a)->xOffset() - pageBleeds.Left);
+			int y = static_cast<int>(m_doc->Pages->at(a)->yOffset() - pageBleeds.Top);
+			int w = static_cast<int>(m_doc->Pages->at(a)->width() + pageBleeds.Left + pageBleeds.Right);
+			int h = static_cast<int>(m_doc->Pages->at(a)->height() + pageBleeds.Bottom + pageBleeds.Top);
+			if (QRect(x, y, w, h).contains(MxpS, MypS))
+			{
+				pgNum = static_cast<int>(a);
+				if (drawBleed)  // check again if its really on the correct page
+				{
+					for (int a2 = docPageCount; a2 > -1; a2--)
+					{
+						int xn = static_cast<int>(m_doc->Pages->at(a2)->xOffset());
+						int yn = static_cast<int>(m_doc->Pages->at(a2)->yOffset());
+						int wn = static_cast<int>(m_doc->Pages->at(a2)->width());
+						int hn = static_cast<int>(m_doc->Pages->at(a2)->height());
+						if (QRect(xn, yn, wn, hn).contains(MxpS, MypS))
+						{
+							pgNum = static_cast<int>(a2);
+							break;
+						}
+					}
+				}
+				break;
+			}
+		}
+		if (pgNum >= 0)
+		{
+			if (m_doc->currentPageNumber() != pgNum)
+			{
+				m_doc->setCurrentPage(m_doc->Pages->at(unsigned(pgNum)));
+				m_view->setMenTxt(unsigned(pgNum));
+				pageChanged = true;
+			}
+		}
+		m_view->setRulerPos(m_view->contentsX(), m_view->contentsY());
+	}
+	
+	currItem = NULL;
+	if ((m->modifiers() & SELECT_BENEATH) != 0)
+	{
+		for (int i=0; i < m_doc->m_Selection->count(); ++i)
+		{
+			if (m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), m_doc->m_Selection->itemAt(i)) >= 0)
+			{
+				currItem = m_doc->m_Selection->itemAt(i);
+				m_doc->m_Selection->removeItem(currItem);
+				break;
+			}
+		}
+	}
+	else if ( (m->modifiers() & SELECT_MULTIPLE) == Qt::NoModifier)
+	{
+		m_view->Deselect(false);
+	}
+	currItem = m_canvas->itemUnderCursor(m->globalPos(), currItem, (m->modifiers() & SELECT_IN_GROUP));
+	if (currItem)
+	{
+		m_doc->m_Selection->delaySignalsOn();
+		if (m_doc->m_Selection->containsItem(currItem))
+		{
+			m_doc->m_Selection->removeItem(currItem);
+		}
+		else
+		{
+			//CB: If we have a selection but the user clicks with control on another item that is not below the current
+			//then clear and select the new item
+			if ((m->modifiers() == SELECT_BENEATH) && m_canvas->frameHitTest(QPointF(mousePointDoc.x(),mousePointDoc.y()), currItem) >= 0)
+				m_doc->m_Selection->clear();
+			//CB: #7186: This was prependItem, does not seem to need to be anymore with current select code
+			m_doc->m_Selection->addItem(currItem);
+			if ( (m->modifiers() & SELECT_IN_GROUP) && (!currItem->isGroup()))
+			{
+				currItem->isSingleSel = true;
+			}
+		}
+		if(pageChanged)
+		{
+			m_canvas->m_viewMode.forceRedraw = true;
+			m_canvas->update();
+		}
+		else
+			m_canvas->update();
+		
+		m_doc->m_Selection->delaySignalsOff();
+		if (m_doc->m_Selection->count() > 1)
+		{
+			m_doc->beginUpdate();
+			for (int aa = 0; aa < m_doc->m_Selection->count(); ++aa)
+			{
+				PageItem *bb = m_doc->m_Selection->itemAt(aa);
+				bb->update();
+			}
+			m_doc->endUpdate();
+			m_doc->m_Selection->setGroupRect();
+			double x, y, w, h;
+			m_doc->m_Selection->getGroupRect(&x, &y, &w, &h);
+			m_view->getGroupRectScreen(&x, &y, &w, &h);
+		}
+		return true;
+	}
+	if ((m_doc->guidesPrefs().guidesShown) /*&& (!m_doc->GuideLock)*/ && (m_doc->OnPage(MxpS, MypS) != -1))
+	{
+		if (!guideMoveGesture)
+		{
+			guideMoveGesture = new RulerGesture(m_view, RulerGesture::HORIZONTAL);
+			connect(guideMoveGesture,SIGNAL(guideInfo(int, qreal)), m_ScMW->alignDistributePalette,SLOT(setGuide(int, qreal)));
+		}
+		if ( (!m_doc->GuideLock) && (guideMoveGesture->mouseHitsGuide(mousePointDoc)) )
+		{
+			m_view->startGesture(guideMoveGesture);
+			guideMoveGesture->mouseMoveEvent(m);
+			m_doc->m_Selection->connectItemToGUI();
+			return true;
+		}
+		else
+		{
+			// If we call startGesture now, a new guide is created each time.
+			// ### could be a weakness to avoid calling it tho.
+// 			m_view->startGesture(guideMoveGesture);
+			guideMoveGesture->mouseSelectGuide(m);
+		}
+	}
+	m_doc->m_Selection->connectItemToGUI();
+	if ( !(m->modifiers() & SELECT_MULTIPLE))
+	{
+		if(m_doc->m_Selection->isEmpty())
+		{
+			m_canvas->m_viewMode.forceRedraw = true;
+			m_canvas->update();
+		}
+		else
+			m_view->Deselect(true);
+	}
+	return false;
+}
+
+void CanvasMode_Normal::importToPage()
+{
+	QString fileName;
+	QString allFormats = tr("All Supported Formats")+" (";
+	QStringList formats;
+	int fmtCode = FORMATID_ODGIMPORT;
+	const FileFormat *fmt = LoadSavePlugin::getFormatById(fmtCode);
+	while (fmt != 0)
+	{
+		if (fmt->load)
+		{
+			formats.append(fmt->filter);
+			int an = fmt->filter.indexOf("(");
+			int en = fmt->filter.indexOf(")");
+			while (an != -1)
+			{
+				allFormats += fmt->filter.mid(an+1, en-an-1)+" ";
+				an = fmt->filter.indexOf("(", en);
+				en = fmt->filter.indexOf(")", an);
+			}
+		}
+		fmtCode++;
+		fmt = LoadSavePlugin::getFormatById(fmtCode);
+	}
+	allFormats += "*.sce *.SCE);;";
+	formats.append("Scribus Objects (*.sce *.SCE)");
+	qSort(formats);
+	allFormats += formats.join(";;");
+	PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs");
+	QString wdir = dirs->get("pastefile", ".");
+	FPoint pastePoint = m_mouseCurrentPoint;
+	CustomFDialog dia(m_view, wdir, tr("Open"), allFormats, fdExistingFiles);
+	if (dia.exec() == QDialog::Accepted)
+		fileName = dia.selectedFile();
+	else
+		return;
+	if (!fileName.isEmpty())
+	{
+		PrefsManager::instance()->prefsFile->getContext("dirs")->set("pastefile", fileName.left(fileName.lastIndexOf("/")));
+		m_doc->setLoading(true);
+		QFileInfo fi(fileName);
+		bool savedAlignGrid = m_doc->useRaster;
+		bool savedAlignGuides = m_doc->SnapGuides;
+		m_doc->useRaster = false;
+		m_doc->SnapGuides = false;
+		if (fi.suffix().toLower() == "sce")
+			m_ScMW->slotElemRead(fileName, pastePoint.x(), pastePoint.y(), true, false, m_doc, m_doc->view());
+		else
+		{
+			FileLoader *fileLoader = new FileLoader(fileName);
+			int testResult = fileLoader->TestFile();
+			delete fileLoader;
+			if ((testResult != -1) && (testResult >= FORMATID_ODGIMPORT))
+			{
+				const FileFormat * fmt = LoadSavePlugin::getFormatById(testResult);
+				if( fmt )
+				{
+					fmt->loadFile(fileName, LoadSavePlugin::lfUseCurrentPage|LoadSavePlugin::lfInteractive|LoadSavePlugin::lfScripted);
+				}
+			}
+			if (m_doc->m_Selection->count() > 0)
+			{
+				double x2, y2, w, h;
+				m_doc->m_Selection->getGroupRect(&x2, &y2, &w, &h);
+				m_doc->moveGroup(pastePoint.x() - x2, pastePoint.y() - y2);
+				m_ScMW->requestUpdate(reqColorsUpdate | reqLineStylesUpdate | reqTextStylesUpdate);
+			}
+		}
+		for (int a = 0; a < m_doc->m_Selection->count(); ++a)
+		{
+			PageItem *currItem = m_doc->m_Selection->itemAt(a);
+			currItem->LayerID = m_doc->activeLayer();
+		}
+		m_doc->useRaster = savedAlignGrid;
+		m_doc->SnapGuides = savedAlignGuides;
+		m_doc->setLoading(false);
+		m_doc->view()->DrawNew();
+		if (m_doc->m_Selection->count() > 0)
+		{
+			m_doc->m_Selection->connectItemToGUI();
+			m_ScMW->HaveNewSel(m_doc->m_Selection->itemAt(0)->itemType());
+		}
+	}
+}
+
+void CanvasMode_Normal::createContextMenu(PageItem* currItem, double mx, double my)
+{
+	ContextMenu* cmen=NULL;
+	qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
+	m_view->setObjectUndoMode();
+	m_mouseCurrentPoint.setXY(mx, my);
+	if(currItem!=NULL)
+		cmen = new ContextMenu(*(m_doc->m_Selection), m_ScMW, m_doc);
+	else
+		cmen = new ContextMenu(m_ScMW, m_doc, mx, my);
+	if (cmen)
+		cmen->exec(QCursor::pos());
+	m_view->setGlobalUndoMode();
+	delete cmen;
+}

Modified: trunk/Scribus/scribus/documentchecker.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/documentchecker.cpp
==============================================================================
--- trunk/Scribus/scribus/documentchecker.cpp (original)
+++ trunk/Scribus/scribus/documentchecker.cpp Fri Jul 29 09:02:47 2011
@@ -23,7 +23,7 @@
 
 #include "commonstrings.h"
 #include "documentchecker.h"
-#include "page.h"
+#include "scpage.h"
 #include "pageitem.h"
 #include "pdf_analyzer.h"
 #include "sccolor.h"
@@ -143,6 +143,21 @@
 						}
 					}
 				}
+				else if (currItem->GrType == 12)
+				{
+					for (int grow = 0; grow < currItem->meshGradientPatches.count(); grow++)
+					{
+						meshGradientPatch patch = currItem->meshGradientPatches[grow];
+						if (currItem->meshGradientPatches[grow].TL.transparency != 1.0)
+							itemError.insert(Transparency, 0);
+						if (currItem->meshGradientPatches[grow].TR.transparency != 1.0)
+							itemError.insert(Transparency, 0);
+						if (currItem->meshGradientPatches[grow].BR.transparency != 1.0)
+							itemError.insert(Transparency, 0);
+						if (currItem->meshGradientPatches[grow].BL.transparency != 1.0)
+							itemError.insert(Transparency, 0);
+					}
+				}
 				else
 				{
 					QList<VColorStop*> colorStops = currItem->fill_gradient.colorStops();
@@ -412,6 +427,21 @@
 						}
 					}
 				}
+				else if (currItem->GrType == 12)
+				{
+					for (int grow = 0; grow < currItem->meshGradientPatches.count(); grow++)
+					{
+						meshGradientPatch patch = currItem->meshGradientPatches[grow];
+						if (currItem->meshGradientPatches[grow].TL.transparency != 1.0)
+							itemError.insert(Transparency, 0);
+						if (currItem->meshGradientPatches[grow].TR.transparency != 1.0)
+							itemError.insert(Transparency, 0);
+						if (currItem->meshGradientPatches[grow].BR.transparency != 1.0)
+							itemError.insert(Transparency, 0);
+						if (currItem->meshGradientPatches[grow].BL.transparency != 1.0)
+							itemError.insert(Transparency, 0);
+					}
+				}
 				else
 				{
 					QList<VColorStop*> colorStops = currItem->fill_gradient.colorStops();

Modified: trunk/Scribus/scribus/fileloader.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/fileloader.cpp
==============================================================================
--- trunk/Scribus/scribus/fileloader.cpp (original)
+++ trunk/Scribus/scribus/fileloader.cpp Fri Jul 29 09:02:47 2011
@@ -26,7 +26,7 @@
 #include "ui/fontreplacedialog.h"
 #include "hyphenator.h"
 #include "ui/missing.h"
-#include "page.h"
+#include "scpage.h"
 #include "pluginmanager.h"
 #include "plugins/formatidlist.h"
 #include "pagestructs.h"
@@ -88,11 +88,13 @@
 		int s = fmt.indexOf("(");
 		int e = fmt.lastIndexOf(")");
 		QString f = fmt.mid(s+1, e-s-1);
+#ifndef HAVE_POPPLER
 		if (f.contains("pdf"))	// for removing PDF from the list
 		{
 			ind = a;
 			continue;
 		}
+#endif
 		fmtString += f + " ";
 	}
 	fmtString += ");;";

Modified: trunk/Scribus/scribus/fonts/scfontmetrics.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/fonts/scfontmetrics.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/scfontmetrics.cpp (original)
+++ trunk/Scribus/scribus/fonts/scfontmetrics.cpp Fri Jul 29 09:02:47 2011
@@ -15,7 +15,7 @@
 
 #include "fpoint.h"
 #include "fpointarray.h"
-#include "page.h"
+#include "scpage.h"
 #include "scfontmetrics.h"
 #include "scfonts.h"
 #include "scpainter.h"

Modified: trunk/Scribus/scribus/guidemanagercore.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/guidemanagercore.cpp
==============================================================================
--- trunk/Scribus/scribus/guidemanagercore.cpp (original)
+++ trunk/Scribus/scribus/guidemanagercore.cpp Fri Jul 29 09:02:47 2011
@@ -9,7 +9,7 @@
 #include <QTabWidget>
 #include "guidemanagercore.h"
 #include "scpainter.h"
-#include "page.h"
+#include "scpage.h"
 #include "fpoint.h"
 #include "undomanager.h"
 #include "undostate.h"
@@ -38,7 +38,7 @@
 	horizontalAutoG.clear();
 }
 
-GuideManagerCore::GuideManagerCore(Page *parentPage):
+GuideManagerCore::GuideManagerCore(ScPage *parentPage):
 	undoManager(UndoManager::instance()),
 	m_page(parentPage),
 	m_horizontalAutoGap(0.0),
@@ -58,7 +58,7 @@
 {
 }
 
-void GuideManagerCore::setPage(Page *p)
+void GuideManagerCore::setPage(ScPage *p)
 {
 	m_page = p;
 }
@@ -236,7 +236,7 @@
 	return -1.0; // just for compiler warning
 }
 
-Guides GuideManagerCore::getAutoHorizontals(Page* page)
+Guides GuideManagerCore::getAutoHorizontals(ScPage* page)
 {
 	Guides guides;
 	double rowSize;
@@ -286,7 +286,7 @@
 	return guides;
 }
 
-Guides GuideManagerCore::getAutoVerticals(Page* page)
+Guides GuideManagerCore::getAutoVerticals(ScPage* page)
 {
 	Guides guides;
 	double columnSize;
@@ -690,7 +690,7 @@
 }
 
 
-void GuideManagerIO::readVerticalGuides(const QString guideString, Page *page, GuideManagerCore::GuideType type, bool useOldGuides)
+void GuideManagerIO::readVerticalGuides(const QString guideString, ScPage *page, GuideManagerCore::GuideType type, bool useOldGuides)
 {
 	QStringList gVal(guideString.split(' ', QString::SkipEmptyParts));
 	for (QStringList::Iterator it = gVal.begin(); it != gVal.end(); ++it )
@@ -699,7 +699,7 @@
 			page->guides.addVertical(ScCLocale::toDoubleC((*it)), type);
 }
 
-void GuideManagerIO::readHorizontalGuides(const QString guideString, Page *page, GuideManagerCore::GuideType type, bool useOldGuides)
+void GuideManagerIO::readHorizontalGuides(const QString guideString, ScPage *page, GuideManagerCore::GuideType type, bool useOldGuides)
 {
 	QStringList gVal(guideString.split(' ', QString::SkipEmptyParts));
 	for (QStringList::Iterator it = gVal.begin(); it != gVal.end(); ++it )
@@ -708,7 +708,7 @@
 			page->guides.addHorizontal(ScCLocale::toDoubleC((*it)), type);
 }
 
-QString GuideManagerIO::writeHorizontalGuides(Page *page, GuideManagerCore::GuideType type)
+QString GuideManagerIO::writeHorizontalGuides(ScPage *page, GuideManagerCore::GuideType type)
 {
 	Guides::iterator it;
 	QString retval;
@@ -722,7 +722,7 @@
 	return retval;
 }
 
-QString GuideManagerIO::writeVerticalGuides(Page *page, GuideManagerCore::GuideType type)
+QString GuideManagerIO::writeVerticalGuides(ScPage *page, GuideManagerCore::GuideType type)
 {
 	Guides::iterator it;
 	QString retval;
@@ -736,12 +736,12 @@
 	return retval;
 }
 
-QString GuideManagerIO::writeSelection(Page *page)
+QString GuideManagerIO::writeSelection(ScPage *page)
 {
 	return QString("%1 %2 %3 %4").arg(page->guides.gx).arg(page->guides.gy).arg(page->guides.gw).arg(page->guides.gh);
 }
 
-void GuideManagerIO::readSelection(const QString guideString, Page *page)
+void GuideManagerIO::readSelection(const QString guideString, ScPage *page)
 {
 	// TODO: examine this check in 134vs.134qt4 - PV
 	if (guideString.isNull() || guideString.isEmpty())

Modified: trunk/Scribus/scribus/guidemanagercore.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/guidemanagercore.h
==============================================================================
--- trunk/Scribus/scribus/guidemanagercore.h (original)
+++ trunk/Scribus/scribus/guidemanagercore.h Fri Jul 29 09:02:47 2011
@@ -14,7 +14,7 @@
 #include "scribusapi.h"
 
 class QColor;
-class Page;
+class ScPage;
 class ScPainter;
 class UndoManager;
 class ScribusDoc;
@@ -37,7 +37,7 @@
 {
 public:
 	GuideManagerCore();
-	GuideManagerCore(Page* parentPage);
+	GuideManagerCore(ScPage* parentPage);
 	~GuideManagerCore();
 
 	typedef enum {Standard, Auto} GuideType;
@@ -56,8 +56,8 @@
 	double horizontal(uint ix, GuideType type);
 	double vertical(uint ix, GuideType type);
 
-	Guides getAutoHorizontals(Page* page = NULL);
-	Guides getAutoVerticals(Page* page = NULL);
+	Guides getAutoHorizontals(ScPage* page = NULL);
+	Guides getAutoVerticals(ScPage* page = NULL);
 
 	void clearHorizontals(GuideType type);
 	void clearVerticals(GuideType type);
@@ -70,7 +70,7 @@
 	int isMouseOnHorizontal(double low, double high, GuideType type);
 	int isMouseOnVertical(double low, double high, GuideType type);
 
-	void setPage(Page *p);
+	void setPage(ScPage *p);
 
 	QPair<double, double> topLeft(double x, double y);// const;
 	QPair<double, double> topRight(double x, double y);// const;
@@ -110,7 +110,7 @@
 
 private:
 	UndoManager * const undoManager;
-	Page* m_page;
+	ScPage* m_page;
 	Guides horizontalStdG;
 	Guides verticalStdG;
 	Guides horizontalAutoG;
@@ -150,7 +150,7 @@
 		in the ancient times. So when is the obsolete XML attribute found in reading document
 		the old reading method is used. All guides are saved in new format then. */
 		static void readHorizontalGuides(const QString guideString,
-										 Page *page,
+										 ScPage *page,
 										 GuideManagerCore::GuideType type,
 										 bool useOldGuides=false);
 
@@ -164,15 +164,15 @@
 		in the ancient times. So when is the obsolete XML attribute found in reading document
 		the old reading method is used. All guides are saved in new format then. */
 		static void readVerticalGuides(const QString guideString,
-									   Page *page,
+									   ScPage *page,
 									   GuideManagerCore::GuideType type,
 									   bool useOldGuides=false);
 
-		static QString writeHorizontalGuides(Page *page, GuideManagerCore::GuideType type);
-		static QString writeVerticalGuides(Page *page, GuideManagerCore::GuideType type);
+		static QString writeHorizontalGuides(ScPage *page, GuideManagerCore::GuideType type);
+		static QString writeVerticalGuides(ScPage *page, GuideManagerCore::GuideType type);
 
-		static void readSelection(const QString guideString, Page *page);
-		static QString writeSelection(Page *page);
+		static void readSelection(const QString guideString, ScPage *page);
+		static QString writeSelection(ScPage *page);
 };
 
 #endif

Modified: trunk/Scribus/scribus/mesh.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/mesh.cpp
==============================================================================
--- trunk/Scribus/scribus/mesh.cpp (original)
+++ trunk/Scribus/scribus/mesh.cpp Fri Jul 29 09:02:47 2011
@@ -62,3 +62,12 @@
 	controlLeft = gr.point(3);
 	controlRight = gr.point(4);
 }
+
+void meshPoint::resetTo(FPoint p)
+{
+	gridPoint = p;
+	controlLeft = gridPoint;
+	controlRight = gridPoint;
+	controlTop = gridPoint;
+	controlBottom = gridPoint;
+}

Modified: trunk/Scribus/scribus/mesh.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/mesh.h
==============================================================================
--- trunk/Scribus/scribus/mesh.h (original)
+++ trunk/Scribus/scribus/mesh.h Fri Jul 29 09:02:47 2011
@@ -37,6 +37,7 @@
 	void moveRel(double dx, double dy);
 	void moveAbs(double x, double y);
 	void transform(QTransform t);
+	void resetTo(FPoint p);
 	FPoint gridPoint;
 	FPoint controlTop;
 	FPoint controlBottom;
@@ -48,4 +49,12 @@
 	QColor  color;
 };
 
+struct meshGradientPatch
+{
+	meshPoint TL;
+	meshPoint TR;
+	meshPoint BL;
+	meshPoint BR;
+};
+
 #endif

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp (original)
+++ trunk/Scribus/scribus/pageitem.cpp Fri Jul 29 09:02:47 2011
@@ -41,7 +41,7 @@
 #include "colorblind.h"
 #include "commonstrings.h"
 #include "ui/guidemanager.h"
-#include "page.h"
+#include "scpage.h"
 #include "pageitem_textframe.h"
 #include "pageitem_latexframe.h"
 #include "prefsmanager.h"
@@ -113,6 +113,7 @@
 	GrCol2Shade(other.GrCol2Shade),
 	GrCol3Shade(other.GrCol3Shade),
 	GrCol4Shade(other.GrCol4Shade),
+	meshGradientPatches(other.meshGradientPatches),
 	meshGradientArray(other.meshGradientArray),
 	selectedMeshPointX(other.selectedMeshPointX),
 	selectedMeshPointY(other.selectedMeshPointY),
@@ -414,6 +415,7 @@
 	GrCol2Shade = 100;
 	GrCol3Shade = 100;
 	GrCol4Shade = 100;
+	meshGradientPatches.clear();
 	meshGradientArray.clear();
 	selectedMeshPointX = -1;
 	selectedMeshPointY = -1;
@@ -1163,7 +1165,7 @@
 	}
 	if (UndoManager::undoEnabled())
 	{
-		ItemState<std::pair<PageItem*, PageItem*> > *is = new ItemState<std::pair<PageItem*, PageItem*> >(UndoManager::LinkTextFrame);
+		ScItemState<std::pair<PageItem*, PageItem*> > *is = new ScItemState<std::pair<PageItem*, PageItem*> >(UndoManager::LinkTextFrame);
 		is->set("LINK_TEXT_FRAME", "linkTextFrame");
 		is->setItem(std::pair<PageItem*, PageItem*>(this, NextBox));
 		undoManager->action(this, is);
@@ -1214,7 +1216,7 @@
 		NextBox = NULL;
 		if (UndoManager::undoEnabled())
 		{
-			ItemState<std::pair<PageItem*, PageItem*> > *is = new ItemState<std::pair<PageItem*, PageItem*> >(UndoManager::UnlinkTextFrame);
+			ScItemState<std::pair<PageItem*, PageItem*> > *is = new ScItemState<std::pair<PageItem*, PageItem*> >(UndoManager::UnlinkTextFrame);
 			is->set("UNLINK_TEXT_FRAME", "unlinkTextFrame");
 			is->setItem(std::pair<PageItem*, PageItem*>(this, undoNextBox));
 			undoManager->action(this, is);
@@ -1486,6 +1488,10 @@
 								case 11:
 									p->setFillMode(ScPainter::Gradient);
 									p->setMeshGradient(FPoint(0, 0), FPoint(width(), 0), FPoint(width(), height()), FPoint(0, height()), meshGradientArray);
+									break;
+								case 12:
+									p->setFillMode(ScPainter::Gradient);
+									p->setMeshGradient(FPoint(0, 0), FPoint(width(), 0), FPoint(width(), height()), FPoint(0, height()), meshGradientPatches);
 									break;
 							}
 						}
@@ -4016,7 +4022,7 @@
 	SimpleState *ss = dynamic_cast<SimpleState*>(state);
 	bool oldMPMode=m_Doc->masterPageMode();
 	m_Doc->setMasterPageMode(!OnMasterPage.isEmpty());
-	Page *oldCurrentPage = m_Doc->currentPage();
+	ScPage *oldCurrentPage = m_Doc->currentPage();
 	if (!OnMasterPage.isEmpty())
 	{
 		oldCurrentPage = m_Doc->currentPage();
@@ -4469,7 +4475,7 @@
 	}
 	else
 	{
-		ItemState<std::pair<PageItem*, PageItem*> > *is = dynamic_cast<ItemState<std::pair<PageItem*, PageItem*> >*>(state);
+		ScItemState<std::pair<PageItem*, PageItem*> > *is = dynamic_cast<ScItemState<std::pair<PageItem*, PageItem*> >*>(state);
 		asTextFrame()->link(is->getItem().second->asTextFrame());
 	}
 }
@@ -4480,7 +4486,7 @@
 		return;
 	if (isUndo)
 	{
-		ItemState<std::pair<PageItem*, PageItem*> > *is = dynamic_cast<ItemState<std::pair<PageItem*, PageItem*> >*>(state);
+		ScItemState<std::pair<PageItem*, PageItem*> > *is = dynamic_cast<ScItemState<std::pair<PageItem*, PageItem*> >*>(state);
 		asTextFrame()->link(is->getItem().second->asTextFrame());
 	}
 	else
@@ -4522,7 +4528,7 @@
 
 void PageItem::restoreContourLine(SimpleState *state, bool isUndo)
 {
-	ItemState<FPointArray> *is = dynamic_cast<ItemState<FPointArray>*>(state);
+	ScItemState<FPointArray> *is = dynamic_cast<ScItemState<FPointArray>*>(state);
 	if (is)
 	{
 		if (isUndo)
@@ -4540,7 +4546,7 @@
 	// OLD_FRAME_TYPE - original frame type
 	// NEW_FRAME_TYPE - change of frame type
 	// binary QPair<FPointArray, FPointArray> - .first original shape, .second new shape
-	ItemState<QPair<FPointArray,FPointArray> > *is = dynamic_cast<ItemState<QPair<FPointArray,FPointArray> >*>(state);
+	ScItemState<QPair<FPointArray,FPointArray> > *is = dynamic_cast<ScItemState<QPair<FPointArray,FPointArray> >*>(state);
 	if (is)
 	{
 		if (isUndo)
@@ -4582,8 +4588,8 @@
 
 void PageItem::restoreShapeContour(UndoState *state, bool isUndo)
 {
-	ItemState<QPair<FPointArray,FPointArray> > *istate =
-			dynamic_cast<ItemState<QPair<FPointArray,FPointArray> >*>(state);
+	ScItemState<QPair<FPointArray,FPointArray> > *istate =
+			dynamic_cast<ScItemState<QPair<FPointArray,FPointArray> >*>(state);
 	if (istate)
 	{
 		FPointArray oldClip = istate->getItem().first;
@@ -4621,8 +4627,8 @@
 
 void PageItem::restoreImageEffects(UndoState *state, bool isUndo)
 {
-	ItemState<QPair<ScImageEffectList, ScImageEffectList> > *istate =
-	dynamic_cast<ItemState<QPair<ScImageEffectList,ScImageEffectList> >*>(state);
+	ScItemState<QPair<ScImageEffectList, ScImageEffectList> > *istate =
+	dynamic_cast<ScItemState<QPair<ScImageEffectList,ScImageEffectList> >*>(state);
 	if (istate)
 	{
 		if (isUndo)
@@ -4781,7 +4787,21 @@
 				meshGradientArray[grow][gcol].colorName = *it;
 		}
 	}
-
+	for (int col = 0; col < meshGradientPatches.count(); col++)
+	{
+		it = newNames.colors().find(meshGradientPatches[col].TL.colorName);
+		if (it != newNames.colors().end())
+			meshGradientPatches[col].TL.colorName = *it;
+		it = newNames.colors().find(meshGradientPatches[col].TR.colorName);
+		if (it != newNames.colors().end())
+			meshGradientPatches[col].TR.colorName = *it;
+		it = newNames.colors().find(meshGradientPatches[col].BL.colorName);
+		if (it != newNames.colors().end())
+			meshGradientPatches[col].BL.colorName = *it;
+		it = newNames.colors().find(meshGradientPatches[col].BR.colorName);
+		if (it != newNames.colors().end())
+			meshGradientPatches[col].BR.colorName = *it;
+	}
 	cstops = stroke_gradient.colorStops();
 	for (uint cst = 0; cst < stroke_gradient.Stops(); ++cst)
 	{
@@ -4994,6 +5014,16 @@
 			}
 		}
 	}
+	else if (GrType == 12)
+	{
+		for (int col = 0; col < meshGradientPatches.count(); col++)
+		{
+			lists.collectColor(meshGradientPatches[col].TL.colorName);
+			lists.collectColor(meshGradientPatches[col].TR.colorName);
+			lists.collectColor(meshGradientPatches[col].BL.colorName);
+			lists.collectColor(meshGradientPatches[col].BR.colorName);
+		}
+	}
 	if (GrTypeStroke == 0)
 		lists.collectColor(lineColor());
 	else if (GrTypeStroke < 8)
@@ -6492,6 +6522,13 @@
 					{
 						meshGradientArray[grow][gcol].transform(ma);
 					}
+				}
+				for (int col = 0; col < meshGradientPatches.count(); col++)
+				{
+					meshGradientPatches[col].TL.transform(ma);
+					meshGradientPatches[col].TR.transform(ma);
+					meshGradientPatches[col].BL.transform(ma);
+					meshGradientPatches[col].BR.transform(ma);
 				}
 				GrStartX = gr.point(0).x();
 				GrStartY = gr.point(0).y();
@@ -6587,6 +6624,13 @@
 					meshGradientArray[grow][gcol].transform(ma);
 				}
 			}
+			for (int col = 0; col < meshGradientPatches.count(); col++)
+			{
+				meshGradientPatches[col].TL.transform(ma);
+				meshGradientPatches[col].TR.transform(ma);
+				meshGradientPatches[col].BL.transform(ma);
+				meshGradientPatches[col].BR.transform(ma);
+			}
 			GrStartX = gr.point(0).x();
 			GrStartY = gr.point(0).y();
 			GrEndX = gr.point(1).x();

Modified: trunk/Scribus/scribus/pageitem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/pageitem.h
==============================================================================
--- trunk/Scribus/scribus/pageitem.h (original)
+++ trunk/Scribus/scribus/pageitem.h Fri Jul 29 09:02:47 2011
@@ -401,6 +401,7 @@
 	int GrCol2Shade;
 	int GrCol3Shade;
 	int GrCol4Shade;
+	QList<meshGradientPatch> meshGradientPatches;
 	QList<QList<meshPoint> > meshGradientArray;
 	int selectedMeshPointX;
 	int selectedMeshPointY;

Modified: trunk/Scribus/scribus/pageitem_arc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/pageitem_arc.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_arc.cpp (original)
+++ trunk/Scribus/scribus/pageitem_arc.cpp Fri Jul 29 09:02:47 2011
@@ -27,7 +27,7 @@
 #include <cmath>
 #include <cassert>
 
-#include "page.h"
+#include "scpage.h"
 #include "pageitem.h"
 #include "pageitem_arc.h"
 #include "prefsmanager.h"

Modified: trunk/Scribus/scribus/pageitem_group.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/pageitem_group.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_group.cpp (original)
+++ trunk/Scribus/scribus/pageitem_group.cpp Fri Jul 29 09:02:47 2011
@@ -27,7 +27,7 @@
 #include <QApplication>
 
 #include "commonstrings.h"
-#include "page.h"
+#include "scpage.h"
 #include "pageitem_group.h"
 #include "prefsmanager.h"
 #include "scpainter.h"
@@ -139,7 +139,9 @@
 					p->setMaskMode(0);
 				else
 				{
-					p->setPatternMask(&m_Doc->docPatterns[patternMask()], patternMaskScaleX, patternMaskScaleY, patternMaskOffsetX + xPos(), patternMaskOffsetY + yPos(), patternMaskRotation, patternMaskSkewX, patternMaskSkewY, patternMaskMirrorX, patternMaskMirrorY);
+					double scw = Width / groupWidth;
+					double sch = Height / groupHeight;
+					p->setPatternMask(&m_Doc->docPatterns[patternMask()], patternMaskScaleX * scw, patternMaskScaleY * sch, patternMaskOffsetX, patternMaskOffsetY, patternMaskRotation, patternMaskSkewX, patternMaskSkewY, patternMaskMirrorX, patternMaskMirrorY);
 					if (maskType() == 3)
 						p->setMaskMode(2);
 					else

Modified: trunk/Scribus/scribus/pageitem_imageframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/pageitem_imageframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_imageframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_imageframe.cpp Fri Jul 29 09:02:47 2011
@@ -30,7 +30,7 @@
 #include <cassert>
 
 #include "filewatcher.h"
-#include "page.h"
+#include "scpage.h"
 #include "pageitem.h"
 #include "pageitem_imageframe.h"
 #include "prefsmanager.h"

Modified: trunk/Scribus/scribus/pageitem_line.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/pageitem_line.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_line.cpp (original)
+++ trunk/Scribus/scribus/pageitem_line.cpp Fri Jul 29 09:02:47 2011
@@ -24,7 +24,7 @@
 #include <cmath>
 #include <cassert>
 
-#include "page.h"
+#include "scpage.h"
 #include "pageitem.h"
 #include "pageitem_line.h"
 #include "prefsmanager.h"

Modified: trunk/Scribus/scribus/pageitem_pathtext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/pageitem_pathtext.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_pathtext.cpp (original)
+++ trunk/Scribus/scribus/pageitem_pathtext.cpp Fri Jul 29 09:02:47 2011
@@ -29,7 +29,7 @@
 
 #include <cassert>
 
-#include "page.h"
+#include "scpage.h"
 #include "pageitem.h"
 #include "prefsmanager.h"
 #include "scpaths.h"

Modified: trunk/Scribus/scribus/pageitem_polygon.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/pageitem_polygon.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_polygon.cpp (original)
+++ trunk/Scribus/scribus/pageitem_polygon.cpp Fri Jul 29 09:02:47 2011
@@ -24,7 +24,7 @@
 #include <cmath>
 #include <cassert>
 
-#include "page.h"
+#include "scpage.h"
 #include "pageitem.h"
 #include "pageitem_polygon.h"
 #include "prefsmanager.h"

Modified: trunk/Scribus/scribus/pageitem_polyline.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/pageitem_polyline.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_polyline.cpp (original)
+++ trunk/Scribus/scribus/pageitem_polyline.cpp Fri Jul 29 09:02:47 2011
@@ -27,7 +27,7 @@
 #include <cmath>
 #include <cassert>
 
-#include "page.h"
+#include "scpage.h"
 #include "pageitem.h"
 #include "pageitem_polyline.h"
 #include "prefsmanager.h"

Modified: trunk/Scribus/scribus/pageitem_regularpolygon.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/pageitem_regularpolygon.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_regularpolygon.cpp (original)
+++ trunk/Scribus/scribus/pageitem_regularpolygon.cpp Fri Jul 29 09:02:47 2011
@@ -27,7 +27,7 @@
 #include <cmath>
 #include <cassert>
 
-#include "page.h"
+#include "scpage.h"
 #include "pageitem.h"
 #include "pageitem_regularpolygon.h"
 #include "prefsmanager.h"

Modified: trunk/Scribus/scribus/pageitem_spiral.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/pageitem_spiral.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_spiral.cpp (original)
+++ trunk/Scribus/scribus/pageitem_spiral.cpp Fri Jul 29 09:02:47 2011
@@ -28,7 +28,7 @@
 #include <cassert>
 
 #include "commonstrings.h"
-#include "page.h"
+#include "scpage.h"
 #include "pageitem.h"
 #include "pageitem_spiral.h"
 #include "prefsmanager.h"

Modified: trunk/Scribus/scribus/pageitem_symbol.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/pageitem_symbol.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_symbol.cpp (original)
+++ trunk/Scribus/scribus/pageitem_symbol.cpp Fri Jul 29 09:02:47 2011
@@ -27,7 +27,7 @@
 #include <QApplication>
 
 #include "commonstrings.h"
-#include "page.h"
+#include "scpage.h"
 #include "pageitem.h"
 #include "pageitem_symbol.h"
 #include "prefsmanager.h"
@@ -90,7 +90,9 @@
 					p->setMaskMode(0);
 				else
 				{
-					p->setPatternMask(&m_Doc->docPatterns[patternMask()], patternMaskScaleX, patternMaskScaleY, patternMaskOffsetX + xPos(), patternMaskOffsetY + yPos(), patternMaskRotation, patternMaskSkewX, patternMaskSkewY, patternMaskMirrorX, patternMaskMirrorY);
+					double scw = Width / groupWidth;
+					double sch = Height / groupHeight;
+					p->setPatternMask(&m_Doc->docPatterns[patternMask()], patternMaskScaleX * scw, patternMaskScaleY * sch, patternMaskOffsetX, patternMaskOffsetY, patternMaskRotation, patternMaskSkewX, patternMaskSkewY, patternMaskMirrorX, patternMaskMirrorY);
 					if (maskType() == 3)
 						p->setMaskMode(2);
 					else

Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp Fri Jul 29 09:02:47 2011
@@ -35,7 +35,7 @@
 #include "commonstrings.h"
 #include "ui/guidemanager.h"
 #include "hyphenator.h"
-#include "page.h"
+#include "scpage.h"
 #include "pageitem.h"
 #include "pageitem_textframe.h"
 #include "prefsmanager.h"
@@ -125,8 +125,8 @@
 	{
 		int LayerLev = m_Doc->layerLevelFromID(LayerID);
 		uint docItemsCount=m_Doc->Items->count();
-		Page* Mp=0;
-		Page* Dp=0;
+		ScPage* Mp=0;
+		ScPage* Dp=0;
 		PageItem* docItem=0;
 		int LayerLevItem;
 		if (!OnMasterPage.isEmpty())

Modified: trunk/Scribus/scribus/pdflib_core.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/pdflib_core.cpp
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.cpp (original)
+++ trunk/Scribus/scribus/pdflib_core.cpp Fri Jul 29 09:02:47 2011
@@ -62,7 +62,7 @@
 #include "cmsettings.h"
 #include "commonstrings.h"
 #include "ui/multiprogressdialog.h"
-#include "page.h"
+#include "scpage.h"
 #include "pageitem.h"
 #include "pageitem_textframe.h"
 #include "pageitem_group.h"
@@ -1888,7 +1888,7 @@
 	return true;
 }
 
-bool PDFLibCore::PDF_TemplatePage(const Page* pag, bool )
+bool PDFLibCore::PDF_TemplatePage(const ScPage* pag, bool )
 {
 	QString tmp, tmpOut;
 	ActPageP = pag;
@@ -2578,12 +2578,15 @@
 				PutDoc("/BBox [ "+FToStr(-bleedLeft)+" "+FToStr(-Options.bleeds.Bottom)+" "+FToStr(maxBoxX)+" "+FToStr(maxBoxY)+" ]\n");
 //				PutDoc("/BBox [ 0 0 "+FToStr(ActPageP->width())+" "+FToStr(ActPageP->height())+" ]\n");
 				PutDoc("/Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]\n");
-				if (Seite.ImgObjects.count() != 0)
+				if ((Seite.ImgObjects.count() != 0) || (Seite.XObjects.count() != 0))
 				{
 					PutDoc("/XObject <<\n");
 					QMap<QString,int>::Iterator it;
 					for (it = Seite.ImgObjects.begin(); it != Seite.ImgObjects.end(); ++it)
 						PutDoc("/"+it.key()+" "+QString::number(it.value())+" 0 R\n");
+					QMap<QString,int>::Iterator iti;
+					for (iti = Seite.XObjects.begin(); iti != Seite.XObjects.end(); ++iti)
+						PutDoc("/"+iti.key()+" "+QString::number(iti.value())+" 0 R\n");
 					PutDoc(">>\n");
 				}
 				if (Seite.FObjects.count() != 0)
@@ -2642,7 +2645,7 @@
 				if (Options.Compress)
 					PutDoc("\n/Filter /FlateDecode");
 				PutDoc(" >>\nstream\n"+EncStream(Content, templateObject)+"\nendstream\nendobj\n");
-				int pIndex   = doc.MasterPages.indexOf((Page* const) pag) + 1;
+				int pIndex   = doc.MasterPages.indexOf((ScPage* const) pag) + 1;
 				QString name = QString("master_page_obj_%1_%2").arg(pIndex).arg(ite->ItemNr);
 				Seite.XObjects[name] = templateObject;
 			}
@@ -2654,7 +2657,7 @@
 	return true;
 }
 
-void PDFLibCore::PDF_Begin_Page(const Page* pag, QPixmap pm)
+void PDFLibCore::PDF_Begin_Page(const ScPage* pag, QPixmap pm)
 {
 	QString tmp;
 	ActPageP = pag;
@@ -3104,7 +3107,7 @@
 }
 
 
-bool PDFLibCore::PDF_ProcessPage(const Page* pag, uint PNr, bool clip)
+bool PDFLibCore::PDF_ProcessPage(const ScPage* pag, uint PNr, bool clip)
 {
 	ActPageP = pag;
 	ScLayer ll;
@@ -3163,7 +3166,7 @@
 	return true;
 }
 
-bool PDFLibCore::PDF_ProcessMasterElements(const ScLayer& layer, const Page* pag, uint PNr)
+bool PDFLibCore::PDF_ProcessMasterElements(const ScLayer& layer, const ScPage* pag, uint PNr)
 {
 	PageItem* ite;
 	QString output;
@@ -3173,8 +3176,8 @@
 		return true;
 	if (doc.MasterItems.count() <= 0)
 		return true;
-	const Page* mPage = doc.MasterPages.at(doc.MasterNames[doc.DocPages.at(PNr)->MPageNam]);
-	int   mPageIndex  = doc.MasterPages.indexOf((Page* const) mPage) + 1;
+	const ScPage* mPage = doc.MasterPages.at(doc.MasterNames[doc.DocPages.at(PNr)->MPageNam]);
+	int   mPageIndex  = doc.MasterPages.indexOf((ScPage* const) mPage) + 1;
 
 	if (!Options.MirrorH)
 		PutPage("1 0 0 1 0 0 cm\n");
@@ -3238,7 +3241,7 @@
 	return true;
 }
 
-bool PDFLibCore::PDF_ProcessPageElements(const ScLayer& layer, const Page* pag, uint PNr)
+bool PDFLibCore::PDF_ProcessPageElements(const ScLayer& layer, const ScPage* pag, uint PNr)
 {
 	PageItem* ite;
 	QString output;
@@ -3429,7 +3432,7 @@
 	return retString;
 }
 
-QString PDFLibCore::PDF_ProcessTableItem(PageItem* ite, const Page* pag)
+QString PDFLibCore::PDF_ProcessTableItem(PageItem* ite, const ScPage* pag)
 {
 	if ((ite->lineColor() == CommonStrings::None) || (ite->lineWidth() == 0.0))
 		return "";
@@ -3524,7 +3527,7 @@
 	return tmp;
 }
 
-bool PDFLibCore::PDF_ProcessItem(QString& output, PageItem* ite, const Page* pag, uint PNr, bool embedded, bool pattern)
+bool PDFLibCore::PDF_ProcessItem(QString& output, PageItem* ite, const ScPage* pag, uint PNr, bool embedded, bool pattern)
 {
 	QString tmp(""), tmpOut;
 	if (ite->isGroup())
@@ -4326,7 +4329,7 @@
 	return true;
 }
 
-QString PDFLibCore::HandleBrushPattern(PageItem* ite, QPainterPath &path, const Page* pag, uint PNr)
+QString PDFLibCore::HandleBrushPattern(PageItem* ite, QPainterPath &path, const ScPage* pag, uint PNr)
 {
 	QString tmp;
 	tmp = "";
@@ -4726,7 +4729,7 @@
 }
 
 // Return a PDF substring representing a PageItem's text
-QString PDFLibCore::setTextSt(PageItem *ite, uint PNr, const Page* pag)
+QString PDFLibCore::setTextSt(PageItem *ite, uint PNr, const ScPage* pag)
 {
 	int tabCc = 0;
 	int savedOwnPage = ite->OwnPage;
@@ -4952,7 +4955,7 @@
 	return tmp;
 }
 
-bool PDFLibCore::setTextCh(PageItem *ite, uint PNr, double x,  double y, uint d, QString &tmp, QString &tmp2, const ScText *hl, const ParagraphStyle& pstyle, const Page* pag)
+bool PDFLibCore::setTextCh(PageItem *ite, uint PNr, double x,  double y, uint d, QString &tmp, QString &tmp2, const ScText *hl, const ParagraphStyle& pstyle, const ScPage* pag)
 {
 #ifndef NLS_PROTO
 	QString output;
@@ -5780,7 +5783,7 @@
 	return tmp;
 }
 
-void PDFLibCore::getBleeds(const Page* page, double &left, double &right)
+void PDFLibCore::getBleeds(const ScPage* page, double &left, double &right)
 {
 	MarginStruct values;
 	doc.getBleeds(page, Options.bleeds, values);
@@ -5788,7 +5791,7 @@
 	right  = values.Right;
 }
 
-void PDFLibCore::getBleeds(const Page* page, double &left, double &right, double &bottom, double& top)
+void PDFLibCore::getBleeds(const ScPage* page, double &left, double &right, double &bottom, double& top)
 {
 	MarginStruct values;
 	doc.getBleeds(page, Options.bleeds, values);
@@ -5973,6 +5976,17 @@
 				PutDoc("/"+it3p.key()+" "+QString::number(it3p.value())+" 0 R\n");
 			PutDoc(">>\n");
 		}
+		if ((Seite.ImgObjects.count() != 0) || (Seite.XObjects.count() != 0))
+		{
+			PutDoc("/XObject <<\n");
+			QMap<QString,int>::Iterator it;
+			for (it = Seite.ImgObjects.begin(); it != Seite.ImgObjects.end(); ++it)
+				PutDoc("/"+it.key()+" "+QString::number(it.value())+" 0 R\n");
+			QMap<QString,int>::Iterator iti;
+			for (iti = Seite.XObjects.begin(); iti != Seite.XObjects.end(); ++iti)
+				PutDoc("/"+iti.key()+" "+QString::number(iti.value())+" 0 R\n");
+			PutDoc(">>\n");
+		}
 		PutDoc(">>\n");
 		QString stre = "q\n";
 		if (currItem->isGroup())
@@ -6292,12 +6306,15 @@
 	PutDoc("/XStep "+FToStr(pat->width)+"\n");
 	PutDoc("/YStep "+FToStr(pat->height)+"\n");
 	PutDoc("/Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]\n");
-	if (Seite.ImgObjects.count() != 0)
+	if ((Seite.ImgObjects.count() != 0) || (Seite.XObjects.count() != 0))
 	{
 		PutDoc("/XObject <<\n");
 		QMap<QString,int>::Iterator it;
 		for (it = Seite.ImgObjects.begin(); it != Seite.ImgObjects.end(); ++it)
 			PutDoc("/"+it.key()+" "+QString::number(it.value())+" 0 R\n");
+		QMap<QString,int>::Iterator iti;
+		for (iti = Seite.XObjects.begin(); iti != Seite.XObjects.end(); ++iti)
+			PutDoc("/"+iti.key()+" "+QString::number(iti.value())+" 0 R\n");
 		PutDoc(">>\n");
 	}
 	if (Seite.FObjects.count() != 0)
@@ -6617,6 +6634,315 @@
 			encodeColor(vs, colorNames[colInd2], colorShades[colInd2], spotColorSet, spotMode);
 			encodeColor(vs, colorNames[colInd3], colorShades[colInd3], spotColorSet, spotMode);
 		}
+	}
+	PutDoc("/Decode [-40000 40000 -40000 40000 "+entx+"]\n");
+	QString dat = "";
+	for (int vd = 0; vd < vertStream.count(); vd++)
+	{
+		dat += vertStream[vd];
+	}
+	if (Options.Compress)
+		dat = CompressStr(&dat);
+	PutDoc("/Length "+QString::number(dat.length())+"\n");
+	if (Options.Compress)
+		PutDoc("/Filter /FlateDecode\n");
+	PutDoc(">>\nstream\n"+EncStream(dat, shadeObject)+"\nendstream\nendobj\n");
+	uint patObject = newObject();
+	StartObj(patObject);
+	PutDoc("<<\n/Type /Pattern\n");
+	PutDoc("/PatternType 2\n");
+	QTransform mpa;
+	if (inPattern == 0)
+	{
+		if (groupStackPos.count() != 0)
+		{
+			mpa.translate(c->xPos() - groupStackPos.top().x(), groupStackPos.top().y() - c->gYpos);
+			mpa.rotate(-c->rotation());
+		}
+		else
+		{
+			mpa.translate(c->xPos() - ActPageP->xOffset(), ActPageP->height() - (c->yPos() - ActPageP->yOffset()));
+			mpa.rotate(-c->rotation());
+		}
+	}
+	PutDoc("/Matrix ["+FToStr(mpa.m11())+" "+FToStr(mpa.m12())+" "+FToStr(mpa.m21())+" "+FToStr(mpa.m22())+" "+FToStr(mpa.dx())+" "+FToStr(mpa.dy())+"]\n");
+	PutDoc("/Shading "+QString::number(shadeObject)+" 0 R\n");
+	PutDoc(">>\nendobj\n");
+	Patterns.insert("Pattern"+QString::number(patObject), patObject);
+	if (spotMode)
+	{
+		QString colorDesc;
+		StartObj(spotObject);
+		PutDoc("<<\n/FunctionType 4\n");
+		PutDoc("/Domain [0 1 0 1 0 1 0 1");
+		for (int sc = 0; sc < spotColorSet.count(); sc++)
+		{
+			PutDoc(" 0 1");
+		}
+		PutDoc("]\n");
+		colorDesc = "{\n";
+		int maxSp = spotColorSet.count() - 1;
+		for (int sc = 0; sc < spotColorSet.count(); sc++)
+		{
+			int cc = 0;
+			int mc = 0;
+			int yc = 0;
+			int kc = 0;
+			CMYKColor cmykValues;
+			ScColorEngine::getCMYKValues(doc.PageColors[spotColorSet.at(maxSp - sc)], &doc, cmykValues);
+			cmykValues.getValues(cc, mc, yc, kc);
+			if (sc == 0)
+				colorDesc += "dup "+FToStr(static_cast<double>(cc) / 255.0)+" mul ";
+			else
+				colorDesc += QString::number(sc*4 + 1)+" -1 roll dup "+FToStr(static_cast<double>(cc) / 255.0)+" mul ";
+			colorDesc += "exch dup "+FToStr(static_cast<double>(mc) / 255.0)+" mul ";
+			colorDesc += "exch dup "+FToStr(static_cast<double>(yc) / 255.0)+" mul ";
+			colorDesc += "exch "+FToStr(static_cast<double>(kc) / 255.0)+" mul\n";
+		}
+		for (int sc = 0; sc < spotColorSet.count(); sc++)
+		{
+			colorDesc += "8 -1 roll 5 -1 roll add 7 -1 roll 5 -1 roll add 6 -1 roll 5 -1 roll add 5 -1 roll 5 -1 roll add\n";
+		}
+		colorDesc += "}\n";
+		PutDoc("/Range [0 1 0 1 0 1 0 1]\n");
+		PutDoc("/Length "+QString::number(colorDesc.length()+1)+"\n");
+		PutDoc(">>\nstream\n"+EncStream(colorDesc, spotObject)+"\nendstream\nendobj\n");
+	}
+	QString tmp;
+	if (((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)) && (transparencyFound))
+		tmp += "/"+TRes+" gs\n";
+	tmp += "/Pattern cs\n";
+	tmp += "/Pattern"+QString::number(patObject)+" scn\n";
+	output = tmp;
+	return true;
+}
+
+bool PDFLibCore::PDF_PatchMeshGradientFill(QString& output, PageItem *c)
+{
+	QList<double> StopVec;
+	QList<double> TransVec;
+	QStringList Gcolors;
+	QStringList colorNames;
+	QList<int> colorShades;
+	QStringList spotColorSet;
+	bool spotMode = false;
+	bool transparencyFound = false;
+	StopVec.clear();
+	TransVec.clear();
+	Gcolors.clear();
+	colorNames.clear();
+	colorShades.clear();
+	for (int col = 0; col < c->meshGradientPatches.count(); col++)
+	{
+		meshGradientPatch patch = c->meshGradientPatches[col];
+		meshPoint mp1 = patch.TL;
+		colorNames.append(mp1.colorName);
+		colorShades.append(mp1.shade);
+		TransVec.append(mp1.transparency);
+		if (mp1.transparency != 1.0)
+			transparencyFound = true;
+		if (spotMap.contains(mp1.colorName))
+		{
+			if (!spotColorSet.contains(mp1.colorName))
+				spotColorSet.append(mp1.colorName);
+		}
+		Gcolors.append(SetGradientColor(mp1.colorName, mp1.shade));
+		meshPoint mp2 = patch.TR;
+		colorNames.append(mp2.colorName);
+		colorShades.append(mp2.shade);
+		TransVec.append(mp2.transparency);
+		if (mp2.transparency != 1.0)
+			transparencyFound = true;
+		if (spotMap.contains(mp2.colorName))
+		{
+			if (!spotColorSet.contains(mp2.colorName))
+				spotColorSet.append(mp2.colorName);
+		}
+		Gcolors.append(SetGradientColor(mp2.colorName, mp2.shade));
+		meshPoint mp3 = patch.BR;
+		colorNames.append(mp3.colorName);
+		colorShades.append(mp3.shade);
+		TransVec.append(mp3.transparency);
+		if (mp3.transparency != 1.0)
+			transparencyFound = true;
+		if (spotMap.contains(mp3.colorName))
+		{
+			if (!spotColorSet.contains(mp3.colorName))
+				spotColorSet.append(mp3.colorName);
+		}
+		Gcolors.append(SetGradientColor(mp3.colorName, mp3.shade));
+		meshPoint mp4 = patch.BL;
+		colorNames.append(mp4.colorName);
+		colorShades.append(mp4.shade);
+		TransVec.append(mp4.transparency);
+		if (mp4.transparency != 1.0)
+			transparencyFound = true;
+		if (spotMap.contains(mp4.colorName))
+		{
+			if (!spotColorSet.contains(mp4.colorName))
+				spotColorSet.append(mp4.colorName);
+		}
+		Gcolors.append(SetGradientColor(mp4.colorName, mp4.shade));
+	}
+	QString TRes("");
+	if (((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)) && (transparencyFound))
+	{
+		uint shadeObjectT = newObject();
+		StartObj(shadeObjectT);
+		PutDoc("<<\n");
+		PutDoc("/ShadingType 6\n");
+		PutDoc("/ColorSpace /DeviceGray\n");
+		PutDoc("/BitsPerCoordinate 32\n");
+		PutDoc("/BitsPerComponent 16\n");
+		PutDoc("/BitsPerFlag 8\n");
+		QByteArray vertStreamT;
+		QDataStream vst(&vertStreamT, QIODevice::WriteOnly);
+		vst.setByteOrder(QDataStream::BigEndian);
+		quint8 flg = 0;
+		for (int col = 0; col < c->meshGradientPatches.count(); col++)
+		{
+			meshGradientPatch patch = c->meshGradientPatches[col];
+			meshPoint mp1 = patch.TL;
+			meshPoint mp2 = patch.TR;
+			meshPoint mp3 = patch.BR;
+			meshPoint mp4 = patch.BL;
+			int colInd1 = 4 * col;
+			int colInd2 = 4 * col + 1;
+			int colInd3 = 4 * col + 2;
+			int colInd4 = 4 * col + 3;
+			vst << flg;
+			vst << encode32dVal(mp4.gridPoint.x()) << encode32dVal(-mp4.gridPoint.y()) << encode32dVal(mp4.controlTop.x()) << encode32dVal(-mp4.controlTop.y()) << encode32dVal(mp1.controlBottom.x()) << encode32dVal(-mp1.controlBottom.y());
+			vst << encode32dVal(mp1.gridPoint.x()) << encode32dVal(-mp1.gridPoint.y()) << encode32dVal(mp1.controlRight.x()) << encode32dVal(-mp1.controlRight.y()) << encode32dVal(mp2.controlLeft.x()) << encode32dVal(-mp2.controlLeft.y());
+			vst << encode32dVal(mp2.gridPoint.x()) << encode32dVal(-mp2.gridPoint.y()) << encode32dVal(mp2.controlBottom.x()) << encode32dVal(-mp2.controlBottom.y()) << encode32dVal(mp3.controlTop.x()) << encode32dVal(-mp3.controlTop.y());
+			vst << encode32dVal(mp3.gridPoint.x()) << encode32dVal(-mp3.gridPoint.y()) << encode32dVal(mp3.controlLeft.x()) << encode32dVal(-mp3.controlLeft.y()) << encode32dVal(mp4.controlRight.x()) << encode32dVal(-mp4.controlRight.y());
+			encodeColor(vst, colorNames[colInd4], colorShades[colInd4], spotColorSet, spotMode);
+			encodeColor(vst, colorNames[colInd1], colorShades[colInd1], spotColorSet, spotMode);
+			encodeColor(vst, colorNames[colInd2], colorShades[colInd2], spotColorSet, spotMode);
+			encodeColor(vst, colorNames[colInd3], colorShades[colInd3], spotColorSet, spotMode);
+		}
+		PutDoc("/Decode [-40000 40000 -40000 40000 0 1]\n");
+		QString dat = "";
+		for (int vd = 0; vd < vertStreamT.count(); vd++)
+		{
+			dat += vertStreamT[vd];
+		}
+		if (Options.Compress)
+			dat = CompressStr(&dat);
+		PutDoc("/Length "+QString::number(dat.length())+"\n");
+		if (Options.Compress)
+			PutDoc("/Filter /FlateDecode\n");
+		PutDoc(">>\nstream\n"+EncStream(dat, shadeObjectT)+"\nendstream\nendobj\n");
+		uint patObject = newObject();
+		StartObj(patObject);
+		PutDoc("<<\n/Type /Pattern\n");
+		PutDoc("/PatternType 2\n");
+		PutDoc("/Shading "+QString::number(shadeObjectT)+" 0 R\n");
+		PutDoc(">>\nendobj\n");
+		Patterns.insert("Pattern"+QString::number(patObject), patObject);
+		uint formObject = newObject();
+		StartObj(formObject);
+		PutDoc("<<\n/Type /XObject\n/Subtype /Form\n");
+		PutDoc("/FormType 1\n");
+		PutDoc("/Group << /S /Transparency /CS /DeviceGray >>\n");
+		double lw = c->lineWidth();
+		PutDoc("/BBox ["+FToStr(-lw / 2.0)+" "+FToStr(lw / 2.0)+" "+FToStr(c->width()+lw)+" "+FToStr(-(c->height()+lw))+" ]\n");
+		PutDoc("/Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]\n");
+		if (Patterns.count() != 0)
+		{
+			PutDoc("/Pattern << \n");
+			QMap<QString,int>::Iterator it3p;
+			for (it3p = Patterns.begin(); it3p != Patterns.end(); ++it3p)
+				PutDoc("/"+it3p.key()+" "+QString::number(it3p.value())+" 0 R\n");
+			PutDoc(">>\n");
+		}
+		PutDoc(">>\n");
+		QString stre = "q\n"+SetClipPath(c)+"h\n";
+		stre += FToStr(fabs(c->lineWidth()))+" w\n";
+		stre += "/Pattern cs\n";
+		stre += "/Pattern"+QString::number(patObject)+" scn\nf*\n";
+		stre += "Q\n";
+		if (Options.Compress)
+			stre = CompressStr(&stre);
+		PutDoc("/Length "+QString::number(stre.length())+"\n");
+		if (Options.Compress)
+			PutDoc("/Filter /FlateDecode\n");
+		PutDoc(">>\nstream\n"+EncStream(stre, formObject)+"\nendstream\nendobj\n");
+		Seite.XObjects[ResNam+QString::number(ResCount)] = formObject;
+		ResCount++;
+		QString GXName = ResNam+QString::number(ResCount);
+		ResCount++;
+		Transpar[GXName] = writeGState("/SMask << /S /Luminosity /G "+QString::number(formObject)+" 0 R >>\n/BM /Normal\n");
+		TRes = GXName;
+	}
+	QString entx = "";
+	uint spotObject = 0;
+	uint shadeObject = newObject();
+	StartObj(shadeObject);
+	PutDoc("<<\n");
+	PutDoc("/ShadingType 6\n");
+	if (Options.UseRGB)
+	{
+		PutDoc("/ColorSpace /DeviceRGB\n");
+		entx = "0 1 0 1 0 1";
+	}
+	else if (Options.isGrayscale)
+	{
+		PutDoc("/ColorSpace /DeviceGray\n");
+		entx = "0 1";
+	}
+	else if ((doc.HasCMS) && (Options.UseProfiles))
+	{
+		PutDoc("/ColorSpace "+ICCProfiles[Options.SolidProf].ICCArray+"\n");
+		entx = "0 1 0 1 0 1";
+	}
+	else
+	{
+		entx = "0 1 0 1 0 1 0 1";
+		if ((Options.UseSpotColors) && ((spotColorSet.count() > 0) && (spotColorSet.count() < 28)))
+		{
+			spotObject = newObject();
+			PutDoc("/ColorSpace [ /DeviceN [ /Cyan /Magenta /Yellow /Black");
+			for (int sc = 0; sc < spotColorSet.count(); sc++)
+			{
+				PutDoc(" /"+spotColorSet.at(sc).simplified().replace("#", "#23").replace( QRegExp("[\\s\\/\\{\\[\\]\\}\\<\\>\\(\\)\\%]"), "#20" ));
+				entx += " 0 1";
+			}
+			PutDoc(" ]\n");
+			PutDoc("/DeviceCMYK\n");
+			PutDoc(QString::number(spotObject)+" 0 R\n");
+			PutDoc("]\n");
+			spotMode = true;
+		}
+		else
+			PutDoc("/ColorSpace /DeviceCMYK\n");
+	}
+	PutDoc("/BitsPerCoordinate 32\n");
+	PutDoc("/BitsPerComponent 16\n");
+	PutDoc("/BitsPerFlag 8\n");
+	QByteArray vertStream;
+	QDataStream vs(&vertStream, QIODevice::WriteOnly);
+	vs.setByteOrder(QDataStream::BigEndian);
+	quint8 flg = 0;
+	for (int col = 0; col < c->meshGradientPatches.count(); col++)
+	{
+		meshGradientPatch patch = c->meshGradientPatches[col];
+		meshPoint mp1 = patch.TL;
+		meshPoint mp2 = patch.TR;
+		meshPoint mp3 = patch.BR;
+		meshPoint mp4 = patch.BL;
+		int colInd1 = 4 * col;
+		int colInd2 = 4 * col + 1;
+		int colInd3 = 4 * col + 2;
+		int colInd4 = 4 * col + 3;
+		vs << flg;
+		vs << encode32dVal(mp4.gridPoint.x()) << encode32dVal(-mp4.gridPoint.y()) << encode32dVal(mp4.controlTop.x()) << encode32dVal(-mp4.controlTop.y()) << encode32dVal(mp1.controlBottom.x()) << encode32dVal(-mp1.controlBottom.y());
+		vs << encode32dVal(mp1.gridPoint.x()) << encode32dVal(-mp1.gridPoint.y()) << encode32dVal(mp1.controlRight.x()) << encode32dVal(-mp1.controlRight.y()) << encode32dVal(mp2.controlLeft.x()) << encode32dVal(-mp2.controlLeft.y());
+		vs << encode32dVal(mp2.gridPoint.x()) << encode32dVal(-mp2.gridPoint.y()) << encode32dVal(mp2.controlBottom.x()) << encode32dVal(-mp2.controlBottom.y()) << encode32dVal(mp3.controlTop.x()) << encode32dVal(-mp3.controlTop.y());
+		vs << encode32dVal(mp3.gridPoint.x()) << encode32dVal(-mp3.gridPoint.y()) << encode32dVal(mp3.controlLeft.x()) << encode32dVal(-mp3.controlLeft.y()) << encode32dVal(mp4.controlRight.x()) << encode32dVal(-mp4.controlRight.y());
+		encodeColor(vs, colorNames[colInd4], colorShades[colInd4], spotColorSet, spotMode);
+		encodeColor(vs, colorNames[colInd1], colorShades[colInd1], spotColorSet, spotMode);
+		encodeColor(vs, colorNames[colInd2], colorShades[colInd2], spotColorSet, spotMode);
+		encodeColor(vs, colorNames[colInd3], colorShades[colInd3], spotColorSet, spotMode);
 	}
 	PutDoc("/Decode [-40000 40000 -40000 40000 "+entx+"]\n");
 	QString dat = "";
@@ -7473,6 +7799,8 @@
 			return PDF_DiamondGradientFill(output, currItem);
 		else if (GType == 11)
 			return PDF_MeshGradientFill(output, currItem);
+		else if (GType == 12)
+			return PDF_PatchMeshGradientFill(output, currItem);
 		StartX = currItem->GrStartX;
 		StartY = currItem->GrStartY;
 		EndX = currItem->GrEndX;
@@ -8547,12 +8875,15 @@
 	PutDoc("<<\n/Type /XObject\n/Subtype /Form\n");
 	PutDoc("/BBox [ 0 0 "+FToStr(w)+" "+FToStr(h)+" ]\n");
 	PutDoc("/Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]\n");
-	if (Seite.ImgObjects.count() != 0)
+	if ((Seite.ImgObjects.count() != 0) || (Seite.XObjects.count() != 0))
 	{
 		PutDoc("/XObject <<\n");
 		QMap<QString,int>::Iterator it;
 		for (it = Seite.ImgObjects.begin(); it != Seite.ImgObjects.end(); ++it)
 			PutDoc("/"+it.key()+" "+QString::number(it.value())+" 0 R\n");
+		QMap<QString,int>::Iterator iti;
+		for (iti = Seite.XObjects.begin(); iti != Seite.XObjects.end(); ++iti)
+			PutDoc("/"+iti.key()+" "+QString::number(iti.value())+" 0 R\n");
 		PutDoc(">>\n");
 	}
 	if (Seite.FObjects.count() != 0)
@@ -9696,7 +10027,7 @@
 				QString action = ip->Action;
 				if (action.isEmpty())
 				{
-					const Page* page = doc.DocPages.at(ip->PageObject->OwnPage);
+					const ScPage* page = doc.DocPages.at(ip->PageObject->OwnPage);
 					double actionPos = page->height() - (ip->PageObject->yPos() - page->yOffset());
 					action = QString("/XYZ 0 %1 0").arg(actionPos);
 				}

Modified: trunk/Scribus/scribus/pdflib_core.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/pdflib_core.h
==============================================================================
--- trunk/Scribus/scribus/pdflib_core.h (original)
+++ trunk/Scribus/scribus/pdflib_core.h Fri Jul 29 09:02:47 2011
@@ -24,7 +24,7 @@
 class BookMItem;
 class BookMView;
 class ScribusDoc;
-class Page;
+class ScPage;
 class PDFOptions;
 class PrefsContext;
 class MultiProgressDialog;
@@ -82,12 +82,12 @@
 	};
 
 	bool PDF_Begin_Doc(const QString& fn, SCFonts &AllFonts, QMap<QString, QMap<uint, FPointArray> > DocFonts, BookMView* vi);
-	void PDF_Begin_Page(const Page* pag, QPixmap pm = 0);
+	void PDF_Begin_Page(const ScPage* pag, QPixmap pm = 0);
 	void PDF_End_Page(int physPage);
-	bool PDF_TemplatePage(const Page* pag, bool clip = false);
-	bool PDF_ProcessPage(const Page* pag, uint PNr, bool clip = false);
-	bool PDF_ProcessMasterElements(const ScLayer& layer, const Page* page, uint PNr);
-	bool PDF_ProcessPageElements(const ScLayer& layer, const Page* page, uint PNr);
+	bool PDF_TemplatePage(const ScPage* pag, bool clip = false);
+	bool PDF_ProcessPage(const ScPage* pag, uint PNr, bool clip = false);
+	bool PDF_ProcessMasterElements(const ScLayer& layer, const ScPage* page, uint PNr);
+	bool PDF_ProcessPageElements(const ScLayer& layer, const ScPage* page, uint PNr);
 	bool PDF_End_Doc(const QString& PrintPr = "", const QString& Name = "", int Components = 0);
 	bool closeAndCleanup();
 
@@ -123,10 +123,10 @@
 	QString putColor(const QString& color, double Shade, bool fill);
 	QString putColorUncached(const QString& color, int Shade, bool fill);
 	QString Write_TransparencyGroup(double trans, int blend, QString &data, PageItem *controlItem = 0);
-	QString setTextSt(PageItem *ite, uint PNr, const Page* pag);
-	bool    setTextCh(PageItem *ite, uint PNr, double x, double y, uint d,  QString &tmp, QString &tmp2, const ScText * hl, const ParagraphStyle& pstyle, const Page* pag);
-	void    getBleeds(const Page* page, double &left, double &right);
-	void    getBleeds(const Page* page, double &left, double &right, double &bottom, double& top);
+	QString setTextSt(PageItem *ite, uint PNr, const ScPage* pag);
+	bool    setTextCh(PageItem *ite, uint PNr, double x, double y, uint d,  QString &tmp, QString &tmp2, const ScText * hl, const ParagraphStyle& pstyle, const ScPage* pag);
+	void    getBleeds(const ScPage* page, double &left, double &right);
+	void    getBleeds(const ScPage* page, double &left, double &right, double &bottom, double& top);
 
 	// Provide a couple of PutDoc implementations to ease transition away from
 	// QString abuse and to provide fast paths for constant strings.
@@ -148,9 +148,9 @@
 	QByteArray ComputeMD5(const QString& in);
 	QByteArray ComputeRC4Key(int ObjNum);
 
-	bool    PDF_ProcessItem(QString& output, PageItem* ite, const Page* pag, uint PNr, bool embedded = false, bool pattern = false);
-	QString PDF_ProcessTableItem(PageItem* ite, const Page* pag);
-	QString HandleBrushPattern(PageItem* ite, QPainterPath &path, const Page* pag, uint PNr);
+	bool    PDF_ProcessItem(QString& output, PageItem* ite, const ScPage* pag, uint PNr, bool embedded = false, bool pattern = false);
+	QString PDF_ProcessTableItem(PageItem* ite, const ScPage* pag);
+	QString HandleBrushPattern(PageItem* ite, QPainterPath &path, const ScPage* pag, uint PNr);
 	QString drawArrow(PageItem *ite, QTransform &arrowTrans, int arrowIndex);
 	void    PDF_Bookmark(PageItem *currItem, double ypos);
 	bool    PDF_PatternFillStroke(QString& output, PageItem *currItem, int kind = 0, bool forArrow = false);
@@ -158,6 +158,7 @@
 	quint16 encode16dVal(double val);
 	void    encodeColor(QDataStream &vs, QString colName, int colShade, QStringList &spotColorSet, bool spotMode);
 	bool    PDF_MeshGradientFill(QString& output, PageItem *currItem);
+	bool	PDF_PatchMeshGradientFill(QString& output, PageItem *c);
 	bool    PDF_DiamondGradientFill(QString& output, PageItem *currItem);
 	bool    PDF_TensorGradientFill(QString& output, PageItem *currItem);
 	bool    PDF_GradientFillStroke(QString& output, PageItem *currItem, bool stroke = false, bool forArrow = false);
@@ -183,7 +184,7 @@
 	QString Content;
 	QString ErrorMessage;
 	ScribusDoc & doc;
-	const Page * ActPageP;
+	const ScPage * ActPageP;
 	const PDFOptions & Options;
 	BookMView* Bvie;
 	QFile Spool;

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp Fri Jul 29 09:02:47 2011
@@ -1751,7 +1751,7 @@
 		return true;
 	}
 	m_Doc->setMasterPageMode(!pageName.isEmpty());
-	Page* newPage = pageName.isEmpty() ? doc->addPage(pageNum) : doc->addMasterPage(pageNum, pageName);
+	ScPage* newPage = pageName.isEmpty() ? doc->addPage(pageNum) : doc->addMasterPage(pageNum, pageName);
 
 	newPage->LeftPg   = attrs.valueAsInt("LEFT", 0);
 	QString mpName    = attrs.valueAsString("MNAM", "Normal");
@@ -1884,7 +1884,7 @@
 		{
 			newItem->itemText.insertChars(newItem->itemText.length(), SpecialChars::PARSEP);
 			ParagraphStyle newStyle;
-			PrefsManager* prefsManager = PrefsManager::instance();
+//			PrefsManager* prefsManager = PrefsManager::instance();
 			readParagraphStyle(doc, reader, newStyle);
 			newItem->itemText.setStyle(newItem->itemText.length()-1, newStyle);
 			newItem->itemText.setCharStyle(newItem->itemText.length()-1, 1, lastStyle->Style);
@@ -1892,7 +1892,7 @@
 		else if (tName == "trail")
 		{
 			ParagraphStyle newStyle;
-			PrefsManager* prefsManager = PrefsManager::instance();
+//			PrefsManager* prefsManager = PrefsManager::instance();
 			readParagraphStyle(doc, reader, newStyle);
 			newItem->itemText.setStyle(newItem->itemText.length(), newStyle);
 		}
@@ -3020,7 +3020,7 @@
 	struct ScribusDoc::BookMa bok;
 	QMap<int, ScribusDoc::BookMa> bookmarks;
 
-	Page* newPage = NULL;
+	ScPage* newPage = NULL;
 	
 	QString tmp;
 	QMap<int,int> TableID;
@@ -3378,7 +3378,7 @@
 	bool fou(false);
 	QString tmpf, tmV;
 	const StyleSet<ParagraphStyle> * docParagraphStyles = tempStyles? tempStyles : & doc->paragraphStyles();
-	PrefsManager* prefsManager = PrefsManager::instance();
+//	PrefsManager* prefsManager = PrefsManager::instance();
 	readParagraphStyle(doc, reader, style);
 	for (int xx=0; xx<docParagraphStyles->count(); ++xx)
 	{

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp Fri Jul 29 09:02:47 2011
@@ -180,7 +180,7 @@
 	QList<PageItem*> TableItemsF;
 	int a;
 	PageItem *Neu;
-	Page* Apage;
+	ScPage* Apage;
 	itemRemap.clear();
 	itemNext.clear();
 	itemCount = 0;
@@ -1939,7 +1939,7 @@
 	ParagraphStyle vg;
 	struct ScribusDoc::BookMa bok;
 	PageItem *Neu;
-	Page* Apage = NULL;
+	ScPage* Apage = NULL;
 	itemRemap.clear();
 	itemNext.clear();
 	itemCount = 0;

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Fri Jul 29 09:02:47 2011
@@ -2522,7 +2522,7 @@
 		return true;
 	}
 	m_Doc->setMasterPageMode(!pageName.isEmpty());
-	Page* newPage = pageName.isEmpty() ? doc->addPage(pageNum) : doc->addMasterPage(pageNum, pageName);
+	ScPage* newPage = pageName.isEmpty() ? doc->addPage(pageNum) : doc->addMasterPage(pageNum, pageName);
 
 	newPage->LeftPg   = attrs.valueAsInt("LEFT", 0);
 	QString mpName    = attrs.valueAsString("MNAM", "Normal");
@@ -2690,6 +2690,34 @@
 			newItem->meshGradientArray[mGArrayRows][mGArrayCols] = mp;
 			mGArrayCols++;
 			if (mGArrayCols == newItem->meshGradientArray[mGArrayRows].count())
+			{
+				mGArrayCols = 0;
+				mGArrayRows++;
+			}
+		}
+		if (tName == "PMPoint")
+		{
+			meshPoint mp;
+			mp.colorName     = tAtt.valueAsString("NAME");
+			mp.shade         = tAtt.valueAsInt("SHADE", 100);
+			mp.transparency  = tAtt.valueAsDouble("TRANS", 1.0);
+			mp.gridPoint     = FPoint(tAtt.valueAsDouble("GX", 0.0), tAtt.valueAsDouble("GY", 0.0));
+			mp.controlTop    = FPoint(tAtt.valueAsDouble("CTX", 0.0), tAtt.valueAsDouble("CTY", 0.0));
+			mp.controlBottom = FPoint(tAtt.valueAsDouble("CBX", 0.0), tAtt.valueAsDouble("CBY", 0.0));
+			mp.controlLeft   = FPoint(tAtt.valueAsDouble("CLX", 0.0), tAtt.valueAsDouble("CLY", 0.0));
+			mp.controlRight  = FPoint(tAtt.valueAsDouble("CRX", 0.0), tAtt.valueAsDouble("CRY", 0.0));
+			mp.color         = SetColor(doc, mp.colorName, mp.shade);
+			mp.color.setAlphaF(mp.transparency);
+			if (mGArrayCols == 0)
+				newItem->meshGradientPatches[mGArrayRows].TL = mp;
+			else if (mGArrayCols == 1)
+				newItem->meshGradientPatches[mGArrayRows].TR = mp;
+			else if (mGArrayCols == 2)
+				newItem->meshGradientPatches[mGArrayRows].BR = mp;
+			else if (mGArrayCols == 3)
+				newItem->meshGradientPatches[mGArrayRows].BL = mp;
+			mGArrayCols++;
+			if (mGArrayCols == 4)
 			{
 				mGArrayCols = 0;
 				mGArrayRows++;
@@ -3786,6 +3814,16 @@
 				currItem->meshGradientArray.append(ml);
 			}
 		}
+		else if (currItem->GrType == 12)
+		{
+			currItem->meshGradientPatches.clear();
+			int mGArrayRows = attrs.valueAsInt("GMAX", 1);
+			for (int mgr = 0; mgr < mGArrayRows; mgr++)
+			{
+				meshGradientPatch patchM;
+				currItem->meshGradientPatches.append(patchM);
+			}
+		}
 		else
 		{
 			currItem->GrStartX = attrs.valueAsDouble("GRSTARTX", 0.0);
@@ -3974,7 +4012,7 @@
 	struct ScribusDoc::BookMa bok;
 	QMap<int, ScribusDoc::BookMa> bookmarks;
 
-	Page* newPage = NULL;
+	ScPage* newPage = NULL;
 	
 	QString tmp;
 	QMap<int,int> TableID;

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Fri Jul 29 09:02:47 2011
@@ -1051,7 +1051,7 @@
 void Scribus150Format::WritePages(ScribusDoc *doc, ScXmlStreamWriter& docu, QProgressBar *dia2, uint maxC, bool master)
 {
 	uint ObCount = maxC;
-	Page *page;
+	ScPage *page;
 	uint pages;
 	QString tmp;
 	if (master)
@@ -1354,6 +1354,10 @@
 				{
 					docu.writeAttribute("GMAY", item->meshGradientArray[0].count());
 					docu.writeAttribute("GMAX", item->meshGradientArray.count());
+				}
+				else if (item->GrType == 12)
+				{
+					docu.writeAttribute("GMAX", item->meshGradientPatches.count());
 				}
 				else
 				{
@@ -1563,6 +1567,40 @@
 				{
 					meshPoint mp = item->meshGradientArray[grow][gcol];
 					docu.writeStartElement("MPoint");
+					docu.writeAttribute("GX", mp.gridPoint.x());
+					docu.writeAttribute("GY", mp.gridPoint.y());
+					docu.writeAttribute("CTX", mp.controlTop.x());
+					docu.writeAttribute("CTY", mp.controlTop.y());
+					docu.writeAttribute("CBX", mp.controlBottom.x());
+					docu.writeAttribute("CBY", mp.controlBottom.y());
+					docu.writeAttribute("CLX", mp.controlLeft.x());
+					docu.writeAttribute("CLY", mp.controlLeft.y());
+					docu.writeAttribute("CRX", mp.controlRight.x());
+					docu.writeAttribute("CRY", mp.controlRight.y());
+					docu.writeAttribute("NAME", mp.colorName);
+					docu.writeAttribute("SHADE", mp.shade);
+					docu.writeAttribute("TRANS", mp.transparency);
+					docu.writeEndElement();
+				}
+			}
+		}
+		if (item->GrType == 12)
+		{
+			for (int grow = 0; grow < item->meshGradientPatches.count(); grow++)
+			{
+				meshGradientPatch patch = item->meshGradientPatches[grow];
+				for (int gcol = 0; gcol < 4; gcol++)
+				{
+					meshPoint mp;
+					if (gcol == 0)
+						mp = patch.TL;
+					else if (gcol == 1)
+						mp = patch.TR;
+					else if (gcol == 2)
+						mp = patch.BR;
+					else if (gcol == 3)
+						mp = patch.BL;
+					docu.writeStartElement("PMPoint");
 					docu.writeAttribute("GX", mp.gridPoint.x());
 					docu.writeAttribute("GY", mp.gridPoint.y());
 					docu.writeAttribute("CTX", mp.controlTop.x());

Modified: trunk/Scribus/scribus/plugins/import/CMakeLists.txt
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/import/CMakeLists.txt
==============================================================================
--- trunk/Scribus/scribus/plugins/import/CMakeLists.txt (original)
+++ trunk/Scribus/scribus/plugins/import/CMakeLists.txt Fri Jul 29 09:02:47 2011
@@ -5,7 +5,11 @@
 ADD_SUBDIRECTORY(idml)
 ADD_SUBDIRECTORY(oodraw)
 ADD_SUBDIRECTORY(pct)
-ADD_SUBDIRECTORY(ps)
+IF(HAVE_POPPLER)
+	ADD_SUBDIRECTORY(pdf)
+ELSE(HAVE_POPPLER)
+	ADD_SUBDIRECTORY(ps)
+ENDIF(HAVE_POPPLER)
 ADD_SUBDIRECTORY(shape)
 ADD_SUBDIRECTORY(sml)
 ADD_SUBDIRECTORY(svg)

Modified: trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp Fri Jul 29 09:02:47 2011
@@ -9,10 +9,11 @@
 #include "importai.h"
 #include "importaiplugin.h"
 #include "ui/scmwmenumanager.h"
-#include "page.h"
+#include "scpage.h"
 #include "prefscontext.h"
 #include "prefsfile.h"
 #include "prefsmanager.h"
+#include "scconfig.h"
 #include "scraction.h"
 #include "scribuscore.h"
 #include "undomanager.h"
@@ -151,6 +152,52 @@
 		UndoManager::instance()->setUndoEnabled(false);
 	if (UndoManager::undoEnabled())
 		activeTransaction = new UndoTransaction(UndoManager::instance()->beginTransaction(trSettings));
+#ifdef HAVE_POPPLER
+	if (!(flags & LoadSavePlugin::lfLoadAsPattern))
+	{
+/* Check if the file is an old style AI or one of the newer PDF wrapped ones */
+		QFile fT(fileName);
+		if (fT.open(QIODevice::ReadOnly))
+		{
+			QByteArray tempBuf(9, ' ');
+			fT.read(tempBuf.data(), 8);
+			fT.close();
+			if (tempBuf.startsWith("%PDF"))
+			{
+				QMessageBox msgBox(ScCore->primaryMainWindow());
+				msgBox.setText( tr("This file contains 2 versions of the data."));
+				msgBox.setInformativeText( tr("Choose which one should be imported"));
+				msgBox.setIcon(QMessageBox::Question);
+				QPushButton *pdfButton = msgBox.addButton( tr("Use the pdf part"), QMessageBox::ActionRole);
+				msgBox.addButton( tr("Use the ai part"), QMessageBox::ActionRole);
+				msgBox.setDefaultButton(pdfButton);
+				msgBox.exec();
+				if ((QPushButton *)msgBox.clickedButton() == pdfButton)
+				{
+					//Import PDF
+					const FileFormat *fmt = LoadSavePlugin::getFormatById(FORMATID_PDFIMPORT);
+					if (!fmt)
+					{
+						QMessageBox::warning(ScCore->primaryMainWindow(), CommonStrings::trWarning, tr("The PDF Import plugin could not be found"), 1, 0, 0);
+						return false;
+					}
+					bool success = fmt->loadFile(fileName, flags);
+					if (activeTransaction)
+					{
+						activeTransaction->commit();
+						delete activeTransaction;
+						activeTransaction = NULL;
+					}
+					if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
+						UndoManager::instance()->setUndoEnabled(true);
+					if (!success)
+						QMessageBox::warning(ScCore->primaryMainWindow(), CommonStrings::trWarning, tr("The file could not be imported"), 1, 0, 0);
+					return success;
+				}
+			}
+		}
+	}
+#endif
 	AIPlug *dia = new AIPlug(m_Doc, flags);
 	Q_CHECK_PTR(dia);
 	bool success = dia->import(fileName, trSettings, flags);

Modified: trunk/Scribus/scribus/plugins/import/cgm/importcgmplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/import/cgm/importcgmplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/cgm/importcgmplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/cgm/importcgmplugin.cpp Fri Jul 29 09:02:47 2011
@@ -16,7 +16,7 @@
 #include "importcgm.h"
 #include "importcgmplugin.h"
 #include "ui/scmwmenumanager.h"
-#include "page.h"
+#include "scpage.h"
 #include "prefscontext.h"
 #include "prefsfile.h"
 #include "prefsmanager.h"

Modified: trunk/Scribus/scribus/plugins/import/cvg/importcvgplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/import/cvg/importcvgplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/cvg/importcvgplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/cvg/importcvgplugin.cpp Fri Jul 29 09:02:47 2011
@@ -9,7 +9,7 @@
 #include "importcvg.h"
 #include "importcvgplugin.h"
 #include "ui/scmwmenumanager.h"
-#include "page.h"
+#include "scpage.h"
 #include "prefscontext.h"
 #include "prefsfile.h"
 #include "prefsmanager.h"

Modified: trunk/Scribus/scribus/plugins/import/drw/importdrwplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/import/drw/importdrwplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/drw/importdrwplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/drw/importdrwplugin.cpp Fri Jul 29 09:02:47 2011
@@ -16,7 +16,7 @@
 #include "importdrw.h"
 #include "importdrwplugin.h"
 #include "ui/scmwmenumanager.h"
-#include "page.h"
+#include "scpage.h"
 #include "prefscontext.h"
 #include "prefsfile.h"
 #include "prefsmanager.h"

Modified: trunk/Scribus/scribus/plugins/import/idml/importidmlimpl.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/import/idml/importidmlimpl.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/idml/importidmlimpl.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/idml/importidmlimpl.cpp Fri Jul 29 09:02:47 2011
@@ -803,7 +803,7 @@
 	pageNumber = pageNumber+1;
 	QDomElement elem = node.toElement();
 	QString appliedMaster;
-	Page* newPage;
+	ScPage* newPage;
 	if(!elem.isNull())
 	{
 		appliedMaster = elem.attribute("AppliedMaster","");

Modified: trunk/Scribus/scribus/plugins/import/pct/importpctplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/import/pct/importpctplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pct/importpctplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pct/importpctplugin.cpp Fri Jul 29 09:02:47 2011
@@ -9,7 +9,7 @@
 #include "importpct.h"
 #include "importpctplugin.h"
 #include "ui/scmwmenumanager.h"
-#include "page.h"
+#include "scpage.h"
 #include "prefscontext.h"
 #include "prefsfile.h"
 #include "prefsmanager.h"

Modified: trunk/Scribus/scribus/plugins/import/ps/importpsplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/import/ps/importpsplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/ps/importpsplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/ps/importpsplugin.cpp Fri Jul 29 09:02:47 2011
@@ -9,10 +9,11 @@
 #include "importps.h"
 #include "importpsplugin.h"
 #include "ui/scmwmenumanager.h"
-#include "page.h"
+#include "scpage.h"
 #include "prefscontext.h"
 #include "prefsfile.h"
 #include "prefsmanager.h"
+#include "scconfig.h"
 #include "scraction.h"
 #include "scribuscore.h"
 #include "undomanager.h"

Modified: trunk/Scribus/scribus/plugins/import/shape/importshapeplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/import/shape/importshapeplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/shape/importshapeplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/shape/importshapeplugin.cpp Fri Jul 29 09:02:47 2011
@@ -9,7 +9,7 @@
 #include "importshape.h"
 #include "importshapeplugin.h"
 #include "ui/scmwmenumanager.h"
-#include "page.h"
+#include "scpage.h"
 #include "prefscontext.h"
 #include "prefsfile.h"
 #include "prefsmanager.h"

Modified: trunk/Scribus/scribus/plugins/import/sml/importsmlplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/import/sml/importsmlplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/sml/importsmlplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/sml/importsmlplugin.cpp Fri Jul 29 09:02:47 2011
@@ -9,7 +9,7 @@
 #include "importsml.h"
 #include "importsmlplugin.h"
 #include "ui/scmwmenumanager.h"
-#include "page.h"
+#include "scpage.h"
 #include "prefscontext.h"
 #include "prefsfile.h"
 #include "prefsmanager.h"

Modified: trunk/Scribus/scribus/plugins/import/wpg/importwpgplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/import/wpg/importwpgplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/wpg/importwpgplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/wpg/importwpgplugin.cpp Fri Jul 29 09:02:47 2011
@@ -9,7 +9,7 @@
 #include "importwpg.h"
 #include "importwpgplugin.h"
 #include "ui/scmwmenumanager.h"
-#include "page.h"
+#include "scpage.h"
 #include "prefscontext.h"
 #include "prefsfile.h"
 #include "prefsmanager.h"

Modified: trunk/Scribus/scribus/plugins/import/xar/importxarplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/import/xar/importxarplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/xar/importxarplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/xar/importxarplugin.cpp Fri Jul 29 09:02:47 2011
@@ -9,7 +9,7 @@
 #include "importxar.h"
 #include "importxarplugin.h"
 #include "ui/scmwmenumanager.h"
-#include "page.h"
+#include "scpage.h"
 #include "prefscontext.h"
 #include "prefsfile.h"
 #include "prefsmanager.h"

Modified: trunk/Scribus/scribus/plugins/import/xfig/importxfigplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/import/xfig/importxfigplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/xfig/importxfigplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/xfig/importxfigplugin.cpp Fri Jul 29 09:02:47 2011
@@ -9,7 +9,7 @@
 #include "importxfig.h"
 #include "importxfigplugin.h"
 #include "ui/scmwmenumanager.h"
-#include "page.h"
+#include "scpage.h"
 #include "prefscontext.h"
 #include "prefsfile.h"
 #include "prefsmanager.h"

Modified: trunk/Scribus/scribus/plugins/pixmapexport/export.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/pixmapexport/export.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/pixmapexport/export.cpp (original)
+++ trunk/Scribus/scribus/plugins/pixmapexport/export.cpp Fri Jul 29 09:02:47 2011
@@ -176,7 +176,7 @@
 
 	if (!doc->Pages->at(pageNr))
 		return false;
-	Page* page = doc->Pages->at(pageNr);
+	ScPage* page = doc->Pages->at(pageNr);
 
 	/* a little magic here - I need to compute the "maxGr" value...
 	* We need to know the right size of the page for landscape,

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdpage.cpp Fri Jul 29 09:02:47 2011
@@ -6,7 +6,7 @@
 */
 #include "cmdpage.h"
 #include "cmdutil.h"
-#include "page.h"
+#include "scpage.h"
 #include "scribuscore.h"
 #include "commonstrings.h"
 #include "scribusdoc.h"

Modified: trunk/Scribus/scribus/plugins/scriptplugin/cmdutil.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/scriptplugin/cmdutil.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/cmdutil.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/cmdutil.cpp Fri Jul 29 09:02:47 2011
@@ -6,7 +6,7 @@
 */
 #include "cmdutil.h"
 #include "units.h"
-#include "page.h"
+#include "scpage.h"
 #include "scribuscore.h"
 #include "scribusdoc.h"
 #include "selection.h"

Modified: trunk/Scribus/scribus/plugins/scriptplugin/objimageexport.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/scriptplugin/objimageexport.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scriptplugin/objimageexport.cpp (original)
+++ trunk/Scribus/scribus/plugins/scriptplugin/objimageexport.cpp Fri Jul 29 09:02:47 2011
@@ -6,7 +6,7 @@
 */
 #include "objimageexport.h"
 #include "cmdutil.h"
-#include "page.h"
+#include "scpage.h"
 
 #include <QImageWriter>
 #include <structmember.h>

Modified: trunk/Scribus/scribus/plugins/short-words/parse.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/short-words/parse.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/short-words/parse.cpp (original)
+++ trunk/Scribus/scribus/plugins/short-words/parse.cpp Fri Jul 29 09:02:47 2011
@@ -26,7 +26,7 @@
 
 #include "scribus.h"
 #include "scribusdoc.h"
-#include "page.h"
+#include "scpage.h"
 #include "pageitem.h"
 #include "selection.h"
 #include "langmgr.h"

Modified: trunk/Scribus/scribus/plugins/short-words/shortwords.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/short-words/shortwords.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/short-words/shortwords.cpp (original)
+++ trunk/Scribus/scribus/plugins/short-words/shortwords.cpp Fri Jul 29 09:02:47 2011
@@ -29,7 +29,7 @@
 #include "swdialog.h"
 #include "configuration.h"
 #include "parse.h"
-#include "page.h"
+#include "scpage.h"
 #include "swprefsgui.h"
 #include "prefs_shortwords.h"
 #include "scpaths.h"

Modified: trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp Fri Jul 29 09:02:47 2011
@@ -36,7 +36,7 @@
 #include "canvas.h"
 #include "cmsettings.h"
 #include "commonstrings.h"
-#include "page.h"
+#include "scpage.h"
 #include "prefsmanager.h"
 #include "prefsfile.h"
 #include "prefscontext.h"
@@ -191,7 +191,7 @@
 	Options = Opts;
 	QFileInfo fiBase(fName);
 	baseDir = fiBase.absolutePath();
-	Page *page;
+	ScPage *page;
 	GradCount = 0;
 	ClipCount = 0;
 	PattCount = 0;
@@ -274,12 +274,12 @@
 	return true;
 }
 
-void SVGExPlug::ProcessPageLayer(Page *page, ScLayer& layer)
+void SVGExPlug::ProcessPageLayer(ScPage *page, ScLayer& layer)
 {
 	QDomElement layerGroup;
 	PageItem *Item;
 	QList<PageItem*> Items;
-	Page* SavedAct = m_Doc->currentPage();
+	ScPage* SavedAct = m_Doc->currentPage();
 	if (page->pageName().isEmpty())
 		Items = m_Doc->DocItems;
 	else

Modified: trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.h
==============================================================================
--- trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.h (original)
+++ trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.h Fri Jul 29 09:02:47 2011
@@ -17,7 +17,7 @@
 class ScribusDoc;
 class ScribusMainWindow;
 class PageItem;
-class Page;
+class ScPage;
 class ScText;
 
 struct SVGOptions
@@ -78,7 +78,7 @@
 	\brief Process a page to export to SVG format
 	\param Seite Page *
 	*/
-	void ProcessPageLayer(Page *page, ScLayer& layer);
+	void ProcessPageLayer(ScPage *page, ScLayer& layer);
 	void ProcessItemOnPage(double xOffset, double yOffset, PageItem *Item, QDomElement *parentElem);
 	QDomElement processSymbolStroke(PageItem *Item, QString trans);
 	QDomElement processSymbolItem(PageItem *Item, QString trans);

Modified: trunk/Scribus/scribus/pslib.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/pslib.cpp
==============================================================================
--- trunk/Scribus/scribus/pslib.cpp (original)
+++ trunk/Scribus/scribus/pslib.cpp Fri Jul 29 09:02:47 2011
@@ -584,7 +584,7 @@
 	PutStream("} bind def\n");
 }
 
-void PSLib::PS_begin_page(Page* pg, MarginStruct* Ma, bool Clipping)
+void PSLib::PS_begin_page(ScPage* pg, MarginStruct* Ma, bool Clipping)
 {
 	double bleedRight = 0.0;
 	double bleedLeft = 0.0;
@@ -1623,7 +1623,7 @@
 		if (usingGUI)
 			ScQApp->processEvents();
 		a = pageNs[aa]-1;
-		Page* page = Doc->Pages->at(a);
+		ScPage* page = Doc->Pages->at(a);
 		if ((!psExport) && (Doc->m_Selection->count() != 0))
 		{
 			MarginStruct Ma;
@@ -1705,7 +1705,7 @@
 	return 0; 
 }
 
-bool PSLib::ProcessItem(ScribusDoc* Doc, Page* a, PageItem* c, uint PNr, bool sep, bool farb, bool ic, bool gcr, bool master, bool embedded, bool useTemplate)
+bool PSLib::ProcessItem(ScribusDoc* Doc, ScPage* a, PageItem* c, uint PNr, bool sep, bool farb, bool ic, bool gcr, bool master, bool embedded, bool useTemplate)
 {
 	double tsz;
 	int h, s, v, k;
@@ -2660,7 +2660,7 @@
 	return true;
 }
 
-void PSLib::ProcessPage(ScribusDoc* Doc, Page* a, uint PNr, bool sep, bool farb, bool ic, bool gcr)
+void PSLib::ProcessPage(ScribusDoc* Doc, ScPage* a, uint PNr, bool sep, bool farb, bool ic, bool gcr)
 {
 	int b;
 	int h, s, v, k;
@@ -2794,12 +2794,12 @@
 	}
 }
 
-bool PSLib::ProcessMasterPageLayer(ScribusDoc* Doc, Page* page, ScLayer& layer, uint PNr, bool sep, bool farb, bool ic, bool gcr)
+bool PSLib::ProcessMasterPageLayer(ScribusDoc* Doc, ScPage* page, ScLayer& layer, uint PNr, bool sep, bool farb, bool ic, bool gcr)
 {
 	bool success = true;
 	int h, s, v, k;
 	QVector<double> dum;
-	Page* mPage = Doc->MasterPages.at(Doc->MasterNames[page->MPageNam]);
+	ScPage* mPage = Doc->MasterPages.at(Doc->MasterNames[page->MPageNam]);
 	if (layer.isPrintable)
 	{
 		for (int am = 0; am < page->FromMaster.count() && !abortExport; ++am)
@@ -2967,7 +2967,7 @@
 	return success;
 }
 
-bool PSLib::ProcessPageLayer(ScribusDoc* Doc, Page* page, ScLayer& layer, uint PNr, bool sep, bool farb, bool ic, bool gcr)
+bool PSLib::ProcessPageLayer(ScribusDoc* Doc, ScPage* page, ScLayer& layer, uint PNr, bool sep, bool farb, bool ic, bool gcr)
 {
 	bool success = true;
 	int b, h, s, v, k;
@@ -3092,7 +3092,7 @@
 }
 
 
-void PSLib::HandleBrushPattern(PageItem *c, QPainterPath &path, Page* a, uint PNr, bool sep, bool farb, bool ic, bool gcr, bool master)
+void PSLib::HandleBrushPattern(PageItem *c, QPainterPath &path, ScPage* a, uint PNr, bool sep, bool farb, bool ic, bool gcr, bool master)
 {
 	ScPattern pat = m_Doc->docPatterns[c->strokePattern()];
 	double pLen = path.length() - ((pat.width / 2.0) * (c->patternStrokeScaleX / 100.0));
@@ -3295,6 +3295,167 @@
 			PutStream(ToStr(mp3.gridPoint.x())+" "+ToStr(-mp3.gridPoint.y())+" "+ToStr(mp3.controlLeft.x())+" "+ToStr(-mp3.controlLeft.y())+" "+ToStr(mp4.controlRight.x())+" "+ToStr(-mp4.controlRight.y())+"\n");
 			PutStream(colorValues[colInd4]+" "+colorValues[colInd1]+" "+colorValues[colInd2]+" "+colorValues[colInd3]+"\n");
 		}
+	}
+	PutStream("]\n");
+	PutStream(">>\n");
+	PutStream(">>\n");
+	PutStream("[1 0 0 1 0 0] makepattern setpattern\n");
+	if (fillRule)
+		PutStream("eofill\n");
+	else
+		PutStream("fill\n");
+	return;
+}
+
+void PSLib::HandlePatchMeshGradient(PageItem* c, bool gcr)
+{
+	QString GCol;
+	QString hs,ss,vs,ks;
+	int ch,cs,cv,ck;
+	QStringList cols;
+	QStringList colorValues;
+	QStringList spotColorSet;
+	QList<int> colsSh;
+	for (int col = 0; col < c->meshGradientPatches.count(); col++)
+	{
+		meshGradientPatch patch = c->meshGradientPatches[col];
+		meshPoint mp1 = patch.TL;
+		cols.append(mp1.colorName);
+		colsSh.append(mp1.shade);
+		if (spotMap.contains(mp1.colorName))
+		{
+			if (!spotColorSet.contains(mp1.colorName))
+				spotColorSet.append(mp1.colorName);
+		}
+		meshPoint mp2 = patch.TR;
+		cols.append(mp2.colorName);
+		colsSh.append(mp2.shade);
+		if (spotMap.contains(mp2.colorName))
+		{
+			if (!spotColorSet.contains(mp2.colorName))
+				spotColorSet.append(mp2.colorName);
+		}
+		meshPoint mp3 = patch.BR;
+		cols.append(mp3.colorName);
+		colsSh.append(mp3.shade);
+		if (spotMap.contains(mp3.colorName))
+		{
+			if (!spotColorSet.contains(mp3.colorName))
+				spotColorSet.append(mp3.colorName);
+		}
+		meshPoint mp4 = patch.BL;
+		cols.append(mp4.colorName);
+		colsSh.append(mp4.shade);
+		if (spotMap.contains(mp4.colorName))
+		{
+			if (!spotColorSet.contains(mp4.colorName))
+				spotColorSet.append(mp4.colorName);
+		}
+	}
+	for (int ac = 0; ac < cols.count(); ac++)
+	{
+		QString colorVal = "";
+		if ((useSpotColors) && ((spotColorSet.count() > 0) && (spotColorSet.count() < 28)) && (!GraySc))
+		{
+			if (spotColorSet.contains(cols.at(ac)))
+			{
+				colorVal = "0 0 0 0";
+				for (int sc = 0; sc < spotColorSet.count(); sc++)
+				{
+					if (spotColorSet.at(sc) == cols.at(ac))
+						colorVal += " "+ToStr(colsSh[ac] / 100.0);
+					else
+						colorVal += " 0";
+				}
+			}
+			else
+			{
+				SetColor(cols.at(ac), colsSh.at(ac), &ch, &cs, &cv, &ck, gcr);
+				colorVal += hs.setNum(ch / 255.0)+" "+ss.setNum(cs / 255.0)+" "+vs.setNum(cv / 255.0)+" "+ks.setNum(ck / 255.0);
+				for (int sc = 0; sc < spotColorSet.count(); sc++)
+				{
+					colorVal += " 0";
+				}
+			}
+			colorValues.append(colorVal);
+		}
+		else
+		{
+			SetColor(cols.at(ac), colsSh.at(ac), &ch, &cs, &cv, &ck, gcr);
+			if (GraySc)
+				colorVal += hs.setNum((255.0 - qMin(0.3 * ch + 0.59 * cs + 0.11 * cv + ck, 255.0))  / 255.0);
+			else
+				colorVal += hs.setNum(ch / 255.0)+" "+ss.setNum(cs / 255.0)+" "+vs.setNum(cv / 255.0)+" "+ks.setNum(ck / 255.0);
+			if (DoSep)
+			{
+				int pla = Plate - 1 < 0 ? 3 : Plate - 1;
+				QStringList cols2 = colorVal.split(" ", QString::SkipEmptyParts);
+				colorVal = ToStr(1 - ScCLocale::toDoubleC(cols2[pla]));
+			}
+			colorValues.append(colorVal);
+		}
+	}
+	PutStream("<<\n");
+	PutStream("/PatternType 2\n");
+	PutStream("/Shading\n");
+	PutStream("<<\n");
+	PutStream("/ShadingType 6\n");
+	if ((DoSep) || (GraySc))
+		PutStream("/ColorSpace /DeviceGray\n");
+	else if ((useSpotColors) && ((spotColorSet.count() > 0) && (spotColorSet.count() < 28)))
+	{
+		PutStream("/ColorSpace [ /DeviceN [/Cyan /Magenta /Yellow /Black");
+		for (int sc = 0; sc < spotColorSet.count(); sc++)
+		{
+			PutStream(" ("+spotColorSet.at(sc)+")");
+		}
+		PutStream("]\n");
+		PutStream("/DeviceCMYK\n");
+		PutStream("{\n");
+		int maxSp = spotColorSet.count() - 1;
+		for (int sc = 0; sc < spotColorSet.count(); sc++)
+		{
+			int cc = 0;
+			int mc = 0;
+			int yc = 0;
+			int kc = 0;
+			CMYKColor cmykValues;
+			ScColorEngine::getCMYKValues(m_Doc->PageColors[spotColorSet.at(maxSp - sc)], m_Doc, cmykValues);
+			cmykValues.getValues(cc, mc, yc, kc);
+			if (sc == 0)
+				PutStream("dup "+ToStr(static_cast<double>(cc) / 255.0)+" mul ");
+			else
+				PutStream(IToStr(sc*4 + 1)+" -1 roll dup "+ToStr(static_cast<double>(cc) / 255.0)+" mul ");
+			PutStream("exch dup "+ToStr(static_cast<double>(mc) / 255.0)+" mul ");
+			PutStream("exch dup "+ToStr(static_cast<double>(yc) / 255.0)+" mul ");
+			PutStream("exch "+ToStr(static_cast<double>(kc) / 255.0)+" mul\n");
+		}
+		for (int sc = 0; sc < spotColorSet.count(); sc++)
+		{
+			PutStream("8 -1 roll 5 -1 roll add 7 -1 roll 5 -1 roll add 6 -1 roll 5 -1 roll add 5 -1 roll 5 -1 roll add\n");
+		}
+		PutStream("} ]\n");
+	}
+	else
+		PutStream("/ColorSpace /DeviceCMYK\n");
+	PutStream("/DataSource [\n");
+	for (int col = 0; col < c->meshGradientPatches.count(); col++)
+	{
+		meshGradientPatch patch = c->meshGradientPatches[col];
+		meshPoint mp1 = patch.TL;
+		meshPoint mp2 = patch.TR;
+		meshPoint mp3 = patch.BR;
+		meshPoint mp4 = patch.BL;
+		int colInd1 = 4 * col;
+		int colInd2 = 4 * col + 1;
+		int colInd3 = 4 * col + 2;
+		int colInd4 = 4 * col + 3;
+		PutStream("0\n");
+		PutStream(ToStr(mp4.gridPoint.x())+" "+ToStr(-mp4.gridPoint.y())+" "+ToStr(mp4.controlTop.x())+" "+ToStr(-mp4.controlTop.y())+" "+ToStr(mp1.controlBottom.x())+" "+ToStr(-mp1.controlBottom.y())+"\n");
+		PutStream(ToStr(mp1.gridPoint.x())+" "+ToStr(-mp1.gridPoint.y())+" "+ToStr(mp1.controlRight.x())+" "+ToStr(-mp1.controlRight.y())+" "+ToStr(mp2.controlLeft.x())+" "+ToStr(-mp2.controlLeft.y())+"\n");
+		PutStream(ToStr(mp2.gridPoint.x())+" "+ToStr(-mp2.gridPoint.y())+" "+ToStr(mp2.controlBottom.x())+" "+ToStr(-mp2.controlBottom.y())+" "+ToStr(mp3.controlTop.x())+" "+ToStr(-mp3.controlTop.y())+"\n");
+		PutStream(ToStr(mp3.gridPoint.x())+" "+ToStr(-mp3.gridPoint.y())+" "+ToStr(mp3.controlLeft.x())+" "+ToStr(-mp3.controlLeft.y())+" "+ToStr(mp4.controlRight.x())+" "+ToStr(-mp4.controlRight.y())+"\n");
+		PutStream(colorValues[colInd4]+" "+colorValues[colInd1]+" "+colorValues[colInd2]+" "+colorValues[colInd3]+"\n");
 	}
 	PutStream("]\n");
 	PutStream(">>\n");
@@ -3702,6 +3863,11 @@
 			HandleMeshGradient(c, gcr);
 			return;
 		}
+		else if (GType == 12)
+		{
+			HandlePatchMeshGradient(c, gcr);
+			return;
+		}
 	}
 	QList<VColorStop*> cstops = gradient.colorStops();
 	PutStream("<<\n");
@@ -4084,7 +4250,7 @@
 	}
 }
 
-void PSLib::setTextSt(ScribusDoc* Doc, PageItem* ite, bool gcr, uint argh, Page* pg, bool sep, bool farb, bool ic, bool master)
+void PSLib::setTextSt(ScribusDoc* Doc, PageItem* ite, bool gcr, uint argh, ScPage* pg, bool sep, bool farb, bool ic, bool master)
 {
 //	qDebug() << QString("pslib setTextSt: ownPage=%1 pageNr=%2 OnMasterPage=%3;").arg(ite->OwnPage).arg(pg->pageNr()).arg(ite->OnMasterPage);
 	int tabCc = 0;
@@ -4208,7 +4374,7 @@
 #endif
 }
 
-void PSLib::setTextCh(ScribusDoc* Doc, PageItem* ite, double x, double y, bool gcr, uint argh, uint doh, ScText *hl, const ParagraphStyle& pstyle, Page* pg, bool sep, bool farb, bool ic, bool master)
+void PSLib::setTextCh(ScribusDoc* Doc, PageItem* ite, double x, double y, bool gcr, uint argh, uint doh, ScText *hl, const ParagraphStyle& pstyle, ScPage* pg, bool sep, bool farb, bool ic, bool master)
 {
 	const CharStyle & cstyle(*hl);
 	const GlyphLayout & glyphs(hl->glyph);
@@ -4619,7 +4785,7 @@
 	}
 }
 
-void PSLib::GetBleeds(Page* page, double& left, double& right)
+void PSLib::GetBleeds(ScPage* page, double& left, double& right)
 {
 	MarginStruct values;
 	m_Doc->getBleeds(page, Options.bleeds, values);
@@ -4627,7 +4793,7 @@
 	right  = values.Right;
 }
 
-void PSLib::GetBleeds(Page* page, double& left, double& right, double& bottom, double& top)
+void PSLib::GetBleeds(ScPage* page, double& left, double& right, double& bottom, double& top)
 {
 	MarginStruct values;
 	m_Doc->getBleeds(page, Options.bleeds, values);

Modified: trunk/Scribus/scribus/pslib.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/pslib.h
==============================================================================
--- trunk/Scribus/scribus/pslib.h (original)
+++ trunk/Scribus/scribus/pslib.h Fri Jul 29 09:02:47 2011
@@ -41,7 +41,7 @@
 class ScText;
 #endif
 
-class Page;
+class ScPage;
 class ScribusDoc;
 class PageItem;
 class MultiProgressDialog;
@@ -81,7 +81,7 @@
 		virtual bool PS_set_file(QString fn);
 		virtual void PS_set_Info(QString art, QString was);
 		virtual bool PS_begin_doc(ScribusDoc *doc, double x, double y, double breite, double hoehe, int numpage, bool doDev, bool sep, bool farb, bool ic, bool gcr);
-		virtual void PS_begin_page(Page* pg, MarginStruct* Ma, bool Clipping);
+		virtual void PS_begin_page(ScPage* pg, MarginStruct* Ma, bool Clipping);
 		virtual void PS_end_page();
 		virtual void PS_curve(double x1, double y1, double x2, double y2, double x3, double y3);
 		virtual void PS_moveto(double x, double y);
@@ -120,26 +120,27 @@
 		virtual void PS_TemplateStart(QString Name);
 		virtual void PS_TemplateEnd();
 		virtual void PS_UseTemplate(QString Name);
-		virtual bool ProcessItem(ScribusDoc* Doc, Page* a, PageItem* c, uint PNr, bool sep, bool farb, bool ic, bool gcr, bool master, bool embedded = false, bool useTemplate = false);
-		virtual void ProcessPage(ScribusDoc* Doc, Page* a, uint PNr, bool sep = false, bool farb = true, bool ic = false, bool gcr = true);
-		virtual bool ProcessMasterPageLayer(ScribusDoc* Doc, Page* a, ScLayer& ll, uint PNr, bool sep = false, bool farb = true, bool ic = false, bool gcr = true);
-		virtual bool ProcessPageLayer(ScribusDoc* Doc, Page* a, ScLayer& ll, uint PNr, bool sep = false, bool farb = true, bool ic = false, bool gcr = true);
+		virtual bool ProcessItem(ScribusDoc* Doc, ScPage* a, PageItem* c, uint PNr, bool sep, bool farb, bool ic, bool gcr, bool master, bool embedded = false, bool useTemplate = false);
+		virtual void ProcessPage(ScribusDoc* Doc, ScPage* a, uint PNr, bool sep = false, bool farb = true, bool ic = false, bool gcr = true);
+		virtual bool ProcessMasterPageLayer(ScribusDoc* Doc, ScPage* a, ScLayer& ll, uint PNr, bool sep = false, bool farb = true, bool ic = false, bool gcr = true);
+		virtual bool ProcessPageLayer(ScribusDoc* Doc, ScPage* a, ScLayer& ll, uint PNr, bool sep = false, bool farb = true, bool ic = false, bool gcr = true);
 		virtual void drawArrow(PageItem *ite, QTransform &arrowTrans, int arrowIndex, bool gcr);
 		virtual void putColor(const QString& color, double shade, bool fill);
 		virtual void putColorNoDraw(const QString& color, double shade, bool gcr);
-		virtual void GetBleeds(Page* page, double& left, double& right);
-		virtual void GetBleeds(Page* page, double& left, double& right, double& bottom, double& top);
+		virtual void GetBleeds(ScPage* page, double& left, double& right);
+		virtual void GetBleeds(ScPage* page, double& left, double& right, double& bottom, double& top);
 		virtual void SetClipPath(FPointArray *c, bool poly = true);
-		virtual void HandleBrushPattern(PageItem *c, QPainterPath &path, Page* a, uint PNr, bool sep, bool farb, bool ic, bool gcr, bool master);
+		virtual void HandleBrushPattern(PageItem *c, QPainterPath &path, ScPage* a, uint PNr, bool sep, bool farb, bool ic, bool gcr, bool master);
 		virtual void HandleStrokePattern(PageItem *c);
 		virtual void HandleMeshGradient(PageItem* c, bool gcr);
+		virtual void HandlePatchMeshGradient(PageItem* c, bool gcr);
 		virtual void HandleDiamondGradient(PageItem* c, bool gcr);
 		virtual void HandleTensorGradient(PageItem* c, bool gcr);
 		virtual void HandleGradientFillStroke(PageItem *c, bool gcr, bool stroke = true, bool forArrow = false);
 		virtual void SetColor(const QString& color, double shade, int *h, int *s, int *v, int *k, bool gcr);
 		virtual void SetColor(const ScColor& color, double shade, int *h, int *s, int *v, int *k, bool gcr);
-		virtual void setTextSt(ScribusDoc* Doc, PageItem* ite, bool gcr, uint a, Page* pg, bool sep, bool farb, bool ic, bool master);
-		virtual void setTextCh(ScribusDoc* Doc, PageItem* ite, double x, double y, bool gcr, uint a, uint d, ScText *hl, const ParagraphStyle& pstyle, Page* pg, bool sep, bool farb, bool ic, bool master);
+		virtual void setTextSt(ScribusDoc* Doc, PageItem* ite, bool gcr, uint a, ScPage* pg, bool sep, bool farb, bool ic, bool master);
+		virtual void setTextCh(ScribusDoc* Doc, PageItem* ite, double x, double y, bool gcr, uint a, uint d, ScText *hl, const ParagraphStyle& pstyle, ScPage* pg, bool sep, bool farb, bool ic, bool master);
 		bool psExport;
 
 	private:
@@ -204,7 +205,7 @@
 		bool usingGUI;
 		bool abortExport;
 		PrintOptions Options;
-		Page* ActPage;
+		ScPage* ActPage;
 
 	protected slots:
 		void cancelRequested();

Modified: trunk/Scribus/scribus/scdocoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/scdocoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/scdocoutput.cpp (original)
+++ trunk/Scribus/scribus/scdocoutput.cpp Fri Jul 29 09:02:47 2011
@@ -1,40 +1,40 @@
-/*
-For general Scribus (>=1.3.2) copyright and licensing information please refer
-to the COPYING file provided with the program. Following this notice may exist
-a copyright and/or license notice that predates the release of Scribus 1.3.2
-for which a new license (GPL+exception) is in place.
-*/
-
-
-#include "scdocoutput.h"
-using namespace std;
-
-bool ScDocOutput::makeOutput(ScribusDoc* doc, vector<int>& pageNumbers)
-{
-	bool  done = true;
-	Page* page;
-
-	begin();
-
-	for (uint index = 0; index < pageNumbers.size(); index++)
-	{
-		page = doc->Pages->at( pageNumbers[index] - 1 );
-		ScPageOutput* outputComponent = createPageOutputComponent(index + 1);
-		if (outputComponent != NULL)
-		{
-			outputComponent->begin();
-			outputComponent->drawPage(page);
-			outputComponent->end();
-			delete outputComponent;
-		}
-		else
-		{
-			done = false;
-			break;
-		}
-	}
-
-	end();
-
-	return done;
-}
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+
+
+#include "scdocoutput.h"
+using namespace std;
+
+bool ScDocOutput::makeOutput(ScribusDoc* doc, vector<int>& pageNumbers)
+{
+	bool  done = true;
+	ScPage* page;
+
+	begin();
+
+	for (uint index = 0; index < pageNumbers.size(); index++)
+	{
+		page = doc->Pages->at( pageNumbers[index] - 1 );
+		ScPageOutput* outputComponent = createPageOutputComponent(index + 1);
+		if (outputComponent != NULL)
+		{
+			outputComponent->begin();
+			outputComponent->drawPage(page);
+			outputComponent->end();
+			delete outputComponent;
+		}
+		else
+		{
+			done = false;
+			break;
+		}
+	}
+
+	end();
+
+	return done;
+}

Modified: trunk/Scribus/scribus/scdocoutput.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/scdocoutput.h
==============================================================================
--- trunk/Scribus/scribus/scdocoutput.h (original)
+++ trunk/Scribus/scribus/scdocoutput.h Fri Jul 29 09:02:47 2011
@@ -11,7 +11,7 @@
 
 #include "scribusapi.h"
 #include "scribusdoc.h"
-#include "page.h"
+#include "scpage.h"
 #include "scpainterexbase.h"
 #include "scpageoutput.h"
 

Modified: trunk/Scribus/scribus/scdocoutput_ps2.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/scdocoutput_ps2.cpp
==============================================================================
--- trunk/Scribus/scribus/scdocoutput_ps2.cpp (original)
+++ trunk/Scribus/scribus/scdocoutput_ps2.cpp Fri Jul 29 09:02:47 2011
@@ -10,7 +10,7 @@
 #include "scribuscore.h"
 #include "commonstrings.h"
 #include "scribusdoc.h"
-#include "page.h"
+#include "scpage.h"
 
 using namespace std;
 

Modified: trunk/Scribus/scribus/scdocoutput_ps2.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/scdocoutput_ps2.h
==============================================================================
--- trunk/Scribus/scribus/scdocoutput_ps2.h (original)
+++ trunk/Scribus/scribus/scdocoutput_ps2.h Fri Jul 29 09:02:47 2011
@@ -1,62 +1,62 @@
-/*
-For general Scribus (>=1.3.2) copyright and licensing information please refer
-to the COPYING file provided with the program. Following this notice may exist
-a copyright and/or license notice that predates the release of Scribus 1.3.2
-for which a new license (GPL+exception) is in place.
-*/
-#ifndef SCDOCOUTPUT_PS2_H
-#define SCDOCOUTPUT_PS2_H
-
-#include <vector>
-
-#include <QFile>
-#include <QTextStream>
-
-#include "scribusapi.h"
-#include "scpainterexbase.h"
-#include "scpageoutput_ps2.h"
-#include "scdocoutput.h"
-
-class ScribusDoc;
-class Page;
-
-class SCRIBUS_API ScDocOutput_Ps2 : public ScDocOutput
-{
-protected:
-
-	QFile m_file;
-	QIODevice* m_device;
-	QTextStream m_stream;
-	ScribusDoc* m_doc;
-	std::vector<int> m_pageNumbers;
-	ScPs2OutputParams m_options;
-
-	int m_status;
-	QString m_lastError;
-
-	QString m_author;
-	QString m_creator;
-	QString m_title;
-
-	QRect   m_clip;
-
-	virtual void begin(void);
-	virtual void end(void);
-
-	virtual ScPageOutput* createPageOutputComponent(int pageIndex);
-
-	bool initializeCmsTransforms(void);
-
-public:
-	ScDocOutput_Ps2(ScribusDoc* doc, QString fileName, std::vector<int>& pageNumbers, QRect& clip, ScPs2OutputParams& options);
-	~ScDocOutput_Ps2();
-
-	void setAuthor(const QString& author) { m_author = author; }
-	void setCreateor(const QString& creator) { m_creator = creator; }
-	void setTitle(const QString& title) { m_title = title; }
-
-	int status() { return m_status; }
-	QString lastError() { return m_lastError; }
-};
-
-#endif
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+#ifndef SCDOCOUTPUT_PS2_H
+#define SCDOCOUTPUT_PS2_H
+
+#include <vector>
+
+#include <QFile>
+#include <QTextStream>
+
+#include "scribusapi.h"
+#include "scpainterexbase.h"
+#include "scpageoutput_ps2.h"
+#include "scdocoutput.h"
+
+class ScribusDoc;
+class ScPage;
+
+class SCRIBUS_API ScDocOutput_Ps2 : public ScDocOutput
+{
+protected:
+
+	QFile m_file;
+	QIODevice* m_device;
+	QTextStream m_stream;
+	ScribusDoc* m_doc;
+	std::vector<int> m_pageNumbers;
+	ScPs2OutputParams m_options;
+
+	int m_status;
+	QString m_lastError;
+
+	QString m_author;
+	QString m_creator;
+	QString m_title;
+
+	QRect   m_clip;
+
+	virtual void begin(void);
+	virtual void end(void);
+
+	virtual ScPageOutput* createPageOutputComponent(int pageIndex);
+
+	bool initializeCmsTransforms(void);
+
+public:
+	ScDocOutput_Ps2(ScribusDoc* doc, QString fileName, std::vector<int>& pageNumbers, QRect& clip, ScPs2OutputParams& options);
+	~ScDocOutput_Ps2();
+
+	void setAuthor(const QString& author) { m_author = author; }
+	void setCreateor(const QString& creator) { m_creator = creator; }
+	void setTitle(const QString& title) { m_title = title; }
+
+	int status() { return m_status; }
+	QString lastError() { return m_lastError; }
+};
+
+#endif

Modified: trunk/Scribus/scribus/scpageoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/scpageoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/scpageoutput.cpp (original)
+++ trunk/Scribus/scribus/scpageoutput.cpp Fri Jul 29 09:02:47 2011
@@ -13,7 +13,7 @@
 
 #include "cmsettings.h"
 #include "commonstrings.h"
-#include "page.h"
+#include "scpage.h"
 #include "pageitem.h"
 #include "pageitem_imageframe.h"
 #include "pageitem_line.h"
@@ -81,7 +81,7 @@
 	return value;
 }
 
-void ScPageOutput::drawPage( Page* page, ScPainterExBase* painter)
+void ScPageOutput::drawPage( ScPage* page, ScPainterExBase* painter)
 {
 	int clipx = static_cast<int>(page->xOffset());
 	int clipy = static_cast<int>(page->yOffset());
@@ -99,7 +99,7 @@
 	drawMarks(page, painter, m_marksOptions);
 }
 
-void ScPageOutput::drawMasterItems(ScPainterExBase *painter, Page *page, ScLayer& layer, const QRect& clip)
+void ScPageOutput::drawMasterItems(ScPainterExBase *painter, ScPage *page, ScLayer& layer, const QRect& clip)
 {
 	PageItem* currItem;
 	if (page->MPageNam.isEmpty())
@@ -108,7 +108,7 @@
 		return;
 	if (!layer.isViewable || !layer.isPrintable)
 		return;
-	Page* Mp = m_doc->MasterPages.at(m_doc->MasterNames[page->MPageNam]);
+	ScPage* Mp = m_doc->MasterPages.at(m_doc->MasterNames[page->MPageNam]);
 	uint pageFromMasterCount = page->FromMaster.count();
 	for (uint a = 0; a < pageFromMasterCount; ++a)
 	{
@@ -203,7 +203,7 @@
 	}
 }
 
-void ScPageOutput::drawPageItems(ScPainterExBase *painter, Page *page, ScLayer& layer, const QRect& clip)
+void ScPageOutput::drawPageItems(ScPainterExBase *painter, ScPage *page, ScLayer& layer, const QRect& clip)
 {
 	PageItem *currItem;
 	if (m_doc->Items->count() <= 0)
@@ -1371,7 +1371,7 @@
 	}
 }
 
-void ScPageOutput::drawMarks( Page* page, ScPainterExBase* painter, const MarksOptions& options )
+void ScPageOutput::drawMarks( ScPage* page, ScPainterExBase* painter, const MarksOptions& options )
 {
 	double markOffs  = options.markOffset;
 	double bleedLeft = 0.0, bleedRight = 0.0;

Modified: trunk/Scribus/scribus/scpageoutput.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/scpageoutput.h
==============================================================================
--- trunk/Scribus/scribus/scpageoutput.h (original)
+++ trunk/Scribus/scribus/scpageoutput.h Fri Jul 29 09:02:47 2011
@@ -17,7 +17,7 @@
 
 class CharStyle;
 struct GlyphLayout;
-class Page;
+class ScPage;
 class PageItem;
 class PageItem_ImageFrame;
 class PageItem_Line;
@@ -59,8 +59,8 @@
 	virtual void fillPath( PageItem* item, ScPainterExBase* painter, const QRect& clip );
 	virtual void strokePath( PageItem* item, ScPainterExBase* painter, const QRect& clip );
 
-	virtual void drawMasterItems( ScPainterExBase *painter, Page *page, ScLayer& layer, const QRect& clip);
-	virtual void drawPageItems( ScPainterExBase *painter, Page *page, ScLayer& layer, const QRect& clip);
+	virtual void drawMasterItems( ScPainterExBase *painter, ScPage *page, ScLayer& layer, const QRect& clip);
+	virtual void drawPageItems( ScPainterExBase *painter, ScPage *page, ScLayer& layer, const QRect& clip);
 
 	virtual void drawItem( PageItem* item, ScPainterExBase* painter, const QRect& clip );
 	virtual void drawItem_Pre( PageItem* item, ScPainterExBase* painter );
@@ -78,7 +78,7 @@
 	virtual void drawItem_TextFrame( PageItem_TextFrame* item, ScPainterExBase* painter, const QRect& clip );
 
 	virtual void drawArrow(ScPainterExBase* painter, PageItem* item, QTransform &arrowTrans, int arrowIndex);
-	virtual void drawMarks( Page* page, ScPainterExBase* painter, const MarksOptions& options );
+	virtual void drawMarks( ScPage* page, ScPainterExBase* painter, const MarksOptions& options );
 	virtual void drawBoxMarks( ScPainterExBase* painter, const QRectF& box, const QRectF& bleedBox, double offset );
 	virtual void drawRegistrationCross( ScPainterExBase* painter );
 
@@ -90,8 +90,8 @@
 	ScPageOutput(ScribusDoc* doc, bool reloadImages = false, int resolution = 72, bool useProfiles = false);
 
 	virtual void begin(void) {};
-	virtual void drawPage( Page* page ) {};
-	virtual void drawPage( Page* page, ScPainterExBase* painter);
+	virtual void drawPage( ScPage* page ) {};
+	virtual void drawPage( ScPage* page, ScPainterExBase* painter);
 	virtual void end(void) {};
 
 	void setMarksOptions(const MarksOptions& opt) { m_marksOptions = opt; }

Modified: trunk/Scribus/scribus/scpageoutput_ps2.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/scpageoutput_ps2.cpp
==============================================================================
--- trunk/Scribus/scribus/scpageoutput_ps2.cpp (original)
+++ trunk/Scribus/scribus/scpageoutput_ps2.cpp Fri Jul 29 09:02:47 2011
@@ -9,7 +9,7 @@
 
 #include "commonstrings.h"
 #include "fonts/scfontmetrics.h"
-#include "page.h"
+#include "scpage.h"
 #include "pageitem.h"
 #include "scimage.h"
 #include "scpageoutput_ps2.h"
@@ -49,7 +49,7 @@
 	}
 }
 
-void ScPageOutput_Ps2::drawPage(Page* page)
+void ScPageOutput_Ps2::drawPage(ScPage* page)
 {
 	// Get page position
 	int clipx = static_cast<int>(page->xOffset());

Modified: trunk/Scribus/scribus/scpageoutput_ps2.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/scpageoutput_ps2.h
==============================================================================
--- trunk/Scribus/scribus/scpageoutput_ps2.h (original)
+++ trunk/Scribus/scribus/scpageoutput_ps2.h Fri Jul 29 09:02:47 2011
@@ -1,48 +1,48 @@
-/*
-For general Scribus (>=1.3.2) copyright and licensing information please refer
-to the COPYING file provided with the program. Following this notice may exist
-a copyright and/or license notice that predates the release of Scribus 1.3.2
-for which a new license (GPL+exception) is in place.
-*/
-#ifndef SCPAGEOUTPUTPS2_H
-#define SCPAGEOUTPUTPS2_H
-
-#include <QDataStream>
-#include <QRect>
-
-#include "scconfig.h"
-#include "scribusapi.h"
-#include "scpageoutput.h"
-#include "scpainterex_ps2.h"
-
-class ScribusDoc;
-class Page;
-class QIODevice;
-
-class SCRIBUS_API ScPageOutput_Ps2 : public ScPageOutput
-{
-protected:
-
-	QRect m_clip;
-	QIODevice* m_device;
-	QTextStream m_stream;
-	ScPs2OutputParams m_options;
-
-	int m_pageIndex;
-
-	virtual void initStream(QIODevice* dev);
-
-public:
-
-	ScPageOutput_Ps2(QIODevice* dev, ScribusDoc* doc, int pageIndex, ScPs2OutputParams& options);
-	virtual ~ScPageOutput_Ps2();
-
-	virtual void begin(void);
-	virtual void drawPage(Page* page);
-	virtual void end(void);
-
-	const QRect clip(void);
-	void  setClip(const QRect& rect) { m_clip = rect; }
-};
-
-#endif
+/*
+For general Scribus (>=1.3.2) copyright and licensing information please refer
+to the COPYING file provided with the program. Following this notice may exist
+a copyright and/or license notice that predates the release of Scribus 1.3.2
+for which a new license (GPL+exception) is in place.
+*/
+#ifndef SCPAGEOUTPUTPS2_H
+#define SCPAGEOUTPUTPS2_H
+
+#include <QDataStream>
+#include <QRect>
+
+#include "scconfig.h"
+#include "scribusapi.h"
+#include "scpageoutput.h"
+#include "scpainterex_ps2.h"
+
+class ScribusDoc;
+class ScPage;
+class QIODevice;
+
+class SCRIBUS_API ScPageOutput_Ps2 : public ScPageOutput
+{
+protected:
+
+	QRect m_clip;
+	QIODevice* m_device;
+	QTextStream m_stream;
+	ScPs2OutputParams m_options;
+
+	int m_pageIndex;
+
+	virtual void initStream(QIODevice* dev);
+
+public:
+
+	ScPageOutput_Ps2(QIODevice* dev, ScribusDoc* doc, int pageIndex, ScPs2OutputParams& options);
+	virtual ~ScPageOutput_Ps2();
+
+	virtual void begin(void);
+	virtual void drawPage(ScPage* page);
+	virtual void end(void);
+
+	const QRect clip(void);
+	void  setClip(const QRect& rect) { m_clip = rect; }
+};
+
+#endif

Modified: trunk/Scribus/scribus/scpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/scpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainter.cpp (original)
+++ trunk/Scribus/scribus/scpainter.cpp Fri Jul 29 09:02:47 2011
@@ -623,6 +623,16 @@
 	gradPatchP4 = p4;
 }
 
+void ScPainter::setMeshGradient(FPoint p1, FPoint p2, FPoint p3, FPoint p4, QList<meshGradientPatch> meshPatches)
+{
+	fill_gradient.setType(VGradient::freemesh);
+	meshGradientPatches = meshPatches;
+	gradPatchP1 = p1;
+	gradPatchP2 = p2;
+	gradPatchP3 = p3;
+	gradPatchP4 = p4;
+}
+
 void ScPainter::fillTextPath()
 {
 	drawVPath( 0 );
@@ -1312,6 +1322,102 @@
 				cairo_pattern_set_filter(pat, CAIRO_FILTER_BEST);
 #endif
 			}
+			else if (fill_gradient.type() == VGradient::freemesh)
+			{
+// #ifdef HAVE_PRIVATE_CAIRO
+#if (CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 11, 2) || HAVE_PRIVATE_CAIRO)
+				double p3x = gradPatchP3.x();
+				double p3y = gradPatchP3.y();
+				img = cairo_surface_create_similar(cairo_get_target(m_cr), CAIRO_CONTENT_COLOR_ALPHA, p3x, p3y);
+				cr = cairo_create(img);
+				cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
+				cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
+				cairo_set_tolerance(cr, 0.5 );
+				double r, g, b, a;
+				mpat = cairo_pattern_create_mesh();
+				for (int col = 0; col < meshGradientPatches.count(); col++)
+				{
+					meshGradientPatch patch = meshGradientPatches[col];
+					meshPoint mp1 = patch.TL;
+					meshPoint mp2 = patch.TR;
+					meshPoint mp3 = patch.BR;
+					meshPoint mp4 = patch.BL;
+					cairo_pattern_mesh_begin_patch(mpat);
+					cairo_pattern_mesh_move_to(mpat, mp1.gridPoint.x(), mp1.gridPoint.y());
+					cairo_pattern_mesh_curve_to(mpat, mp1.controlRight.x(), mp1.controlRight.y(), mp2.controlLeft.x(), mp2.controlLeft.y(), mp2.gridPoint.x(), mp2.gridPoint.y());
+					cairo_pattern_mesh_curve_to(mpat, mp2.controlBottom.x(), mp2.controlBottom.y(), mp3.controlTop.x(), mp3.controlTop.y(), mp3.gridPoint.x(), mp3.gridPoint.y());
+					cairo_pattern_mesh_curve_to(mpat, mp3.controlLeft.x(), mp3.controlLeft.y(), mp4.controlRight.x(), mp4.controlRight.y(), mp4.gridPoint.x(), mp4.gridPoint.y());
+					cairo_pattern_mesh_curve_to(mpat, mp4.controlTop.x(), mp4.controlTop.y(), mp1.controlBottom.x(), mp1.controlBottom.y(), mp1.gridPoint.x(), mp1.gridPoint.y());
+					mp1.color.getRgbF(&r, &g, &b, &a);
+					cairo_pattern_mesh_set_corner_color_rgba(mpat, 0, r, g, b, a);
+					mp2.color.getRgbF(&r, &g, &b, &a);
+					cairo_pattern_mesh_set_corner_color_rgba(mpat, 1, r, g, b, a);
+					mp3.color.getRgbF(&r, &g, &b, &a);
+					cairo_pattern_mesh_set_corner_color_rgba(mpat, 2, r, g, b, a);
+					mp4.color.getRgbF(&r, &g, &b, &a);
+					cairo_pattern_mesh_set_corner_color_rgba(mpat, 3, r, g, b, a);
+					cairo_pattern_mesh_end_patch(mpat);
+				}
+				cairo_pattern_set_filter(mpat, CAIRO_FILTER_BEST);
+				cairo_set_source(cr, mpat);
+				cairo_paint_with_alpha(cr, 1.0);
+				pat = cairo_pattern_create_for_surface(img);
+				cairo_pattern_set_extend(pat, CAIRO_EXTEND_NONE);
+				cairo_pattern_set_filter(pat, CAIRO_FILTER_BEST);
+#else
+				double p3x = gradPatchP3.x();
+				double p3y = gradPatchP3.y();
+				img = cairo_surface_create_similar(cairo_get_target(m_cr), CAIRO_CONTENT_COLOR_ALPHA, p3x, p3y);
+				cr = cairo_create(img);
+				cairo_set_fill_rule(cr, CAIRO_FILL_RULE_EVEN_ODD);
+				cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE);
+				cairo_set_tolerance(cr, 0.5 );
+				double r, g, b, a;
+				for (int col = 0; col < meshGradientPatches.count(); col++)
+				{
+					meshPoint mp1 = patch.TL;
+					meshPoint mp2 = patch.TR;
+					meshPoint mp3 = patch.BR;
+					meshPoint mp4 = patch.BL;
+					cairo_new_path( cr );
+					cairo_move_to(mpat, mp1.gridPoint.x(), mp1.gridPoint.y());
+					cairo_curve_to(mpat, mp1.controlRight.x(), mp1.controlRight.y(), mp2.controlLeft.x(), mp2.controlLeft.y(), mp2.gridPoint.x(), mp2.gridPoint.y());
+					cairo_curve_to(mpat, mp2.controlBottom.x(), mp2.controlBottom.y(), mp3.controlTop.x(), mp3.controlTop.y(), mp3.gridPoint.x(), mp3.gridPoint.y());
+					cairo_curve_to(mpat, mp3.controlLeft.x(), mp3.controlLeft.y(), mp4.controlRight.x(), mp4.controlRight.y(), mp4.gridPoint.x(), mp4.gridPoint.y());
+					cairo_curve_to(mpat, mp4.controlTop.x(), mp4.controlTop.y(), mp1.controlBottom.x(), mp1.controlBottom.y(), mp1.gridPoint.x(), mp1.gridPoint.y());
+					cairo_close_path( cr );
+					double acr = 0.0;
+					double acg = 0.0;
+					double acb = 0.0;
+					double aca = 0.0;
+					mp1.color.getRgbF(&r, &g, &b, &a);
+					acr += r;
+					acg += g;
+					acb += b;
+					aca += a;
+					mp2.color.getRgbF(&r, &g, &b, &a);
+					acr += r;
+					acg += g;
+					acb += b;
+					aca += a;
+					mp3.color.getRgbF(&r, &g, &b, &a);
+					acr += r;
+					acg += g;
+					acb += b;
+					aca += a;
+					mp4.color.getRgbF(&r, &g, &b, &a);
+					acr += r;
+					acg += g;
+					acb += b;
+					aca += a;
+					cairo_set_source_rgba(cr, acr / 4.0, acg / 4.0, acb / 4.0, aca / 4.0);
+					cairo_fill(cr);
+				}
+				pat = cairo_pattern_create_for_surface(img);
+				cairo_pattern_set_extend(pat, CAIRO_EXTEND_NONE);
+				cairo_pattern_set_filter(pat, CAIRO_FILTER_BEST);
+#endif
+			}
 			else
 			{
 				bool   isFirst = true;
@@ -1394,14 +1500,14 @@
 			cairo_pattern_destroy (pat);
 // #ifdef HAVE_PRIVATE_CAIRO
 #if (CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 11, 2)  || HAVE_PRIVATE_CAIRO)
-			if ((fill_gradient.type() == VGradient::fourcolor) || (fill_gradient.type() == VGradient::diamond) || (fill_gradient.type() == VGradient::mesh))
+			if ((fill_gradient.type() == VGradient::fourcolor) || (fill_gradient.type() == VGradient::diamond) || (fill_gradient.type() == VGradient::mesh) || (fill_gradient.type() == VGradient::freemesh))
 			{
 				cairo_surface_destroy(img);
 				cairo_pattern_destroy(mpat);
 				cairo_destroy( cr );
 			}
 #else
-			if (fill_gradient.type() == VGradient::mesh)
+			if ((fill_gradient.type() == VGradient::mesh) || (fill_gradient.type() == VGradient::freemesh))
 			{
 				cairo_surface_destroy(img);
 				cairo_destroy( cr );

Modified: trunk/Scribus/scribus/scpainter.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/scpainter.h
==============================================================================
--- trunk/Scribus/scribus/scpainter.h (original)
+++ trunk/Scribus/scribus/scpainter.h Fri Jul 29 09:02:47 2011
@@ -76,6 +76,7 @@
 	virtual void set4ColorColors(QColor col1, QColor col2, QColor col3, QColor col4);
 	virtual void setDiamondGeometry(FPoint p1, FPoint p2, FPoint p3, FPoint p4, FPoint c1, FPoint c2, FPoint c3, FPoint c4, FPoint c5);
 	virtual void setMeshGradient(FPoint p1, FPoint p2, FPoint p3, FPoint p4, QList<QList<meshPoint> > meshArray);
+	virtual void setMeshGradient(FPoint p1, FPoint p2, FPoint p3, FPoint p4, QList<meshGradientPatch> meshPatches);
 
 	virtual void setClipPath();
 
@@ -191,6 +192,7 @@
 	QColor gradPatchColor3;
 	QColor gradPatchColor4;
 	QList<QList<meshPoint> > meshGradientArray;
+	QList<meshGradientPatch> meshGradientPatches;
 	/*! \brief Stroking */
 	QColor m_stroke;
 	double stroke_trans;

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Fri Jul 29 09:02:47 2011
@@ -99,7 +99,7 @@
 #include "gtgettext.h"
 #include "hyphenator.h"
 #include "langmgr.h"
-#include "page.h"
+#include "scpage.h"
 #include "pageitem_imageframe.h"
 #include "pageitem_latexframe.h"
 #include "pageitem_textframe.h"
@@ -5541,7 +5541,7 @@
 		wot=doc->Pages->count();
 	qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
 	view->updatesOn(false);
-	Page* currentPage = doc->currentPage();
+	ScPage* currentPage = doc->currentPage();
 	for (cc = 0; cc < numPages; ++cc)
 	{
 		slotNewPage(wot, base[(wot+doc->pageSets()[doc->pagePositioning()].FirstPage) % doc->pageSets()[doc->pagePositioning()].Columns], mov); //Avoid the master page application with QString::null
@@ -6725,7 +6725,7 @@
 				tmpSelection.addItem(ite);
 			}
 		}
-		Page *page = doc->Pages->at(a); // need to remove guides too to get their undo/redo actions working
+		ScPage *page = doc->Pages->at(a); // need to remove guides too to get their undo/redo actions working
 		page->guides.clearHorizontals(GuideManagerCore::Standard);
 		page->guides.clearHorizontals(GuideManagerCore::Auto);
 		page->guides.clearVerticals(GuideManagerCore::Standard);
@@ -9078,7 +9078,7 @@
 		}
 		else
 		{
-			Annot *dia = new Annot(this, currItem, doc->DocPages.count(), static_cast<int>(doc->pageWidth()), static_cast<int>(doc->pageHeight()), doc->PageColors, view);
+			ScAnnot *dia = new ScAnnot(this, currItem, doc->DocPages.count(), static_cast<int>(doc->pageWidth()), static_cast<int>(doc->pageHeight()), doc->PageColors, view);
 			if (dia->exec())
 				slotDocCh();
 			delete dia;

Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h (original)
+++ trunk/Scribus/scribus/scribus.h Fri Jul 29 09:02:47 2011
@@ -486,8 +486,8 @@
 	void setNewCharStyle(const QString& name);
 	void setAlignmentValue(int a);
 	void selectItemsFromOutlines(PageItem *ite, bool single = false);
-	void selectItemsFromOutlines(int Page, int Item, bool single = false);
-	void selectPagesFromOutlines(int Page);
+	void selectItemsFromOutlines(int ScPage, int Item, bool single = false);
+	void selectPagesFromOutlines(int ScPage);
 	void doPrintPreview();
 	void printPreview();
 	void SaveAsEps();

Modified: trunk/Scribus/scribus/scribusXml.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/scribusXml.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusXml.cpp (original)
+++ trunk/Scribus/scribus/scribusXml.cpp Fri Jul 29 09:02:47 2011
@@ -31,7 +31,7 @@
 #include <cstdlib>
 
 #include "commonstrings.h"
-#include "page.h"
+#include "scpage.h"
 #include "pageitem.h"
 #include "pageitem_latexframe.h"
 #ifdef HAVE_OSG

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Fri Jul 29 09:02:47 2011
@@ -44,7 +44,6 @@
 #include "filewatcher.h"
 #include "ui/guidemanager.h"
 #include "hyphenator.h"
-#include "page.h"
 #include "pageitem.h"
 #include "pageitem_imageframe.h"
 #include "pageitem_latexframe.h"
@@ -73,6 +72,7 @@
 #include "scclocale.h"
 #include "scpainter.h"
 #include "sclimits.h"
+#include "scpage.h"
 #include "scraction.h"
 #include "scribus.h"
 #include "scribusXml.h"
@@ -87,7 +87,6 @@
 #include "ui/storyeditor.h"
 #include "text/nlsconfig.h"
 #include "undomanager.h"
-#include "undostate.h"
 #include "units.h"
 #include "util.h"
 #include "util_icon.h"
@@ -102,7 +101,7 @@
  This class forwards change events for pages and pageitems to 
  the region occupied by this page or pageitem.
  */
-class DocUpdater : public Observer<Page*>, public Observer<PageItem*> 
+class DocUpdater : public Observer<ScPage*>, public Observer<PageItem*>
 {
 	ScribusDoc* doc;
 	int  m_updateEnabled;
@@ -135,7 +134,7 @@
 		}
 	}
 	
-	void changed(Page* pg, bool /*doLayout*/)
+	void changed(ScPage* pg, bool /*doLayout*/)
 	{
 		QRectF pagebox(pg->xOffset(), pg->yOffset(), pg->width(), pg->height());
 		doc->invalidateRegion(pagebox);
@@ -1840,10 +1839,10 @@
 }
 
 
-Page* ScribusDoc::addPage(const int pageIndex, const QString& masterPageName, const bool addAutoFrame)
+ScPage* ScribusDoc::addPage(const int pageIndex, const QString& masterPageName, const bool addAutoFrame)
 {
 	assert(masterPageMode()==false);
-	Page* addedPage = new Page(docPrefsData.displayPrefs.scratch.Left, DocPages.count()*(docPrefsData.docSetupPrefs.pageHeight+docPrefsData.displayPrefs.scratch.Bottom+docPrefsData.displayPrefs.scratch.Top)+docPrefsData.displayPrefs.scratch.Top, docPrefsData.docSetupPrefs.pageWidth, docPrefsData.docSetupPrefs.pageHeight);
+	ScPage* addedPage = new ScPage(docPrefsData.displayPrefs.scratch.Left, DocPages.count()*(docPrefsData.docSetupPrefs.pageHeight+docPrefsData.displayPrefs.scratch.Bottom+docPrefsData.displayPrefs.scratch.Top)+docPrefsData.displayPrefs.scratch.Top, docPrefsData.docSetupPrefs.pageWidth, docPrefsData.docSetupPrefs.pageHeight);
 	assert(addedPage!=NULL);
 	addedPage->setDocument(this);
 	addedPage->Margins.Top = docPrefsData.docSetupPrefs.margins.Top;
@@ -1871,11 +1870,11 @@
 }
 
 
-Page* ScribusDoc::addMasterPage(const int pageNumber, const QString& pageName)
+ScPage* ScribusDoc::addMasterPage(const int pageNumber, const QString& pageName)
 {
 	//CB We dont create master pages (yet) with a pageCount based location
 	//Page* addedPage = new Page(ScratchLeft, MasterPages.count()*(pageHeight+ScratchBottom+ScratchTop)+ScratchTop, pageWidth, pageHeight);
-	Page* addedPage = new Page(docPrefsData.displayPrefs.scratch.Left, docPrefsData.displayPrefs.scratch.Top, docPrefsData.docSetupPrefs.pageWidth, docPrefsData.docSetupPrefs.pageHeight);
+	ScPage* addedPage = new ScPage(docPrefsData.displayPrefs.scratch.Left, docPrefsData.displayPrefs.scratch.Top, docPrefsData.docSetupPrefs.pageWidth, docPrefsData.docSetupPrefs.pageHeight);
 	assert(addedPage!=NULL);
 	addedPage->setDocument(this);
 	addedPage->Margins = docPrefsData.docSetupPrefs.margins;
@@ -1907,7 +1906,7 @@
 		Q_ASSERT(MasterPages.at(number)->pageName()==oldPageName);
 		MasterPages.at(number)->setPageName(newPageName);
 		//Update any pages that were linking to our old name
-		Page* docPage=NULL;
+		ScPage* docPage=NULL;
 		for (int i=0; i < DocPages.count(); ++i )
 		{
 			docPage=DocPages[i];
@@ -1933,7 +1932,7 @@
 	assert(masterPageMode());
 	assert( Pages->count() > 1 && Pages->count() > pageNumber );
 	setCurrentPage(Pages->at(0));
-	Page* page = Pages->takeAt(pageNumber);
+	ScPage* page = Pages->takeAt(pageNumber);
 	QString oldPageName(page->pageName());
 	delete page;
 	// remove the master page from the master page name list
@@ -1966,8 +1965,8 @@
 {
 	uint pageIndex = 0;
 	QMap<QString,int>::Iterator it = MasterNames.begin();
-	QListIterator<Page *> dpIt(DocPages);
-	Page* docPage=NULL;
+	QListIterator<ScPage *> dpIt(DocPages);
+	ScPage* docPage=NULL;
 	while(dpIt.hasNext())
 	//for (Page* docPage = currentDoc->DocPages.first(); docPage; docPage = currentDoc->DocPages.next() )
 	{
@@ -2013,7 +2012,7 @@
 	assert( Pages->count() > 1 && Pages->count() > pageNumber );
 	//#5561: If we are going to delete the first page, do not set the current page to it
 	setCurrentPage(Pages->at(pageNumber!=0?0:1));
-	Page* page = Pages->takeAt(pageNumber);
+	ScPage* page = Pages->takeAt(pageNumber);
 	delete page;
 	changed();
 }
@@ -2021,7 +2020,7 @@
 
 void ScribusDoc::movePage(const int from, const int to, const int ziel, const int art)
 {
-	QList<Page*> Buf;
+	QList<ScPage*> Buf;
 	int zz = ziel;
 	Buf.clear();
 	for (int a = from; a < to; ++a)
@@ -2054,7 +2053,7 @@
 {
 	if (!automaticTextFrames)
 		return -1;
-	Page *addToPage=DocPages.at(pageNumber);
+	ScPage *addToPage=DocPages.at(pageNumber);
 	if ((!masterPageMode()) && (usesAutomaticTextFrames()))// && (!isLoading()))
 	{
 		int z = itemAdd(PageItem::TextFrame, PageItem::Unspecified,
@@ -3727,10 +3726,10 @@
 // 		mna = CommonStrings::masterPageNormal;
 // 	if (!MasterNames.contains(mna))
 // 		mna = CommonStrings::masterPageNormal;
-	Page* Ap = DocPages.at(pageNumber);
+	ScPage* Ap = DocPages.at(pageNumber);
 	Ap->MPageNam = pageName;
 	const int MpNr = MasterNames[pageName];
-	Page* Mp = MasterPages.at(MpNr);
+	ScPage* Mp = MasterPages.at(MpNr);
 	PageItem *currItem;
 
 // 	for (currItem = Ap->FromMaster.first(); currItem; currItem = Ap->FromMaster.next())
@@ -4049,12 +4048,12 @@
 	if (masterPageMode())
 		return false;
 	int GrMax = GroupCounter;
-	Page* sourcePage = Pages->at(pageNumber);
+	ScPage* sourcePage = Pages->at(pageNumber);
 	int nr = MasterPages.count();
-	Page* targetPage=addMasterPage(nr, masterPageName);
+	ScPage* targetPage=addMasterPage(nr, masterPageName);
 	assert(targetPage!=NULL);
 	//Backup currentpage, and dont use sourcepage here as we might convert a non current page
-	Page* oldCurrentPage = currentPage();
+	ScPage* oldCurrentPage = currentPage();
 	//Must set current page for pasteitem to work properly
 	setLoading(true);
 	targetPage->copySizingProperties(sourcePage, sourcePage->Margins);
@@ -4080,7 +4079,7 @@
 	{
 		if (!sourcePage->MPageNam.isEmpty() && MasterNames.contains(sourcePage->MPageNam))
 		{
-			Page* pageMaster=NULL;
+			ScPage* pageMaster=NULL;
 			for (int i=0; i < MasterPages.count(); ++i )
 			{
 				pageMaster=MasterPages[i];
@@ -4245,7 +4244,7 @@
 	itemAddDetails(itemType, frameType, newItem->ItemNr);
 	if (UndoManager::undoEnabled())
 	{
-		ItemState<PageItem*> *is = new ItemState<PageItem*>("Create PageItem");
+		ScItemState<PageItem*> *is = new ScItemState<PageItem*>("Create PageItem");
 		is->set("CREATE_ITEM", "create_item");
 		is->setItem(newItem);
 		//Undo target rests with the Page for object specific undo
@@ -4290,7 +4289,7 @@
 	}
 	else
 		parsePagesString(iafData.pageList, &pageNs, DocPages.count());
-	Page* oldCurrentPage = currentPage();
+	ScPage* oldCurrentPage = currentPage();
 	int z=-2;
 	PageItem *prevItem=0; //Previous item for text frame linking
 	if (iafData.linkToExistingFrame && iafData.linkToExistingFramePtr!=NULL && 
@@ -4302,7 +4301,7 @@
 															  Um::InsertFrame, "", Um::ICreate));
 	for (uint i=0;i<pageNs.size();++i)
 	{
-		Page* targetPage=Pages->at(pageNs[i]-1);
+		ScPage* targetPage=Pages->at(pageNs[i]-1);
 		//We need this for the itemAdd, FIXME later
 		setCurrentPage(targetPage);
 		
@@ -4705,7 +4704,7 @@
 	}
 	else
 	{
-		Page* Seite;
+		ScPage* Seite;
 		uint docPageCount=Pages->count();
 		MarginStruct pageBleeds;
 		for (uint a = 0; a < docPageCount; ++a)
@@ -4849,7 +4848,7 @@
 void  ScribusDoc::fixItemPageOwner()
 {
 	int pageNr;
-	Page* page;
+	ScPage* page;
 	PageItem* currItem;
 	MarginStruct pageBleeds;
 
@@ -4910,7 +4909,7 @@
 	currentXPos += (docPrefsData.docSetupPrefs.pageWidth+docPrefsData.displayPrefs.pageGapHorizontal) * counter;
 
 	lastYPos = Pages->at(0)->initialHeight();
-	Page* Seite;
+	ScPage* Seite;
 	uint docPageCount=Pages->count();
 	for (uint a = 0; a < docPageCount; ++a)
 	{
@@ -5068,12 +5067,12 @@
 		qCritical() << "Attempting to get bleeds for non-existant page";
 }
 
-void ScribusDoc::getBleeds(const Page* page, MarginStruct& bleedData)
+void ScribusDoc::getBleeds(const ScPage* page, MarginStruct& bleedData)
 {
 	getBleeds(page, docPrefsData.docSetupPrefs.bleeds, bleedData);
 }
 
-void ScribusDoc::getBleeds(const Page* page, const MarginStruct& baseValues, MarginStruct& bleedData)
+void ScribusDoc::getBleeds(const ScPage* page, const MarginStruct& baseValues, MarginStruct& bleedData)
 {
 	bleedData.Bottom = baseValues.Bottom;
 	bleedData.Top    = baseValues.Top;
@@ -5300,7 +5299,7 @@
 	//Create the undo action for the new item
 	if (UndoManager::undoEnabled())
 	{
-		ItemState<std::pair<PageItem*, PageItem*> > *is = new ItemState<std::pair<PageItem*, PageItem*> >("Convert Item");
+		ScItemState<std::pair<PageItem*, PageItem*> > *is = new ScItemState<std::pair<PageItem*, PageItem*> >("Convert Item");
 		is->set("CONVERT_ITEM", "convert_item");
 		is->setItem(std::pair<PageItem*, PageItem*>(oldItem, newItem));
 		//Undo target rests with the Page for object specific undo
@@ -5367,7 +5366,7 @@
 	{
 		ScPattern pa = docPatterns[symbolName];
 		currentEditedSymbol = symbolName;
-		Page* addedPage = new Page(docPrefsData.displayPrefs.scratch.Left, docPrefsData.displayPrefs.scratch.Top, pa.width, pa.height);
+		ScPage* addedPage = new ScPage(docPrefsData.displayPrefs.scratch.Left, docPrefsData.displayPrefs.scratch.Top, pa.width, pa.height);
 		addedPage->setDocument(this);
 		addedPage->Margins.Top = 0;
 		addedPage->Margins.Bottom = 0;
@@ -5399,7 +5398,7 @@
 	else
 	{
 		PageItem* currItem = Items->at(0);
-		Page* addedPage = TempPages.at(0);
+		ScPage* addedPage = TempPages.at(0);
 		if (Items->count() > 1)
 		{
 			if ((!currItem->isGroup()) && (Items->count() > 1))
@@ -5688,8 +5687,8 @@
 	//CB Should we really be disabling auto text frames here?
 	bool autoText = usesAutomaticTextFrames();
 	setUsesAutomaticTextFrames(false);
-	Page* from = DocPages.at(pageNumberToCopy);
-	Page* lastDest = NULL;
+	ScPage* from = DocPages.at(pageNumberToCopy);
+	ScPage* lastDest = NULL;
 
 	uint oldItems = Items->count();
 	QList<QString> itemBuffer;
@@ -5735,7 +5734,7 @@
 			--destLocation;
 		else if (whereToInsert==2)
 			destLocation=DocPages.count();
-		Page* destination = new Page(docPrefsData.displayPrefs.scratch.Left, DocPages.count()*(docPrefsData.docSetupPrefs.pageHeight+docPrefsData.displayPrefs.scratch.Bottom+docPrefsData.displayPrefs.scratch.Top)+docPrefsData.displayPrefs.scratch.Top, docPrefsData.docSetupPrefs.pageWidth, docPrefsData.docSetupPrefs.pageHeight);
+		ScPage* destination = new ScPage(docPrefsData.displayPrefs.scratch.Left, DocPages.count()*(docPrefsData.docSetupPrefs.pageHeight+docPrefsData.displayPrefs.scratch.Bottom+docPrefsData.displayPrefs.scratch.Top)+docPrefsData.displayPrefs.scratch.Top, docPrefsData.docSetupPrefs.pageWidth, docPrefsData.docSetupPrefs.pageHeight);
 		destination->setDocument(this);
 		destination->setPageNr(destLocation);
 		lastDest = destination;
@@ -5823,13 +5822,13 @@
 	int setcol=pageSets()[docPrefsData.docSetupPrefs.pagePositioning].Columns;
 	if (setcol==1)
 	{
-		Page* pageToAdjust=DocPages.at(pageIndex);
+		ScPage* pageToAdjust=DocPages.at(pageIndex);
 		pageToAdjust->Margins.Left = pageToAdjust->initialMargins.Left;
 		pageToAdjust->Margins.Right = pageToAdjust->initialMargins.Right;
 		return;
 	}
 
-	Page* pageToAdjust=DocPages.at(pageIndex);
+	ScPage* pageToAdjust=DocPages.at(pageIndex);
 	PageLocation pageLoc=locationOfPage(pageIndex);
 	if (pageLoc==LeftPage) //Left hand page
 	{
@@ -8880,7 +8879,7 @@
 		// OLD_FRAME_TYPE - original frame type
 		// NEW_FRAME_TYPE - change of frame type
 		// binary QPair<FPointArray, FPointArray> - .first original shape, .second new shape
-		ItemState<QPair<FPointArray,FPointArray> > *is = new ItemState<QPair<FPointArray,FPointArray> >(Um::ChangeShapeType, "", Um::IBorder);
+		ScItemState<QPair<FPointArray,FPointArray> > *is = new ScItemState<QPair<FPointArray,FPointArray> >(Um::ChangeShapeType, "", Um::IBorder);
 		is->set("CHANGE_SHAPE_TYPE", "change_shape_type");
 		is->set("OLD_FRAME_TYPE", item->FrameType);
 		is->set("NEW_FRAME_TYPE", frameType);
@@ -9089,7 +9088,7 @@
 	}
 	if (UndoManager::undoEnabled() && (selectedItemCount > 0) && !forceDeletion)
 	{
-		ItemState< QList<PageItem*> > *is = new ItemState< QList<PageItem*> >(Um::Delete + " " + currItem->getUName(), "", Um::IDelete);
+		ScItemState< QList<PageItem*> > *is = new ScItemState< QList<PageItem*> >(Um::Delete + " " + currItem->getUName(), "", Um::IDelete);
 		is->setItem(delItems);
 		is->set("DELETE_ITEM", "delete_item");
 		undoManager->action(Pages->at(0), is, currItem->getUPixmap());
@@ -11012,13 +11011,13 @@
 }
 
 
-Page* ScribusDoc::currentPage()
+ScPage* ScribusDoc::currentPage()
 {
 	return m_currentPage;
 }
 
 
-void ScribusDoc::setCurrentPage(Page *newPage)
+void ScribusDoc::setCurrentPage(ScPage *newPage)
 {
 	if (newPage==NULL)
 		return;
@@ -11203,8 +11202,8 @@
 		updatePic();
 		
 		// this messy part is for the undo action
-		ItemState<QPair<ScImageEffectList, ScImageEffectList> > *state = 
-		new ItemState<QPair<ScImageEffectList, ScImageEffectList> >(
+		ScItemState<QPair<ScImageEffectList, ScImageEffectList> > *state =
+		new ScItemState<QPair<ScImageEffectList, ScImageEffectList> >(
 				Um::ImageEffects, "", currItem->getUPixmap());
 		state->set("APPLY_IMAGE_EFFECTS", "apply_image_effects");
 		state->setItem(QPair<ScImageEffectList, ScImageEffectList>(oldEffects, currItem->effectsInUse));
@@ -11300,7 +11299,7 @@
 	}
 	else if (setcol == 2)
 	{
-		Page *lp = addMasterPage(0, CommonStrings::trMasterPageNormalLeft);
+		ScPage *lp = addMasterPage(0, CommonStrings::trMasterPageNormalLeft);
 		lp->LeftPg = 1;
 		lp->Margins.Left = lp->initialMargins.Right;
 		lp->Margins.Right = lp->initialMargins.Left;
@@ -11311,7 +11310,7 @@
 	}
 	else if ((setcol == 3) || (setcol == 4))
 	{
-		Page *lp = addMasterPage(0, CommonStrings::trMasterPageNormalLeft);
+		ScPage *lp = addMasterPage(0, CommonStrings::trMasterPageNormalLeft);
 		lp->LeftPg = 1;
 		lp->Margins.Left = lp->initialMargins.Right;
 		lp->Margins.Right = lp->initialMargins.Left;
@@ -11363,11 +11362,11 @@
 }
 
 
-void ScribusDoc::getClosestGuides(double xin, double yin, double *xout, double *yout, int *GxM, int *GyM, Page* refPage)
+void ScribusDoc::getClosestGuides(double xin, double yin, double *xout, double *yout, int *GxM, int *GyM, ScPage* refPage)
 {
 	*GxM = -1;
 	*GyM = -1;
-	Page* page = (refPage == NULL) ? currentPage() : refPage;
+	ScPage* page = (refPage == NULL) ? currentPage() : refPage;
 	QMap<double, uint> tmpGuidesSel;
 	Guides tmpGuides = page->guides.horizontals(GuideManagerCore::Standard);
 	Guides::iterator it;
@@ -11431,7 +11430,7 @@
 	double xout, yout;
 	if (pg == -1)
 		return;
-	Page* page = Pages->at(pg);
+	ScPage* page = Pages->at(pg);
 	int GxM, GyM;
 	
 	//FIXME: stop using m_View
@@ -11486,7 +11485,7 @@
 	int pg = OnPage(*x, *y);
 	if (pg == -1)
 		return ret;
-	Page* page = Pages->at(pg);
+	ScPage* page = Pages->at(pg);
 	int GxM, GyM;
 
 	//	if ((SnapGuides) && (m_SnapCounter > 1))
@@ -12878,8 +12877,8 @@
 		if (*oldClip != newClip)
 		{
 			QString name = Doc->nodeEdit.isContourLine ? Um::EditContour : Um::EditShape;
-			ItemState<QPair<FPointArray, FPointArray> > *state =
-				new ItemState<QPair<FPointArray, FPointArray> >(name);
+			ScItemState<QPair<FPointArray, FPointArray> > *state =
+				new ScItemState<QPair<FPointArray, FPointArray> >(name);
 			state->set("EDIT_SHAPE_OR_CONTOUR", "edit_shape_or_contour");
 			state->set("IS_CONTOUR", Doc->nodeEdit.isContourLine);
 			state->setItem(QPair<FPointArray, FPointArray>(*oldClip, newClip));
@@ -12904,11 +12903,11 @@
 /**
   first part: create a new UndoState or cancel the current transaction
  */
-ItemState<QPair<FPointArray, FPointArray> >* NodeEditContext::finishTransaction1(PageItem* currItem)
+ScItemState<QPair<FPointArray, FPointArray> >* NodeEditContext::finishTransaction1(PageItem* currItem)
 {
 	ScribusDoc* Doc = currItem->doc();
 	UndoManager* undoManager = UndoManager::instance();
-	ItemState<QPair<FPointArray, FPointArray> >* state = NULL;
+	ScItemState<QPair<FPointArray, FPointArray> >* state = NULL;
 	
 	if (nodeTransaction) // is there the old clip stored for the undo action
 	{
@@ -12916,7 +12915,7 @@
 		if (*oldClip != newClip)
 		{
 			QString name = Doc->nodeEdit.isContourLine ? Um::EditContour : Um::EditShape;
-			state = new ItemState<QPair<FPointArray, FPointArray> >(name);
+			state = new ScItemState<QPair<FPointArray, FPointArray> >(name);
 			state->set("EDIT_SHAPE_OR_CONTOUR", "edit_shape_or_contour");
 			state->set("IS_CONTOUR", Doc->nodeEdit.isContourLine);
 			state->setItem(QPair<FPointArray, FPointArray>(*oldClip, newClip));
@@ -12937,7 +12936,7 @@
 /**
   second part: take the UndoState returned from finishTransaction1() and commit it
 */
-void NodeEditContext::finishTransaction2(PageItem* currItem, ItemState<QPair<FPointArray, FPointArray> >* state)
+void NodeEditContext::finishTransaction2(PageItem* currItem, ScItemState<QPair<FPointArray, FPointArray> >* state)
 {
 	UndoManager* undoManager = UndoManager::instance();
 	
@@ -13170,8 +13169,8 @@
 	FPointArray newClip(Doc->nodeEdit.isContourLine ? currItem->ContourLine : currItem->PoLine);
 	if (*oldClip != newClip)
 	{
-		ItemState<QPair<FPointArray, FPointArray> > *state =
-		new ItemState<QPair<FPointArray, FPointArray> >(Um::ResetControlPoint, "",
+		ScItemState<QPair<FPointArray, FPointArray> > *state =
+		new ScItemState<QPair<FPointArray, FPointArray> >(Um::ResetControlPoint, "",
 														currItem->getUPixmap());
 		state->set("EDIT_SHAPE_OR_CONTOUR", "edit_shape_or_contour");
 		state->set("IS_CONTOUR", Doc->nodeEdit.isContourLine);
@@ -13268,8 +13267,8 @@
 	FPointArray newClip(Doc->nodeEdit.isContourLine ? currItem->ContourLine : currItem->PoLine);
 	if (*oldClip != newClip)
 	{
-		ItemState<QPair<FPointArray, FPointArray> > *state =
-		new ItemState<QPair<FPointArray, FPointArray> >(Um::ResetControlPoints, "",
+		ScItemState<QPair<FPointArray, FPointArray> > *state =
+		new ScItemState<QPair<FPointArray, FPointArray> >(Um::ResetControlPoints, "",
 														currItem->getUPixmap());
 		state->set("EDIT_SHAPE_OR_CONTOUR", "edit_shape_or_contour");
 		state->set("IS_CONTOUR", Doc->nodeEdit.isContourLine);
@@ -13549,7 +13548,7 @@
 {
 	for (int p = 0; p < Pages->count(); ++p)
 	{
-		Page *pp = Pages->at(p);
+		ScPage *pp = Pages->at(p);
 		if (resizePages)
 		{
 			pp->setInitialWidth(pageWidth());
@@ -13571,7 +13570,7 @@
 			//check if *pp's margins are the same as the *mp's current margins
 			//apply new margins if same
 			const int masterPageNumber = MasterNames[pp->MPageNam];
-			const Page* mp = MasterPages.at(masterPageNumber);
+			const ScPage* mp = MasterPages.at(masterPageNumber);
 			if (pp->initialMargins.Left == mp->initialMargins.Left &&
 				pp->initialMargins.Right == mp->initialMargins.Right &&
 				pp->initialMargins.Top == mp->initialMargins.Top &&
@@ -13584,7 +13583,7 @@
 	}
 	for (int p = 0; p < MasterPages.count(); ++p)
 	{
-		Page *pp = MasterPages.at(p);
+		ScPage *pp = MasterPages.at(p);
 		if (resizeMasterPages)
 		{
 			pp->setInitialWidth(pageWidth());

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Fri Jul 29 09:02:47 2011
@@ -41,7 +41,7 @@
 #include "colormgmt/sccolormgmtengine.h"
 #include "documentinformation.h"
 #include "observable.h"
-#include "page.h"
+#include "scpage.h"
 #include "pageitem.h"
 #include "pagestructs.h"
 #include "prefsstructs.h"
@@ -49,6 +49,7 @@
 #include "sclayer.h"
 #include "styles/styleset.h"
 #include "undoobject.h"
+#include "undostate.h"
 #include "updatemanager.h"
 #include "usertaskstructs.h"
 
@@ -57,7 +58,7 @@
 
 class DocUpdater;
 class UndoManager;
-class UndoState;
+// class UndoState;
 class PDFOptions;
 class Hyphenator;
 class Selection;
@@ -100,8 +101,8 @@
 	void resetControl(PageItem* currItem);
 	FPointArray beginTransaction(PageItem* currItem);
 	void finishTransaction(PageItem* currItem);
-	ItemState<QPair<FPointArray, FPointArray> >* finishTransaction1(PageItem* currItem);
-	void finishTransaction2(PageItem* currItem, ItemState<QPair<FPointArray, FPointArray> >* state);
+	ScItemState<QPair<FPointArray, FPointArray> >* finishTransaction1(PageItem* currItem);
+	void finishTransaction2(PageItem* currItem, ScItemState<QPair<FPointArray, FPointArray> >* state);
 	void moveClipPoint(PageItem *currItem, FPoint ip);
 };
 
@@ -142,7 +143,7 @@
 	
 	UpdateManager* updateManager() { return &m_updateManager; }
 	MassObservable<PageItem*> * itemsChanged() { return &m_itemsChanged; }
-	MassObservable<Page*>     * pagesChanged() { return &m_pagesChanged; }
+	MassObservable<ScPage*>     * pagesChanged() { return &m_pagesChanged; }
 	MassObservable<QRectF>    * regionsChanged() { return &m_regionsChanged; }
 	
 	void invalidateAll();
@@ -230,10 +231,10 @@
 
 	// Add, delete and move pages
 	
-	Page* addPage(const int pageNumber, const QString& masterPageName=QString::null, const bool addAutoFrame=false);
+	ScPage* addPage(const int pageNumber, const QString& masterPageName=QString::null, const bool addAutoFrame=false);
 	void deletePage(const int);
 	//! @brief Add a master page with this function, do not use addPage
-	Page* addMasterPage(const int, const QString&);
+	ScPage* addMasterPage(const int, const QString&);
 	void deleteMasterPage(const int);
 	//! @brief Rebuild master name list
 	void rebuildMasterNames(void);
@@ -794,8 +795,8 @@
 	double getXOffsetForPage(const int);
 	double getYOffsetForPage(const int);
 	void getBleeds(int pageNumber, MarginStruct& bleedData);
-	void getBleeds(const Page* page, MarginStruct& bleedData);
-	void getBleeds(const Page* page, const MarginStruct& baseValues, MarginStruct& bleedData);
+	void getBleeds(const ScPage* page, MarginStruct& bleedData);
+	void getBleeds(const ScPage* page, const MarginStruct& baseValues, MarginStruct& bleedData);
 	
 	/**
 	 * @brief Item type conversion functions
@@ -989,10 +990,10 @@
 	void changed();
 	/*! \brief Get pointer to the current page
 	\retval Page* current page object */
-	Page* currentPage();
+	ScPage* currentPage();
 	/*! \brief Set new current page
 	\param newPage New current page */
-	void setCurrentPage(Page *newPage);
+	void setCurrentPage(ScPage *newPage);
 	bool hasGUI() const {return m_hasGUI;}
 	/*! \brief Apply grid to a QPoint, from ScribusView */
 	QPoint ApplyGrid(const QPoint& in);
@@ -1001,7 +1002,7 @@
 	/*! \brief Does this doc have any TOC setups and potentially a TOC to generate */
 	bool hasTOCSetup() { return !docPrefsData.tocPrefs.defaultToCSetups.empty(); }
 	//! \brief Get the closest guide to the given point
-	void getClosestGuides(double xin, double yin, double *xout, double *yout, int *GxM, int *GyM, Page* refPage = NULL);
+	void getClosestGuides(double xin, double yin, double *xout, double *yout, int *GxM, int *GyM, ScPage* refPage = NULL);
 	//! \brief Snap an item to the guides
 	void SnapToGuides(PageItem *currItem);
 	bool ApplyGuides(double *x, double *y);
@@ -1071,13 +1072,13 @@
 	double rulerXoffset;
 	double rulerYoffset;
 	/** \brief List of Pages */
-	QList<Page*>* Pages;
+	QList<ScPage*>* Pages;
 	/** \brief List of Master Pages */
-	QList<Page*> MasterPages;
+	QList<ScPage*> MasterPages;
 	/** \brief List of Document Pages */
-	QList<Page*> DocPages;
+	QList<ScPage*> DocPages;
 	/** \brief List for temporary Pages */
-	QList<Page*> TempPages;
+	QList<ScPage*> TempPages;
 	/** \brief Mapping Master Page Name to Master Page numbers */
 	QMap<QString,int> MasterNames;
 	/** \brief List of Objects */
@@ -1181,7 +1182,7 @@
 	struct OpenNodesList
 	{
 		int type;
-		Page *page;
+		ScPage *page;
 		PageItem *item;
 	};
 	QList<OpenNodesList> OpenNodes;
@@ -1201,10 +1202,10 @@
 	UndoTransaction* m_itemCreationTransaction;
 	UndoTransaction* m_alignTransaction;
 
-	Page* m_currentPage;
+	ScPage* m_currentPage;
 	UpdateManager m_updateManager;
 	MassObservable<PageItem*> m_itemsChanged;
-	MassObservable<Page*> m_pagesChanged;
+	MassObservable<ScPage*> m_pagesChanged;
 	MassObservable<QRectF> m_regionsChanged;
 	DocUpdater* m_docUpdater;
 	

Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Fri Jul 29 09:02:47 2011
@@ -79,7 +79,7 @@
 #include "commonstrings.h"
 #include "filewatcher.h"
 #include "hyphenator.h"
-#include "page.h"
+#include "scpage.h"
 #include "pageitem_imageframe.h"
 #include "pageitem_line.h"
 #include "pageitem_pathtext.h"
@@ -1026,7 +1026,7 @@
 										for (int i = 0; i < Doc->m_Selection->count(); ++i)
 										{
 											PageItem* newItem = Doc->m_Selection->itemAt(i);
-											ItemState<PageItem*> *is = new ItemState<PageItem*>("Create PageItem");
+											ScItemState<PageItem*> *is = new ScItemState<PageItem*>("Create PageItem");
 											is->set("CREATE_ITEM", "create_item");
 											is->setItem(newItem);
 											//Undo target rests with the Page for object specific undo
@@ -2281,9 +2281,9 @@
 
 //CB This MUST now be called AFTER a call to doc->addPage or doc->addMasterPage as it
 //does NOT create a page anymore.
-Page* ScribusView::addPage(int nr, bool mov)
-{
-	Page* fe=Doc->Pages->at(nr);
+ScPage* ScribusView::addPage(int nr, bool mov)
+{
+	ScPage* fe=Doc->Pages->at(nr);
 	Q_ASSERT(fe!=0);
 	if (fe==0)
 		return 0;
@@ -2764,7 +2764,7 @@
 		double cx = Doc->minCanvasCoordinate.x();
 		double cy = Doc->minCanvasCoordinate.y();
 		Doc->minCanvasCoordinate = FPoint(0, 0);
-		Page* act = Doc->currentPage();
+		ScPage* act = Doc->currentPage();
 		bool mMode = Doc->masterPageMode();
 		Doc->setMasterPageMode(true);
 		Doc->setCurrentPage(Doc->MasterPages.at(Nr));
@@ -2840,7 +2840,7 @@
 			m_canvas->setScale(sc);
 			m_canvas->m_viewMode.previewMode = true;
 			m_canvas->m_viewMode.forceRedraw = true;
-			Page* act = Doc->currentPage();
+			ScPage* act = Doc->currentPage();
 			bool mMode = Doc->masterPageMode();
 			Doc->setMasterPageMode(false);
 			Doc->setLoading(true);
@@ -2859,7 +2859,7 @@
 			painter->setZoomFactor(m_canvas->scale());
 
 			QList<QPair<PageItem*, int> > changedList;
-			Page* page = Doc->DocPages.at(Nr);
+			ScPage* page = Doc->DocPages.at(Nr);
 			PageItem* currItem;
 			if (page->FromMaster.count() != 0)
 			{

Modified: trunk/Scribus/scribus/scribusview.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/scribusview.h
==============================================================================
--- trunk/Scribus/scribus/scribusview.h (original)
+++ trunk/Scribus/scribus/scribusview.h Fri Jul 29 09:02:47 2011
@@ -71,7 +71,7 @@
 class CanvasGesture;
 class Hruler;
 class Vruler;
-class Page;
+class ScPage;
 class RulerMover;
 class PageItem;
 class PageSelector;
@@ -172,7 +172,7 @@
 	void updatesOn(bool on);
 	//CB This MUST now be called AFTER a call to doc->addPage or doc->addMasterPage as it
 	//does NOT create a page anymore.
-	Page* addPage(int nr, bool mov = true);
+	ScPage* addPage(int nr, bool mov = true);
 
 	void reformPages(bool moveObjects = true);
 	void updateLayerMenu();

Modified: trunk/Scribus/scribus/tocgenerator.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/tocgenerator.cpp
==============================================================================
--- trunk/Scribus/scribus/tocgenerator.cpp (original)
+++ trunk/Scribus/scribus/tocgenerator.cpp Fri Jul 29 09:02:47 2011
@@ -26,7 +26,7 @@
 #include "gtframestyle.h"
 #include "gtparagraphstyle.h"
 #include "gtwriter.h"
-#include "page.h"
+#include "scpage.h"
 #include "pageitem.h"
 #include "pagestructs.h"
 #include "scribusdoc.h"

Modified: trunk/Scribus/scribus/ui/aligndistribute.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/aligndistribute.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/aligndistribute.cpp (original)
+++ trunk/Scribus/scribus/ui/aligndistribute.cpp Fri Jul 29 09:02:47 2011
@@ -35,7 +35,7 @@
 #include <QVariant>
 
 #include "commonstrings.h"
-#include "page.h"
+#include "scpage.h"
 #include "ui/scmessagebox.h"
 #include "scribusdoc.h"
 #include "ui/scrspinbox.h"

Modified: trunk/Scribus/scribus/ui/annot.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/annot.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/annot.cpp (original)
+++ trunk/Scribus/scribus/ui/annot.cpp Fri Jul 29 09:02:47 2011
@@ -53,7 +53,7 @@
 #include "util_icon.h"
 #include "util.h"
 
-Annot::Annot(QWidget* parent, PageItem *it, int Seite, int b, int h, ColorList Farben, ScribusView* vie)
+ScAnnot::ScAnnot(QWidget* parent, PageItem *it, int Seite, int b, int h, ColorList Farben, ScribusView* vie)
 		: QDialog( parent )
 {
 	ScribusDoc* doc = Farben.document();
@@ -1196,10 +1196,10 @@
 	resize( minimumSizeHint() );
 }
 
-Annot::~Annot()
+ScAnnot::~ScAnnot()
 {}
 
-void Annot::NewName()
+void ScAnnot::NewName()
 {
 	QString NameNew = Name->text();
 	if (NameNew.isEmpty())
@@ -1234,7 +1234,7 @@
 	}
 }
 
-void Annot::IPlace()
+void ScAnnot::IPlace()
 {
 	ButtonIcon* dia = new ButtonIcon(this, item);
 	if (dia->exec())
@@ -1268,7 +1268,7 @@
 	delete dia;
 }
 
-void Annot::RemoveNIcon()
+void ScAnnot::RemoveNIcon()
 {
 	NiconPrev->clear();
 	item->Pfile = "";
@@ -1276,21 +1276,21 @@
 	IconNR->setEnabled(false);
 }
 
-void Annot::RemovePIcon()
+void ScAnnot::RemovePIcon()
 {
 	PiconPrev->clear();
 	item->Pfile2 = "";
 	IconPR->setEnabled(false);
 }
 
-void Annot::RemoveRIcon()
+void ScAnnot::RemoveRIcon()
 {
 	RiconPrev->clear();
 	item->Pfile3 = "";
 	IconRR->setEnabled(false);
 }
 
-void Annot::IconsEin()
+void ScAnnot::IconsEin()
 {
 	bool setter = !UseIcons->isChecked() ? false : true;
 	IconN->setEnabled(setter);
@@ -1307,7 +1307,7 @@
 	item->annotation().setUseIcons(UseIcons->isChecked());
 }
 
-void Annot::GetNIcon()
+void ScAnnot::GetNIcon()
 {
 	QString fileName;
 	QString wdir = dirs->get("icon", ".");
@@ -1339,7 +1339,7 @@
 	}
 }
 
-void Annot::GetPIcon()
+void ScAnnot::GetPIcon()
 {
 	QString fileName;
 	QString wdir = dirs->get("icon", ".");
@@ -1364,7 +1364,7 @@
 	}
 }
 
-void Annot::GetRIcon()
+void ScAnnot::GetRIcon()
 {
 	QString fileName;
 	QString wdir = dirs->get("icon", ".");
@@ -1389,7 +1389,7 @@
 	}
 }
 
-void Annot::SelectFelder()
+void ScAnnot::SelectFelder()
 {
 	SelectFields* dia = new SelectFields(this, CalcFields->text(), item->itemName(), view->Doc, 3);
 	if (dia->exec())
@@ -1397,7 +1397,7 @@
 	delete dia;
 }
 
-void Annot::editKeySc()
+void ScAnnot::editKeySc()
 {
 	Editor* dia = new Editor(this, item->annotation().K_act(), view);
 	if (dia->exec())
@@ -1408,7 +1408,7 @@
 	delete dia;
 }
 
-void Annot::editFormatSc()
+void ScAnnot::editFormatSc()
 {
 	Editor* dia = new Editor(this, item->annotation().F_act(), view);
 	if (dia->exec())
@@ -1419,7 +1419,7 @@
 	delete dia;
 }
 
-void Annot::editValidSc()
+void ScAnnot::editValidSc()
 {
 	Editor* dia = new Editor(this, item->annotation().V_act(), view);
 	if (dia->exec())
@@ -1430,7 +1430,7 @@
 	delete dia;
 }
 
-void Annot::editCalcSc()
+void ScAnnot::editCalcSc()
 {
 	Editor* dia = new Editor(this, item->annotation().C_act(), view);
 	if (dia->exec())
@@ -1441,7 +1441,7 @@
 	delete dia;
 }
 
-void Annot::editJavaSc()
+void ScAnnot::editJavaSc()
 {
 	Editor* dia = new Editor(this, EditJava->toPlainText(), view);
 	if (dia->exec())
@@ -1449,7 +1449,7 @@
 	delete dia;
 }
 
-void Annot::setDateSample(const QString& ds)
+void ScAnnot::setDateSample(const QString& ds)
 {
 	QDateTime dt = QDateTime::currentDateTime();
 	QString tmp = "";
@@ -1490,7 +1490,7 @@
 	TextDa1->setText( tr("Example:")+" "+dt.toString(tmp));
 }
 
-void Annot::DecodeVali()
+void ScAnnot::DecodeVali()
 {
 	QString pfor = item->annotation().V_act();
 	int ss = pfor.indexOf("(");
@@ -1501,7 +1501,7 @@
 	MaxValid->setText(pfol[3].simplified());
 }
 
-void Annot::DecodeCalc()
+void ScAnnot::DecodeCalc()
 {
 	QString tm = "";
 	QString tm2;
@@ -1534,7 +1534,7 @@
 	}
 }
 
-void Annot::DecodeNum()
+void ScAnnot::DecodeNum()
 {
 	QString pfor = item->annotation().F_act();
 	int ss = pfor.indexOf("(");
@@ -1636,7 +1636,7 @@
 		}
 }
 
-void Annot::SetFormNum()
+void ScAnnot::SetFormNum()
 {
 	switch (item->annotation().Format())
 	{
@@ -1673,7 +1673,7 @@
 	}
 }
 
-void Annot::HandleVali()
+void ScAnnot::HandleVali()
 {
 	bool setter = SimpleValid->isChecked() ? true : false;
 	MaxValid->setEnabled(setter);
@@ -1683,7 +1683,7 @@
 		EditValScript->setEnabled(true);
 }
 
-void Annot::SetVali()
+void ScAnnot::SetVali()
 {
 	MaxValid->setEnabled(false);
 	MinValid->setEnabled(false);
@@ -1709,7 +1709,7 @@
 	}
 }
 
-void Annot::HandleCalc()
+void ScAnnot::HandleCalc()
 {
 	bool setter = SimpleCalc->isChecked() ? true : false;
 	CalcFields->setEnabled(setter);
@@ -1720,7 +1720,7 @@
 		EditCalc->setEnabled(true);
 }
 
-void Annot::SetCalc()
+void ScAnnot::SetCalc()
 {
 	CalcFields->setEnabled(false);
 	CalcArt->setEnabled(false);
@@ -1747,14 +1747,14 @@
 	}
 }
 
-void Annot::SetCurr()
+void ScAnnot::SetCurr()
 {
 	bool setter = UseCurr->isChecked() ? true : false;
 	CurSym->setEnabled(setter);
 	PreCurr->setEnabled(setter);
 }
 
-void Annot::SetFoScript(int it)
+void ScAnnot::SetFoScript(int it)
 {
 	if (it >= 0 && it <=5)
 		FoFram->setCurrentIndex(it);
@@ -1772,13 +1772,13 @@
 	item->annotation().setFormat(it);
 }
 
-void Annot::SetCoords(double x, double y)
+void ScAnnot::SetCoords(double x, double y)
 {
 	SpinBox21->setValue(static_cast<int>(x*Width));
 	SpinBox31->setValue(static_cast<int>(y*Height));
 }
 
-void Annot::SetPage(int v)
+void ScAnnot::SetPage(int v)
 {
 	disconnect(SpinBox11, SIGNAL(valueChanged(int)), this, SLOT(SetPage(int)));
 	if ((item->annotation().ActionType() == 7) || (item->annotation().ActionType() == 9))
@@ -1805,7 +1805,7 @@
 	connect(SpinBox11, SIGNAL(valueChanged(int)), this, SLOT(SetPage(int)));
 }
 
-void Annot::SetCross()
+void ScAnnot::SetCross()
 {
 	int x,y;
 	disconnect(Pg1, SIGNAL(Coords(double, double)), this, SLOT(SetCoords(double, double)));
@@ -1815,7 +1815,7 @@
 	connect(Pg1, SIGNAL(Coords(double, double)), this, SLOT(SetCoords(double, double)));
 }
 
-void Annot::SetValues()
+void ScAnnot::SetValues()
 {
 	QString tmp, tmp2;
 	QString Nfo("");
@@ -2048,7 +2048,7 @@
 	accept();
 }
 
-void Annot::SetAnnotationType(int it)
+void ScAnnot::SetAnnotationType(int it)
 {
 	disconnect(ActionCombo, SIGNAL(activated(int)), this, SLOT(SetActionType(int)));
 	disconnect(TxFormat, SIGNAL(activated(int)), this, SLOT(SetFoScript(int)));
@@ -2143,12 +2143,12 @@
 	connect(TxFormat, SIGNAL(activated(int)), this, SLOT(SetFoScript(int)));
 }
 
-void Annot::SetLimit()
+void ScAnnot::SetLimit()
 {
 	Limit->isChecked() ? MaxChars->setEnabled(true) :MaxChars->setEnabled(false);
 }
 
-void Annot::SetExternLink()
+void ScAnnot::SetExternLink()
 {
 	disconnect(LExtern, SIGNAL(clicked()), this, SLOT(SetExternLink()));
 	bool enable;
@@ -2188,7 +2188,7 @@
 	connect(LExtern, SIGNAL(clicked()), this, SLOT(SetExternLink()));
 }
 
-void Annot::SetActionType(int it)
+void ScAnnot::SetActionType(int it)
 {
 	bool setter;
 	switch (it)
@@ -2220,7 +2220,7 @@
 	}
 }
 
-void Annot::SetActionScript(int it)
+void ScAnnot::SetActionScript(int it)
 {
 	switch (ScrEdited)
 	{
@@ -2273,7 +2273,7 @@
 	ScrEdited = it;
 }
 
-void Annot::GetFile()
+void ScAnnot::GetFile()
 {
 	QString fn;
 	QString wdir = dirs->get("annot_getfile", ".");

Modified: trunk/Scribus/scribus/ui/annot.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/annot.h
==============================================================================
--- trunk/Scribus/scribus/ui/annot.h (original)
+++ trunk/Scribus/scribus/ui/annot.h Fri Jul 29 09:02:47 2011
@@ -34,13 +34,13 @@
 class ScribusView;
 class PrefsContext;
 
-class SCRIBUS_API Annot : public QDialog
+class SCRIBUS_API ScAnnot : public QDialog
 {
 	Q_OBJECT
 
 public:
-	Annot ( QWidget* parent, PageItem *it, int Seite, int b, int h, ColorList Farben, ScribusView* vie );
-	~Annot();
+	ScAnnot ( QWidget* parent, PageItem *it, int Seite, int b, int h, ColorList Farben, ScribusView* vie );
+	~ScAnnot();
 	void DecodeNum();
 	void DecodeVali();
 	void DecodeCalc();

Modified: trunk/Scribus/scribus/ui/applytemplatedialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/applytemplatedialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/applytemplatedialog.cpp (original)
+++ trunk/Scribus/scribus/ui/applytemplatedialog.cpp Fri Jul 29 09:02:47 2011
@@ -29,7 +29,7 @@
 
 #include "commonstrings.h"
 #include "scribusdoc.h"
-#include "page.h"
+#include "scpage.h"
 #include "util_icon.h"
 
 enum {

Modified: trunk/Scribus/scribus/ui/applytemplatedialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/applytemplatedialog.h
==============================================================================
--- trunk/Scribus/scribus/ui/applytemplatedialog.h (original)
+++ trunk/Scribus/scribus/ui/applytemplatedialog.h Fri Jul 29 09:02:47 2011
@@ -20,7 +20,7 @@
 
 #include "scribusapi.h"
 #include "scribusdoc.h"
-#include "page.h"
+#include "scpage.h"
 
 class QCheckBox;
 class QComboBox;

Modified: trunk/Scribus/scribus/ui/checkDocument.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/checkDocument.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/checkDocument.cpp (original)
+++ trunk/Scribus/scribus/ui/checkDocument.cpp Fri Jul 29 09:02:47 2011
@@ -23,7 +23,7 @@
 #include "sccombobox.h"
 #include "scribuscore.h"
 #include "scribusdoc.h"
-#include "page.h"
+#include "scpage.h"
 #include "prefsmanager.h"
 #include "documentchecker.h"
 #include "util_icon.h"

Modified: trunk/Scribus/scribus/ui/colorlistbox.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/colorlistbox.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/colorlistbox.cpp (original)
+++ trunk/Scribus/scribus/ui/colorlistbox.cpp Fri Jul 29 09:02:47 2011
@@ -446,7 +446,9 @@
 
 bool ColorListBox::viewportEvent(QEvent *event)
 {
-	/* commented out because of random crashes in the colorcombobox of the gradient editor
+	if (event != NULL)
+	{
+	/* commented out because of random crashes in the colorcombobox of the gradient editor */
 	if (event->type() == QEvent::ToolTip)
 	{
 		if (cList != NULL)
@@ -478,7 +480,7 @@
 			}
 		}
 	}
-	else */
+	else
 	if (event->type() == QEvent::MouseButtonPress)
 	{
 		QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
@@ -494,5 +496,6 @@
 			return true;
 		}
 	}
+	}
 	return QListWidget::viewportEvent(event);
 }

Modified: trunk/Scribus/scribus/ui/colorpalette.ui
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/colorpalette.ui
==============================================================================
--- trunk/Scribus/scribus/ui/colorpalette.ui (original)
+++ trunk/Scribus/scribus/ui/colorpalette.ui Fri Jul 29 09:02:47 2011
@@ -1,858 +1,863 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>colorPalette</class>
- <widget class="QWidget" name="colorPalette">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>258</width>
-    <height>360</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Form</string>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
-   <property name="margin">
-    <number>5</number>
-   </property>
-   <item>
-    <widget class="QTabWidget" name="tabFillStroke">
-     <property name="currentIndex">
-      <number>0</number>
-     </property>
-     <widget class="QWidget" name="tabFill">
-      <attribute name="title">
-       <string>Fill</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout_2">
-       <property name="spacing">
-        <number>2</number>
-       </property>
-       <property name="margin">
-        <number>2</number>
-       </property>
-       <item>
-        <layout class="QHBoxLayout" name="horizontalLayout_2">
-         <item>
-          <widget class="QLabel" name="fillModeLabel">
-           <property name="text">
-            <string>Fill Mode</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QComboBox" name="fillModeCombo"/>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="Line" name="line">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QStackedWidget" name="fillModeStack">
-         <property name="currentIndex">
-          <number>0</number>
-         </property>
-         <widget class="QWidget" name="solidFillPage">
-          <layout class="QVBoxLayout" name="verticalLayout_3">
-           <property name="spacing">
-            <number>2</number>
-           </property>
-           <property name="margin">
-            <number>0</number>
-           </property>
-           <item>
-            <widget class="ColorListBox" name="colorListFill"/>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_3">
-             <item>
-              <widget class="QLabel" name="label">
-               <property name="text">
-                <string>Shade:</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QSpinBox" name="fillShade">
-               <property name="suffix">
-                <string>%</string>
-               </property>
-               <property name="maximum">
-                <number>100</number>
-               </property>
-               <property name="value">
-                <number>100</number>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-          </layout>
-         </widget>
-         <widget class="QWidget" name="gradientFillPage">
-          <layout class="QVBoxLayout" name="verticalLayout_5">
-           <property name="spacing">
-            <number>2</number>
-           </property>
-           <property name="margin">
-            <number>0</number>
-           </property>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_4">
-             <item>
-              <widget class="QComboBox" name="gradientType">
-               <item>
-                <property name="text">
-                 <string>Linear</string>
-                </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>Radial</string>
-                </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>4 Colors</string>
-                </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>Diamond</string>
-                </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>Mesh</string>
-                </property>
-               </item>
-              </widget>
-             </item>
-             <item>
-              <widget class="QToolButton" name="gradEditButton">
-               <property name="text">
-                <string>Move Vector</string>
-               </property>
-               <property name="checkable">
-                <bool>true</bool>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <widget class="QStackedWidget" name="stackedWidget_2">
-             <property name="currentIndex">
-              <number>0</number>
-             </property>
-             <widget class="QWidget" name="page_3">
-              <layout class="QVBoxLayout" name="verticalLayout_4">
-               <property name="margin">
-                <number>0</number>
-               </property>
-               <item>
-                <widget class="ScComboBox" name="namedGradient"/>
-               </item>
-               <item>
-                <widget class="GradientEditor" name="gradEdit">
-                 <property name="frameShape">
-                  <enum>QFrame::NoFrame</enum>
-                 </property>
-                 <property name="frameShadow">
-                  <enum>QFrame::Raised</enum>
-                 </property>
-                </widget>
-               </item>
-              </layout>
-             </widget>
-             <widget class="QWidget" name="page_4">
-              <layout class="QVBoxLayout" name="verticalLayout_8">
-               <property name="margin">
-                <number>0</number>
-               </property>
-               <item>
-                <layout class="QGridLayout" name="gridLayout_4">
-                 <item row="0" column="0">
-                  <widget class="QLabel" name="label_5">
-                   <property name="text">
-                    <string>Color</string>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="0" column="1">
-                  <widget class="QLabel" name="label_2">
-                   <property name="text">
-                    <string>Shade</string>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="0" column="2">
-                  <widget class="QLabel" name="label_9">
-                   <property name="text">
-                    <string>Transparency</string>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="1" column="0">
-                  <widget class="ColorCombo" name="colorPoint1">
-                   <property name="sizePolicy">
-                    <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-                     <horstretch>0</horstretch>
-                     <verstretch>0</verstretch>
-                    </sizepolicy>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="1" column="1">
-                  <widget class="QSpinBox" name="color1Shade">
-                   <property name="suffix">
-                    <string> %</string>
-                   </property>
-                   <property name="minimum">
-                    <number>0</number>
-                   </property>
-                   <property name="maximum">
-                    <number>100</number>
-                   </property>
-                   <property name="singleStep">
-                    <number>10</number>
-                   </property>
-                   <property name="value">
-                    <number>100</number>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="1" column="2">
-                  <widget class="QSpinBox" name="color1Alpha">
-                   <property name="suffix">
-                    <string> %</string>
-                   </property>
-                   <property name="maximum">
-                    <number>100</number>
-                   </property>
-                   <property name="singleStep">
-                    <number>10</number>
-                   </property>
-                   <property name="value">
-                    <number>100</number>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="2" column="0">
-                  <widget class="ColorCombo" name="colorPoint2">
-                   <property name="sizePolicy">
-                    <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-                     <horstretch>0</horstretch>
-                     <verstretch>0</verstretch>
-                    </sizepolicy>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="2" column="1">
-                  <widget class="QSpinBox" name="color2Shade">
-                   <property name="suffix">
-                    <string> %</string>
-                   </property>
-                   <property name="minimum">
-                    <number>0</number>
-                   </property>
-                   <property name="maximum">
-                    <number>100</number>
-                   </property>
-                   <property name="singleStep">
-                    <number>10</number>
-                   </property>
-                   <property name="value">
-                    <number>100</number>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="2" column="2">
-                  <widget class="QSpinBox" name="color2Alpha">
-                   <property name="suffix">
-                    <string> %</string>
-                   </property>
-                   <property name="maximum">
-                    <number>100</number>
-                   </property>
-                   <property name="singleStep">
-                    <number>10</number>
-                   </property>
-                   <property name="value">
-                    <number>100</number>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="3" column="0">
-                  <widget class="ColorCombo" name="colorPoint3">
-                   <property name="sizePolicy">
-                    <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-                     <horstretch>0</horstretch>
-                     <verstretch>0</verstretch>
-                    </sizepolicy>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="3" column="1">
-                  <widget class="QSpinBox" name="color3Shade">
-                   <property name="suffix">
-                    <string> %</string>
-                   </property>
-                   <property name="minimum">
-                    <number>0</number>
-                   </property>
-                   <property name="maximum">
-                    <number>100</number>
-                   </property>
-                   <property name="singleStep">
-                    <number>10</number>
-                   </property>
-                   <property name="value">
-                    <number>100</number>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="3" column="2">
-                  <widget class="QSpinBox" name="color3Alpha">
-                   <property name="suffix">
-                    <string> %</string>
-                   </property>
-                   <property name="maximum">
-                    <number>100</number>
-                   </property>
-                   <property name="singleStep">
-                    <number>10</number>
-                   </property>
-                   <property name="value">
-                    <number>100</number>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="4" column="0">
-                  <widget class="ColorCombo" name="colorPoint4">
-                   <property name="sizePolicy">
-                    <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-                     <horstretch>0</horstretch>
-                     <verstretch>0</verstretch>
-                    </sizepolicy>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="4" column="1">
-                  <widget class="QSpinBox" name="color4Shade">
-                   <property name="suffix">
-                    <string> %</string>
-                   </property>
-                   <property name="minimum">
-                    <number>0</number>
-                   </property>
-                   <property name="maximum">
-                    <number>100</number>
-                   </property>
-                   <property name="singleStep">
-                    <number>10</number>
-                   </property>
-                   <property name="value">
-                    <number>100</number>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="4" column="2">
-                  <widget class="QSpinBox" name="color4Alpha">
-                   <property name="suffix">
-                    <string> %</string>
-                   </property>
-                   <property name="maximum">
-                    <number>100</number>
-                   </property>
-                   <property name="singleStep">
-                    <number>10</number>
-                   </property>
-                   <property name="value">
-                    <number>100</number>
-                   </property>
-                  </widget>
-                 </item>
-                </layout>
-               </item>
-               <item>
-                <spacer name="verticalSpacer">
-                 <property name="orientation">
-                  <enum>Qt::Vertical</enum>
-                 </property>
-                 <property name="sizeHint" stdset="0">
-                  <size>
-                   <width>20</width>
-                   <height>70</height>
-                  </size>
-                 </property>
-                </spacer>
-               </item>
-              </layout>
-             </widget>
-             <widget class="QWidget" name="page_5">
-              <layout class="QVBoxLayout" name="verticalLayout_9">
-               <item>
-                <layout class="QGridLayout" name="gridLayout_5">
-                 <item row="0" column="0">
-                  <widget class="QLabel" name="label_3">
-                   <property name="text">
-                    <string>Color:</string>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="0" column="1">
-                  <widget class="ColorCombo" name="colorMeshPoint">
-                   <property name="enabled">
-                    <bool>false</bool>
-                   </property>
-                   <property name="sizePolicy">
-                    <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
-                     <horstretch>0</horstretch>
-                     <verstretch>0</verstretch>
-                    </sizepolicy>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="1" column="0">
-                  <widget class="QLabel" name="label_4">
-                   <property name="text">
-                    <string>Shade:</string>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="1" column="1">
-                  <widget class="QSpinBox" name="shadeMeshPoint">
-                   <property name="enabled">
-                    <bool>false</bool>
-                   </property>
-                   <property name="suffix">
-                    <string> %</string>
-                   </property>
-                   <property name="minimum">
-                    <number>0</number>
-                   </property>
-                   <property name="maximum">
-                    <number>100</number>
-                   </property>
-                   <property name="singleStep">
-                    <number>10</number>
-                   </property>
-                   <property name="value">
-                    <number>100</number>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="2" column="0">
-                  <widget class="QLabel" name="label_6">
-                   <property name="text">
-                    <string>Transparency:</string>
-                   </property>
-                  </widget>
-                 </item>
-                 <item row="2" column="1">
-                  <widget class="QSpinBox" name="transparencyMeshPoint">
-                   <property name="enabled">
-                    <bool>false</bool>
-                   </property>
-                   <property name="suffix">
-                    <string> %</string>
-                   </property>
-                   <property name="maximum">
-                    <number>100</number>
-                   </property>
-                   <property name="singleStep">
-                    <number>10</number>
-                   </property>
-                   <property name="value">
-                    <number>100</number>
-                   </property>
-                  </widget>
-                 </item>
-                </layout>
-               </item>
-               <item>
-                <layout class="QHBoxLayout" name="horizontalLayout_8">
-                 <item>
-                  <widget class="QToolButton" name="editMeshColors">
-                   <property name="text">
-                    <string>Edit Colors</string>
-                   </property>
-                   <property name="checkable">
-                    <bool>true</bool>
-                   </property>
-                  </widget>
-                 </item>
-                 <item>
-                  <spacer name="horizontalSpacer_2">
-                   <property name="orientation">
-                    <enum>Qt::Horizontal</enum>
-                   </property>
-                   <property name="sizeHint" stdset="0">
-                    <size>
-                     <width>40</width>
-                     <height>20</height>
-                    </size>
-                   </property>
-                  </spacer>
-                 </item>
-                </layout>
-               </item>
-               <item>
-                <spacer name="verticalSpacer_2">
-                 <property name="orientation">
-                  <enum>Qt::Vertical</enum>
-                 </property>
-                 <property name="sizeHint" stdset="0">
-                  <size>
-                   <width>20</width>
-                   <height>101</height>
-                  </size>
-                 </property>
-                </spacer>
-               </item>
-              </layout>
-             </widget>
-            </widget>
-           </item>
-          </layout>
-         </widget>
-         <widget class="QWidget" name="patternFillPage">
-          <layout class="QVBoxLayout" name="verticalLayout_6">
-           <property name="spacing">
-            <number>2</number>
-           </property>
-           <property name="margin">
-            <number>0</number>
-           </property>
-           <item>
-            <widget class="QListWidget" name="patternBox">
-             <property name="movement">
-              <enum>QListView::Snap</enum>
-             </property>
-             <property name="flow">
-              <enum>QListView::LeftToRight</enum>
-             </property>
-             <property name="isWrapping" stdset="0">
-              <bool>true</bool>
-             </property>
-             <property name="resizeMode">
-              <enum>QListView::Adjust</enum>
-             </property>
-             <property name="viewMode">
-              <enum>QListView::IconMode</enum>
-             </property>
-             <property name="wordWrap">
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_5">
-             <property name="spacing">
-              <number>5</number>
-             </property>
-             <item>
-              <widget class="QToolButton" name="editPatternProps">
-               <property name="text">
-                <string>Properties...</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_3">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-            </layout>
-           </item>
-          </layout>
-         </widget>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="tabStroke">
-      <attribute name="title">
-       <string>Stroke</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout_11">
-       <property name="spacing">
-        <number>2</number>
-       </property>
-       <property name="margin">
-        <number>2</number>
-       </property>
-       <item>
-        <layout class="QHBoxLayout" name="horizontalLayout_6">
-         <item>
-          <widget class="QLabel" name="strokeModeLabel">
-           <property name="text">
-            <string>Stroke Mode</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QComboBox" name="strokeModeCombo"/>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <widget class="Line" name="line_2">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QStackedWidget" name="strokeModeStack">
-         <property name="currentIndex">
-          <number>0</number>
-         </property>
-         <widget class="QWidget" name="solidStrokePage">
-          <layout class="QVBoxLayout" name="verticalLayout_7">
-           <property name="spacing">
-            <number>2</number>
-           </property>
-           <property name="margin">
-            <number>0</number>
-           </property>
-           <item>
-            <widget class="ColorListBox" name="colorListStroke"/>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_7">
-             <item>
-              <widget class="QLabel" name="label_7">
-               <property name="text">
-                <string>Shade:</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <widget class="QSpinBox" name="strokeShade">
-               <property name="suffix">
-                <string>%</string>
-               </property>
-               <property name="maximum">
-                <number>100</number>
-               </property>
-               <property name="value">
-                <number>100</number>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-          </layout>
-         </widget>
-         <widget class="QWidget" name="gradientStrokePage">
-          <layout class="QVBoxLayout" name="verticalLayout_10">
-           <property name="spacing">
-            <number>2</number>
-           </property>
-           <property name="margin">
-            <number>0</number>
-           </property>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_9">
-             <item>
-              <widget class="QComboBox" name="gradientTypeStroke">
-               <item>
-                <property name="text">
-                 <string>Linear</string>
-                </property>
-               </item>
-               <item>
-                <property name="text">
-                 <string>Radial</string>
-                </property>
-               </item>
-              </widget>
-             </item>
-             <item>
-              <widget class="QToolButton" name="gradEditButtonStroke">
-               <property name="text">
-                <string>Move Vector</string>
-               </property>
-               <property name="checkable">
-                <bool>true</bool>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-           <item>
-            <widget class="ScComboBox" name="namedGradientStroke"/>
-           </item>
-           <item>
-            <widget class="GradientEditor" name="gradEditStroke">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="frameShape">
-              <enum>QFrame::NoFrame</enum>
-             </property>
-             <property name="frameShadow">
-              <enum>QFrame::Raised</enum>
-             </property>
-            </widget>
-           </item>
-          </layout>
-         </widget>
-         <widget class="QWidget" name="patternStrokePage">
-          <layout class="QVBoxLayout" name="verticalLayout_14">
-           <property name="spacing">
-            <number>2</number>
-           </property>
-           <property name="margin">
-            <number>0</number>
-           </property>
-           <item>
-            <widget class="QListWidget" name="patternBoxStroke">
-             <property name="movement">
-              <enum>QListView::Snap</enum>
-             </property>
-             <property name="flow">
-              <enum>QListView::LeftToRight</enum>
-             </property>
-             <property name="isWrapping" stdset="0">
-              <bool>true</bool>
-             </property>
-             <property name="resizeMode">
-              <enum>QListView::Adjust</enum>
-             </property>
-             <property name="viewMode">
-              <enum>QListView::IconMode</enum>
-             </property>
-             <property name="wordWrap">
-              <bool>true</bool>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <layout class="QHBoxLayout" name="horizontalLayout_11">
-             <property name="spacing">
-              <number>5</number>
-             </property>
-             <item>
-              <widget class="QToolButton" name="editPatternPropsStroke">
-               <property name="text">
-                <string>Properties...</string>
-               </property>
-              </widget>
-             </item>
-             <item>
-              <spacer name="horizontalSpacer_5">
-               <property name="orientation">
-                <enum>Qt::Horizontal</enum>
-               </property>
-               <property name="sizeHint" stdset="0">
-                <size>
-                 <width>40</width>
-                 <height>20</height>
-                </size>
-               </property>
-              </spacer>
-             </item>
-             <item>
-              <widget class="QCheckBox" name="followsPath">
-               <property name="layoutDirection">
-                <enum>Qt::RightToLeft</enum>
-               </property>
-               <property name="text">
-                <string>Pattern follows Path</string>
-               </property>
-              </widget>
-             </item>
-            </layout>
-           </item>
-          </layout>
-         </widget>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-    </widget>
-   </item>
-   <item>
-    <layout class="QHBoxLayout" name="horizontalLayout">
-     <item>
-      <widget class="QLabel" name="overprintLabel">
-       <property name="text">
-        <string>Overprinting</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QComboBox" name="overPrintCombo">
-       <item>
-        <property name="text">
-         <string>Knockout</string>
-        </property>
-       </item>
-       <item>
-        <property name="text">
-         <string>Overprint</string>
-        </property>
-       </item>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <widget class="QCheckBox" name="displayAllColors">
-     <property name="layoutDirection">
-      <enum>Qt::RightToLeft</enum>
-     </property>
-     <property name="text">
-      <string>Display only used colors</string>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <customwidgets>
-  <customwidget>
-   <class>ScComboBox</class>
-   <extends>QComboBox</extends>
-   <header>ui/sccombobox.h</header>
-  </customwidget>
-  <customwidget>
-   <class>GradientEditor</class>
-   <extends>QFrame</extends>
-   <header>ui/gradienteditor.h</header>
-   <container>1</container>
-  </customwidget>
-  <customwidget>
-   <class>ColorListBox</class>
-   <extends>QListWidget</extends>
-   <header>ui/colorlistbox.h</header>
-  </customwidget>
-  <customwidget>
-   <class>ColorCombo</class>
-   <extends>QComboBox</extends>
-   <header>ui/colorcombo.h</header>
-  </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>colorPalette</class>
+ <widget class="QWidget" name="colorPalette">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>258</width>
+    <height>360</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <property name="margin">
+    <number>5</number>
+   </property>
+   <item>
+    <widget class="QTabWidget" name="tabFillStroke">
+     <property name="currentIndex">
+      <number>0</number>
+     </property>
+     <widget class="QWidget" name="tabFill">
+      <attribute name="title">
+       <string>Fill</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_2">
+       <property name="spacing">
+        <number>2</number>
+       </property>
+       <property name="margin">
+        <number>2</number>
+       </property>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_2">
+         <item>
+          <widget class="QLabel" name="fillModeLabel">
+           <property name="text">
+            <string>Fill Mode</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QComboBox" name="fillModeCombo"/>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <widget class="Line" name="line">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QStackedWidget" name="fillModeStack">
+         <property name="currentIndex">
+          <number>0</number>
+         </property>
+         <widget class="QWidget" name="solidFillPage">
+          <layout class="QVBoxLayout" name="verticalLayout_3">
+           <property name="spacing">
+            <number>2</number>
+           </property>
+           <property name="margin">
+            <number>0</number>
+           </property>
+           <item>
+            <widget class="ColorListBox" name="colorListFill"/>
+           </item>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_3">
+             <item>
+              <widget class="QLabel" name="label">
+               <property name="text">
+                <string>Shade:</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QSpinBox" name="fillShade">
+               <property name="suffix">
+                <string>%</string>
+               </property>
+               <property name="maximum">
+                <number>100</number>
+               </property>
+               <property name="value">
+                <number>100</number>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </widget>
+         <widget class="QWidget" name="gradientFillPage">
+          <layout class="QVBoxLayout" name="verticalLayout_5">
+           <property name="spacing">
+            <number>2</number>
+           </property>
+           <property name="margin">
+            <number>0</number>
+           </property>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_4">
+             <item>
+              <widget class="QComboBox" name="gradientType">
+               <item>
+                <property name="text">
+                 <string>Linear</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string>Radial</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string>4 Colors</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string>Diamond</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string>Mesh</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string>Patch Mesh</string>
+                </property>
+               </item>
+              </widget>
+             </item>
+             <item>
+              <widget class="QToolButton" name="gradEditButton">
+               <property name="text">
+                <string>Move Vector</string>
+               </property>
+               <property name="checkable">
+                <bool>true</bool>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+           <item>
+            <widget class="QStackedWidget" name="stackedWidget_2">
+             <property name="currentIndex">
+              <number>0</number>
+             </property>
+             <widget class="QWidget" name="page_3">
+              <layout class="QVBoxLayout" name="verticalLayout_4">
+               <property name="margin">
+                <number>0</number>
+               </property>
+               <item>
+                <widget class="ScComboBox" name="namedGradient"/>
+               </item>
+               <item>
+                <widget class="GradientEditor" name="gradEdit">
+                 <property name="frameShape">
+                  <enum>QFrame::NoFrame</enum>
+                 </property>
+                 <property name="frameShadow">
+                  <enum>QFrame::Raised</enum>
+                 </property>
+                </widget>
+               </item>
+              </layout>
+             </widget>
+             <widget class="QWidget" name="page_4">
+              <layout class="QVBoxLayout" name="verticalLayout_8">
+               <property name="margin">
+                <number>0</number>
+               </property>
+               <item>
+                <layout class="QGridLayout" name="gridLayout_4">
+                 <item row="0" column="0">
+                  <widget class="QLabel" name="label_5">
+                   <property name="text">
+                    <string>Color</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="0" column="1">
+                  <widget class="QLabel" name="label_2">
+                   <property name="text">
+                    <string>Shade</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="0" column="2">
+                  <widget class="QLabel" name="label_9">
+                   <property name="text">
+                    <string>Transparency</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="1" column="0">
+                  <widget class="ColorCombo" name="colorPoint1">
+                   <property name="sizePolicy">
+                    <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+                     <horstretch>0</horstretch>
+                     <verstretch>0</verstretch>
+                    </sizepolicy>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="1" column="1">
+                  <widget class="QSpinBox" name="color1Shade">
+                   <property name="suffix">
+                    <string> %</string>
+                   </property>
+                   <property name="minimum">
+                    <number>0</number>
+                   </property>
+                   <property name="maximum">
+                    <number>100</number>
+                   </property>
+                   <property name="singleStep">
+                    <number>10</number>
+                   </property>
+                   <property name="value">
+                    <number>100</number>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="1" column="2">
+                  <widget class="QSpinBox" name="color1Alpha">
+                   <property name="suffix">
+                    <string> %</string>
+                   </property>
+                   <property name="maximum">
+                    <number>100</number>
+                   </property>
+                   <property name="singleStep">
+                    <number>10</number>
+                   </property>
+                   <property name="value">
+                    <number>100</number>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="2" column="0">
+                  <widget class="ColorCombo" name="colorPoint2">
+                   <property name="sizePolicy">
+                    <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+                     <horstretch>0</horstretch>
+                     <verstretch>0</verstretch>
+                    </sizepolicy>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="2" column="1">
+                  <widget class="QSpinBox" name="color2Shade">
+                   <property name="suffix">
+                    <string> %</string>
+                   </property>
+                   <property name="minimum">
+                    <number>0</number>
+                   </property>
+                   <property name="maximum">
+                    <number>100</number>
+                   </property>
+                   <property name="singleStep">
+                    <number>10</number>
+                   </property>
+                   <property name="value">
+                    <number>100</number>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="2" column="2">
+                  <widget class="QSpinBox" name="color2Alpha">
+                   <property name="suffix">
+                    <string> %</string>
+                   </property>
+                   <property name="maximum">
+                    <number>100</number>
+                   </property>
+                   <property name="singleStep">
+                    <number>10</number>
+                   </property>
+                   <property name="value">
+                    <number>100</number>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="3" column="0">
+                  <widget class="ColorCombo" name="colorPoint3">
+                   <property name="sizePolicy">
+                    <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+                     <horstretch>0</horstretch>
+                     <verstretch>0</verstretch>
+                    </sizepolicy>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="3" column="1">
+                  <widget class="QSpinBox" name="color3Shade">
+                   <property name="suffix">
+                    <string> %</string>
+                   </property>
+                   <property name="minimum">
+                    <number>0</number>
+                   </property>
+                   <property name="maximum">
+                    <number>100</number>
+                   </property>
+                   <property name="singleStep">
+                    <number>10</number>
+                   </property>
+                   <property name="value">
+                    <number>100</number>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="3" column="2">
+                  <widget class="QSpinBox" name="color3Alpha">
+                   <property name="suffix">
+                    <string> %</string>
+                   </property>
+                   <property name="maximum">
+                    <number>100</number>
+                   </property>
+                   <property name="singleStep">
+                    <number>10</number>
+                   </property>
+                   <property name="value">
+                    <number>100</number>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="4" column="0">
+                  <widget class="ColorCombo" name="colorPoint4">
+                   <property name="sizePolicy">
+                    <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+                     <horstretch>0</horstretch>
+                     <verstretch>0</verstretch>
+                    </sizepolicy>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="4" column="1">
+                  <widget class="QSpinBox" name="color4Shade">
+                   <property name="suffix">
+                    <string> %</string>
+                   </property>
+                   <property name="minimum">
+                    <number>0</number>
+                   </property>
+                   <property name="maximum">
+                    <number>100</number>
+                   </property>
+                   <property name="singleStep">
+                    <number>10</number>
+                   </property>
+                   <property name="value">
+                    <number>100</number>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="4" column="2">
+                  <widget class="QSpinBox" name="color4Alpha">
+                   <property name="suffix">
+                    <string> %</string>
+                   </property>
+                   <property name="maximum">
+                    <number>100</number>
+                   </property>
+                   <property name="singleStep">
+                    <number>10</number>
+                   </property>
+                   <property name="value">
+                    <number>100</number>
+                   </property>
+                  </widget>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <spacer name="verticalSpacer">
+                 <property name="orientation">
+                  <enum>Qt::Vertical</enum>
+                 </property>
+                 <property name="sizeHint" stdset="0">
+                  <size>
+                   <width>20</width>
+                   <height>70</height>
+                  </size>
+                 </property>
+                </spacer>
+               </item>
+              </layout>
+             </widget>
+             <widget class="QWidget" name="page_5">
+              <layout class="QVBoxLayout" name="verticalLayout_9">
+               <item>
+                <layout class="QGridLayout" name="gridLayout_5">
+                 <item row="0" column="0">
+                  <widget class="QLabel" name="label_3">
+                   <property name="text">
+                    <string>Color:</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="0" column="1">
+                  <widget class="ColorCombo" name="colorMeshPoint">
+                   <property name="enabled">
+                    <bool>false</bool>
+                   </property>
+                   <property name="sizePolicy">
+                    <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+                     <horstretch>0</horstretch>
+                     <verstretch>0</verstretch>
+                    </sizepolicy>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="1" column="0">
+                  <widget class="QLabel" name="label_4">
+                   <property name="text">
+                    <string>Shade:</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="1" column="1">
+                  <widget class="QSpinBox" name="shadeMeshPoint">
+                   <property name="enabled">
+                    <bool>false</bool>
+                   </property>
+                   <property name="suffix">
+                    <string> %</string>
+                   </property>
+                   <property name="minimum">
+                    <number>0</number>
+                   </property>
+                   <property name="maximum">
+                    <number>100</number>
+                   </property>
+                   <property name="singleStep">
+                    <number>10</number>
+                   </property>
+                   <property name="value">
+                    <number>100</number>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="2" column="0">
+                  <widget class="QLabel" name="label_6">
+                   <property name="text">
+                    <string>Transparency:</string>
+                   </property>
+                  </widget>
+                 </item>
+                 <item row="2" column="1">
+                  <widget class="QSpinBox" name="transparencyMeshPoint">
+                   <property name="enabled">
+                    <bool>false</bool>
+                   </property>
+                   <property name="suffix">
+                    <string> %</string>
+                   </property>
+                   <property name="maximum">
+                    <number>100</number>
+                   </property>
+                   <property name="singleStep">
+                    <number>10</number>
+                   </property>
+                   <property name="value">
+                    <number>100</number>
+                   </property>
+                  </widget>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <layout class="QHBoxLayout" name="horizontalLayout_8">
+                 <item>
+                  <widget class="QToolButton" name="editMeshColors">
+                   <property name="text">
+                    <string>Edit Colors</string>
+                   </property>
+                   <property name="checkable">
+                    <bool>true</bool>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <spacer name="horizontalSpacer_2">
+                   <property name="orientation">
+                    <enum>Qt::Horizontal</enum>
+                   </property>
+                   <property name="sizeHint" stdset="0">
+                    <size>
+                     <width>40</width>
+                     <height>20</height>
+                    </size>
+                   </property>
+                  </spacer>
+                 </item>
+                </layout>
+               </item>
+               <item>
+                <spacer name="verticalSpacer_2">
+                 <property name="orientation">
+                  <enum>Qt::Vertical</enum>
+                 </property>
+                 <property name="sizeHint" stdset="0">
+                  <size>
+                   <width>20</width>
+                   <height>101</height>
+                  </size>
+                 </property>
+                </spacer>
+               </item>
+              </layout>
+             </widget>
+            </widget>
+           </item>
+          </layout>
+         </widget>
+         <widget class="QWidget" name="patternFillPage">
+          <layout class="QVBoxLayout" name="verticalLayout_6">
+           <property name="spacing">
+            <number>2</number>
+           </property>
+           <property name="margin">
+            <number>0</number>
+           </property>
+           <item>
+            <widget class="QListWidget" name="patternBox">
+             <property name="movement">
+              <enum>QListView::Snap</enum>
+             </property>
+             <property name="flow">
+              <enum>QListView::LeftToRight</enum>
+             </property>
+             <property name="isWrapping" stdset="0">
+              <bool>true</bool>
+             </property>
+             <property name="resizeMode">
+              <enum>QListView::Adjust</enum>
+             </property>
+             <property name="viewMode">
+              <enum>QListView::IconMode</enum>
+             </property>
+             <property name="wordWrap">
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_5">
+             <property name="spacing">
+              <number>5</number>
+             </property>
+             <item>
+              <widget class="QToolButton" name="editPatternProps">
+               <property name="text">
+                <string>Properties...</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <spacer name="horizontalSpacer_3">
+               <property name="orientation">
+                <enum>Qt::Horizontal</enum>
+               </property>
+               <property name="sizeHint" stdset="0">
+                <size>
+                 <width>40</width>
+                 <height>20</height>
+                </size>
+               </property>
+              </spacer>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </widget>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tabStroke">
+      <attribute name="title">
+       <string>Stroke</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_11">
+       <property name="spacing">
+        <number>2</number>
+       </property>
+       <property name="margin">
+        <number>2</number>
+       </property>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_6">
+         <item>
+          <widget class="QLabel" name="strokeModeLabel">
+           <property name="text">
+            <string>Stroke Mode</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QComboBox" name="strokeModeCombo"/>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <widget class="Line" name="line_2">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QStackedWidget" name="strokeModeStack">
+         <property name="currentIndex">
+          <number>0</number>
+         </property>
+         <widget class="QWidget" name="solidStrokePage">
+          <layout class="QVBoxLayout" name="verticalLayout_7">
+           <property name="spacing">
+            <number>2</number>
+           </property>
+           <property name="margin">
+            <number>0</number>
+           </property>
+           <item>
+            <widget class="ColorListBox" name="colorListStroke"/>
+           </item>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_7">
+             <item>
+              <widget class="QLabel" name="label_7">
+               <property name="text">
+                <string>Shade:</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <widget class="QSpinBox" name="strokeShade">
+               <property name="suffix">
+                <string>%</string>
+               </property>
+               <property name="maximum">
+                <number>100</number>
+               </property>
+               <property name="value">
+                <number>100</number>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </widget>
+         <widget class="QWidget" name="gradientStrokePage">
+          <layout class="QVBoxLayout" name="verticalLayout_10">
+           <property name="spacing">
+            <number>2</number>
+           </property>
+           <property name="margin">
+            <number>0</number>
+           </property>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_9">
+             <item>
+              <widget class="QComboBox" name="gradientTypeStroke">
+               <item>
+                <property name="text">
+                 <string>Linear</string>
+                </property>
+               </item>
+               <item>
+                <property name="text">
+                 <string>Radial</string>
+                </property>
+               </item>
+              </widget>
+             </item>
+             <item>
+              <widget class="QToolButton" name="gradEditButtonStroke">
+               <property name="text">
+                <string>Move Vector</string>
+               </property>
+               <property name="checkable">
+                <bool>true</bool>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+           <item>
+            <widget class="ScComboBox" name="namedGradientStroke"/>
+           </item>
+           <item>
+            <widget class="GradientEditor" name="gradEditStroke">
+             <property name="sizePolicy">
+              <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
+               <horstretch>0</horstretch>
+               <verstretch>0</verstretch>
+              </sizepolicy>
+             </property>
+             <property name="frameShape">
+              <enum>QFrame::NoFrame</enum>
+             </property>
+             <property name="frameShadow">
+              <enum>QFrame::Raised</enum>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </widget>
+         <widget class="QWidget" name="patternStrokePage">
+          <layout class="QVBoxLayout" name="verticalLayout_14">
+           <property name="spacing">
+            <number>2</number>
+           </property>
+           <property name="margin">
+            <number>0</number>
+           </property>
+           <item>
+            <widget class="QListWidget" name="patternBoxStroke">
+             <property name="movement">
+              <enum>QListView::Snap</enum>
+             </property>
+             <property name="flow">
+              <enum>QListView::LeftToRight</enum>
+             </property>
+             <property name="isWrapping" stdset="0">
+              <bool>true</bool>
+             </property>
+             <property name="resizeMode">
+              <enum>QListView::Adjust</enum>
+             </property>
+             <property name="viewMode">
+              <enum>QListView::IconMode</enum>
+             </property>
+             <property name="wordWrap">
+              <bool>true</bool>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <layout class="QHBoxLayout" name="horizontalLayout_11">
+             <property name="spacing">
+              <number>5</number>
+             </property>
+             <item>
+              <widget class="QToolButton" name="editPatternPropsStroke">
+               <property name="text">
+                <string>Properties...</string>
+               </property>
+              </widget>
+             </item>
+             <item>
+              <spacer name="horizontalSpacer_5">
+               <property name="orientation">
+                <enum>Qt::Horizontal</enum>
+               </property>
+               <property name="sizeHint" stdset="0">
+                <size>
+                 <width>40</width>
+                 <height>20</height>
+                </size>
+               </property>
+              </spacer>
+             </item>
+             <item>
+              <widget class="QCheckBox" name="followsPath">
+               <property name="layoutDirection">
+                <enum>Qt::RightToLeft</enum>
+               </property>
+               <property name="text">
+                <string>Pattern follows Path</string>
+               </property>
+              </widget>
+             </item>
+            </layout>
+           </item>
+          </layout>
+         </widget>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+   <item>
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <widget class="QLabel" name="overprintLabel">
+       <property name="text">
+        <string>Overprinting</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QComboBox" name="overPrintCombo">
+       <item>
+        <property name="text">
+         <string>Knockout</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string>Overprint</string>
+        </property>
+       </item>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item>
+    <widget class="QCheckBox" name="displayAllColors">
+     <property name="layoutDirection">
+      <enum>Qt::RightToLeft</enum>
+     </property>
+     <property name="text">
+      <string>Display only used colors</string>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <customwidgets>
+  <customwidget>
+   <class>ScComboBox</class>
+   <extends>QComboBox</extends>
+   <header>ui/sccombobox.h</header>
+  </customwidget>
+  <customwidget>
+   <class>GradientEditor</class>
+   <extends>QFrame</extends>
+   <header>ui/gradienteditor.h</header>
+   <container>1</container>
+  </customwidget>
+  <customwidget>
+   <class>ColorListBox</class>
+   <extends>QListWidget</extends>
+   <header>ui/colorlistbox.h</header>
+  </customwidget>
+  <customwidget>
+   <class>ColorCombo</class>
+   <extends>QComboBox</extends>
+   <header>ui/colorcombo.h</header>
+  </customwidget>
+ </customwidgets>
+ <resources/>
+ <connections/>
+</ui>

Modified: trunk/Scribus/scribus/ui/cpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/cpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/cpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/cpalette.cpp Fri Jul 29 09:02:47 2011
@@ -51,11 +51,12 @@
 #include "gradienteditor.h"
 #include "insertTable.h"
 #include "units.h"
-#include "page.h"
+#include "scpage.h"
 #include "pageitem.h"
 #include "util_icon.h"
 #include "commonstrings.h"
 #include "sccolorengine.h"
+#include "sclistwidgetdelegate.h"
 #include "scpainter.h"
 #include "scpattern.h"
 #include "scribus.h"
@@ -78,6 +79,14 @@
 	strokeModeCombo->addItem( tr("Solid") );
 	strokeModeCombo->addItem( tr("Gradient") );
 
+/*  Setting a delegate to dispaly only icons for the patterns */
+/*	ScListWidgetDelegate* delegateF = new ScListWidgetDelegate(patternBox, patternBox);
+	delegateF->setIconOnly(true);
+	patternBox->setItemDelegate(delegateF);
+	ScListWidgetDelegate* delegateS = new ScListWidgetDelegate(patternBoxStroke, patternBoxStroke);
+	delegateS->setIconOnly(true);
+	patternBoxStroke->setItemDelegate(delegateS);
+*/
 	gradEdit->layout()->setAlignment(Qt::AlignTop);
 	gradEditStroke->layout()->setAlignment(Qt::AlignTop);
 	gradientTypeStroke->setCurrentIndex(0);
@@ -860,7 +869,7 @@
 	}
 	if (number == 0)
 		fillModeCombo->setCurrentIndex(0);
-	else if (((number > 0) && (number < 8)) || (number == 9) || (number == 10) || (number == 11))
+	else if (((number > 0) && (number < 8)) || (number == 9) || (number == 10) || (number == 11) || (number == 12))
 	{
 		if ((number == 5) || (number == 7))
 		{
@@ -913,6 +922,11 @@
 			}
 			gradientType->setCurrentIndex(4);
 		}
+		else if (number == 12)
+		{
+			stackedWidget_2->setCurrentIndex(2);
+			gradientType->setCurrentIndex(5);
+		}
 		else
 		{
 			stackedWidget_2->setCurrentIndex(0);
@@ -1009,6 +1023,11 @@
 			}
 			emit NewGradient(11);
 		}
+		else if (gradientType->currentIndex() == 5)
+		{
+			stackedWidget_2->setCurrentIndex(2);
+			emit NewGradient(12);
+		}
 		connect(namedGradient, SIGNAL(activated(const QString &)), this, SLOT(setNamedGradient(const QString &)));
 		connect(gradientType, SIGNAL(activated(int)), this, SLOT(slotGradType(int)));
 		connect(gradEdit, SIGNAL(gradientChanged()) , this, SLOT(handleFillGradient()));
@@ -1077,6 +1096,11 @@
 			transparencyMeshPoint->setValue(mp.transparency * 100);
 		}
 		emit NewGradient(11);
+	}
+	else if (type == 5)
+	{
+		stackedWidget_2->setCurrentIndex(2);
+		emit NewGradient(12);
 	}
 }
 

Modified: trunk/Scribus/scribus/ui/dcolor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/dcolor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/dcolor.cpp (original)
+++ trunk/Scribus/scribus/ui/dcolor.cpp Fri Jul 29 09:02:47 2011
@@ -15,7 +15,7 @@
 
 #include "commonstrings.h"
 #include "scribusdoc.h"
-#include "page.h"
+#include "scpage.h"
 #include "colorcombo.h"
 #include "prefsmanager.h"
 

Modified: trunk/Scribus/scribus/ui/effectsdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/effectsdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/effectsdialog.cpp (original)
+++ trunk/Scribus/scribus/ui/effectsdialog.cpp Fri Jul 29 09:02:47 2011
@@ -27,7 +27,7 @@
 #include "cmsettings.h"
 #include "colorcombo.h"
 #include "curvewidget.h"
-#include "page.h"
+#include "scpage.h"
 #include "sccombobox.h"
 #include "scclocale.h"
 #include "scribusdoc.h"

Modified: trunk/Scribus/scribus/ui/fontcombo.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/fontcombo.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/fontcombo.cpp (original)
+++ trunk/Scribus/scribus/ui/fontcombo.cpp Fri Jul 29 09:02:47 2011
@@ -33,7 +33,7 @@
 
 #include "scribusdoc.h"
 #include "fontcombo.h"
-#include "page.h"
+#include "scpage.h"
 #include "prefsmanager.h"
 #include "util_icon.h"
 #include "util.h"

Modified: trunk/Scribus/scribus/ui/guidemanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/guidemanager.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/guidemanager.cpp (original)
+++ trunk/Scribus/scribus/ui/guidemanager.cpp Fri Jul 29 09:02:47 2011
@@ -24,7 +24,7 @@
 
 #include "guidemanager.h"
 #include "commonstrings.h"
-#include "page.h"
+#include "scpage.h"
 #include "scinputdialog.h"
 #include "scribuscore.h"
 #include "scribusdoc.h"
@@ -188,7 +188,7 @@
 // 	drawGuides(); let Canvas::DrawPageMarks take care of it and avoid a costly ScribusView::DrawNew()
 }
 
-void GuideManager::storePageValues(Page *page)
+void GuideManager::storePageValues(ScPage *page)
 {
 	if (!page || !m_Doc)
 		return;
@@ -355,8 +355,8 @@
 
 void GuideManager::copyGuidesToAllPages(GuideManagerCore::GuideType t)
 {
-	QListIterator<Page*> it(*m_Doc->Pages);
-	Page *tmpPage;
+	QListIterator<ScPage*> it(*m_Doc->Pages);
+	ScPage *tmpPage;
 	while (it.hasNext())
 	{
 		tmpPage=it.next();
@@ -567,7 +567,7 @@
 	QDialog::windowActivationChange( oldActive );
 }
 
-Guides GuideManager::getAutoVerticals(Page * page)
+Guides GuideManager::getAutoVerticals(ScPage * page)
 {
 	GuideManagerCore guides;
 
@@ -588,7 +588,7 @@
 	return guides.getAutoVerticals(page);
 }
 
-Guides GuideManager::getAutoHorizontals(Page * page)
+Guides GuideManager::getAutoHorizontals(ScPage * page)
 {
 	GuideManagerCore guides;
 

Modified: trunk/Scribus/scribus/ui/guidemanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/guidemanager.h
==============================================================================
--- trunk/Scribus/scribus/ui/guidemanager.h (original)
+++ trunk/Scribus/scribus/ui/guidemanager.h Fri Jul 29 09:02:47 2011
@@ -13,7 +13,7 @@
 #include "guidemanagercore.h"
 #include "ui/scrpalettebase.h"
 #include "scribusstructs.h"
-#include "page.h"
+#include "scpage.h"
 
 class GuidesModel;
 class ScribusDoc;
@@ -76,7 +76,7 @@
 
 	ScribusDoc* m_Doc;
 	//! \brief a reference to the current pages
-	Page * currentPage;
+	ScPage * currentPage;
 	//! \brief A flag to prevent guides drawing when it's not needed
 	bool m_drawGuides;
 
@@ -97,7 +97,7 @@
 	/*! \brief Save needed (Auto) values into GuideManagerCore.
 	To be restored on the page return.
 	\param page A reference to the page to store values. */
-	void storePageValues(Page * page);
+	void storePageValues(ScPage * page);
 
 	/*! \brief Overriden QDialog method to operate selection related widgets.
 	Auto guides tab. It disables the "selection" radio buttons when there
@@ -108,13 +108,13 @@
 	Calculates positions of the guides.
 	\param p a Page for what should be calculation performed
 	*/
-	Guides getAutoHorizontals(Page * p);
+	Guides getAutoHorizontals(ScPage * p);
 
 	/*! \brief Create automatic vertical guides.
 	Calculates positions of the guides.
 	\param p a Page for what should be calculation performed
 	*/
-	Guides getAutoVerticals(Page * p);
+	Guides getAutoVerticals(ScPage * p);
 
 	/*! \brief Recalculate the selection position and measurements for the current page.
 	It's used for automatic guides position. It's called for every

Modified: trunk/Scribus/scribus/ui/hruler.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/hruler.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/hruler.cpp (original)
+++ trunk/Scribus/scribus/ui/hruler.cpp Fri Jul 29 09:02:47 2011
@@ -35,7 +35,7 @@
 
 #include "canvasgesture_rulermove.h"
 #include "hruler.h"
-#include "page.h"
+#include "scpage.h"
 #include "prefsmanager.h"
 #include "scribus.h"
 #include "scribusdoc.h"

Modified: trunk/Scribus/scribus/ui/inspage.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/inspage.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/inspage.cpp (original)
+++ trunk/Scribus/scribus/ui/inspage.cpp Fri Jul 29 09:02:47 2011
@@ -14,7 +14,7 @@
 #include <QCheckBox>
 #include <QPushButton>
 #include "scribusdoc.h"
-#include "page.h"
+#include "scpage.h"
 #include "units.h"
 #include "scrspinbox.h"
 #include "pagesize.h"

Modified: trunk/Scribus/scribus/ui/javadocs.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/javadocs.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/javadocs.cpp (original)
+++ trunk/Scribus/scribus/ui/javadocs.cpp Fri Jul 29 09:02:47 2011
@@ -16,7 +16,7 @@
 #include "editor.h"
 #include "ui/scmessagebox.h"
 #include "scribusdoc.h"
-#include "page.h"
+#include "scpage.h"
 #include "commonstrings.h"
 #include "query.h"
 #include "util_icon.h"

Modified: trunk/Scribus/scribus/ui/margindialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/margindialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/margindialog.cpp (original)
+++ trunk/Scribus/scribus/ui/margindialog.cpp Fri Jul 29 09:02:47 2011
@@ -17,7 +17,7 @@
 #include "margindialog.h"
 #include "marginwidget.h"
 #include "pagestructs.h"
-#include "page.h"
+#include "scpage.h"
 #include "scribusdoc.h"
 #include "units.h"
 #include "scrspinbox.h"

Modified: trunk/Scribus/scribus/ui/masterpagepalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/masterpagepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/masterpagepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/masterpagepalette.cpp Fri Jul 29 09:02:47 2011
@@ -23,7 +23,7 @@
 #include "commonstrings.h"
 #include "mergedoc.h"
 #include "newtemp.h"
-#include "page.h"
+#include "scpage.h"
 #include "pagestructs.h"
 #include "selection.h"
 #include "prefsmanager.h"
@@ -208,8 +208,8 @@
 		PrefsManager* prefsManager = PrefsManager::instance();
 		int inde = currentDoc->MasterNames[sMuster];
 		int nr = currentDoc->Pages->count();
-		Page* from = currentDoc->Pages->at(inde);
-		Page* destination = currentDoc->addMasterPage(nr, MasterPageName);
+		ScPage* from = currentDoc->Pages->at(inde);
+		ScPage* destination = currentDoc->addMasterPage(nr, MasterPageName);
 		if (currentDoc->pagePositioning() != singlePage)
 		{
 			int lp = dia->Links->currentIndex();

Modified: trunk/Scribus/scribus/ui/missing.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/missing.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/missing.cpp (original)
+++ trunk/Scribus/scribus/ui/missing.cpp Fri Jul 29 09:02:47 2011
@@ -15,7 +15,7 @@
 
 #include "fontcombo.h"
 #include "scribusdoc.h"
-#include "page.h"
+#include "scpage.h"
 #include "prefsmanager.h"
 #include "commonstrings.h"
 #include "util_icon.h"

Modified: trunk/Scribus/scribus/ui/multiprogressdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/multiprogressdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/multiprogressdialog.cpp (original)
+++ trunk/Scribus/scribus/ui/multiprogressdialog.cpp Fri Jul 29 09:02:47 2011
@@ -107,6 +107,17 @@
 	return false;
 }
 
+bool MultiProgressDialog::setBusyIndicator(const QString &barName)
+{
+	if (progressBars.contains(barName))
+	{
+		progressBars[barName]->setMaximum(0);
+		progressBars[barName]->setMinimum(0);
+		return true;
+	}
+	return false;
+}
+
 bool MultiProgressDialog::setTotalSteps(const QString &barName, int totalSteps)
 {
 	if (progressBars.contains(barName))

Modified: trunk/Scribus/scribus/ui/multiprogressdialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/multiprogressdialog.h
==============================================================================
--- trunk/Scribus/scribus/ui/multiprogressdialog.h (original)
+++ trunk/Scribus/scribus/ui/multiprogressdialog.h Fri Jul 29 09:02:47 2011
@@ -94,6 +94,12 @@
 		 */
 		bool setLabel(const QString &barName, const QString & newLabel);
 		/**
+		 * Sets a user defined progress bar to a busy bar
+		 * @param barName
+		 * @return Success
+		 */
+		bool setBusyIndicator(const QString &barName);
+		/**
 		 * Set the total steps for a user defined progress bar
 		 * @param barName 
 		 * @param totalSteps 

Modified: trunk/Scribus/scribus/ui/newtemp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/newtemp.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/newtemp.cpp (original)
+++ trunk/Scribus/scribus/ui/newtemp.cpp Fri Jul 29 09:02:47 2011
@@ -15,7 +15,7 @@
 #include <QLabel>
 #include <QPushButton>
 
-#include "page.h"
+#include "scpage.h"
 #include "pagestructs.h"
 #include "scribusdoc.h"
 #include "commonstrings.h"

Modified: trunk/Scribus/scribus/ui/nodeeditpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/nodeeditpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/nodeeditpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/nodeeditpalette.cpp Fri Jul 29 09:02:47 2011
@@ -8,7 +8,7 @@
 #include <QEvent>
 
 #include "nodeeditpalette.h"
-#include "page.h"
+#include "scpage.h"
 #include "pageitem.h"
 #include "scribusview.h"
 #include "selection.h"
@@ -530,7 +530,7 @@
 		PageItem *currItem = doc->m_Selection->itemAt(0);
 		if (UndoManager::undoEnabled())
 		{
-			ItemState<FPointArray> *is = new ItemState<FPointArray>(Um::ResetContourLine, "",Um::IBorder);
+			ScItemState<FPointArray> *is = new ScItemState<FPointArray>(Um::ResetContourLine, "",Um::IBorder);
 			is->set("RESET_CONTOUR", "reset_contour");
 			is->setItem(doc->m_Selection->itemAt(0)->ContourLine);
 			UndoManager::instance()->action(currItem, is);

Modified: trunk/Scribus/scribus/ui/outlinepalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/outlinepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/outlinepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/outlinepalette.cpp Fri Jul 29 09:02:47 2011
@@ -25,7 +25,7 @@
 #include "commonstrings.h"
 #include "contextmenu.h"
 #include "outlinepalette.h"
-#include "page.h"
+#include "scpage.h"
 #include "propertiespalette.h"
 #include "scribus.h"
 #include "selection.h"

Modified: trunk/Scribus/scribus/ui/outlinepalette.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/outlinepalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/outlinepalette.h (original)
+++ trunk/Scribus/scribus/ui/outlinepalette.h Fri Jul 29 09:02:47 2011
@@ -22,7 +22,7 @@
 class ScribusMainWindow;
 class ScribusDoc;
 class PageItem;
-class Page;
+class ScPage;
 
 class SCRIBUS_API OutlineTreeItem : public QTreeWidgetItem
 {
@@ -31,7 +31,7 @@
 	OutlineTreeItem(QTreeWidget* parent, OutlineTreeItem* after);
 	~OutlineTreeItem() {};
 	PageItem *PageItemObject;
-	Page *PageObject;
+	ScPage *PageObject;
 	int type;
 };
 

Modified: trunk/Scribus/scribus/ui/pagepalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/pagepalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pagepalette.cpp (original)
+++ trunk/Scribus/scribus/ui/pagepalette.cpp Fri Jul 29 09:02:47 2011
@@ -20,7 +20,7 @@
 #include <QPainter>
 
 #include "commonstrings.h"
-#include "page.h"
+#include "scpage.h"
 #include "pagelayout.h"
 #include "pagepalette.h"
 #include "sccombobox.h"

Modified: trunk/Scribus/scribus/ui/prefs_tableofcontents.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/prefs_tableofcontents.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_tableofcontents.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_tableofcontents.cpp Fri Jul 29 09:02:47 2011
@@ -8,7 +8,7 @@
 #include "ui/prefs_tableofcontents.h"
 #include "pagestructs.h"
 #include "prefsstructs.h"
-#include "page.h"
+#include "scpage.h"
 #include "scribusdoc.h"
 #include "commonstrings.h"
 #include "util.h"

Modified: trunk/Scribus/scribus/ui/preview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/preview.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/preview.cpp (original)
+++ trunk/Scribus/scribus/ui/preview.cpp Fri Jul 29 09:02:47 2011
@@ -1283,7 +1283,7 @@
 			}
 		}
 	}
-	const Page* page = doc->Pages->at(Seite);
+	const ScPage* page = doc->Pages->at(Seite);
 	if ((page->orientation() == 1) && (image.width() < image.height()))
 		image = image.transformed( QMatrix(0, 1, -1, 0, 0, 0) );
 	if (AliasTr->isChecked())

Modified: trunk/Scribus/scribus/ui/propertiespalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/propertiespalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette.cpp (original)
+++ trunk/Scribus/scribus/ui/propertiespalette.cpp Fri Jul 29 09:02:47 2011
@@ -491,7 +491,7 @@
 	int currentTab = TabStack->currentIndex();
 	disconnect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
 
-	qDebug() << "PropertiesPalette::handleSelectionChanged()";
+//	qDebug() << "PropertiesPalette::handleSelectionChanged()";
 
 	/*xyzPal->handleSelectionChanged();
 	shapePal->handleSelectionChanged();

Modified: trunk/Scribus/scribus/ui/propertiespalette.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/propertiespalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette.h (original)
+++ trunk/Scribus/scribus/ui/propertiespalette.h Fri Jul 29 09:02:47 2011
@@ -22,7 +22,7 @@
 #include "scguardedptr.h"
 #include "scrspinbox.h"
 #include "pageitem.h"
-#include "page.h"
+#include "scpage.h"
 #include "linkbutton.h"
 #include "linecombo.h"
 #include "spalette.h"

Modified: trunk/Scribus/scribus/ui/propertiespalette_utils.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/propertiespalette_utils.h
==============================================================================
--- trunk/Scribus/scribus/ui/propertiespalette_utils.h (original)
+++ trunk/Scribus/scribus/ui/propertiespalette_utils.h Fri Jul 29 09:02:47 2011
@@ -33,7 +33,7 @@
 #include "scribusapi.h"
 #include "scrspinbox.h"
 #include "pageitem.h"
-#include "page.h"
+#include "scpage.h"
 #include "linkbutton.h"
 #include "linecombo.h"
 #include "sclistboxpixmap.h"

Modified: trunk/Scribus/scribus/ui/search.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/search.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/search.cpp (original)
+++ trunk/Scribus/scribus/ui/search.cpp Fri Jul 29 09:02:47 2011
@@ -24,7 +24,7 @@
 #include "colorcombo.h"
 #include "fontcombo.h"
 #include "scrspinbox.h"
-#include "page.h"
+#include "scpage.h"
 #include "prefscontext.h"
 #include "prefsfile.h"
 #include "prefsmanager.h"

Modified: trunk/Scribus/scribus/ui/spalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/spalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/spalette.cpp (original)
+++ trunk/Scribus/scribus/ui/spalette.cpp Fri Jul 29 09:02:47 2011
@@ -26,7 +26,7 @@
 
 #include <QListView>
 
-#include "page.h"
+#include "scpage.h"
 #include "util.h"
 
 ParaStyleComboBox::ParaStyleComboBox(QWidget* parent) : QComboBox(parent)

Modified: trunk/Scribus/scribus/ui/symbolpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/symbolpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/symbolpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/symbolpalette.cpp Fri Jul 29 09:02:47 2011
@@ -40,7 +40,29 @@
 	setResizeMode(QListView::Adjust);
 	setSelectionMode(QAbstractItemView::SingleSelection);
 	setContextMenuPolicy(Qt::CustomContextMenu);
+	delegate = new ScListWidgetDelegate(this, this);
+	setItemDelegate(delegate);
 	setIconSize(QSize(48, 48));
+	connect(this, SIGNAL(customContextMenuRequested (const QPoint &)), this, SLOT(HandleContextMenu(QPoint)));
+}
+
+void SymbolView::HandleContextMenu(QPoint)
+{
+	QMenu *pmenu = new QMenu();
+	QAction* viewAct;
+	viewAct = pmenu->addAction( tr("Display Icons only"));
+	viewAct->setCheckable(true);
+	viewAct->setChecked(delegate->iconOnly());
+	connect(viewAct, SIGNAL(triggered()), this, SLOT(changeDisplay()));
+	pmenu->exec(QCursor::pos());
+	delete pmenu;
+}
+
+void SymbolView::changeDisplay()
+{
+	reset();
+	delegate->setIconOnly(!delegate->iconOnly());
+	repaint();
 }
 
 void SymbolView::dragEnterEvent(QDragEnterEvent *e)
@@ -69,6 +91,41 @@
 	}
 	else
 		e->ignore();
+}
+
+bool SymbolView::viewportEvent(QEvent *event)
+{
+	if (event != NULL)
+	{
+		if (event->type() == QEvent::ToolTip)
+		{
+			QHelpEvent *helpEvent = static_cast<QHelpEvent *>(event);
+			QListWidgetItem* it = itemAt(helpEvent->pos());
+			if (it != NULL)
+			{
+				event->accept();
+				QString tipText = it->text();
+				QToolTip::showText(helpEvent->globalPos(), tipText, this);
+				return true;
+			}
+		}
+		else if (event->type() == QEvent::MouseButtonPress)
+		{
+			QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
+			if (mouseEvent->button() == Qt::RightButton)
+				return true;
+		}
+		else if (event->type() == QEvent::MouseButtonRelease)
+		{
+			QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
+			if (mouseEvent->button() == Qt::RightButton)
+			{
+				emit customContextMenuRequested(mouseEvent->pos());
+				return true;
+			}
+		}
+	}
+	return QListWidget::viewportEvent(event);
 }
 
  void SymbolView::startDrag(Qt::DropActions supportedActions)

Modified: trunk/Scribus/scribus/ui/symbolpalette.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/symbolpalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/symbolpalette.h (original)
+++ trunk/Scribus/scribus/ui/symbolpalette.h Fri Jul 29 09:02:47 2011
@@ -41,6 +41,7 @@
 
 #include "scribusapi.h"
 #include "scdockpalette.h"
+#include "sclistwidgetdelegate.h"
 
 class SCRIBUS_API SymbolView : public QListWidget
 {
@@ -50,11 +51,19 @@
 	SymbolView( QWidget* parent);
 	~SymbolView() {};
 
+public slots:
+	void HandleContextMenu(QPoint);
+	void changeDisplay();
+
 protected:
+	bool viewportEvent(QEvent *event);
 	void dragEnterEvent(QDragEnterEvent *e);
 	void dragMoveEvent(QDragMoveEvent *e);
 	void dropEvent(QDropEvent *e);
 	void startDrag(Qt::DropActions supportedActions);
+
+private:
+	ScListWidgetDelegate* delegate;
 };
 
 class SCRIBUS_API SymbolPalette : public ScDockPalette
@@ -90,4 +99,4 @@
 	QStringList editItemNames;
 };
 
-#endif
+#endif

Modified: trunk/Scribus/scribus/ui/vruler.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/ui/vruler.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/vruler.cpp (original)
+++ trunk/Scribus/scribus/ui/vruler.cpp Fri Jul 29 09:02:47 2011
@@ -34,7 +34,7 @@
 #include <cmath>
 
 #include "canvasgesture_rulermove.h"
-#include "page.h"
+#include "scpage.h"
 #include "prefsmanager.h"
 #include "scribus.h"
 #include "scribusdoc.h"

Modified: trunk/Scribus/scribus/undostate.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/undostate.h
==============================================================================
--- trunk/Scribus/scribus/undostate.h (original)
+++ trunk/Scribus/scribus/undostate.h Fri Jul 29 09:02:47 2011
@@ -283,12 +283,12 @@
 /*** ItemState ***************************************************************************/
 
 template<class C>
-class ItemState : public SimpleState
+class ScItemState : public SimpleState
 {
 public:
-	ItemState(const QString& name, const QString& description = 0, QPixmap* pixmap = 0)
+	ScItemState(const QString& name, const QString& description = 0, QPixmap* pixmap = 0)
 	: SimpleState(name, description, pixmap) {}
-	~ItemState() {}
+	~ScItemState() {}
 	void setItem(const C &c) { item_ = c; }
 	C getItem() const { return item_; }
 private:

Modified: trunk/Scribus/scribus/vgradient.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/vgradient.h
==============================================================================
--- trunk/Scribus/scribus/vgradient.h (original)
+++ trunk/Scribus/scribus/vgradient.h Fri Jul 29 09:02:47 2011
@@ -86,7 +86,8 @@
 	    radial = 1,
 	    fourcolor  = 2,
 	    diamond = 3,
-	    mesh = 4
+		mesh = 4,
+		freemesh = 5
 	};
 
 	enum VGradientRepeatMethod

Modified: trunk/Scribus/scribus/vgradientex.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16729&path=/trunk/Scribus/scribus/vgradientex.h
==============================================================================
--- trunk/Scribus/scribus/vgradientex.h (original)
+++ trunk/Scribus/scribus/vgradientex.h Fri Jul 29 09:02:47 2011
@@ -88,7 +88,8 @@
 	    radial = 1,
 	    fourcolor  = 2,
 	    diamond = 3,
-	    mesh = 4
+		mesh = 4,
+		freemesh = 5
 	};
 
 	enum RepeatMethod




More information about the scribus-commit mailing list