From 9f4b3f27d3c08da51dd824075cbcf3456085cb97 Mon Sep 17 00:00:00 2001 From: Ivan Ilin Date: Wed, 19 Oct 2011 18:33:17 +0300 Subject: [PATCH 01/12] Cff new functional --- src/adaptors/UBCFFSubsetAdaptor.cpp | 104 ++++++++++++++++++++++------ src/adaptors/UBCFFSubsetAdaptor.h | 22 ++++++ src/adaptors/UBImportCFF.cpp | 4 +- 3 files changed, 105 insertions(+), 25 deletions(-) diff --git a/src/adaptors/UBCFFSubsetAdaptor.cpp b/src/adaptors/UBCFFSubsetAdaptor.cpp index a4812096..6d688b34 100644 --- a/src/adaptors/UBCFFSubsetAdaptor.cpp +++ b/src/adaptors/UBCFFSubsetAdaptor.cpp @@ -34,6 +34,8 @@ #include "core/UBApplication.h" #include "QFile" +#include "QDomDocument" + //enum of xmlparse status //tag names definition @@ -75,11 +77,54 @@ static QString aFontstyle = "font-style"; static QString aFontweight = "font-weight"; static QString aTextalign = "text-align"; static QString aPoints = "points"; +static QString svgNS = "http://www.w3.org/2000/svg"; +static QString tId = "id"; + UBCFFSubsetAdaptor::UBCFFSubsetAdaptor() { } +void UBCFFSubsetAdaptor::UBCFFSubsetReader::hashNode(QDomNode *parent, QString prefix) +{ + QDomNode n = parent->firstChild(); + while (!n.isNull()) { + QDomElement e = n.toElement(); + QString id = e.attribute(tId); + if(!id.isNull()) { + extProperties.insert(id, IwbExt(e)); + qDebug() << prefix + e.prefix() + ":" + e.tagName(); + } + if (n.hasChildNodes()) { + hashNode(&n, QString("| %1").arg(prefix)); + } + n = n.nextSibling(); + } +} + +bool UBCFFSubsetAdaptor::UBCFFSubsetReader::hashElements() +{ + QDomElement svgSection = mDOMdoc.elementsByTagNameNS(svgNS, tSvg).at(0).toElement(); + Q_ASSERT(!svgSection.isNull()); + + hashNode(&svgSection); + + qDebug() << "ext properties count " << extProperties.count(); + qDebug() << extProperties.value("link1").element.toElement().tagName(); + + + // QDomNode n = docElem.firstChild(); +// int i = 0; +// while(!n.isNull()) { +// QDomElement e = n.toElement(); // try to convert the node to an element. +// if(!e.isNull()) { +// qDebug() << e.prefix() << ":" << e.tagName() ; // the node really is an element. +// i++; +// } +// n = n.nextSibling(); +// } + return false; +} bool UBCFFSubsetAdaptor::ConvertCFFFileToUbz(QString &cffSourceFile, UBDocumentProxy* pDocument) { @@ -116,6 +161,14 @@ bool UBCFFSubsetAdaptor::ConvertCFFFileToUbz(QString &cffSourceFile, UBDocumentP UBCFFSubsetAdaptor::UBCFFSubsetReader::UBCFFSubsetReader(UBDocumentProxy *proxy, QByteArray &content): mReader(content), mProxy(proxy), currentState(NONE) { + int errorLine, errorColumn; + QString errorStr; + if(!mDOMdoc.setContent(content, true, &errorStr, &errorLine, &errorColumn)){ + qWarning() << "Error:Parseerroratline" << errorLine << "," + << "column" << errorColumn << ":" << errorStr; + } else { + qDebug() << "well parsed to DOM"; + } // QFile tfile("/home/ilia/Documents/tmp/2/out.xml"); // tfile.open(QIODevice::ReadWr ite | QIODevice::Text); // QTextStream out(&tfile); @@ -131,6 +184,9 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parse() if (!getTempFileName()) return false; + if (mDOMdoc.isNull()) + return false; + bool result = parseDoc(); if (result) result = mProxy->pageCount() != 0; @@ -160,29 +216,31 @@ void UBCFFSubsetAdaptor::UBCFFSubsetReader::PushState(int state) bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseDoc() { - while (!mReader.atEnd()) - { - mReader.readNext(); - if (mReader.isStartElement()) - { - if (!parseCurrentElementStart()) - return false; - } - else - if (mReader.isCharacters()) - { - if (!parseCurrentElementCharacters()) - return false; - } - else - if (mReader.isEndElement()) - { - if (!parseCurrentElementEnd()) - return false; - } - } - if (!mReader.error() == QXmlStreamReader::NoError) - UBApplication::showMessage(mReader.errorString()); +// while (!mReader.atEnd()) +// { +// mReader.readNext(); +// if (mReader.isStartElement()) +// { +// if (!parseCurrentElementStart()) +// return false; +// } +// else +// if (mReader.isCharacters()) +// { +// if (!parseCurrentElementCharacters()) +// return false; +// } +// else +// if (mReader.isEndElement()) +// { +// if (!parseCurrentElementEnd()) +// return false; +// } +// } +// if (!mReader.error() == QXmlStreamReader::NoError) +// UBApplication::showMessage(mReader.errorString()); + if (!hashElements()) return false; + return true; } diff --git a/src/adaptors/UBCFFSubsetAdaptor.h b/src/adaptors/UBCFFSubsetAdaptor.h index 2c78f1e4..7515b2c4 100644 --- a/src/adaptors/UBCFFSubsetAdaptor.h +++ b/src/adaptors/UBCFFSubsetAdaptor.h @@ -19,6 +19,8 @@ #include #include #include +#include +#include class UBDocumentProxy; class UBGraphicsScene; @@ -26,6 +28,15 @@ class QSvgGenerator; class UBGraphicsSvgItem; class QTransform; +struct IwbExt { + IwbExt() : group(NULL) {;} + IwbExt(QDomNode element) : group(NULL), element(element) {;} + + QDomNode *group; + QDomNode element; + QHash textAttributes; +}; + class UBCFFSubsetAdaptor { public: @@ -65,6 +76,15 @@ private: QPointF mViewBoxCenter; QSize mSize; + private: + QDomDocument mDOMdoc; + QHash extProperties; + bool hashElements(); + + void hashNode(QDomNode *parent, QString prefix = ""); + + + //methods to store current xml parse state int PopState(); void PushState(int state); @@ -92,7 +112,9 @@ private: bool createNewScene(); bool persistCurrentScene(); + QStack stateStack; + int currentState; //helper methods diff --git a/src/adaptors/UBImportCFF.cpp b/src/adaptors/UBImportCFF.cpp index 4ad47896..f6554415 100644 --- a/src/adaptors/UBImportCFF.cpp +++ b/src/adaptors/UBImportCFF.cpp @@ -47,8 +47,8 @@ UBImportCFF::~UBImportCFF() QStringList UBImportCFF::supportedExtentions() { -// return QStringList("iwb"); - return QStringList(); + return QStringList("iwb"); +// return QStringList(); } From 6174a7833fc5211397473c6165bac92a63f0acad Mon Sep 17 00:00:00 2001 From: Ivan Ilin Date: Thu, 20 Oct 2011 17:59:56 +0300 Subject: [PATCH 02/12] A new step to implement cff support --- src/adaptors/UBCFFSubsetAdaptor.cpp | 74 +++++++++++++++++++++++++---- src/adaptors/UBCFFSubsetAdaptor.h | 13 +++-- src/board/UBBoardPaletteManager.cpp | 21 ++++---- 3 files changed, 84 insertions(+), 24 deletions(-) diff --git a/src/adaptors/UBCFFSubsetAdaptor.cpp b/src/adaptors/UBCFFSubsetAdaptor.cpp index 6d688b34..b19d6529 100644 --- a/src/adaptors/UBCFFSubsetAdaptor.cpp +++ b/src/adaptors/UBCFFSubsetAdaptor.cpp @@ -41,6 +41,7 @@ //tag names definition //use them everiwhere! static QString tElement = "element"; +static QString tGroup = "group"; static QString tEllipse = "ellipse"; static QString tIwb = "iwb"; static QString tMeta = "meta"; @@ -78,25 +79,72 @@ static QString aFontweight = "font-weight"; static QString aTextalign = "text-align"; static QString aPoints = "points"; static QString svgNS = "http://www.w3.org/2000/svg"; -static QString tId = "id"; - +static QString iwbNS = "http://www.becta.org.uk/iwb"; +static QString aId = "id"; UBCFFSubsetAdaptor::UBCFFSubsetAdaptor() { } -void UBCFFSubsetAdaptor::UBCFFSubsetReader::hashNode(QDomNode *parent, QString prefix) + +void UBCFFSubsetAdaptor::UBCFFSubsetReader::hashSiblingIwbElements(QDomElement *parent, QDomElement *topGroup) { + + QDomElement curExt = parent->firstChildElement(tElement); + while (!curExt.isNull()) { + QDomElement n = curExt; + if (curExt.namespaceURI() != iwbNS) + continue; + QHash::iterator iSvgElement = extProperties.find(curExt.attribute("ref")); + if (iSvgElement != extProperties.end()) { + IwbExt &svgElement = *iSvgElement; + svgElement.extAttr.push_back(curExt); + if (topGroup) + qDebug() << "made"; + } + curExt = curExt.nextSiblingElement(tElement); + } +} + +void UBCFFSubsetAdaptor::UBCFFSubsetReader::addExtentionsToHash(QDomElement *parent) +{ + + //add top level elements + QDomElement curGroup = parent->firstChildElement(tGroup); + QDomElement topGroup; + while (!curGroup.isNull()) { + if (curGroup.namespaceURI() != iwbNS) + continue; + +// if (parent == mDOMdoc.documentElement()) +// topGroup = curGroup; +// QHash::iterator iSvgElement = extProperties.find(curExt.attribute("ref")); +// if (iSvgElement != extProperties.end()) { +// IwbExt &svgElement = *iSvgElement; +// svgElement.group = curGroup; +// qDebug() << "made"; +// } + hashSiblingIwbElements(&curGroup, &topGroup); + if (curGroup.hasChildNodes()) { + addExtentionsToHash(&curGroup); + } + + curGroup = curGroup.nextSiblingElement(tGroup); + } + //add groups +} + +void UBCFFSubsetAdaptor::UBCFFSubsetReader::hashSvg(QDomNode *parent, QString prefix) { QDomNode n = parent->firstChild(); while (!n.isNull()) { QDomElement e = n.toElement(); - QString id = e.attribute(tId); + QString id = e.attribute(aId); if(!id.isNull()) { extProperties.insert(id, IwbExt(e)); qDebug() << prefix + e.prefix() + ":" + e.tagName(); } if (n.hasChildNodes()) { - hashNode(&n, QString("| %1").arg(prefix)); + hashSvg(&n, QString("| %1").arg(prefix)); } n = n.nextSibling(); } @@ -107,11 +155,21 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::hashElements() QDomElement svgSection = mDOMdoc.elementsByTagNameNS(svgNS, tSvg).at(0).toElement(); Q_ASSERT(!svgSection.isNull()); - hashNode(&svgSection); + hashSvg(&svgSection); + + QDomElement parElement = mDOMdoc.documentElement(); + Q_ASSERT(!parElement.isNull()); - qDebug() << "ext properties count " << extProperties.count(); - qDebug() << extProperties.value("link1").element.toElement().tagName(); + addExtentionsToHash(&parElement); +// qDebug() << "ext properties count " << extProperties.count(); +// qDebug() << extProperties.value("link1").element.toElement().tagName(); + foreach (IwbExt cur, extProperties) { + qDebug() << (cur.extAttr.count() ? cur.extAttr.first().toElement().tagName() : "count < 0") ; + } +// for (int i = 0; i < extProperties.count(); i++) { + +// } // QDomNode n = docElem.firstChild(); // int i = 0; diff --git a/src/adaptors/UBCFFSubsetAdaptor.h b/src/adaptors/UBCFFSubsetAdaptor.h index 7515b2c4..bd4a7e71 100644 --- a/src/adaptors/UBCFFSubsetAdaptor.h +++ b/src/adaptors/UBCFFSubsetAdaptor.h @@ -29,12 +29,14 @@ class UBGraphicsSvgItem; class QTransform; struct IwbExt { - IwbExt() : group(NULL) {;} - IwbExt(QDomNode element) : group(NULL), element(element) {;} + IwbExt() {;} + IwbExt(QDomNode element) : element(element), extAttr(*(new QVector())) {;} - QDomNode *group; + QDomNode group; QDomNode element; + QVector extAttr; QHash textAttributes; + operator bool() const {return group.isNull() || !element.isNull();} }; class UBCFFSubsetAdaptor @@ -80,9 +82,10 @@ private: QDomDocument mDOMdoc; QHash extProperties; bool hashElements(); + void addExtentionsToHash(QDomElement *parent); - void hashNode(QDomNode *parent, QString prefix = ""); - + void hashSvg(QDomNode *parent, QString prefix = ""); + void hashSiblingIwbElements(QDomElement *parent, QDomElement *topGroup = 0); //methods to store current xml parse state diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp index 145e4035..fc743c99 100755 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -162,20 +162,21 @@ void UBBoardPaletteManager::setupDockPaletteWidgets() mpPageNavigWidget = new UBPageNavigationWidget(); mpPageNavigWidget->registerMode(eUBDockPaletteWidget_BOARD); - connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpPageNavigWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); - + connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpPageNavigWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); + mpLibWidget = new UBLibWidget(); mpLibWidget ->registerMode(eUBDockPaletteWidget_BOARD); mpLibWidget ->registerMode(eUBDockPaletteWidget_DESKTOP); - connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpLibWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); + + connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpLibWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); // mpCachePropWidget = new UBCachePropertiesWidget(); // mpCachePropWidget->registerMode(eUBDockPaletteWidget_BOARD); -// connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpCachePropWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); +// connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpCachePropWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); -// mpTeacherBarWidget = new UBTeacherBarWidget(); -// mpTeacherBarWidget->registerMode(eUBDockPaletteWidget_BOARD); -// connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpTeacherBarWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); + mpTeacherBarWidget = new UBTeacherBarWidget(); + mpTeacherBarWidget->registerMode(eUBDockPaletteWidget_BOARD); + connect(this, SIGNAL(signal_changeMode(eUBDockPaletteWidgetMode)), mpTeacherBarWidget, SLOT(slot_changeMode(eUBDockPaletteWidgetMode))); //------------------------------------------------// // Add the dock palettes @@ -200,8 +201,8 @@ void UBBoardPaletteManager::setupDockPaletteWidgets() // mRightPalette->addTabWidget(mpCachePropWidget); // // ??? -// mRightPalette->registerWidget(mpTeacherBarWidget); -// mRightPalette->addTabWidget(mpTeacherBarWidget); + mRightPalette->registerWidget(mpTeacherBarWidget); + mRightPalette->addTabWidget(mpTeacherBarWidget); mRightPalette->connectSignals(); @@ -443,8 +444,6 @@ void UBBoardPaletteManager::connectPalettes() } - - void UBBoardPaletteManager::containerResized() { int innerMargin = UBSettings::boardMargin; From 696ed59ecfdbe97a829da97d9eb30bd2f4a46dc0 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Wed, 26 Oct 2011 08:57:43 +0200 Subject: [PATCH 03/12] removed a warning --- src/board/UBBoardPaletteManager.cpp | 2 +- src/board/UBLibraryController.cpp | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp index a6461bc5..f0c9bff0 100755 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -64,6 +64,7 @@ UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardControll , mZoomPalette(0) , mLeftPalette(NULL) , mRightPalette(NULL) + , mDesktopRightPalette(NULL) , mBackgroundsPalette(0) , mToolsPalette(0) , mAddItemPalette(0) @@ -77,7 +78,6 @@ UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardControll , mpLibWidget(NULL) , mpCachePropWidget(NULL) , mpTeacherBarWidget(NULL) - , mDesktopRightPalette(NULL) , mpDesktopLibWidget(NULL) { setupPalettes(); diff --git a/src/board/UBLibraryController.cpp b/src/board/UBLibraryController.cpp index 1a4a42a1..3d4d4514 100644 --- a/src/board/UBLibraryController.cpp +++ b/src/board/UBLibraryController.cpp @@ -345,7 +345,6 @@ QList UBLibraryController::listElementsInPath(const QString& pPat UBLibElement *element = new UBLibElement(fileType, QUrl::fromLocalFile(fileInfo->absoluteFilePath()), itemName); if (fileType == eUBLibElementType_Folder) { -// QImage* directoryImage = new QImage(":images/libpalette/folder.svg"); element->setThumbnail(QImage(":images/libpalette/folder.svg")); } else if (fileType == eUBLibElementType_Item) { From 184ffd0e67aef0daf0a408d79815d7b5d77ece45 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Wed, 26 Oct 2011 17:19:23 +0200 Subject: [PATCH 04/12] fixed http://188.165.53.52/jira/browse/SANKORE-358 --- .../Backgrounds/2009_calendar_EU.svg | 6619 ----------------- .../Backgrounds/2009_calendar_US.svg | 5811 --------------- .../userImage/Backgrounds/calendar_2011.svg | 5576 ++++++++++++++ .../userImage/Backgrounds/calendar_2012.svg | 5116 +++++++++++++ .../userImage/Backgrounds/calendrier_2011.svg | 5114 +++++++++++++ .../userImage/Backgrounds/calendrier_2012.svg | 5116 +++++++++++++ 6 files changed, 20922 insertions(+), 12430 deletions(-) delete mode 100644 resources/library/userImage/Backgrounds/2009_calendar_EU.svg delete mode 100644 resources/library/userImage/Backgrounds/2009_calendar_US.svg create mode 100644 resources/library/userImage/Backgrounds/calendar_2011.svg create mode 100644 resources/library/userImage/Backgrounds/calendar_2012.svg create mode 100644 resources/library/userImage/Backgrounds/calendrier_2011.svg create mode 100644 resources/library/userImage/Backgrounds/calendrier_2012.svg diff --git a/resources/library/userImage/Backgrounds/2009_calendar_EU.svg b/resources/library/userImage/Backgrounds/2009_calendar_EU.svg deleted file mode 100644 index 5007696f..00000000 --- a/resources/library/userImage/Backgrounds/2009_calendar_EU.svg +++ /dev/null @@ -1,6619 +0,0 @@ - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/library/userImage/Backgrounds/2009_calendar_US.svg b/resources/library/userImage/Backgrounds/2009_calendar_US.svg deleted file mode 100644 index 697691fb..00000000 --- a/resources/library/userImage/Backgrounds/2009_calendar_US.svg +++ /dev/null @@ -1,5811 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/library/userImage/Backgrounds/calendar_2011.svg b/resources/library/userImage/Backgrounds/calendar_2011.svg new file mode 100644 index 00000000..2452cec7 --- /dev/null +++ b/resources/library/userImage/Backgrounds/calendar_2011.svg @@ -0,0 +1,5576 @@ + + + + + + image/svg+xml + + + + + + + SVG drawing + This was produced by version 4.4 of GNU libplot, a free library for exporting 2-D vector graphics. + + +January 2011 + + +Sun + + +Mon + + +Tue + + +Wed + + +Thu + + +Fri + + +Sat + + +1 + + +2 + + +3 + + +4 + + +5 + + +6 + + +7 + + +8 + + +9 + + +10 + + +11 + + +12 + + +13 + + +14 + + +15 + + +16 + + +17 + + +18 + + +19 + + +20 + + +21 + + +22 + + +23 + + +24 + + +25 + + +26 + + +27 + + +28 + + +29 + + +30 + + +31 + + + + + + + + + + + + + + + + + + + + + + + + + +February 2011 + + +Sun + + +Mon + + +Tue + + +Wed + + +Thu + + +Fri + + +Sat + + +1 + + +2 + + +3 + + +4 + + +5 + + +6 + + +7 + + +8 + + +9 + + +10 + + +11 + + +12 + + +13 + + +14 + + +15 + + +16 + + +17 + + +18 + + +19 + + +20 + + +21 + + +22 + + +23 + + +24 + + +25 + + +26 + + +27 + + +28 + + + + + + + + + + + + + + + + + + + + + + + + + + + + +March 2011 + + +Sun + + +Mon + + +Tue + + +Wed + + +Thu + + +Fri + + +Sat + + +1 + + +2 + + +3 + + +4 + + +5 + + +6 + + +7 + + +8 + + +9 + + +10 + + +11 + + +12 + + +13 + + +14 + + +15 + + +16 + + +17 + + +18 + + +19 + + +20 + + +21 + + +22 + + +23 + + +24 + + +25 + + +26 + + +27 + + +28 + + +29 + + +30 + + +31 + + + + + + + + + + + + + + + + + + + + + + + + + +April 2011 + + +Sun + + +Mon + + +Tue + + +Wed + + +Thu + + +Fri + + +Sat + + +1 + + +2 + + +3 + + +4 + + +5 + + +6 + + +7 + + +8 + + +9 + + +10 + + +11 + + +12 + + +13 + + +14 + + +15 + + +16 + + +17 + + +18 + + +19 + + +20 + + +21 + + +22 + + +23 + + +24 + + +25 + + +26 + + +27 + + +28 + + +29 + + +30 + + + + + + + + + + + + + + + + + + + + + + + + + + +May 2011 + + +Sun + + +Mon + + +Tue + + +Wed + + +Thu + + +Fri + + +Sat + + +1 + + +2 + + +3 + + +4 + + +5 + + +6 + + +7 + + +8 + + +9 + + +10 + + +11 + + +12 + + +13 + + +14 + + +15 + + +16 + + +17 + + +18 + + +19 + + +20 + + +21 + + +22 + + +23 + + +24 + + +25 + + +26 + + +27 + + +28 + + +29 + + +30 + + +31 + + + + + + + + + + + + + + + + + + + + + + + + + +June 2011 + + +Sun + + +Mon + + +Tue + + +Wed + + +Thu + + +Fri + + +Sat + + +1 + + +2 + + +3 + + +4 + + +5 + + +6 + + +7 + + +8 + + +9 + + +10 + + +11 + + +12 + + +13 + + +14 + + +15 + + +16 + + +17 + + +18 + + +19 + + +20 + + +21 + + +22 + + +23 + + +24 + + +25 + + +26 + + +27 + + +28 + + +29 + + +30 + + + + + + + + + + + + + + + + + + + + + + + + + + +July 2011 + + +Sun + + +Mon + + +Tue + + +Wed + + +Thu + + +Fri + + +Sat + + +1 + + +2 + + +3 + + +4 + + +5 + + +6 + + +7 + + +8 + + +9 + + +10 + + +11 + + +12 + + +13 + + +14 + + +15 + + +16 + + +17 + + +18 + + +19 + + +20 + + +21 + + +22 + + +23 + + +24 + + +25 + + +26 + + +27 + + +28 + + +29 + + +30 + + +31 + + + + + + + + + + + + + + + + + + + + + + + + + +August 2011 + + +Sun + + +Mon + + +Tue + + +Wed + + +Thu + + +Fri + + +Sat + + +1 + + +2 + + +3 + + +4 + + +5 + + +6 + + +7 + + +8 + + +9 + + +10 + + +11 + + +12 + + +13 + + +14 + + +15 + + +16 + + +17 + + +18 + + +19 + + +20 + + +21 + + +22 + + +23 + + +24 + + +25 + + +26 + + +27 + + +28 + + +29 + + +30 + + +31 + + + + + + + + + + + + + + + + + + + + + + + + + +September 2011 + + +Sun + + +Mon + + +Tue + + +Wed + + +Thu + + +Fri + + +Sat + + +1 + + +2 + + +3 + + +4 + + +5 + + +6 + + +7 + + +8 + + +9 + + +10 + + +11 + + +12 + + +13 + + +14 + + +15 + + +16 + + +17 + + +18 + + +19 + + +20 + + +21 + + +22 + + +23 + + +24 + + +25 + + +26 + + +27 + + +28 + + +29 + + +30 + + + + + + + + + + + + + + + + + + + + + + + + + + +October 2011 + + +Sun + + +Mon + + +Tue + + +Wed + + +Thu + + +Fri + + +Sat + + +1 + + +2 + + +3 + + +4 + + +5 + + +6 + + +7 + + +8 + + +9 + + +10 + + +11 + + +12 + + +13 + + +14 + + +15 + + +16 + + +17 + + +18 + + +19 + + +20 + + +21 + + +22 + + +23 + + +24 + + +25 + + +26 + + +27 + + +28 + + +29 + + +30 + + +31 + + + + + + + + + + + + + + + + + + + + + + + + + +November 2011 + + +Sun + + +Mon + + +Tue + + +Wed + + +Thu + + +Fri + + +Sat + + +1 + + +2 + + +3 + + +4 + + +5 + + +6 + + +7 + + +8 + + +9 + + +10 + + +11 + + +12 + + +13 + + +14 + + +15 + + +16 + + +17 + + +18 + + +19 + + +20 + + +21 + + +22 + + +23 + + +24 + + +25 + + +26 + + +27 + + +28 + + +29 + + +30 + + + + + + + + + + + + + + + + + + + + + + + + + + +December 2011 + + +Sun + + +Mon + + +Tue + + +Wed + + +Thu + + +Fri + + +Sat + + +1 + + +2 + + +3 + + +4 + + +5 + + +6 + + +7 + + +8 + + +9 + + +10 + + +11 + + +12 + + +13 + + +14 + + +15 + + +16 + + +17 + + +18 + + +19 + + +20 + + +21 + + +22 + + +23 + + +24 + + +25 + + +26 + + +27 + + +28 + + +29 + + +30 + + +31 + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/library/userImage/Backgrounds/calendar_2012.svg b/resources/library/userImage/Backgrounds/calendar_2012.svg new file mode 100644 index 00000000..d8e8a619 --- /dev/null +++ b/resources/library/userImage/Backgrounds/calendar_2012.svg @@ -0,0 +1,5116 @@ + + + + + + image/svg+xml + + + + + + + SVG drawing + This was produced by version 4.4 of GNU libplot, a free library for exporting 2-D vector graphics. + + +January 2012 + +Sun + +Mon + +Tue + +Wed + +Thu + +Fri + +Sat + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + +31 + + + + + + + + + + + + + + + + + + + + + + + + +February 2012 + +Sun + +Mon + +Tue + +Wed + +Thu + +Fri + +Sat + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + + + + + + + + + + + + + + + + + + + + + + + + + + +March 2012 + +Sun + +Mon + +Tue + +Wed + +Thu + +Fri + +Sat + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + +31 + + + + + + + + + + + + + + + + + + + + + + + + +April 2012 + +Sun + +Mon + +Tue + +Wed + +Thu + +Fri + +Sat + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + + + + + + + + + + + + + + + + + + + + + + + + + +May 2012 + +Sun + +Mon + +Tue + +Wed + +Thu + +Fri + +Sat + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + +31 + + + + + + + + + + + + + + + + + + + + + + + + +June 2012 + +Sun + +Mon + +Tue + +Wed + +Thu + +Fri + +Sat + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + + + + + + + + + + + + + + + + + + + + + + + + + +July 2012 + +Sun + +Mon + +Tue + +Wed + +Thu + +Fri + +Sat + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + +31 + + + + + + + + + + + + + + + + + + + + + + + + +August 2012 + +Sun + +Mon + +Tue + +Wed + +Thu + +Fri + +Sat + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + +31 + + + + + + + + + + + + + + + + + + + + + + + + +September 2012 + +Sun + +Mon + +Tue + +Wed + +Thu + +Fri + +Sat + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + + + + + + + + + + + + + + + + + + + + + + + + + +October 2012 + +Sun + +Mon + +Tue + +Wed + +Thu + +Fri + +Sat + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + +31 + + + + + + + + + + + + + + + + + + + + + + + + +November 2012 + +Sun + +Mon + +Tue + +Wed + +Thu + +Fri + +Sat + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + + + + + + + + + + + + + + + + + + + + + + + + + +December 2012 + +Sun + +Mon + +Tue + +Wed + +Thu + +Fri + +Sat + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + +31 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/library/userImage/Backgrounds/calendrier_2011.svg b/resources/library/userImage/Backgrounds/calendrier_2011.svg new file mode 100644 index 00000000..3a95030b --- /dev/null +++ b/resources/library/userImage/Backgrounds/calendrier_2011.svg @@ -0,0 +1,5114 @@ + + + + + + image/svg+xml + + + + + + + SVG drawing + This was produced by version 4.4 of GNU libplot, a free library for exporting 2-D vector graphics. + + +Janvier 2011 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + +31 + + + + + + + + + + + + + + + + + + + + + + + + +Février 2011 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + + + + + + + + + + + + + + + + + + + + + + + + + + + +Mars 2011 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + +31 + + + + + + + + + + + + + + + + + + + + + + + + +Avril 2011 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + + + + + + + + + + + + + + + + + + + + + + + + + +Mai 2011 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + +31 + + + + + + + + + + + + + + + + + + + + + + + + +Juin 2011 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + + + + + + + + + + + + + + + + + + + + + + + + + +Juillet 2011 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + +31 + + + + + + + + + + + + + + + + + + + + + + + + +Août 2011 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + +31 + + + + + + + + + + + + + + + + + + + + + + + + +Septembre 2011 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + + + + + + + + + + + + + + + + + + + + + + + + + +Octobre 2011 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + +31 + + + + + + + + + + + + + + + + + + + + + + + + +Novembre 2011 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + + + + + + + + + + + + + + + + + + + + + + + + + +Décembre 2011 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + +31 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/library/userImage/Backgrounds/calendrier_2012.svg b/resources/library/userImage/Backgrounds/calendrier_2012.svg new file mode 100644 index 00000000..c70360ab --- /dev/null +++ b/resources/library/userImage/Backgrounds/calendrier_2012.svg @@ -0,0 +1,5116 @@ + + + + + + image/svg+xml + + + + + + + SVG drawing + This was produced by version 4.4 of GNU libplot, a free library for exporting 2-D vector graphics. + + +Janvier 2012 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + +31 + + + + + + + + + + + + + + + + + + + + + + + + +Février 2012 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + + + + + + + + + + + + + + + + + + + + + + + + + + +Mars 2012 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + +31 + + + + + + + + + + + + + + + + + + + + + + + + +Avril 2012 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + + + + + + + + + + + + + + + + + + + + + + + + + +Mai 2012 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + +31 + + + + + + + + + + + + + + + + + + + + + + + + +Juin 2012 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + + + + + + + + + + + + + + + + + + + + + + + + + +Juillet 2012 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + +31 + + + + + + + + + + + + + + + + + + + + + + + + +Août 2012 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + +31 + + + + + + + + + + + + + + + + + + + + + + + + +Septembre 2012 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + + + + + + + + + + + + + + + + + + + + + + + + + +Octobre 2012 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + +31 + + + + + + + + + + + + + + + + + + + + + + + + +Novembre 2012 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + + + + + + + + + + + + + + + + + + + + + + + + + +Décembre 2012 + +Dim + +Lun + +Mar + +Mer + +Jeu + +Ven + +Sam + +1 + +2 + +3 + +4 + +5 + +6 + +7 + +8 + +9 + +10 + +11 + +12 + +13 + +14 + +15 + +16 + +17 + +18 + +19 + +20 + +21 + +22 + +23 + +24 + +25 + +26 + +27 + +28 + +29 + +30 + +31 + + + + + + + + + + + + + + + + + + + + + + + + + From 14cb47578b88f1527ffc801bb17f4c5cff40e1a0 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Thu, 27 Oct 2011 14:43:20 +0200 Subject: [PATCH 05/12] fixed audio issue on linux. This is only a ugly workaround --- src/board/UBBoardController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/board/UBBoardController.cpp b/src/board/UBBoardController.cpp index 6efd102d..e5d2d116 100644 --- a/src/board/UBBoardController.cpp +++ b/src/board/UBBoardController.cpp @@ -1693,7 +1693,7 @@ UBGraphicsAudioItem* UBBoardController::addAudio(const QUrl& pSourceUrl, bool st QUuid uuid = QUuid::createUuid(); QUrl concreteUrl = pSourceUrl; - concreteUrl = QUrl(UBPersistenceManager::persistenceManager() + concreteUrl = QUrl::fromLocalFile(mActiveDocument->persistencePath() + "/" + UBPersistenceManager::persistenceManager() ->addAudioFileToDocument(mActiveDocument, pSourceUrl.toLocalFile(), uuid)); UBGraphicsAudioItem* vi = mActiveScene->addAudio(concreteUrl, startPlay, pos); From 7a6776a4a965258d80a039511844f4a4a8a64ac9 Mon Sep 17 00:00:00 2001 From: Anatoly Mihalchenko Date: Thu, 27 Oct 2011 15:57:50 +0300 Subject: [PATCH 06/12] SANKORE-329 last part of issue - refactoring virtual keyboard. source code still require testing and defect correction for Linux and Mac OS --- src/board/UBBoardPaletteManager.cpp | 153 ++++++++++++++---- src/core/UBApplicationController.cpp | 7 +- src/desktop/UBDesktopAnnotationController.cpp | 87 +++++----- src/desktop/UBDesktopAnnotationController.h | 8 +- src/document/UBDocumentController.cpp | 18 ++- src/document/UBDocumentController.h | 6 +- src/gui/UBKeyboardPalette.cpp | 57 ++----- src/gui/UBKeyboardPalette.h | 9 +- src/web/UBWebController.cpp | 31 ++-- src/web/UBWebController.h | 14 +- 10 files changed, 236 insertions(+), 154 deletions(-) diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp index e0152975..3ab4f111 100755 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -220,15 +220,38 @@ void UBBoardPaletteManager::setupDockPaletteWidgets() void UBBoardPaletteManager::slot_changeMainMode(UBApplicationController::MainMode mainMode) { +// Board = 0, Internet, Document, Tutorial, ParaschoolEditor, WebDocument + switch( mainMode ) { - case UBApplicationController::Board: - // call changeMode only when switch NOT from desktop mode - if(!UBApplication::applicationController->isShowingDesktop()) - changeMode(eUBDockPaletteWidget_BOARD); + case UBApplicationController::Board: + { + // call changeMode only when switch NOT from desktop mode + if(!UBApplication::applicationController->isShowingDesktop()) + changeMode(eUBDockPaletteWidget_BOARD); + } + break; + + case UBApplicationController::Tutorial: + { + if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) + mKeyboardPalette->hide(); + } + break; + + case UBApplicationController::Internet: + changeMode(eUBDockPaletteWidget_WEB); + break; + + case UBApplicationController::Document: + changeMode(eUBDockPaletteWidget_DOCUMENT); break; default: + { + if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) + mKeyboardPalette->hide(); + } break; } } @@ -255,25 +278,25 @@ void UBBoardPaletteManager::slot_changeDesktopMode(bool isDesktop) void UBBoardPaletteManager::setupPalettes() { - setupDockPaletteWidgets(); - - - // Add the other palettes - mStylusPalette = new UBStylusPalette(mContainer, UBSettings::settings()->appToolBarOrientationVertical->get().toBool() ? Qt::Vertical : Qt::Horizontal); - connect(mStylusPalette, SIGNAL(stylusToolDoubleClicked(int)), UBApplication::boardController, SLOT(stylusToolDoubleClicked(int))); - mStylusPalette->show(); // always show stylus palette at startup - if (UBPlatformUtils::hasVirtualKeyboard()) { - mKeyboardPalette = UBKeyboardPalette::create(0); + mKeyboardPalette = new UBKeyboardPalette(0); #ifndef Q_WS_WIN connect(mKeyboardPalette, SIGNAL(closed()), mKeyboardPalette, SLOT(onDeactivated())); #endif #ifndef Q_WS_MAC - mKeyboardPalette->setParent(mContainer); + // mKeyboardPalette->setParent(mContainer); #endif } + setupDockPaletteWidgets(); + + + // Add the other palettes + mStylusPalette = new UBStylusPalette(mContainer, UBSettings::settings()->appToolBarOrientationVertical->get().toBool() ? Qt::Vertical : Qt::Horizontal); + connect(mStylusPalette, SIGNAL(stylusToolDoubleClicked(int)), UBApplication::boardController, SLOT(stylusToolDoubleClicked(int))); + mStylusPalette->show(); // always show stylus palette at startup + mZoomPalette = new UBZoomPalette(mContainer); QList backgroundsActions; @@ -483,7 +506,7 @@ void UBBoardPaletteManager::connectPalettes() } - +bool isFirstResized = true; void UBBoardPaletteManager::containerResized() { int innerMargin = UBSettings::boardMargin; @@ -493,25 +516,39 @@ void UBBoardPaletteManager::containerResized() int userTop = innerMargin; int userHeight = mContainer->height() - (2 * innerMargin); - mStylusPalette->move(userLeft, userTop); - mStylusPalette->adjustSizeAndPosition(); - mStylusPalette->initPosition(); + if(mStylusPalette) + { + mStylusPalette->move(userLeft, userTop); + mStylusPalette->adjustSizeAndPosition(); + mStylusPalette->initPosition(); + } - mZoomPalette->move(userLeft + userWidth - mZoomPalette->width() - , userTop + userHeight /*- mPageNumberPalette->height()*/ - innerMargin - mZoomPalette->height()); - mZoomPalette->adjustSizeAndPosition(); + if(mZoomPalette) + { + mZoomPalette->move(userLeft + userWidth - mZoomPalette->width() + , userTop + userHeight /*- mPageNumberPalette->height()*/ - innerMargin - mZoomPalette->height()); + mZoomPalette->adjustSizeAndPosition(); + } - if (mKeyboardPalette) + if (isFirstResized && mKeyboardPalette && mKeyboardPalette->parent() == UBApplication::boardController->controlContainer()) { - mKeyboardPalette->move(userLeft + (userWidth - mKeyboardPalette->width())/2, - userTop + userHeight - mKeyboardPalette->height()); - mKeyboardPalette->adjustSizeAndPosition(); + isFirstResized = false; + mKeyboardPalette->move(userLeft + (userWidth - mKeyboardPalette->width())/2, + userTop + (userHeight - mKeyboardPalette->height())/2); + mKeyboardPalette->adjustSizeAndPosition(); } - mLeftPalette->resize(mLeftPalette->width()-1, mContainer->height()); - mRightPalette->resize(mRightPalette->width()-1, mContainer->height()); - mLeftPalette->resize(mLeftPalette->width(), mContainer->height()); - mRightPalette->resize(mRightPalette->width(), mContainer->height()); + if(mLeftPalette) + { + mLeftPalette->resize(mLeftPalette->width()-1, mContainer->height()); + mLeftPalette->resize(mLeftPalette->width(), mContainer->height()); + } + + if(mRightPalette) + { + mRightPalette->resize(mRightPalette->width()-1, mContainer->height()); + mRightPalette->resize(mRightPalette->width(), mContainer->height()); + } } @@ -683,6 +720,18 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is { mLeftPalette->setParent(UBApplication::boardController->controlContainer()); mRightPalette->setParent(UBApplication::boardController->controlContainer()); + if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) + { + + if(mKeyboardPalette->m_isVisible) + { + mKeyboardPalette->hide(); + mKeyboardPalette->setParent(UBApplication::boardController->controlContainer()); + mKeyboardPalette->show(); + } + else + mKeyboardPalette->setParent(UBApplication::boardController->controlContainer()); + } mLeftPalette->setVisible(true); mRightPalette->setVisible(true); @@ -696,6 +745,18 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is { mLeftPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); mRightPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); + if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) + { + + if(mKeyboardPalette->m_isVisible) + { + mKeyboardPalette->hide(); + mKeyboardPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); + mKeyboardPalette->show(); + } + else + mKeyboardPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); + } mLeftPalette->setVisible(false); mRightPalette->setVisible(true); @@ -705,12 +766,46 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is } break; + case eUBDockPaletteWidget_WEB: + { + if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) + { + WBBrowserWindow* brWnd = UBApplication::webController->GetCurrentWebBrowser(); + + if(mKeyboardPalette->m_isVisible) + { + mKeyboardPalette->hide(); + mKeyboardPalette->setParent(brWnd); + mKeyboardPalette->show(); + } + else + mKeyboardPalette->setParent(brWnd); + } + + } + break; + default: { mLeftPalette->setVisible(false); mRightPalette->setVisible(false); mLeftPalette->setParent(0); mRightPalette->setParent(0); + if (UBPlatformUtils::hasVirtualKeyboard() && mKeyboardPalette != NULL) + { + + if(mKeyboardPalette->m_isVisible) + { + mKeyboardPalette->hide(); + mKeyboardPalette->setParent(0); + mKeyboardPalette->show(); + } + else + mKeyboardPalette->setParent(0); + +// mKeyboardPalette->update(); + + } } break; } diff --git a/src/core/UBApplicationController.cpp b/src/core/UBApplicationController.cpp index b3560186..6000f097 100644 --- a/src/core/UBApplicationController.cpp +++ b/src/core/UBApplicationController.cpp @@ -368,6 +368,8 @@ void UBApplicationController::showInternet() if (UBSettings::settings()->webUseExternalBrowser->get().toBool()) { showDesktop(true); + UBApplication::webController->show(UBWebController::WebBrowser); + // really no have emit mainModeChanged here ? potential problem with virtual keyboard ? } else { @@ -382,10 +384,11 @@ void UBApplicationController::showInternet() mMainWindow->show(); mUninoteController->hideWindow(); + + UBApplication::webController->show(UBWebController::WebBrowser); + emit mainModeChanged(Internet); } - - UBApplication::webController->show(UBWebController::WebBrowser); } diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 5ffd8759..9bf8a694 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -52,7 +52,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) , mTransparentDrawingView(0) , mTransparentDrawingScene(0) , mDesktopPalette(NULL) - , mKeyboardPalette(0) +// , mKeyboardPalette(0) , mDesktopPenPalette(NULL) , mDesktopMarkerPalette(NULL) , mDesktopEraserPalette(NULL) @@ -64,7 +64,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) , mPendingMarkerButtonPressed(false) , mPendingEraserButtonPressed(false) , mbArrowClicked(false) - , mBoardStylusTool(UBStylusTool::Pen) + , mBoardStylusTool(UBStylusTool::Selector /*UBStylusTool::Pen*/) , mDesktopStylusTool(UBStylusTool::Selector) { @@ -101,10 +101,15 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) connect(mTransparentDrawingView, SIGNAL(hidden()), mKeyboardPalette, SLOT(hide())); connect(mTransparentDrawingView, SIGNAL(shown()), this, SLOT(showKeyboard())); #else - mKeyboardPalette = UBKeyboardPalette::create(mTransparentDrawingView); - mKeyboardPalette->setParent(mTransparentDrawingView); +// mKeyboardPalette = UBKeyboardPalette::create(mTransparentDrawingView); +// mKeyboardPalette->setParent(mTransparentDrawingView); #endif - connect(mKeyboardPalette, SIGNAL(keyboardActivated(bool)), mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool))); + connect( UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(keyboardActivated(bool)), + mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool))); + +// connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), +// mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool))); + #ifdef Q_WS_X11 connect(mKeyboardPalette, SIGNAL(moved(QPoint)), this, SLOT(refreshMask())); connect(mDesktopPalette,SIGNAL(refreshMask()), this, SLOT(refreshMask())); @@ -117,7 +122,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) connect(mDesktopPalette, SIGNAL(screenClick()), this, SLOT(screenCapture())); connect(mDesktopPalette, SIGNAL(maximized()), this, SLOT(onDesktopPaletteMaximized())); connect(mDesktopPalette, SIGNAL(minimizeStart(eMinimizedLocation)), this, SLOT(onDesktopPaletteMinimize())); - connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool))); +// connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool))); connect(mTransparentDrawingView, SIGNAL(resized(QResizeEvent*)), this, SLOT(onTransparentWidgetResized())); @@ -164,31 +169,32 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) onDesktopPaletteMaximized(); } -void UBDesktopAnnotationController::showKeyboard(bool show) -{ - #ifdef Q_WS_X11 - if (!mTransparentDrawingView->isVisible()) - return; - #endif - - if(mKeyboardPalette) - { - if(show) - UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector); - mKeyboardPalette->setVisible(show); - - #ifdef Q_WS_X11 - updateMask(true); - #endif - - } - -} -void UBDesktopAnnotationController::showKeyboard() -{ - if (UBApplication::mainWindow->actionVirtualKeyboard->isChecked()) - mKeyboardPalette->show(); -} +// void UBDesktopAnnotationController::showKeyboard(bool show) +// { +// #ifdef Q_WS_X11 +// if (!mTransparentDrawingView->isVisible()) +// return; +// #endif +// +// if(mKeyboardPalette) +// { +// if(show) +// UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector); +// mKeyboardPalette->setVisible(show); +// +// #ifdef Q_WS_X11 +// updateMask(true); +// #endif +// +// } +// +// } + +// void UBDesktopAnnotationController::showKeyboard() +// { +// if (UBApplication::mainWindow->actionVirtualKeyboard->isChecked()) +// mKeyboardPalette->show(); +// } UBDesktopAnnotationController::~UBDesktopAnnotationController() { @@ -366,12 +372,12 @@ void UBDesktopAnnotationController::close() void UBDesktopAnnotationController::stylusToolChanged(int tool) { - UBStylusTool::Enum eTool = (UBStylusTool::Enum)tool; - if(eTool != UBStylusTool::Selector && eTool != UBStylusTool::Text) - { - if(mKeyboardPalette->m_isVisible) - UBApplication::mainWindow->actionVirtualKeyboard->activate(QAction::Trigger); - } +// UBStylusTool::Enum eTool = (UBStylusTool::Enum)tool; +// if(eTool != UBStylusTool::Selector && eTool != UBStylusTool::Text) +// { +// if(mKeyboardPalette->m_isVisible) +// UBApplication::mainWindow->actionVirtualKeyboard->activate(QAction::Trigger); +// } updateBackground(); } @@ -910,9 +916,10 @@ void UBDesktopAnnotationController::updateMask(bool bTransparent) { p.drawRect(mDesktopPalette->geometry().x(), mDesktopPalette->geometry().y(), mDesktopPalette->width(), mDesktopPalette->height()); } - if(mKeyboardPalette->isVisible()) + if(UBApplication::boardController->paletteManager()->mKeyboardPalette->isVisible()) { - p.drawRect(mKeyboardPalette->geometry().x(), mKeyboardPalette->geometry().y(), mKeyboardPalette->width(), mKeyboardPalette->height()); + p.drawRect(UBApplication::boardController->paletteManager()->mKeyboardPalette->geometry().x(), UBApplication::boardController->paletteManager()->mKeyboardPalette->geometry().y(), + UBApplication::boardController->paletteManager()->mKeyboardPalette->width(), UBApplication::boardController->paletteManager()->mKeyboardPalette->height()); } // UBApplication::boardController->paletteManager()->mDesktopRightPalette @@ -978,4 +985,4 @@ void UBDesktopAnnotationController::refreshMask() { updateMask(true); } -} +} \ No newline at end of file diff --git a/src/desktop/UBDesktopAnnotationController.h b/src/desktop/UBDesktopAnnotationController.h index b3a9e37f..924156b0 100644 --- a/src/desktop/UBDesktopAnnotationController.h +++ b/src/desktop/UBDesktopAnnotationController.h @@ -29,7 +29,7 @@ class UBDesktopPenPalette; class UBDesktopMarkerPalette; class UBDesktopEraserPalette; class UBActionPalette; -class UBKeyboardPalette; +//class UBKeyboardPalette; class UBMainWindow; #define PROPERTY_PALETTE_TIMER 1000 @@ -72,8 +72,8 @@ class UBDesktopAnnotationController : public QObject void stylusToolChanged(int tool); void updateBackground(); - void showKeyboard(bool show); - void showKeyboard(); //X11 virtual keyboard working only needed +// void showKeyboard(bool show); +// void showKeyboard(); //X11 virtual keyboard working only needed signals: /** @@ -118,7 +118,7 @@ class UBDesktopAnnotationController : public QObject void updateMask(bool bTransparent); UBDesktopPalette *mDesktopPalette; - UBKeyboardPalette *mKeyboardPalette; + //UBKeyboardPalette *mKeyboardPalette; UBDesktopPenPalette* mDesktopPenPalette; UBDesktopMarkerPalette* mDesktopMarkerPalette; UBDesktopEraserPalette* mDesktopEraserPalette; diff --git a/src/document/UBDocumentController.cpp b/src/document/UBDocumentController.cpp index b2cd201b..dd014988 100644 --- a/src/document/UBDocumentController.cpp +++ b/src/document/UBDocumentController.cpp @@ -38,7 +38,7 @@ #include "board/UBBoardPaletteManager.h" #include "board/UBDrawingController.h" -#include "gui/UBKeyboardPalette.h" +//#include "gui/UBKeyboardPalette.h" #include "gui/UBThumbnailView.h" #include "gui/UBDocumentTreeWidget.h" @@ -70,7 +70,7 @@ UBDocumentController::UBDocumentController(UBMainWindow* mainWindow) , mToolsPalette(0) , mToolsPalettePositionned(false) , mTrashTi(0) - , mKeyboardPalette(0) +// , mKeyboardPalette(0) { setupViews(); setupToolbar(); @@ -444,12 +444,12 @@ void UBDocumentController::setupViews() mMessageWindow = new UBMessageWindow(mDocumentUI->thumbnailWidget); mMessageWindow->hide(); - if (UBPlatformUtils::hasVirtualKeyboard()) - { - mKeyboardPalette = UBKeyboardPalette::create(0); - mKeyboardPalette->setParent(controlView()); - connect(mMainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool))); - } +// if (UBPlatformUtils::hasVirtualKeyboard()) +// { +// mKeyboardPalette = UBKeyboardPalette::create(0); +// mKeyboardPalette->setParent(controlView()); +// connect(mMainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool))); +// } } } @@ -467,6 +467,7 @@ void UBDocumentController::setupToolbar() connect(mMainWindow->actionDocumentTools, SIGNAL(triggered()), this, SLOT(toggleDocumentToolsPalette())); } +/* void UBDocumentController::showKeyboard(bool show) { if(mKeyboardPalette) @@ -477,6 +478,7 @@ void UBDocumentController::showKeyboard(bool show) } } +*/ void UBDocumentController::setupPalettes() { diff --git a/src/document/UBDocumentController.h b/src/document/UBDocumentController.h index 4e9b3d31..4baf8b36 100644 --- a/src/document/UBDocumentController.h +++ b/src/document/UBDocumentController.h @@ -34,7 +34,7 @@ class UBDocumentGroupTreeItem; class UBDocumentProxyTreeItem; class UBMainWindow; class UBDocumentToolsPalette; -class UBKeyboardPalette; +//class UBKeyboardPalette; class UBDocumentController : public QObject { @@ -76,7 +76,7 @@ class UBDocumentController : public QObject void paste(); void focusChanged(QWidget *old, QWidget *current); - void showKeyboard(bool show); +// void showKeyboard(bool show); protected: virtual void setupViews(); @@ -112,7 +112,7 @@ class UBDocumentController : public QObject UBDocumentGroupTreeItem* mTrashTi; UBDocumentProxy* mCurrentDocument; - UBKeyboardPalette *mKeyboardPalette; +// UBKeyboardPalette *mKeyboardPalette; private slots: diff --git a/src/gui/UBKeyboardPalette.cpp b/src/gui/UBKeyboardPalette.cpp index cf4f3b85..9c76cc9b 100644 --- a/src/gui/UBKeyboardPalette.cpp +++ b/src/gui/UBKeyboardPalette.cpp @@ -27,6 +27,9 @@ UBKeyboardPalette::UBKeyboardPalette(QWidget *parent) : UBActionPalette(Qt::TopRightCorner, parent) { + + // setWindowFlags(/*Qt::CustomizeWindowHint|*/Qt::WindowStaysOnTopHint|Qt::FramelessWindowHint); + setCustomCloseProcessing(true); setCustomPosition(true); setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); @@ -56,57 +59,25 @@ UBKeyboardPalette::UBKeyboardPalette(QWidget *parent) setContentsMargins( 22, 22, 22, 22 ); - connect(this, SIGNAL(keyboardActivated(bool)), this, SLOT(onActivated(bool))); + init(); } -QList UBKeyboardPalette::instances; -UBKeyboardPalette* UBKeyboardPalette::create(QWidget *parent) +//QList UBKeyboardPalette::instances; +void UBKeyboardPalette::init() { - //------------------------------// - - if (!UBPlatformUtils::hasVirtualKeyboard()) - return NULL; - - //------------------------------// - - UBKeyboardPalette* firstKeyboard = NULL; - // if we already have keyboards inside, get it position and show/hide status, for new keyboard - if(instances.size() > 0) - firstKeyboard = instances.at(0); - - //------------------------------// + m_isVisible = false; + setVisible(false); - UBKeyboardPalette* instance = new UBKeyboardPalette(parent); - instance->setKeyButtonSize(UBSettings::settings()->boardKeyboardPaletteKeyBtnSize->get().toString()); + setKeyButtonSize(UBSettings::settings()->boardKeyboardPaletteKeyBtnSize->get().toString()); - instance->m_isVisible = firstKeyboard ? firstKeyboard->m_isVisible : false; - instance->setVisible(instance->m_isVisible); - - if( firstKeyboard ) - instance->move(firstKeyboard->m_pos); - - connect(UBSettings::settings()->boardKeyboardPaletteKeyBtnSize, SIGNAL(changed(QVariant)), instance, SLOT(keyboardPaletteButtonSizeChanged(QVariant))); - connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), instance, SLOT(showKeyboard(bool))); -// connect(instance, SIGNAL(moved(const QPoint&)), instance, SLOT(syncPosition(const QPoint&))); - connect(instance, SIGNAL(closed()), instance, SLOT(hideKeyboard())); - - //------------------------------// - - instances.append(instance); - foreach(UBKeyboardPalette* inst, instances) - { - connect(inst, SIGNAL(moved(const QPoint&)), instance, SLOT(syncPosition(const QPoint&))); - connect(instance, SIGNAL(moved(const QPoint&)), inst, SLOT(syncPosition(const QPoint&))); - - connect(inst, SIGNAL(localeChanged(int)), instance, SLOT(syncLocale(int))); - connect(instance, SIGNAL(localeChanged(int)), inst, SLOT(syncLocale(int))); - -// connect(instance, SIGNAL(closed()), inst, ) - } + connect(this, SIGNAL(keyboardActivated(bool)), this, SLOT(onActivated(bool))); + connect(UBSettings::settings()->boardKeyboardPaletteKeyBtnSize, SIGNAL(changed(QVariant)), this, SLOT(keyboardPaletteButtonSizeChanged(QVariant))); + connect(UBApplication::mainWindow->actionVirtualKeyboard, SIGNAL(triggered(bool)), this, SLOT(showKeyboard(bool))); + connect(this, SIGNAL(closed()), this, SLOT(hideKeyboard())); //------------------------------// - return instance; + UBPlatformUtils::setWindowNonActivableFlag(this, true); } void UBKeyboardPalette::showKeyboard(bool show) diff --git a/src/gui/UBKeyboardPalette.h b/src/gui/UBKeyboardPalette.h index 68a0a7e9..c7077fe2 100644 --- a/src/gui/UBKeyboardPalette.h +++ b/src/gui/UBKeyboardPalette.h @@ -67,6 +67,7 @@ friend class UBCapsLockButton; friend class UBLocaleButton; public: + UBKeyboardPalette(QWidget *parent); ~UBKeyboardPalette(); BTNImages *currBtnImages; @@ -77,8 +78,6 @@ public: QString getKeyButtonSize() const {QString res; res.sprintf("%dx%d", btnWidth, btnHeight); return res;} void setKeyButtonSize(const QString& strSize); - static UBKeyboardPalette* create(QWidget *parent); - static QList instances; bool m_isVisible; QPoint m_pos; @@ -119,10 +118,10 @@ protected: void setLocale(int nLocale); const QString* getLocaleName(); - -private: - UBKeyboardPalette(QWidget *parent); + void init(); + +private: QRect originalRect; diff --git a/src/web/UBWebController.cpp b/src/web/UBWebController.cpp index 6ae2361b..463354ef 100644 --- a/src/web/UBWebController.cpp +++ b/src/web/UBWebController.cpp @@ -32,7 +32,7 @@ #include "gui/UBScreenMirror.h" #include "gui/UBMainWindow.h" #include "gui/UBWebToolsPalette.h" -#include "gui/UBKeyboardPalette.h" +//#include "gui/UBKeyboardPalette.h" #include "core/UBSettings.h" #include "core/UBSetting.h" @@ -55,7 +55,7 @@ UBWebController::UBWebController(UBMainWindow* mainWindow) , mBrowserWidget(0) , mTrapFlashController(0) , mToolsCurrentPalette(0) - , mKeyboardCurrentPalette(0) +// , mKeyboardCurrentPalette(0) , mToolsPalettePositionned(false) , mDownloadViewIsVisible(false) @@ -113,7 +113,7 @@ void UBWebController::webBrowserInstance() { mCurrentWebBrowser = &mWebBrowserList[WebBrowser]; mToolsCurrentPalette = &mToolsPaletteList[WebBrowser]; - mKeyboardCurrentPalette = &mKeyboardPaletteList[WebBrowser]; +// mKeyboardCurrentPalette = &mKeyboardPaletteList[WebBrowser]; mToolsPalettePositionned = mToolsPalettePositionnedList[WebBrowser]; if (!(*mCurrentWebBrowser)) { @@ -191,7 +191,7 @@ void UBWebController::tutorialWebInstance() { mCurrentWebBrowser = &mWebBrowserList[Tutorial]; mToolsCurrentPalette = &mToolsPaletteList[Tutorial]; - mKeyboardCurrentPalette = &mKeyboardPaletteList[Tutorial]; +// mKeyboardCurrentPalette = &mKeyboardPaletteList[Tutorial]; mToolsPalettePositionned = &mToolsPalettePositionnedList[Tutorial]; if (!(*mCurrentWebBrowser)) { @@ -249,7 +249,7 @@ void UBWebController::paraschoolWebInstance() else { mCurrentWebBrowser = &mWebBrowserList[Paraschool]; mToolsCurrentPalette = &mToolsPaletteList[Paraschool]; - mKeyboardCurrentPalette = &mKeyboardPaletteList[Paraschool]; +// mKeyboardCurrentPalette = &mKeyboardPaletteList[Paraschool]; mToolsPalettePositionned = &mToolsPalettePositionnedList[Paraschool]; if (!(*mCurrentWebBrowser)){ (*mCurrentWebBrowser) = new WBBrowserWindow(mMainWindow->centralWidget(), mMainWindow, true); @@ -391,7 +391,7 @@ void UBWebController::setupPalettes() { (*mToolsCurrentPalette) = new UBWebToolsPalette((*mCurrentWebBrowser),false); - (*mKeyboardCurrentPalette) = UBKeyboardPalette::create(*mCurrentWebBrowser); +// (*mKeyboardCurrentPalette) = UBKeyboardPalette::create(*mCurrentWebBrowser); #ifndef Q_WS_WIN if (*mKeyboardCurrentPalette) connect(*mKeyboardCurrentPalette, SIGNAL(closed()), *mKeyboardCurrentPalette, SLOT(onDeactivated())); @@ -411,7 +411,7 @@ void UBWebController::setupPalettes() (*mToolsCurrentPalette)->hide(); (*mToolsCurrentPalette)->adjustSizeAndPosition(); - (*mKeyboardCurrentPalette)->adjustSizeAndPosition(); +// (*mKeyboardCurrentPalette)->adjustSizeAndPosition(); if (controlView()){ int left = controlView()->width() - 20 - (*mToolsCurrentPalette)->width(); @@ -435,15 +435,14 @@ void UBWebController::toggleWebTrap(bool checked) } } -void UBWebController::showKeyboard(bool checked) -{ - if (mKeyboardCurrentPalette - && (*mKeyboardCurrentPalette)) - { - (*mKeyboardCurrentPalette)->setVisible(checked); - } -} - +// void UBWebController::showKeyboard(bool checked) +// { +// if (mKeyboardCurrentPalette +// && (*mKeyboardCurrentPalette)) +// { +// (*mKeyboardCurrentPalette)->setVisible(checked); +// } +// } void UBWebController::toggleWebToolsPalette(bool checked) { diff --git a/src/web/UBWebController.h b/src/web/UBWebController.h index 1cb38c4c..29640cbe 100644 --- a/src/web/UBWebController.h +++ b/src/web/UBWebController.h @@ -28,7 +28,7 @@ class UBMainWindow; class UBWebToolsPalette; class WBWebView; class UBServerXMLHttpRequest; -class UBKeyboardPalette; +//class UBKeyboardPalette; class UBWebController : public QObject @@ -58,6 +58,12 @@ class UBWebController : public QObject void show(WebInstance type = UBWebController::WebBrowser); + WBBrowserWindow* GetCurrentWebBrowser() + { + if( mCurrentWebBrowser != NULL ) return *mCurrentWebBrowser; + else return NULL; + }; + protected: void setupPalettes(); @@ -101,8 +107,8 @@ class UBWebController : public QObject UBTrapFlashController* mTrapFlashController; UBWebToolsPalette** mToolsCurrentPalette; UBWebToolsPalette* mToolsPaletteList[TotalNumberOfWebInstances]; - UBKeyboardPalette** mKeyboardCurrentPalette; - UBKeyboardPalette* mKeyboardPaletteList[TotalNumberOfWebInstances]; +// UBKeyboardPalette** mKeyboardCurrentPalette; +// UBKeyboardPalette* mKeyboardPaletteList[TotalNumberOfWebInstances]; bool mToolsPalettePositionned; bool mToolsPalettePositionnedList[TotalNumberOfWebInstances]; @@ -124,7 +130,7 @@ class UBWebController : public QObject void toggleWebTrap(bool checked); - void showKeyboard(bool checked); +// void showKeyboard(bool checked); signals: /** From 6f205698d94041f4d17ed77e401636d86814e696 Mon Sep 17 00:00:00 2001 From: Ivan Ilin Date: Thu, 27 Oct 2011 16:04:59 +0300 Subject: [PATCH 07/12] images for CFF implementation --- src/adaptors/UBCFFSubsetAdaptor.cpp | 843 +++++++++++++++++++++++++--- src/adaptors/UBCFFSubsetAdaptor.h | 37 +- src/board/UBBoardPaletteManager.cpp | 0 3 files changed, 790 insertions(+), 90 deletions(-) mode change 100755 => 100644 src/board/UBBoardPaletteManager.cpp diff --git a/src/adaptors/UBCFFSubsetAdaptor.cpp b/src/adaptors/UBCFFSubsetAdaptor.cpp index b19d6529..572486d7 100644 --- a/src/adaptors/UBCFFSubsetAdaptor.cpp +++ b/src/adaptors/UBCFFSubsetAdaptor.cpp @@ -25,6 +25,7 @@ #include "domain/UBGraphicsStroke.h" #include "domain/UBGraphicsTextItem.h" #include "domain/UBGraphicsSvgItem.h" +#include "domain/UBGraphicsPixmapItem.h" #include "UBCFFSubsetAdaptor.h" #include "UBMetadataDcSubsetAdaptor.h" @@ -55,6 +56,7 @@ static QString tText = "text"; static QString tTextarea = "textarea"; static QString tTspan = "tspan"; static QString tBreak = "tbreak"; +static QString tImage = "image"; //attribute names definition static QString aFill = "fill"; @@ -81,56 +83,57 @@ static QString aPoints = "points"; static QString svgNS = "http://www.w3.org/2000/svg"; static QString iwbNS = "http://www.becta.org.uk/iwb"; static QString aId = "id"; +static QString aRef = "ref"; +static QString aHref = "href"; + +//attributes part names +static QString apRotate = "rotate"; +static QString apTranslate = "translate"; UBCFFSubsetAdaptor::UBCFFSubsetAdaptor() { + } void UBCFFSubsetAdaptor::UBCFFSubsetReader::hashSiblingIwbElements(QDomElement *parent, QDomElement *topGroup) { QDomElement curExt = parent->firstChildElement(tElement); while (!curExt.isNull()) { - QDomElement n = curExt; if (curExt.namespaceURI() != iwbNS) continue; - QHash::iterator iSvgElement = extProperties.find(curExt.attribute("ref")); - if (iSvgElement != extProperties.end()) { + QHash::iterator iSvgElement = iwbExtProperties.find(curExt.attribute(aRef)); + if (iSvgElement != iwbExtProperties.end()) { IwbExt &svgElement = *iSvgElement; svgElement.extAttr.push_back(curExt); if (topGroup) - qDebug() << "made"; + svgElement.group = *topGroup; } curExt = curExt.nextSiblingElement(tElement); } } -void UBCFFSubsetAdaptor::UBCFFSubsetReader::addExtentionsToHash(QDomElement *parent) +void UBCFFSubsetAdaptor::UBCFFSubsetReader::addExtentionsToHash(QDomElement *parent, QDomElement *topGroup) { - //add top level elements + if(*parent == mDOMdoc.documentElement()) { + hashSiblingIwbElements(parent); + } else + hashSiblingIwbElements(parent, topGroup); + + //add iwb groups if needed QDomElement curGroup = parent->firstChildElement(tGroup); - QDomElement topGroup; while (!curGroup.isNull()) { if (curGroup.namespaceURI() != iwbNS) continue; - -// if (parent == mDOMdoc.documentElement()) -// topGroup = curGroup; -// QHash::iterator iSvgElement = extProperties.find(curExt.attribute("ref")); -// if (iSvgElement != extProperties.end()) { -// IwbExt &svgElement = *iSvgElement; -// svgElement.group = curGroup; -// qDebug() << "made"; -// } - hashSiblingIwbElements(&curGroup, &topGroup); + if(*parent == mDOMdoc.documentElement()) { + topGroup = &curGroup; + } if (curGroup.hasChildNodes()) { - addExtentionsToHash(&curGroup); + addExtentionsToHash(&curGroup, topGroup); } - curGroup = curGroup.nextSiblingElement(tGroup); } - //add groups } void UBCFFSubsetAdaptor::UBCFFSubsetReader::hashSvg(QDomNode *parent, QString prefix) @@ -140,7 +143,7 @@ void UBCFFSubsetAdaptor::UBCFFSubsetReader::hashSvg(QDomNode *parent, QString pr QDomElement e = n.toElement(); QString id = e.attribute(aId); if(!id.isNull()) { - extProperties.insert(id, IwbExt(e)); + iwbExtProperties.insert(id, IwbExt(e)); qDebug() << prefix + e.prefix() + ":" + e.tagName(); } if (n.hasChildNodes()) { @@ -152,36 +155,51 @@ void UBCFFSubsetAdaptor::UBCFFSubsetReader::hashSvg(QDomNode *parent, QString pr bool UBCFFSubsetAdaptor::UBCFFSubsetReader::hashElements() { - QDomElement svgSection = mDOMdoc.elementsByTagNameNS(svgNS, tSvg).at(0).toElement(); - Q_ASSERT(!svgSection.isNull()); + bool result = true; + QDomElement svgSection = mDOMdoc.elementsByTagNameNS(svgNS, tSvg).at(0).toElement(); + if (svgSection.isNull()) { + qDebug("\"svg:svg\" section not found maybe invalid document"); + result = false; + } hashSvg(&svgSection); QDomElement parElement = mDOMdoc.documentElement(); - Q_ASSERT(!parElement.isNull()); - - addExtentionsToHash(&parElement); - -// qDebug() << "ext properties count " << extProperties.count(); -// qDebug() << extProperties.value("link1").element.toElement().tagName(); - foreach (IwbExt cur, extProperties) { - qDebug() << (cur.extAttr.count() ? cur.extAttr.first().toElement().tagName() : "count < 0") ; + if (parElement.isNull()) { + qDebug("invalid pass paramentr maybe invalid document"); + result = false; } -// for (int i = 0; i < extProperties.count(); i++) { + // Adding iwb extentions to hash table crossing elements and groups using recursive descent + addExtentionsToHash(&parElement, 0); + +// int i = 0; +// foreach (IwbExt cur, iwbExtProperties) { +// QString elem = cur.element.toElement().attribute(aId); +// QString tagName = cur.element.toElement().tagName(); +// QString gr = !cur.group.isNull() +// ? i++, " is group\n-------------\n" + QString::number(i) +// + cur.group.toElement().tagName() +// + (cur.group.toElement().hasChildNodes() ? "true" : "false") +// : ""; +//// QString attr = !cur.extAttr.isEmpty() ? cur.extAttr.first().toElement().attribute(aRef) : ""; +//// if (cur.group) { +//// *(cur.group); +//// } +// qDebug() << "element" + elem + "tag" + tagName + gr; +// if (!gr.isNull()) { + +// mDOMdoc.documentElement().removeChild(cur.group); +// } +// } +// QDomNode n = mDOMdoc.documentElement().firstChild(); +// while (!n.isNull()) { +// qDebug() << "new dom tags"<< n.toElement().tagName(); +// n = n.nextSibling(); // } - // QDomNode n = docElem.firstChild(); -// int i = 0; -// while(!n.isNull()) { -// QDomElement e = n.toElement(); // try to convert the node to an element. -// if(!e.isNull()) { -// qDebug() << e.prefix() << ":" << e.tagName() ; // the node really is an element. -// i++; -// } -// n = n.nextSibling(); -// } - return false; + + return result; } bool UBCFFSubsetAdaptor::ConvertCFFFileToUbz(QString &cffSourceFile, UBDocumentProxy* pDocument) @@ -198,25 +216,14 @@ bool UBCFFSubsetAdaptor::ConvertCFFFileToUbz(QString &cffSourceFile, UBDocumentP return false; } -// QTextStream out(&file); -// out.setCodec("UTF-8"); -// QString dta = out.readAll(); - QByteArray data = file.readAll(); - if (data.length() == 0) - { - qWarning() << "Either content file " << cffSourceFile << " is empty or failed to read from file"; - file.close(); - return false; - } - - UBCFFSubsetReader cffReader(pDocument, data); + UBCFFSubsetReader cffReader(pDocument, &file); bool result = cffReader.parse(); file.close(); return result; } -UBCFFSubsetAdaptor::UBCFFSubsetReader::UBCFFSubsetReader(UBDocumentProxy *proxy, QByteArray &content): +UBCFFSubsetAdaptor::UBCFFSubsetReader::UBCFFSubsetReader(UBDocumentProxy *proxy, QFile *content): mReader(content), mProxy(proxy), currentState(NONE) { int errorLine, errorColumn; @@ -226,6 +233,7 @@ UBCFFSubsetAdaptor::UBCFFSubsetReader::UBCFFSubsetReader(UBDocumentProxy *proxy, << "column" << errorColumn << ":" << errorStr; } else { qDebug() << "well parsed to DOM"; + pwdContent = QFileInfo(content->fileName()).dir().absolutePath(); } // QFile tfile("/home/ilia/Documents/tmp/2/out.xml"); // tfile.open(QIODevice::ReadWr ite | QIODevice::Text); @@ -272,8 +280,633 @@ void UBCFFSubsetAdaptor::UBCFFSubsetReader::PushState(int state) currentState = state; } +bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgRect(const QDomElement &element) +{ + qreal x1 = element.attribute(aX).toDouble(); + qreal y1 = element.attribute(aY).toDouble(); + //rect dimensions + qreal width = element.attribute(aWidth).toDouble(); + qreal height = element.attribute(aHeight).toDouble(); + + QString textFillColor = element.attribute(aFill); + QString textStrokeColor = element.attribute(aStroke); + QString textStrokeWidth = element.attribute(aStrokewidth); + + QColor fillColor = !textFillColor.isNull() ? colorFromString(textFillColor) : QColor(); + QColor strokeColor = !textStrokeColor.isNull() ? colorFromString(textStrokeColor) : QColor(); + int strokeWidth = !textStrokeWidth.isNull() ? textStrokeWidth.toInt() : 0; + + //init svg generator with temp file + QSvgGenerator *generator = createSvgGenerator(width + 10, height + 10); + + //init painter to paint to svg + QPainter painter; + + painter.begin(generator); + + //fill rect + if (fillColor.isValid()) { + painter.setBrush(QBrush(fillColor)); + painter.fillRect(5, 5, width, height, fillColor); + } + QPen pen; + if (strokeColor.isValid()) { + pen.setColor(strokeColor); + } + if (strokeWidth) + pen.setWidth(strokeWidth); + painter.setPen(pen); + painter.drawRect(5, 5, width, height); + + painter.end(); + + UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); + QTransform transform; + QString textTransform = element.attribute(aTransform); + bool hastransform = false; + if (!textTransform.isNull()) { + transform = transformFromString(textTransform); + hastransform = true; + } + repositionSvgItem(svgItem, width + 10, height + 10, x1 - 5, y1 - 5, hastransform, transform); + delete generator; + + return true; +} +bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgEllipse(const QDomElement &element) +{ + //ellipse horisontal and vertical radius + qreal rx = element.attribute(aRx).toDouble(); + qreal ry = element.attribute(aRy).toDouble(); + QSvgGenerator *generator = createSvgGenerator(rx * 2 + 10, ry * 2 + 10); + + //fill and stroke color + QColor fillColor = colorFromString(element.attribute(aFill)); + QColor strokeColor = colorFromString(element.attribute(aStroke)); + int strokeWidth = element.attribute(aStrokewidth).toInt(); + + //ellipse center coordinates + qreal cx = element.attribute(aCx).toDouble(); + qreal cy = element.attribute(aCy).toDouble(); + + //init painter to paint to svg + QPainter painter; + painter.begin(generator); + + QPen pen(strokeColor); + pen.setWidth(strokeWidth); + painter.setPen(pen); + painter.setBrush(QBrush(fillColor)); + + painter.drawEllipse(5, 5, rx * 2, ry * 2); + + painter.end(); + + UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); + QTransform transform; + QString textTransform = element.attribute(aTransform); + bool hastransform = false; + if (!textTransform.isNull()) { + transform = transformFromString(textTransform); + hastransform = true; + } + repositionSvgItem(svgItem, rx * 2 + 10, ry * 2 + 10, cx - rx - 5, cy - ry -5, hastransform, transform); + delete generator; + + return true; +} +bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgPolygon(const QDomElement &element) +{ + QString svgPoints = element.attribute(aPoints); + QPolygonF polygon; + + if (!svgPoints.isNull()) { + QStringList ts = svgPoints.split(QLatin1Char(' '), QString::SkipEmptyParts); + + foreach(const QString sPoint, ts) { + QStringList sCoord = sPoint.split(QLatin1Char(','), QString::SkipEmptyParts); + if (sCoord.size() == 2) { + QPointF point; + point.setX(sCoord.at(0).toFloat()); + point.setY(sCoord.at(1).toFloat()); + polygon << point; + } + else { + qWarning() << "cannot make sense of a 'point' value" << sCoord; + } + } + } + + //bounding rect lef top corner coordinates + qreal x1 = polygon.boundingRect().topLeft().x(); + qreal y1 = polygon.boundingRect().topLeft().y(); + //bounding rect dimensions + qreal width = polygon.boundingRect().width(); + qreal height = polygon.boundingRect().height(); + + QString strokeColorText = element.attribute(aStroke); + QString fillColorText = element.attribute(aFill); + QString strokeWidthText = element.attribute(aStrokewidth); + + QColor strokeColor = !strokeColorText.isEmpty() ? colorFromString(strokeColorText) : QColor(); + QColor fillColor = !fillColorText.isEmpty() ? colorFromString(fillColorText) : QColor(); + int strokeWidth = strokeWidthText.toInt() > 0 ? strokeWidthText.toInt() : 0; + + QPen pen; + pen.setColor(strokeColor); + pen.setWidth(strokeWidth); + + QBrush brush; + brush.setColor(fillColor); + brush.setStyle(Qt::SolidPattern); + + QSvgGenerator *generator = createSvgGenerator(width + pen.width(), height + pen.width()); + QPainter painter; + + painter.begin(generator); //drawing to svg tmp file + + painter.translate(pen.widthF() / 2 - x1, pen.widthF() / 2 - y1); + painter.setBrush(brush); + painter.setPen(pen); + painter.drawPolygon(polygon); + + painter.end(); + + //add resulting svg file to scene + UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); + QTransform transform; + QString textTransform = element.attribute(aTransform); + bool hastransform = false; + if (!textTransform.isNull()) { + transform = transformFromString(textTransform); + hastransform = true; + } + repositionSvgItem(svgItem, width + 10, height + 10, x1 - 5, y1 - 5, hastransform, transform); + delete generator; + + return true; +} +bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgPolyline(const QDomElement &element) +{ + QString svgPoints = element.attribute(aPoints); + QPolygonF polygon; + + if (!svgPoints.isNull()) { + QStringList ts = svgPoints.split(QLatin1Char(' '), + QString::SkipEmptyParts); + + foreach(const QString sPoint, ts) { + QStringList sCoord = sPoint.split(QLatin1Char(','), QString::SkipEmptyParts); + if (sCoord.size() == 2) { + QPointF point; + point.setX(sCoord.at(0).toFloat()); + point.setY(sCoord.at(1).toFloat()); + polygon << point; + } + else { + qWarning() << "cannot make sense of a 'point' value" << sCoord; + } + } + } + + //bounding rect lef top corner coordinates + qreal x1 = polygon.boundingRect().topLeft().x(); + qreal y1 = polygon.boundingRect().topLeft().y(); + //bounding rect dimensions + qreal width = polygon.boundingRect().width(); + qreal height = polygon.boundingRect().height(); + + QString strokeColorText = element.attribute(aStroke); + QString strokeWidthText = element.attribute(aStrokewidth); + + QColor strokeColor = !strokeColorText.isEmpty() ? colorFromString(strokeColorText) : QColor(); + int strokeWidth = strokeWidthText.toInt() > 0 ? strokeWidthText.toInt() : 0; + + QPen pen; + pen.setColor(strokeColor); + pen.setWidth(strokeWidth); + + QSvgGenerator *generator = createSvgGenerator(width + pen.width(), height + pen.width()); + QPainter painter; + + painter.begin(generator); //drawing to svg tmp file + + painter.translate(pen.widthF() / 2 - x1, pen.widthF() / 2 - y1); + painter.setPen(pen); + painter.drawPolyline(polygon); + + painter.end(); + + //add resulting svg file to scene + UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); + QTransform transform; + QString textTransform = element.attribute(aTransform); + bool hastransform = false; + if (!textTransform.isNull()) { + transform = transformFromString(textTransform); + hastransform = true; + } + repositionSvgItem(svgItem, width + 10, height + 10, x1 - 5, y1 - 5, hastransform, transform); + delete generator; + + return true; +} + +void UBCFFSubsetAdaptor::UBCFFSubsetReader::parseTextAttributes(const QDomElement &element, + qreal &fontSize, QColor &fontColor, QString &fontFamily, + QString &fontStretch, bool &italic, int &fontWeight, + int &textAlign, QTransform &fontTransform) +{ + //consider inch has 72 liens + //since svg font size is given in pixels, divide it by pixels per line + QString fontSz = element.attribute(aFontSize); + if (!fontSz.isNull()) fontSize = fontSz.toDouble() * 72 / QApplication::desktop()->physicalDpiY(); + + QString fontColorText = element.attribute(aFill); + if (!fontColorText.isNull()) fontColor = colorFromString(fontColorText); + + QString fontFamilyText = element.attribute(aFontfamily); + if (!fontFamilyText.isNull()) fontFamily = fontFamilyText; + + QString fontStretchText = element.attribute(aFontstretch); + if (!fontStretchText.isNull()) fontStretch = fontStretchText; + + if (!element.attribute(aFontstyle).isNull()) + italic = (element.attribute(aFontstyle) == "italic"); + + QString weight = element.attribute(aFontweight); + if (!weight.isNull()) { + if (weight == "normal") fontWeight = QFont::Normal; + else if (weight == "light") fontWeight = QFont::Light; + else if (weight == "demibold") fontWeight = QFont::DemiBold; + else if (weight == "bold") fontWeight = QFont::Bold; + else if (weight == "black") fontWeight = QFont::Black; + } + QString align = element.attribute(aTextalign); + if (!align.isNull()) { + if (align == "middle" || align == "center") textAlign = Qt::AlignHCenter; + else if (align == "start") textAlign = Qt::AlignLeft; + else if (align == "end") textAlign = Qt::AlignRight; + } + + if (!element.attribute(aTransform).isNull()) + fontTransform = transformFromString(element.attribute(aTransform)); +} + +bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgText(const QDomElement &element) +{ +// qreal x = element.attribute(aX).toDouble(); +// qreal y = element.attribute(aY).toDouble();; + +// qreal width = 0; +// qreal height = 0; + +// QList textRects; +// QList textFonts; +// QList textLines; +// QList textAligns; +// QList textColors; + +// qWarning() << QString().sprintf("Text coordinates : %f,%f. Text size %f,%f", x, y, width, height); + +// qreal fontSize = 12.0; +// QFont textFont; +// QColor fontColor; +// QString fontFamily = "Arial"; +// QString fontStretch = "normal"; + +// bool italic = false; +// int fontWeight = QFont::Normal; +// int textAlign = Qt::AlignLeft; +// QTransform fontTransform; +// parseTextAttributes(element, fontSize, fontColor, fontFamily, fontStretch, italic, fontWeight, textAlign, fontTransform); +// textFont = QFont(fontFamily, fontSize, fontWeight, italic); + +// QFontMetricsF metrics = QFontMetricsF(textFont); +// qreal curHeight = metrics.height(); + +// qreal curY = 0.0; +// qreal curX = 0.0; + +// qreal linespacing = QFontMetrics(textFont).leading(); + +// //remember if text area has transform +// QTransform transform; +//// bool hasTransform = getCurElementTransorm(transform); + +// QRectF lastDrawnTextBoundingRect; + +// QStack fontStack; +// QStack colorStack; +// QStack alignStack; + +// // first extimate desired text area size +// // to do that, parse text area tags +// while(true) +// { +// mReader.readNext(); +// QStringRef elementName = mReader.name(); +// if (mReader.isEndDocument()) +// break; +// if (mReader.isEndElement()) +// { +// if (elementName == tBreak) +// { +// //when tbreak appers, move down by the drawn rect height +// //TODO: line spacing is not calculated yet, probably additional code is required +// curY += lastDrawnTextBoundingRect.height() + linespacing; +// curX = 0.0; +// height += lastDrawnTextBoundingRect.height(); +// lastDrawnTextBoundingRect = QRectF(0,0,0,0); +// continue; +// } +// if (elementName == tTspan) +// { +// textFont = fontStack.pop(); +// fontColor = colorStack.pop(); +// textAlign = alignStack.pop(); +// continue; +// } +// } +// if (mReader.isEndElement() && elementName == tText) +// break; +// if (mReader.isStartElement() && elementName == tTspan) +// { +// fontStack.push(textFont); +// colorStack.push(fontColor); +// alignStack.push(textAlign); + +// parseTextAttributes(fontSize, fontColor, fontFamily, fontStretch, italic, fontWeight, textAlign, fontTransform); +// textFont = QFont(fontFamily, fontSize, fontWeight, italic); +// metrics = QFontMetricsF(textFont); +// curHeight = metrics.height(); +// linespacing = QFontMetricsF(textFont).leading(); +// continue; +// } +// if (mReader.isCharacters() || mReader.isCDATA()) +// { +// QString text = mReader.text().toString(); + +// //skip empty text +// if (text.trimmed().length() == 0) +// continue; +// //get bounding rect to obtain desired text height +// lastDrawnTextBoundingRect = metrics.boundingRect(QRectF(), textAlign, text); +// QString log = QString().sprintf(" at rect %f, %f, %f, %f. Bounding rect is %f, %f, %f, %f", 0.0, curY, width, height - curY, lastDrawnTextBoundingRect.x(), lastDrawnTextBoundingRect.y(), lastDrawnTextBoundingRect.width(), lastDrawnTextBoundingRect.height()); +// qWarning() << "Text " << text << log; +// textFonts.append(textFont); +// textRects.append(QRectF(curX, curY, lastDrawnTextBoundingRect.width(), lastDrawnTextBoundingRect.height())); +// textLines.append(text); +// textAligns.append(textAlign); +// textColors.append(fontColor); +// curX += lastDrawnTextBoundingRect.width(); +// if (width < curX) +// width = curX; +// if (height == 0) +// height = curHeight; + +// continue; +// } +// } + +// QSvgGenerator *generator = createSvgGenerator(width, height); +// QPainter painter; +// painter.begin(generator); + +// if (textRects.count() != 0) +// { +// QListIterator textRectsIter(textRects); +// QListIterator textFontsIter(textFonts); +// QListIterator textLinesIter(textLines); +// QListIterator textAlignsIter(textAligns); +// QListIterator textColorsIter(textColors); + +// while (textRectsIter.hasNext()) +// { +// QRectF rt = textRectsIter.next(); +// QFont font = textFontsIter.next(); +// QString line = textLinesIter.next(); +// int align = textAlignsIter.next(); +// QColor color = textColorsIter.next(); +// painter.setFont(font); +// painter.setPen(color); +// painter.drawText(rt.x(), rt.y(), rt.width(), rt.height(), align, line); +// } +// } + +// painter.end(); + +// //add resulting svg file to scene +// UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); +// repositionSvgItem(svgItem, width, height, x, y, hasTransform, transform); + +// delete generator; + + return true; + +} +bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgTextarea(const QDomElement &element) +{ + //TODO textarea node + qreal x = element.attribute(aX).toDouble(); + qreal y = element.attribute(aY).toDouble(); + qreal width = element.attribute(aWidth).toDouble(); + qreal height = element.attribute(aHeight).toDouble(); + + qreal fontSize = 12; + QColor fontColor; + QString fontFamily = "Arial"; + QString fontStretch = "normal"; + bool italic = false; + int fontWeight = QFont::Normal; + int textAlign = Qt::AlignLeft; + QTransform fontTransform; + parseTextAttributes(fontSize, fontColor, fontFamily, fontStretch, italic, fontWeight, textAlign, fontTransform); + + QSvgGenerator *generator = createSvgGenerator(width, height); + QPainter painter; + painter.begin(generator); + painter.setFont(QFont(fontFamily, fontSize, fontWeight, italic)); + + qreal curY = 0.0; + qreal curX = 0.0; + qreal linespacing = QFontMetricsF(painter.font()).leading(); + +// remember if text area has transform +// QString transformString; + QTransform transform = fontTransform; + bool hasTransform = !fontTransform.isIdentity(); + + QRectF lastDrawnTextBoundingRect; + //parse text area tags + + QDomElement curTextElement = element.firstChildElement(); + while (!curTextElement.isNull()) { + QString tagName = curTextElement.tagName(); + if (tagName == tTspan) { + parseTextAttributes(curTextElement, fontSize, fontColor, fontFamily, fontStretch, italic, fontWeight, textAlign, fontTransform); + painter.setFont(QFont(fontFamily, fontSize, fontWeight, italic)); + painter.setPen(fontColor); + linespacing = QFontMetricsF(painter.font()).leading(); + + QDomNode tspanNode = curTextElement.firstChild(); + while (!tspanNode.isNull()) { + if (tspanNode.nodeType() == QDomNode::CharacterDataNode + || tspanNode.nodeType() == QDomNode::CDATASectionNode) { + QDomCharacterData textData = tspanNode.toCharacterData(); + QString text = textData.data().trimmed(); + //get bounding rect to obtain desired text height + lastDrawnTextBoundingRect = painter.boundingRect(QRectF(curX, curY, width, height - curY), textAlign|Qt::TextWordWrap, text); + painter.drawText(curX, curY, width, lastDrawnTextBoundingRect.height(), textAlign|Qt::TextWordWrap, text); + curX += lastDrawnTextBoundingRect.x() + lastDrawnTextBoundingRect.width(); + } else if (tspanNode.nodeType() == QDomNode::ElementNode) { + //when tbreak appers, move down by the drawn rect height + //TODO: line spacing is not calculated yet, additional code is required + curY += lastDrawnTextBoundingRect.height() + linespacing; + curX = 0.0; + lastDrawnTextBoundingRect = QRectF(0,0,0,0); + } + tspanNode = tspanNode.nextSibling(); + } + } else if (tagName == tBreak) { + + } + curTextElement = curTextElement.nextSiblingElement(); + } + + painter.end(); + + //add resulting svg file to scene + UBGraphicsSvgItem *svgItem = mCurrentScene->addSvg(QUrl::fromLocalFile(generator->fileName())); + repositionSvgItem(svgItem, width, height, x, y, hasTransform, transform); + delete generator; + + return true; +} +bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgImage(const QDomElement &element) +{ + qreal x = element.attribute(aX).toDouble(); + qreal y = element.attribute(aY).toDouble(); + qreal width = element.attribute(aWidth).toDouble(); + qreal height = element.attribute(aHeight).toDouble(); + + QString itemRefPath = element.attribute(aHref); + + QPixmap pix; + if (!itemRefPath.isNull()) { + QString imagePath = pwdContent + "/" + itemRefPath; + if (!QFile::exists(imagePath)) { + qDebug() << "can't load file" << pwdContent + "/" + itemRefPath << "maybe file corrupted"; + return false; + } + pix.load(imagePath); + if (pix.isNull()) { + qDebug() << "can't create pixmap for file" << pwdContent + "/" + itemRefPath << "maybe format does not supported"; + } + } + + UBGraphicsPixmapItem *pixItem = mCurrentScene->addPixmap(pix); + QTransform transform; + QString textTransform = element.attribute(aTransform); + bool hastransform = false; + if (!textTransform.isNull()) { + transform = transformFromString(textTransform); + hastransform = true; + } +// repositionSvgItem(svgItem, rx * 2 + 10, ry * 2 + 10, cx - rx - 5, cy - ry -5, hastransform, transform); +repositionPixmapItem(pixItem, width, height, x, y, hastransform, transform); + + return true; +} + +void UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgSectionAttr(const QDomElement &svgSection) +{ + getViewBoxDimenstions(svgSection.attribute(aViewbox)); + mSize = QSize(svgSection.attribute(aWidth).toInt(), + svgSection.attribute(aHeight).toInt()); +} + +bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseIwbGroup(QDomNode *group) +{ + QDomElement curGroupPtr = group->firstChildElement(); + + while (!curGroupPtr.isNull()) { + if (curGroupPtr.namespaceURI() != iwbNS) + continue; + if (curGroupPtr.hasChildNodes() && curGroupPtr.toElement().tagName() == tGroup) { + parseIwbGroup(&curGroupPtr); + } else if (curGroupPtr.toElement().tagName() == tElement) { + QHash::iterator iSvgElementExt = iwbExtProperties.find(curGroupPtr.attribute(aRef)); + if (iSvgElementExt != iwbExtProperties.end()) { + IwbExt &svgElementExt = *iSvgElementExt; + QDomNode &svgElement = svgElementExt.element; + svgElement.parentNode().removeChild(svgElement); + } + } + curGroupPtr = curGroupPtr.nextSiblingElement(tElement); + } + return true; +} + +bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgElement(const QDomElement &parent) +{ + QString tagName = parent.tagName(); + if (parent.namespaceURI() != svgNS) { + qDebug() << "Incorrect namespace, error at content file, line number" << parent.lineNumber(); + return false; + } + + if (tagName == tRect && !parseSvgRect(parent)) return false; + else if (tagName == tEllipse && !parseSvgEllipse(parent)) return false; + else if (tagName == tPolygon && !parseSvgPolygon(parent)) return false; + else if (tagName == tPolyline && !parseSvgPolyline(parent)) return false; + else if (tagName == tText && !parseSvgText(parent)) return false; + else if (tagName == tTextarea && !parseSvgTextarea(parent)) return false; + else if (tagName == tImage && !parseSvgImage(parent)) return false; + + return true; +} + +bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgPage(const QDomElement &parent) +{ + createNewScene(); + QDomElement currentSvgElement = parent.firstChildElement(); + while (!currentSvgElement.isNull()) { + if (!parseSvgElement(currentSvgElement)) + return false; + + currentSvgElement = currentSvgElement.nextSiblingElement(); + } + persistCurrentScene(); + return true; +} +bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgPageset(const QDomElement &parent) +{ + QDomElement currentPage = parent.firstChildElement(tPage); + while (!currentPage.isNull()) { + if (!parseSvgPage(currentPage)) + return false; + currentPage = currentPage.nextSiblingElement(tPage); + } + return true; +} + bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseDoc() { + if (!hashElements()) return false; //hashing all elements having id attribute + + QDomElement svgSection = mDOMdoc.elementsByTagNameNS(svgNS, tSvg).at(0).toElement(); + parseSvgSectionAttr(svgSection); + + QDomElement currentSvg = svgSection.firstChildElement(); + + if (currentSvg.tagName() != tPageset) { + parseSvgPage(svgSection); + } else if (currentSvg.tagName() == tPageset){ + parseSvgPageset(currentSvg); + } + + // while (!mReader.atEnd()) // { // mReader.readNext(); @@ -297,7 +930,6 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseDoc() // } // if (!mReader.error() == QXmlStreamReader::NoError) // UBApplication::showMessage(mReader.errorString()); - if (!hashElements()) return false; return true; } @@ -305,8 +937,8 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseDoc() bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseCurrentElementStart() { QStringRef elName = mReader.name(); - QString log = QString("%1<%2>").arg(mIndent).arg(elName.toString()); - qDebug() << log; +// QString log = QString("%1<%2>").arg(mIndent).arg(elName.toString()); +// qDebug() << log; mIndent += " "; if ( elName == tIwb) { @@ -467,10 +1099,12 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvg() return true; } -void UBCFFSubsetAdaptor::UBCFFSubsetReader::repositionSvgItem(UBGraphicsSvgItem *item, qreal width, qreal height, qreal x, qreal y, bool useTransform, QTransform &transform) +void UBCFFSubsetAdaptor::UBCFFSubsetReader::repositionSvgItem(UBGraphicsSvgItem *item, qreal width, qreal height, + qreal x, qreal y, + bool useTransform, QTransform &transform) { QTransform curTrans = item->transform(); - qWarning() << QString().sprintf("Item current transform = %f 0 0 %f %f %f, position %f, %f", curTrans.m11(), curTrans.m22(), curTrans.dx(), curTrans.dy(), item->x(), item->y()); +// qWarning() << QString().sprintf("Item current transform = %f 0 0 %f %f %f, position %f, %f", curTrans.m11(), curTrans.m22(), curTrans.dx(), curTrans.dy(), item->x(), item->y()); //check if rect is rotated //rotate svg item itself QRectF itemBounds = item->boundingRect(); @@ -495,7 +1129,49 @@ void UBCFFSubsetAdaptor::UBCFFSubsetReader::repositionSvgItem(UBGraphicsSvgItem } QTransform newTrans = item->transform(); - qWarning() << QString("Item new transform = %3 0 0 %4 %1 %2, position %5, %6").arg(newTrans.dx()).arg(newTrans.dy()).arg(newTrans.m11()).arg(newTrans.m22()).arg(item->x()).arg(item->y()); +// qWarning() << QString("Item new transform = %3 0 0 %4 %1 %2, position %5, %6").arg(newTrans.dx()).arg(newTrans.dy()).arg(newTrans.m11()).arg(newTrans.m22()).arg(item->x()).arg(item->y()); + +} +void UBCFFSubsetAdaptor::UBCFFSubsetReader::repositionPixmapItem(UBGraphicsPixmapItem *item, qreal width, qreal height, + qreal x, qreal y, + bool useTransform, QTransform &transform) +{ + //if element is to transform +// if (!transform.isIdentity()) { +// QTransform curTransform = item->transform(); +// qreal hScale = item->boundingRect().width() / width * curTransform.m11(); +// qreal vScale = item->boundingRect().height() / height * curTransform.m22(); +// curTransform = curTransform.translate(x - mViewBoxCenter.x(), y - mViewBoxCenter.y()).scale(hScale, vScale); +// curTransform = curTransform * transform; + +// item->setTransform(curTransform); + + + QTransform curTrans = item->transform(); +// qWarning() << QString().sprintf("Item current transform = %f 0 0 %f %f %f, position %f, %f", curTrans.m11(), curTrans.m22(), curTrans.dx(), curTrans.dy(), item->x(), item->y()); + //check if rect is rotated + //rotate svg item itself + QRectF itemBounds = item->boundingRect(); + //first, svg is mapped to svg item bound + //second, svg item is mapped to scene + //so, get svg to svg item scale and multiple by scene scale + qreal hScale = itemBounds.width() / width * curTrans.m11(); + qreal vScale = itemBounds.height() / height * curTrans.m22(); + + if (useTransform) + { + QPointF oldVector((x - transform.dx()), (y - transform.dy())); + QTransform rTransform(transform.m11(), transform.m12(), transform.m21(), transform.m22(), 0, 0); + QPointF newVector = rTransform.map(oldVector); + rTransform.scale(curTrans.m11(), curTrans.m22()); + item->setTransform(QTransform(rTransform.m11(), rTransform.m12(), rTransform.m21(), rTransform.m22(), 0, 0)); + item->setPos((x - mViewBoxCenter.x() + (newVector - oldVector).x()) * hScale, (y - mViewBoxCenter.y() + (newVector - oldVector).y()) * vScale ); + } + else + { + item->setPos((x - mViewBoxCenter.x()) * hScale, (y - mViewBoxCenter.y()) * vScale); + } + } bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseRect() @@ -995,8 +1671,6 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parsePolyline() if (mReader.attributes().hasAttribute(aStrokewidth)) pen.setWidth(mReader.attributes().value(aStrokewidth).toString().toInt()); - pen.setColor(Qt::yellow); - QSvgGenerator *generator = createSvgGenerator(width + pen.width(), height + pen.width()); QPainter painter; @@ -1025,11 +1699,8 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parsePage() qWarning() << "iwb content parse error, unexpected page tag at line" << mReader.lineNumber(); return false; } - createNewScene(); - qWarning() << "Added page number" << mProxy->pageCount(); - return true; } @@ -1115,31 +1786,31 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::getCurElementTransorm(QTransform &tr QTransform UBCFFSubsetAdaptor::UBCFFSubsetReader::transformFromString(const QString trString) { + qreal dx = 0.0; + qreal dy = 0.0; + qreal angle = 0.0; + //check pattern for strings like 'rotate(10)' QRegExp regexp("rotate\\( *([-+]{0,1}[0-9]*\\.{0,1}[0-9]*) *\\)"); - if (regexp.exactMatch(trString)) - { - if (regexp.capturedTexts().count() == 2 && regexp.capturedTexts().at(0).length() == trString.length()) - { - qreal angle = regexp.capturedTexts().at(1).toDouble(); - return QTransform().rotate(angle); + if (regexp.exactMatch(trString)) { + angle = regexp.capturedTexts().at(1).toDouble(); + } else { + //check pattern for strings like 'rotate(10,20,20)' or 'rotate(10.1,10.2,34.2)' + regexp.setPattern("rotate\\( *([-+]{0,1}[0-9]*\\.{0,1}[0-9]*) *, *([-+]{0,1}[0-9]*\\.{0,1}[0-9]*) *, *([-+]{0,1}[0-9]*\\.{0,1}[0-9]*) *\\)"); + if (regexp.exactMatch(trString)) { + angle = regexp.capturedTexts().at(1).toDouble(); + dx = regexp.capturedTexts().at(2).toDouble(); + dy = regexp.capturedTexts().at(3).toDouble(); } } - - //check pattern for strings like 'rotate(10,20,20)' or 'rotate(10.1,10.2,34.2)' - regexp.setPattern("rotate\\( *([-+]{0,1}[0-9]*\\.{0,1}[0-9]*) *, *([-+]{0,1}[0-9]*\\.{0,1}[0-9]*) *, *([-+]{0,1}[0-9]*\\.{0,1}[0-9]*) *\\)"); - if (regexp.exactMatch(trString)) - { - if (regexp.capturedTexts().count() == 4 && regexp.capturedTexts().at(0).length() == trString.length()) - { - qreal angle = regexp.capturedTexts().at(1).toDouble(); - qreal dx = regexp.capturedTexts().at(2).toDouble(); - qreal dy = regexp.capturedTexts().at(3).toDouble(); - return QTransform().translate(dx, dy).rotate(angle); - } + //check pattern for strings like 'translate(11.0, 12.34)' + regexp.setPattern("translate\\( *([-+]{0,1}[0-9]*\\.{0,1}[0-9]*) *,*([-+]{0,1}[0-9]*\\.{0,1}[0-9]*)*\\)"); + if (regexp.exactMatch(trString)) { + dx = regexp.capturedTexts().at(1).toDouble(); + dy = regexp.capturedTexts().at(2).toDouble(); } - return QTransform(); + return QTransform().translate(dx, dy).rotate(angle); } bool UBCFFSubsetAdaptor::UBCFFSubsetReader::getViewBoxDimenstions(const QString& viewBox) diff --git a/src/adaptors/UBCFFSubsetAdaptor.h b/src/adaptors/UBCFFSubsetAdaptor.h index bd4a7e71..78d953ee 100644 --- a/src/adaptors/UBCFFSubsetAdaptor.h +++ b/src/adaptors/UBCFFSubsetAdaptor.h @@ -26,7 +26,9 @@ class UBDocumentProxy; class UBGraphicsScene; class QSvgGenerator; class UBGraphicsSvgItem; +class UBGraphicsPixmapItem; class QTransform; +class QPainter; struct IwbExt { IwbExt() {;} @@ -36,7 +38,7 @@ struct IwbExt { QDomNode element; QVector extAttr; QHash textAttributes; - operator bool() const {return group.isNull() || !element.isNull();} + operator bool() const {return !group.isNull() || !element.isNull();} }; class UBCFFSubsetAdaptor @@ -62,10 +64,11 @@ private: }; public: - UBCFFSubsetReader(UBDocumentProxy *proxy, QByteArray &content); + UBCFFSubsetReader(UBDocumentProxy *proxy, QFile *content); QXmlStreamReader mReader; UBDocumentProxy *mProxy; + QString pwdContent; bool parse(); @@ -79,14 +82,38 @@ private: QSize mSize; private: + // to kill QDomDocument mDOMdoc; - QHash extProperties; + QDomNode mCurrentDOMElement; + QHash iwbExtProperties; + bool hashElements(); - void addExtentionsToHash(QDomElement *parent); + void addExtentionsToHash(QDomElement *parent, QDomElement *topGroup); void hashSvg(QDomNode *parent, QString prefix = ""); void hashSiblingIwbElements(QDomElement *parent, QDomElement *topGroup = 0); + inline void parseSvgSectionAttr(const QDomElement &); + bool parseSvgPage(const QDomElement &parent); + bool parseSvgPageset(const QDomElement &parent); + bool parseSvgElement(const QDomElement &parent); + + inline bool parseSvgRect(const QDomElement &element); + inline bool parseSvgEllipse(const QDomElement &element); + inline bool parseSvgPolygon(const QDomElement &element); + inline bool parseSvgPolyline(const QDomElement &element); + inline bool parseSvgText(const QDomElement &element); + inline bool parseSvgTextarea(const QDomElement &element); + inline bool parseSvgImage(const QDomElement &element); +// inline bool parseSvgTSpan(const QDomElement) + bool parseIwbGroup(QDomNode *element); + + + // to kill + void parseTextAttributes(const QDomElement &element, qreal &fontSize, QColor &fontColor, + QString &fontFamily, QString &fontStretch, bool &italic, + int &fontWeight, int &textAlign, QTransform &fontTransform); + //methods to store current xml parse state int PopState(); @@ -123,6 +150,8 @@ private: //helper methods bool getCurElementTransorm(QTransform &transform); void repositionSvgItem(UBGraphicsSvgItem *item, qreal width, qreal height, qreal x, qreal y, bool useTransform, QTransform &transform); + void repositionPixmapItem(UBGraphicsPixmapItem *item, qreal width, qreal height, qreal x, qreal y + , bool useTransform, QTransform &transform); QColor colorFromString(const QString& clrString); QTransform transformFromString(const QString trString); bool getViewBoxDimenstions(const QString& viewBox); diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp old mode 100755 new mode 100644 From d7b5c0b6371c231c4cf06850c3f84ca977e50627 Mon Sep 17 00:00:00 2001 From: Ivan Ilin Date: Thu, 27 Oct 2011 16:26:09 +0300 Subject: [PATCH 08/12] Sankore 329 minor fixes support vkeyboard linux --- src/board/UBBoardPaletteManager.cpp | 4 ++++ src/desktop/UBDesktopAnnotationController.cpp | 10 +++++----- src/web/UBWebController.cpp | 8 +++++--- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp index 2756f99a..1fca96f5 100644 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -756,7 +756,11 @@ void UBBoardPaletteManager::changeMode(eUBDockPaletteWidgetMode newMode, bool is if(mKeyboardPalette->m_isVisible) { mKeyboardPalette->hide(); +#ifndef Q_WS_X11 mKeyboardPalette->setParent((QWidget*)UBApplication::applicationController->uninotesController()->drawingView()); +#else + mKeyboardPalette->setParent(0); +#endif mKeyboardPalette->show(); } else diff --git a/src/desktop/UBDesktopAnnotationController.cpp b/src/desktop/UBDesktopAnnotationController.cpp index 9bf8a694..aa4b0504 100644 --- a/src/desktop/UBDesktopAnnotationController.cpp +++ b/src/desktop/UBDesktopAnnotationController.cpp @@ -97,9 +97,9 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) if (UBPlatformUtils::hasVirtualKeyboard()) { #ifdef Q_WS_X11 - mKeyboardPalette = UBKeyboardPalette::create(0); - connect(mTransparentDrawingView, SIGNAL(hidden()), mKeyboardPalette, SLOT(hide())); - connect(mTransparentDrawingView, SIGNAL(shown()), this, SLOT(showKeyboard())); +// mKeyboardPalette = UBKeyboardPalette::create(0); +// connect(mTransparentDrawingView, SIGNAL(hidden()), mKeyboardPalette, SLOT(hide())); +// connect(mTransparentDrawingView, SIGNAL(shown()), this, SLOT(showKeyboard())); #else // mKeyboardPalette = UBKeyboardPalette::create(mTransparentDrawingView); // mKeyboardPalette->setParent(mTransparentDrawingView); @@ -111,7 +111,7 @@ UBDesktopAnnotationController::UBDesktopAnnotationController(QObject *parent) // mTransparentDrawingView, SLOT(virtualKeyboardActivated(bool))); #ifdef Q_WS_X11 - connect(mKeyboardPalette, SIGNAL(moved(QPoint)), this, SLOT(refreshMask())); + connect(UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(moved(QPoint)), this, SLOT(refreshMask())); connect(mDesktopPalette,SIGNAL(refreshMask()), this, SLOT(refreshMask())); #endif } @@ -985,4 +985,4 @@ void UBDesktopAnnotationController::refreshMask() { updateMask(true); } -} \ No newline at end of file +} diff --git a/src/web/UBWebController.cpp b/src/web/UBWebController.cpp index 463354ef..26ddd181 100644 --- a/src/web/UBWebController.cpp +++ b/src/web/UBWebController.cpp @@ -32,7 +32,7 @@ #include "gui/UBScreenMirror.h" #include "gui/UBMainWindow.h" #include "gui/UBWebToolsPalette.h" -//#include "gui/UBKeyboardPalette.h" +#include "gui/UBKeyboardPalette.h" #include "core/UBSettings.h" #include "core/UBSetting.h" @@ -46,6 +46,7 @@ #include "domain/UBGraphicsScene.h" #include "desktop/UBCustomCaptureWindow.h" +#include "board/UBBoardPaletteManager.h" UBWebController::UBWebController(UBMainWindow* mainWindow) @@ -393,8 +394,9 @@ void UBWebController::setupPalettes() // (*mKeyboardCurrentPalette) = UBKeyboardPalette::create(*mCurrentWebBrowser); #ifndef Q_WS_WIN - if (*mKeyboardCurrentPalette) - connect(*mKeyboardCurrentPalette, SIGNAL(closed()), *mKeyboardCurrentPalette, SLOT(onDeactivated())); + if (UBPlatformUtils::hasVirtualKeyboard() && UBApplication::boardController->paletteManager()->mKeyboardPalette) + connect(UBApplication::boardController->paletteManager()->mKeyboardPalette, SIGNAL(closed()), + UBApplication::boardController->paletteManager()->mKeyboardPalette, SLOT(onDeactivated())); #endif connect(mMainWindow->actionWebTrapFlash, SIGNAL(triggered()), this, SLOT(trapFlash())); From 2f34f5e5ff775e2d0184dd2ee5183fd10645fd29 Mon Sep 17 00:00:00 2001 From: Ivan Ilin Date: Mon, 31 Oct 2011 11:27:15 +0200 Subject: [PATCH 09/12] commit berore new branch created --- src/adaptors/UBCFFSubsetAdaptor.cpp | 15 ++++++- src/adaptors/UBCFFSubsetAdaptor.h | 4 +- src/domain/UBGraphicsProxyWidget.h | 2 +- src/web/UBTrapFlashController.cpp | 70 ++++++++++++++--------------- 4 files changed, 53 insertions(+), 38 deletions(-) diff --git a/src/adaptors/UBCFFSubsetAdaptor.cpp b/src/adaptors/UBCFFSubsetAdaptor.cpp index 572486d7..2661f667 100644 --- a/src/adaptors/UBCFFSubsetAdaptor.cpp +++ b/src/adaptors/UBCFFSubsetAdaptor.cpp @@ -240,6 +240,7 @@ UBCFFSubsetAdaptor::UBCFFSubsetReader::UBCFFSubsetReader(UBDocumentProxy *proxy, // QTextStream out(&tfile); // out << content; // tfile.close(); + qDebug() << "tmp path is" << pwdContent; } bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parse() @@ -798,6 +799,8 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgImage(const QDomElement &ele if (!QFile::exists(imagePath)) { qDebug() << "can't load file" << pwdContent + "/" + itemRefPath << "maybe file corrupted"; return false; + } else { + qDebug() << "size of file" << itemRefPath << QFileInfo(itemRefPath).size(); } pix.load(imagePath); if (pix.isNull()) { @@ -814,7 +817,8 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgImage(const QDomElement &ele hastransform = true; } // repositionSvgItem(svgItem, rx * 2 + 10, ry * 2 + 10, cx - rx - 5, cy - ry -5, hastransform, transform); -repositionPixmapItem(pixItem, width, height, x, y, hastransform, transform); + repositionPixmapItem(pixItem, width, height, x, y, hastransform, transform); +// hashSceneItem(element, pixItem->); return true; } @@ -848,6 +852,14 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseIwbGroup(QDomNode *group) return true; } +//void UBCFFSubsetAdaptor::UBCFFSubsetReader::hashSceneItem(QDomNode &element, UBGraphicsItemDelegate *item) +//{ +//// adding element pointer to hash to refer if needed +// QString key = element.attribute(aId); +// if (!key.isNull()) +// persistedItems.insert(key, item); +//} + bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgElement(const QDomElement &parent) { QString tagName = parent.tagName(); @@ -856,6 +868,7 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgElement(const QDomElement &p return false; } + if (tagName == tRect && !parseSvgRect(parent)) return false; else if (tagName == tEllipse && !parseSvgEllipse(parent)) return false; else if (tagName == tPolygon && !parseSvgPolygon(parent)) return false; diff --git a/src/adaptors/UBCFFSubsetAdaptor.h b/src/adaptors/UBCFFSubsetAdaptor.h index 78d953ee..dcddefdd 100644 --- a/src/adaptors/UBCFFSubsetAdaptor.h +++ b/src/adaptors/UBCFFSubsetAdaptor.h @@ -27,6 +27,7 @@ class UBGraphicsScene; class QSvgGenerator; class UBGraphicsSvgItem; class UBGraphicsPixmapItem; +class UBGraphicsItemDelegate; class QTransform; class QPainter; @@ -86,6 +87,7 @@ private: QDomDocument mDOMdoc; QDomNode mCurrentDOMElement; QHash iwbExtProperties; + QHash persistedItems; bool hashElements(); void addExtentionsToHash(QDomElement *parent, QDomElement *topGroup); @@ -107,7 +109,7 @@ private: inline bool parseSvgImage(const QDomElement &element); // inline bool parseSvgTSpan(const QDomElement) bool parseIwbGroup(QDomNode *element); - + inline void hashSceneItem(QDomNode *element, UBGraphicsItemDelegate *item); // to kill void parseTextAttributes(const QDomElement &element, qreal &fontSize, QColor &fontColor, diff --git a/src/domain/UBGraphicsProxyWidget.h b/src/domain/UBGraphicsProxyWidget.h index a7dc5de7..adf0737f 100644 --- a/src/domain/UBGraphicsProxyWidget.h +++ b/src/domain/UBGraphicsProxyWidget.h @@ -41,7 +41,7 @@ class UBGraphicsProxyWidget: public QGraphicsProxyWidget, public UBItem, public virtual void remove(); - UBGraphicsItemDelegate* delegate (){ return mDelegate;}; + UBGraphicsItemDelegate* delegate (){ return mDelegate;} protected: diff --git a/src/web/UBTrapFlashController.cpp b/src/web/UBTrapFlashController.cpp index f88136af..bd2c4c06 100644 --- a/src/web/UBTrapFlashController.cpp +++ b/src/web/UBTrapFlashController.cpp @@ -73,49 +73,49 @@ void UBTrapFlashController::showTrapFlash() , viewHeight); connect(mTrapFlashUi->flashCombobox, SIGNAL(currentIndexChanged(int)), this, SLOT(selectFlash(int))); - connect(mTrapFlashUi->widgetNameLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(text_Changed(const QString &))); - connect(mTrapFlashUi->widgetNameLineEdit, SIGNAL(textEdited(const QString &)), this, SLOT(text_Edited(const QString &))); + connect(mTrapFlashUi->widgetNameLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(text_Changed(const QString &))); + connect(mTrapFlashUi->widgetNameLineEdit, SIGNAL(textEdited(const QString &)), this, SLOT(text_Edited(const QString &))); connect(mTrapFlashUi->createWidgetButton, SIGNAL(clicked(bool)), this, SLOT(createWidget())); } mTrapFlashDialog->show(); } -void UBTrapFlashController::text_Changed(const QString &newText) -{ - QString new_text = newText; - -#ifdef Q_WS_WIN // Defined on Windows. - QString illegalCharList(" < > : \" / \\ | ? * "); - QRegExp regExp("[<>:\"/\\\\|?*]"); -#endif - -#ifdef Q_WS_QWS // Defined on Qt for Embedded Linux. - QString illegalCharList(" < > : \" / \\ | ? * "); - QRegExp regExp("[<>:\"/\\\\|?*]"); -#endif - -#ifdef Q_WS_MAC // Defined on Mac OS X. - QString illegalCharList(" < > : \" / \\ | ? * "); - QRegExp regExp("[<>:\"/\\\\|?*]"); -#endif - -#ifdef Q_WS_X11 // Defined on X11. - QString illegalCharList(" < > : \" / \\ | ? * "); - QRegExp regExp("[<>:\"/\\\\|?*]"); -#endif - - if(new_text.indexOf(regExp) > -1) - { - new_text.remove(regExp); - mTrapFlashUi->widgetNameLineEdit->setText(new_text); - QToolTip::showText(mTrapFlashUi->widgetNameLineEdit->mapToGlobal(QPoint()), "Application name can`t contain any of the following characters:\r\n"+illegalCharList); - } +void UBTrapFlashController::text_Changed(const QString &newText) +{ + QString new_text = newText; + +#ifdef Q_WS_WIN // Defined on Windows. + QString illegalCharList(" < > : \" / \\ | ? * "); + QRegExp regExp("[<>:\"/\\\\|?*]"); +#endif + +#ifdef Q_WS_QWS // Defined on Qt for Embedded Linux. + QString illegalCharList(" < > : \" / \\ | ? * "); + QRegExp regExp("[<>:\"/\\\\|?*]"); +#endif + +#ifdef Q_WS_MAC // Defined on Mac OS X. + QString illegalCharList(" < > : \" / \\ | ? * "); + QRegExp regExp("[<>:\"/\\\\|?*]"); +#endif + +#ifdef Q_WS_X11 // Defined on X11. + QString illegalCharList(" < > : \" / \\ | ? * "); + QRegExp regExp("[<>:\"/\\\\|?*]"); +#endif + + if(new_text.indexOf(regExp) > -1) + { + new_text.remove(regExp); + mTrapFlashUi->widgetNameLineEdit->setText(new_text); + QToolTip::showText(mTrapFlashUi->widgetNameLineEdit->mapToGlobal(QPoint()), "Application name can`t contain any of the following characters:\r\n"+illegalCharList); + } } -void UBTrapFlashController::text_Edited(const QString &newText) -{ - +void UBTrapFlashController::text_Edited(const QString &newText) +{ + } void UBTrapFlashController::hideTrapFlash() From 23a1b8b47821ff2c7c9e93ba39dc36b1c05ccbdf Mon Sep 17 00:00:00 2001 From: Ivan Ilin Date: Mon, 31 Oct 2011 17:31:14 +0200 Subject: [PATCH 10/12] Sankore 284 fixed --- .../npapi-wrapper.application.x-shockwave-flash.swf.htm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/resources/etc/npapi-wrapper.application.x-shockwave-flash.swf.htm b/resources/etc/npapi-wrapper.application.x-shockwave-flash.swf.htm index a59f0462..7d99bf8c 100644 --- a/resources/etc/npapi-wrapper.application.x-shockwave-flash.swf.htm +++ b/resources/etc/npapi-wrapper.application.x-shockwave-flash.swf.htm @@ -7,6 +7,15 @@ html, body, #content { height:100%; } body { margin:0; padding:0; overflow:hidden; } +
From 5af55898e5ecf3956fc9fcfa65acde408f276bd4 Mon Sep 17 00:00:00 2001 From: Claudio Valerio Date: Tue, 1 Nov 2011 10:00:16 +0100 Subject: [PATCH 11/12] fixed after merge issue --- src/board/UBBoardPaletteManager.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp index 919d3c7a..1fca96f5 100644 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -68,7 +68,6 @@ UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardControll , mZoomPalette(0) , mLeftPalette(NULL) , mRightPalette(NULL) - , mDesktopRightPalette(NULL) , mBackgroundsPalette(0) , mToolsPalette(0) , mAddItemPalette(0) From 6302664ba6bbd46538eacb512b9ed32336bfb024 Mon Sep 17 00:00:00 2001 From: Ivan Ilin Date: Tue, 1 Nov 2011 11:47:39 +0200 Subject: [PATCH 12/12] extra mrightpallette deleted --- src/board/UBBoardPaletteManager.cpp | 2 -- src/domain/UBGraphicsWidgetItemDelegate.cpp | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/board/UBBoardPaletteManager.cpp b/src/board/UBBoardPaletteManager.cpp index 919d3c7a..314cfd39 100644 --- a/src/board/UBBoardPaletteManager.cpp +++ b/src/board/UBBoardPaletteManager.cpp @@ -68,7 +68,6 @@ UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardControll , mZoomPalette(0) , mLeftPalette(NULL) , mRightPalette(NULL) - , mDesktopRightPalette(NULL) , mBackgroundsPalette(0) , mToolsPalette(0) , mAddItemPalette(0) @@ -81,7 +80,6 @@ UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardControll , mpPageNavigWidget(NULL) , mpLibWidget(NULL) , mpCachePropWidget(NULL) -// , mDesktopRightPalette(NULL) , mpTeacherBarWidget(NULL) , mpDesktopLibWidget(NULL) { diff --git a/src/domain/UBGraphicsWidgetItemDelegate.cpp b/src/domain/UBGraphicsWidgetItemDelegate.cpp index 8b45eefa..a5f45d3a 100644 --- a/src/domain/UBGraphicsWidgetItemDelegate.cpp +++ b/src/domain/UBGraphicsWidgetItemDelegate.cpp @@ -17,8 +17,6 @@ #include #include "UBGraphicsWidgetItemDelegate.h" - - #include "UBGraphicsScene.h" #include "core/UBApplication.h"