Rename Qt Quick-specific classes to QQuick*
[profile/ivi/qtdeclarative.git] / src / declarative / items / qquicktextnode.cpp
similarity index 94%
rename from src/declarative/items/qsgtextnode.cpp
rename to src/declarative/items/qquicktextnode.cpp
index f712bd7..fab592f 100644 (file)
@@ -39,7 +39,7 @@
 **
 ****************************************************************************/
 
-#include "qsgtextnode_p.h"
+#include "qquicktextnode_p.h"
 #include "qsgsimplerectnode.h"
 #include <private/qsgadaptationlayer_p.h>
 #include <private/qsgdistancefieldglyphcache_p.h>
@@ -67,9 +67,9 @@
 QT_BEGIN_NAMESPACE
 
 /*!
-  Creates an empty QSGTextNode
+  Creates an empty QQuickTextNode
 */
-QSGTextNode::QSGTextNode(QSGContext *context)
+QQuickTextNode::QQuickTextNode(QSGContext *context)
     : m_context(context), m_cursorNode(0)
 {
 #if defined(QML_RUNTIME_TESTING)
@@ -77,13 +77,13 @@ QSGTextNode::QSGTextNode(QSGContext *context)
 #endif
 }
 
-QSGTextNode::~QSGTextNode()
+QQuickTextNode::~QQuickTextNode()
 {
     qDeleteAll(m_textures);
 }
 
 #if 0
-void QSGTextNode::setColor(const QColor &color)
+void QQuickTextNode::setColor(const QColor &color)
 {
     if (m_usePixmapCache) {
         setUpdateFlag(UpdateNodes);
@@ -103,9 +103,9 @@ void QSGTextNode::setColor(const QColor &color)
     m_color = color;
 }
 
-void QSGTextNode::setStyleColor(const QColor &styleColor)
+void QQuickTextNode::setStyleColor(const QColor &styleColor)
 {
-    if (m_textStyle != QSGTextNode::NormalTextStyle) {
+    if (m_textStyle != QQuickTextNode::NormalTextStyle) {
         if (m_usePixmapCache) {
             setUpdateFlag(UpdateNodes);
         } else {
@@ -126,8 +126,8 @@ void QSGTextNode::setStyleColor(const QColor &styleColor)
 }
 #endif
 
-QSGGlyphNode *QSGTextNode::addGlyphs(const QPointF &position, const QGlyphRun &glyphs, const QColor &color,
-                                     QSGText::TextStyle style, const QColor &styleColor,
+QSGGlyphNode *QQuickTextNode::addGlyphs(const QPointF &position, const QGlyphRun &glyphs, const QColor &color,
+                                     QQuickText::TextStyle style, const QColor &styleColor,
                                      QSGNode *parentNode)
 {
     QSGGlyphNode *node = m_context->createGlyphNode();
@@ -153,7 +153,7 @@ QSGGlyphNode *QSGTextNode::addGlyphs(const QPointF &position, const QGlyphRun &g
     return node;
 }
 
-void QSGTextNode::setCursor(const QRectF &rect, const QColor &color)
+void QQuickTextNode::setCursor(const QRectF &rect, const QColor &color)
 {
     if (m_cursorNode != 0)
         delete m_cursorNode;
@@ -173,7 +173,7 @@ namespace {
         BinaryTreeNode()
             : selectionState(Unselected)
             , clipNode(0)
-            , decorations(QSGTextNode::NoDecoration)
+            , decorations(QQuickTextNode::NoDecoration)
             , ascent(0.0)
             , leftChildIndex(-1)
             , rightChildIndex(-1)
@@ -185,7 +185,7 @@ namespace {
             : boundingRect(brect)
             , selectionState(selState)
             , clipNode(0)
-            , decorations(QSGTextNode::NoDecoration)
+            , decorations(QQuickTextNode::NoDecoration)
             , image(i)
             , ascent(a)
             , leftChildIndex(-1)
@@ -194,7 +194,7 @@ namespace {
         }
 
         BinaryTreeNode(const QGlyphRun &g, SelectionState selState, const QRectF &brect,
-                       const QSGTextNode::Decorations &decs, const QColor &c, const QColor &bc,
+                       const QQuickTextNode::Decorations &decs, const QColor &c, const QColor &bc,
                        const QPointF &pos, qreal a)
             : glyphRun(g)
             , boundingRect(brect)
@@ -214,7 +214,7 @@ namespace {
         QRectF boundingRect;
         SelectionState selectionState;
         QSGClipNode *clipNode;
-        QSGTextNode::Decorations decorations;
+        QQuickTextNode::Decorations decorations;
         QColor color;
         QColor backgroundColor;
         QPointF position;
@@ -246,11 +246,11 @@ namespace {
             if (qFuzzyIsNull(searchRect.width()) || qFuzzyIsNull(searchRect.height()))
                 return;
 
-            QSGTextNode::Decorations decorations = QSGTextNode::NoDecoration;
-            decorations |= (glyphRun.underline() ? QSGTextNode::Underline : QSGTextNode::NoDecoration);
-            decorations |= (glyphRun.overline()  ? QSGTextNode::Overline  : QSGTextNode::NoDecoration);
-            decorations |= (glyphRun.strikeOut() ? QSGTextNode::StrikeOut : QSGTextNode::NoDecoration);
-            decorations |= (backgroundColor.isValid() ? QSGTextNode::Background : QSGTextNode::NoDecoration);
+            QQuickTextNode::Decorations decorations = QQuickTextNode::NoDecoration;
+            decorations |= (glyphRun.underline() ? QQuickTextNode::Underline : QQuickTextNode::NoDecoration);
+            decorations |= (glyphRun.overline()  ? QQuickTextNode::Overline  : QQuickTextNode::NoDecoration);
+            decorations |= (glyphRun.strikeOut() ? QQuickTextNode::StrikeOut : QQuickTextNode::NoDecoration);
+            decorations |= (backgroundColor.isValid() ? QQuickTextNode::Background : QQuickTextNode::NoDecoration);
 
             qreal ascent = glyphRun.rawFont().ascent();
             insert(binaryTree, BinaryTreeNode(glyphRun, selectionState, searchRect, decorations,
@@ -340,8 +340,8 @@ namespace {
                                 int start, int end,
                                 int selectionStart, int selectionEnd);
 
-        void addToSceneGraph(QSGTextNode *parent,
-                             QSGText::TextStyle style = QSGText::Normal,
+        void addToSceneGraph(QQuickTextNode *parent,
+                             QQuickText::TextStyle style = QQuickText::Normal,
                              const QColor &styleColor = QColor());
 
         void setSelectionColor(const QColor &selectionColor)
@@ -441,7 +441,7 @@ namespace {
         BinaryTreeNode::SelectionState currentSelectionState = BinaryTreeNode::Unselected;
         QRectF currentRect;
 
-        QSGTextNode::Decorations currentDecorations = QSGTextNode::NoDecoration;
+        QQuickTextNode::Decorations currentDecorations = QQuickTextNode::NoDecoration;
         qreal underlineOffset = 0.0;
         qreal underlineThickness = 0.0;
 
@@ -475,7 +475,7 @@ namespace {
                     currentSelectionState = node->selectionState;
 
                 // Update decorations
-                if (currentDecorations != QSGTextNode::NoDecoration) {
+                if (currentDecorations != QQuickTextNode::NoDecoration) {
                     decorationRect.setY(m_position.y() + m_currentLine.y());
                     decorationRect.setHeight(m_currentLine.height());
 
@@ -483,16 +483,16 @@ namespace {
                         decorationRect.setRight(node->boundingRect.left());
 
                     TextDecoration textDecoration(currentSelectionState, decorationRect, lastColor);
-                    if (currentDecorations & QSGTextNode::Underline)
+                    if (currentDecorations & QQuickTextNode::Underline)
                         pendingUnderlines.append(textDecoration);
 
-                    if (currentDecorations & QSGTextNode::Overline)
+                    if (currentDecorations & QQuickTextNode::Overline)
                         pendingOverlines.append(textDecoration);
 
-                    if (currentDecorations & QSGTextNode::StrikeOut)
+                    if (currentDecorations & QQuickTextNode::StrikeOut)
                         pendingStrikeOuts.append(textDecoration);
 
-                    if (currentDecorations & QSGTextNode::Background)
+                    if (currentDecorations & QQuickTextNode::Background)
                         m_backgrounds.append(qMakePair(decorationRect, lastBackgroundColor));
                 }
 
@@ -548,7 +548,7 @@ namespace {
                     // If previous item(s) had underline and current does not, then we add the
                     // pending lines to the lists and likewise for overlines and strikeouts
                     if (!pendingUnderlines.isEmpty()
-                      && !(node->decorations & QSGTextNode::Underline)) {
+                      && !(node->decorations & QQuickTextNode::Underline)) {
                         addTextDecorations(pendingUnderlines, underlineOffset, underlineThickness);
 
                         pendingUnderlines.clear();
@@ -581,19 +581,19 @@ namespace {
 
                     // Merge current values with previous. Prefer greatest thickness
                     QRawFont rawFont = node->glyphRun.rawFont();
-                    if (node->decorations & QSGTextNode::Underline) {
+                    if (node->decorations & QQuickTextNode::Underline) {
                         if (rawFont.lineThickness() > underlineThickness) {
                             underlineThickness = rawFont.lineThickness();
                             underlineOffset = rawFont.underlinePosition();
                         }
                     }
 
-                    if (node->decorations & QSGTextNode::Overline) {
+                    if (node->decorations & QQuickTextNode::Overline) {
                         overlineOffset = -rawFont.ascent();
                         overlineThickness = rawFont.lineThickness();
                     }
 
-                    if (node->decorations & QSGTextNode::StrikeOut) {
+                    if (node->decorations & QQuickTextNode::StrikeOut) {
                         strikeOutThickness = rawFont.lineThickness();
                         strikeOutOffset = rawFont.ascent() / -3.0;
                     }
@@ -869,8 +869,8 @@ namespace {
         }
     }
 
-    void SelectionEngine::addToSceneGraph(QSGTextNode *parentNode,
-                                          QSGText::TextStyle style,
+    void SelectionEngine::addToSceneGraph(QQuickTextNode *parentNode,
+                                          QQuickText::TextStyle style,
                                           const QColor &styleColor)
     {
         if (m_currentLine.isValid())
@@ -971,7 +971,7 @@ namespace {
     }
 }
 
-void QSGTextNode::mergeFormats(QTextLayout *textLayout,
+void QQuickTextNode::mergeFormats(QTextLayout *textLayout,
                                QVarLengthArray<QTextLayout::FormatRange> *mergedFormats)
 {
     Q_ASSERT(mergedFormats != 0);
@@ -1037,7 +1037,7 @@ namespace {
 
 }
 
-void QSGTextNode::addImage(const QRectF &rect, const QImage &image)
+void QQuickTextNode::addImage(const QRectF &rect, const QImage &image)
 {
     QSGImageNode *node = m_context->createImageNode();
     QSGTexture *texture = m_context->createTexture(image);
@@ -1048,9 +1048,9 @@ void QSGTextNode::addImage(const QRectF &rect, const QImage &image)
     node->update();
 }
 
-void QSGTextNode::addTextDocument(const QPointF &, QTextDocument *textDocument,
+void QQuickTextNode::addTextDocument(const QPointF &, QTextDocument *textDocument,
                                   const QColor &textColor,
-                                  QSGText::TextStyle style, const QColor &styleColor,
+                                  QQuickText::TextStyle style, const QColor &styleColor,
                                   const QColor &selectionColor, const QColor &selectedTextColor,
                                   int selectionStart, int selectionEnd)
 {
@@ -1222,8 +1222,8 @@ void QSGTextNode::addTextDocument(const QPointF &, QTextDocument *textDocument,
     engine.addToSceneGraph(this, style, styleColor);
 }
 
-void QSGTextNode::addTextLayout(const QPointF &position, QTextLayout *textLayout, const QColor &color,
-                                QSGText::TextStyle style, const QColor &styleColor,
+void QQuickTextNode::addTextLayout(const QPointF &position, QTextLayout *textLayout, const QColor &color,
+                                QQuickText::TextStyle style, const QColor &styleColor,
                                 const QColor &selectionColor, const QColor &selectedTextColor,
                                 int selectionStart, int selectionEnd)
 {
@@ -1259,7 +1259,7 @@ void QSGTextNode::addTextLayout(const QPointF &position, QTextLayout *textLayout
     engine.addToSceneGraph(this, style, styleColor);
 }
 
-void QSGTextNode::deleteContent()
+void QQuickTextNode::deleteContent()
 {
     while (firstChild() != 0)
         delete firstChild();
@@ -1267,7 +1267,7 @@ void QSGTextNode::deleteContent()
 }
 
 #if 0
-void QSGTextNode::updateNodes()
+void QQuickTextNode::updateNodes()
 {
     return;
     deleteContent();