diff options
Diffstat (limited to 'kivio/kiviopart/kiviosdk/kivio_shape.cpp')
-rw-r--r-- | kivio/kiviopart/kiviosdk/kivio_shape.cpp | 178 |
1 files changed, 89 insertions, 89 deletions
diff --git a/kivio/kiviopart/kiviosdk/kivio_shape.cpp b/kivio/kiviopart/kiviosdk/kivio_shape.cpp index dad8459a..302c6547 100644 --- a/kivio/kiviopart/kiviosdk/kivio_shape.cpp +++ b/kivio/kiviopart/kiviosdk/kivio_shape.cpp @@ -44,7 +44,7 @@ KivioShape::KivioShape() */ KivioShape::KivioShape( const KivioShape &source ) { - source.m_tqshapeData.copyInto( &m_tqshapeData ); + source.m_shapeData.copyInto( &m_shapeData ); } @@ -68,7 +68,7 @@ void KivioShape::copyInto( KivioShape *pTarget ) const if( !pTarget ) return; - m_tqshapeData.copyInto( &(pTarget->m_tqshapeData) ); + m_shapeData.copyInto( &(pTarget->m_shapeData) ); } @@ -84,13 +84,13 @@ bool KivioShape::loadXML( const TQDomElement &e ) TQDomNode node = e.firstChild(); TQString name = XmlReadString( e, "name", "" ); - m_tqshapeData.setName( name ); - m_tqshapeData.setShapeType( (KivioShapeData::KivioShapeType)XmlReadInt( e, "tqshapeType", -1 )); + m_shapeData.setName( name ); + m_shapeData.setShapeType( (KivioShapeData::KivioShapeType)XmlReadInt( e, "shapeType", -1 )); - if( m_tqshapeData.name().isEmpty() || - m_tqshapeData.tqshapeType() == -1 ) + if( m_shapeData.name().isEmpty() || + m_shapeData.shapeType() == -1 ) { - kdWarning(43000) << "-LOAD KivioShape::loadXML() - Unknown tqshape or bad name read. Shape load aborted." << endl; + kdWarning(43000) << "-LOAD KivioShape::loadXML() - Unknown shape or bad name read. Shape load aborted." << endl; return false; } @@ -101,7 +101,7 @@ bool KivioShape::loadXML( const TQDomElement &e ) if( nodeName == "KivioShapeData" ) { - m_tqshapeData.loadXML( ele ); + m_shapeData.loadXML( ele ); } node = node.nextSibling(); @@ -120,17 +120,17 @@ TQDomElement KivioShape::saveXML( TQDomDocument &doc ) { TQDomElement e = doc.createElement("KivioShape"); - XmlWriteString( e, "name", m_tqshapeData.m_name ); - XmlWriteInt( e, "tqshapeType", m_tqshapeData.m_tqshapeType ); + XmlWriteString( e, "name", m_shapeData.m_name ); + XmlWriteInt( e, "shapeType", m_shapeData.m_shapeType ); - e.appendChild( m_tqshapeData.saveXML( doc ) ); + e.appendChild( m_shapeData.saveXML( doc ) ); return e; } /** - * Loads a tqshape of type arc + * Loads a shape of type arc * * @param e The element to load from * @returns A newly allocated KivioShape, or NULL on error. @@ -144,7 +144,7 @@ KivioShape *KivioShape::loadShapeArc( const TQDomElement & ) /** - * Loads a tqshape of type closed-path. + * Loads a shape of type closed-path. * * @param e The element to load from. * @returns A newly allocated KivioShape, or NULL on error. @@ -157,12 +157,12 @@ KivioShape *KivioShape::loadShapeClosedPath( const TQDomElement &e ) TQString nodeName; - // Create the new tqshape to load into + // Create the new shape to load into pShape = new KivioShape(); // Load the type, name, and lineWidth properties - pShape->m_tqshapeData.m_tqshapeType = KivioShapeData::kstClosedPath; - pShape->m_tqshapeData.m_name = XmlReadString( e, "name", "" ); + pShape->m_shapeData.m_shapeType = KivioShapeData::kstClosedPath; + pShape->m_shapeData.m_name = XmlReadString( e, "name", "" ); // Iterate through the nodes loading the various items node = e.firstChild(); @@ -176,16 +176,16 @@ KivioShape *KivioShape::loadShapeClosedPath( const TQDomElement &e ) // Allocate a new point, load it, and store it in the list pPoint = new KivioPoint(0.0f, 0.0f, KivioPoint::kptBezier); pPoint->loadXML( node.toElement() ); - pShape->m_tqshapeData.m_pOriginalPointList->append( pPoint ); + pShape->m_shapeData.m_pOriginalPointList->append( pPoint ); pPoint = NULL; } else if( nodeName == "KivioFillStyle" ) { - pShape->m_tqshapeData.m_pFillStyle->loadXML( node.toElement() ); + pShape->m_shapeData.m_pFillStyle->loadXML( node.toElement() ); } else if( nodeName == "KivioLineStyle" ) { - pShape->m_tqshapeData.m_pLineStyle->loadXML( node.toElement() ); + pShape->m_shapeData.m_pLineStyle->loadXML( node.toElement() ); } node = node.nextSibling(); @@ -196,7 +196,7 @@ KivioShape *KivioShape::loadShapeClosedPath( const TQDomElement &e ) /** - * Loads a tqshape of type bezier + * Loads a shape of type bezier * * @param e The element to load from. * @returns A newly allocated KivioShape, or NULL on error. @@ -209,12 +209,12 @@ KivioShape *KivioShape::loadShapeBezier( const TQDomElement &e ) TQString nodeName; - // Create the new tqshape to load into + // Create the new shape to load into pShape = new KivioShape(); // Load the type, name, and lineWidth properties - pShape->m_tqshapeData.m_tqshapeType = KivioShapeData::kstBezier; - pShape->m_tqshapeData.m_name = XmlReadString( e, "name", "" ); + pShape->m_shapeData.m_shapeType = KivioShapeData::kstBezier; + pShape->m_shapeData.m_name = XmlReadString( e, "name", "" ); // Iterate through the nodes loading the various items node = e.firstChild(); @@ -230,25 +230,25 @@ KivioShape *KivioShape::loadShapeBezier( const TQDomElement &e ) pPoint->loadXML( node.toElement() ); if( pPoint->pointType() != KivioPoint::kptBezier ) { - kdDebug(43000) << "KivioShape::loadShapeBezier() - Non-bezier point found. Aborting tqshape." << endl; + kdDebug(43000) << "KivioShape::loadShapeBezier() - Non-bezier point found. Aborting shape." << endl; delete pPoint; delete pShape; return NULL; } - pShape->m_tqshapeData.m_pOriginalPointList->append( pPoint ); + pShape->m_shapeData.m_pOriginalPointList->append( pPoint ); pPoint = NULL; } else if( nodeName == "KivioLineStyle" ) { - pShape->m_tqshapeData.m_pLineStyle->loadXML( node.toElement() ); + pShape->m_shapeData.m_pLineStyle->loadXML( node.toElement() ); } node = node.nextSibling(); } - if( pShape->m_tqshapeData.m_pOriginalPointList->count() != 4 ) + if( pShape->m_shapeData.m_pOriginalPointList->count() != 4 ) { - kdDebug(43000) << "KivioShape::loadShapeBezier() - Wrong number of points loaded, should be 4, tqshape aborted" << endl; + kdDebug(43000) << "KivioShape::loadShapeBezier() - Wrong number of points loaded, should be 4, shape aborted" << endl; delete pShape; return NULL; } @@ -258,7 +258,7 @@ KivioShape *KivioShape::loadShapeBezier( const TQDomElement &e ) /** - * Loads a tqshape of type ellipse. + * Loads a shape of type ellipse. * * @param e The element to load from. * @returns A newly allocated KivioShape, or NULL on error. @@ -270,15 +270,15 @@ KivioShape *KivioShape::loadShapeEllipse( const TQDomElement &e ) TQString nodeName; - // Create the new tqshape to load into + // Create the new shape to load into pShape = new KivioShape(); // Load the type, name, and lineWidth properties - pShape->m_tqshapeData.m_tqshapeType = KivioShapeData::kstEllipse; - pShape->m_tqshapeData.m_name = XmlReadString( e, "name", "" ); + pShape->m_shapeData.m_shapeType = KivioShapeData::kstEllipse; + pShape->m_shapeData.m_name = XmlReadString( e, "name", "" ); - pShape->m_tqshapeData.m_position.set( XmlReadFloat( e, "x", 0.0f ), XmlReadFloat( e, "y", 0.0f ) ); - pShape->m_tqshapeData.m_dimensions.set( XmlReadFloat( e, "w", 0.0f ), XmlReadFloat( e, "h", 0.0f ) ); + pShape->m_shapeData.m_position.set( XmlReadFloat( e, "x", 0.0f ), XmlReadFloat( e, "y", 0.0f ) ); + pShape->m_shapeData.m_dimensions.set( XmlReadFloat( e, "w", 0.0f ), XmlReadFloat( e, "h", 0.0f ) ); // Iterate through the nodes loading the various items node = e.firstChild(); @@ -288,11 +288,11 @@ KivioShape *KivioShape::loadShapeEllipse( const TQDomElement &e ) if( nodeName == "KivioFillStyle" ) { - pShape->m_tqshapeData.m_pFillStyle->loadXML( node.toElement() ); + pShape->m_shapeData.m_pFillStyle->loadXML( node.toElement() ); } else if( nodeName == "KivioLineStyle" ) { - pShape->m_tqshapeData.m_pLineStyle->loadXML( node.toElement() ); + pShape->m_shapeData.m_pLineStyle->loadXML( node.toElement() ); } node = node.nextSibling(); @@ -303,7 +303,7 @@ KivioShape *KivioShape::loadShapeEllipse( const TQDomElement &e ) /** - * Loads a tqshape of type line-array. + * Loads a shape of type line-array. * * @param e The element to load from. * @returns A newly allocated KivioShape, or NULL on error. @@ -317,12 +317,12 @@ KivioShape *KivioShape::loadShapeLineArray( const TQDomElement &e ) TQDomElement lineElement; - // Create the new tqshape to load into + // Create the new shape to load into pShape = new KivioShape(); // Load the type, name, and lineWidth properties - pShape->m_tqshapeData.m_tqshapeType = KivioShapeData::kstLineArray; - pShape->m_tqshapeData.m_name = XmlReadString( e, "name", "" ); + pShape->m_shapeData.m_shapeType = KivioShapeData::kstLineArray; + pShape->m_shapeData.m_name = XmlReadString( e, "name", "" ); // Iterate through the nodes loading the various items node = e.firstChild(); @@ -337,14 +337,14 @@ KivioShape *KivioShape::loadShapeLineArray( const TQDomElement &e ) // Allocate a new point, load it, and store it in the list pPoint = new KivioPoint( XmlReadFloat( lineElement, "x1", 0.0f ), XmlReadFloat( lineElement, "y1", 0.0f ) ); - pShape->m_tqshapeData.m_pOriginalPointList->append( pPoint ); + pShape->m_shapeData.m_pOriginalPointList->append( pPoint ); pPoint = new KivioPoint( XmlReadFloat( lineElement, "x2", 0.0f ), XmlReadFloat( lineElement, "y2", 0.0f ) ); - pShape->m_tqshapeData.m_pOriginalPointList->append( pPoint ); + pShape->m_shapeData.m_pOriginalPointList->append( pPoint ); pPoint = NULL; } else if( nodeName == "KivioLineStyle" ) { - pShape->m_tqshapeData.m_pLineStyle->loadXML( node.toElement() ); + pShape->m_shapeData.m_pLineStyle->loadXML( node.toElement() ); } node = node.nextSibling(); @@ -355,7 +355,7 @@ KivioShape *KivioShape::loadShapeLineArray( const TQDomElement &e ) /** - * Loads a tqshape of type open-path. + * Loads a shape of type open-path. * * @param e The element to load from. * @returns A newly allocated KivioShape, or NULL on error. @@ -368,12 +368,12 @@ KivioShape *KivioShape::loadShapeOpenPath( const TQDomElement &e ) TQString nodeName; - // Create the new tqshape to load into + // Create the new shape to load into pShape = new KivioShape(); // Load the type, name, and lineWidth properties - pShape->m_tqshapeData.m_tqshapeType = KivioShapeData::kstOpenPath; - pShape->m_tqshapeData.m_name = XmlReadString( e, "name", "" ); + pShape->m_shapeData.m_shapeType = KivioShapeData::kstOpenPath; + pShape->m_shapeData.m_name = XmlReadString( e, "name", "" ); // Iterate through the nodes loading the various items node = e.firstChild(); @@ -387,12 +387,12 @@ KivioShape *KivioShape::loadShapeOpenPath( const TQDomElement &e ) // Allocate a new point, load it, and store it in the list pPoint = new KivioPoint(0.0f, 0.0f, KivioPoint::kptBezier); pPoint->loadXML( node.toElement() ); - pShape->m_tqshapeData.m_pOriginalPointList->append( pPoint ); + pShape->m_shapeData.m_pOriginalPointList->append( pPoint ); pPoint = NULL; } else if( nodeName == "KivioLineStyle" ) { - pShape->m_tqshapeData.m_pLineStyle->loadXML( node.toElement() ); + pShape->m_shapeData.m_pLineStyle->loadXML( node.toElement() ); } node = node.nextSibling(); @@ -403,7 +403,7 @@ KivioShape *KivioShape::loadShapeOpenPath( const TQDomElement &e ) /** - * Loads a tqshape of type pie. + * Loads a shape of type pie. * * @param e The element to load from. * @returns A newly allocated KivioShape, or NULL on error. @@ -417,7 +417,7 @@ KivioShape *KivioShape::loadShapePie( const TQDomElement & ) /** - * Loads a tqshape of type polygon. + * Loads a shape of type polygon. * * @param e The element to load from. * @returns A newly allocated KivioShape, or NULL on error. @@ -430,12 +430,12 @@ KivioShape *KivioShape::loadShapePolygon( const TQDomElement &e ) TQString nodeName; - // Create the new tqshape to load into + // Create the new shape to load into pShape = new KivioShape(); // Load the type, name, and lineWidth properties - pShape->m_tqshapeData.m_tqshapeType = KivioShapeData::kstPolygon; - pShape->m_tqshapeData.m_name = XmlReadString( e, "name", "" ); + pShape->m_shapeData.m_shapeType = KivioShapeData::kstPolygon; + pShape->m_shapeData.m_name = XmlReadString( e, "name", "" ); // Iterate through the nodes loading the various items node = e.firstChild(); @@ -449,16 +449,16 @@ KivioShape *KivioShape::loadShapePolygon( const TQDomElement &e ) // Allocate a new point, load it, and store it in the list pPoint = new KivioPoint(); pPoint->loadXML( node.toElement() ); - pShape->m_tqshapeData.m_pOriginalPointList->append( pPoint ); + pShape->m_shapeData.m_pOriginalPointList->append( pPoint ); pPoint = NULL; } else if( nodeName == "KivioFillStyle" ) { - pShape->m_tqshapeData.m_pFillStyle->loadXML( node.toElement() ); + pShape->m_shapeData.m_pFillStyle->loadXML( node.toElement() ); } else if( nodeName == "KivioLineStyle" ) { - pShape->m_tqshapeData.m_pLineStyle->loadXML( node.toElement() ); + pShape->m_shapeData.m_pLineStyle->loadXML( node.toElement() ); } node = node.nextSibling(); @@ -469,7 +469,7 @@ KivioShape *KivioShape::loadShapePolygon( const TQDomElement &e ) /** - * Loads a tqshape of type polyline. + * Loads a shape of type polyline. * * @param e The element to load from. * @returns A newly allocated KivioShape, or NULL on error. @@ -482,12 +482,12 @@ KivioShape *KivioShape::loadShapePolyline( const TQDomElement &e ) TQString nodeName; - // Create the new tqshape to load into + // Create the new shape to load into pShape = new KivioShape(); // Load the type, name, and lineWidth properties - pShape->m_tqshapeData.m_tqshapeType = KivioShapeData::kstPolyline; - pShape->m_tqshapeData.m_name = XmlReadString( e, "name", "" ); + pShape->m_shapeData.m_shapeType = KivioShapeData::kstPolyline; + pShape->m_shapeData.m_name = XmlReadString( e, "name", "" ); // Iterate through the nodes loading the various items node = e.firstChild(); @@ -501,12 +501,12 @@ KivioShape *KivioShape::loadShapePolyline( const TQDomElement &e ) // Allocate a new point, load it, and store it in the list pPoint = new KivioPoint(); pPoint->loadXML( node.toElement() ); - pShape->m_tqshapeData.m_pOriginalPointList->append( pPoint ); + pShape->m_shapeData.m_pOriginalPointList->append( pPoint ); pPoint = NULL; } else if( nodeName == "KivioLineStyle" ) { - pShape->m_tqshapeData.m_pLineStyle->loadXML( node.toElement() ); + pShape->m_shapeData.m_pLineStyle->loadXML( node.toElement() ); } node = node.nextSibling(); @@ -517,7 +517,7 @@ KivioShape *KivioShape::loadShapePolyline( const TQDomElement &e ) /** - * Loads a tqshape of type rectangle. + * Loads a shape of type rectangle. * * @param e The element to load from. * @returns A newly allocated KivioShape, or NULL on error. @@ -529,15 +529,15 @@ KivioShape *KivioShape::loadShapeRectangle( const TQDomElement &e ) TQString nodeName; - // Create the new tqshape to load into + // Create the new shape to load into pShape = new KivioShape(); // Load the type, name, and lineWidth properties - pShape->m_tqshapeData.m_tqshapeType = KivioShapeData::kstRectangle; - pShape->m_tqshapeData.m_name = XmlReadString( e, "name", "" ); + pShape->m_shapeData.m_shapeType = KivioShapeData::kstRectangle; + pShape->m_shapeData.m_name = XmlReadString( e, "name", "" ); - pShape->m_tqshapeData.m_position.set( XmlReadFloat( e, "x", 0.0f ), XmlReadFloat( e, "y", 0.0f ) ); - pShape->m_tqshapeData.m_dimensions.set( XmlReadFloat( e, "w", 72.0f ), XmlReadFloat( e, "h", 72.0f ) ); + pShape->m_shapeData.m_position.set( XmlReadFloat( e, "x", 0.0f ), XmlReadFloat( e, "y", 0.0f ) ); + pShape->m_shapeData.m_dimensions.set( XmlReadFloat( e, "w", 72.0f ), XmlReadFloat( e, "h", 72.0f ) ); // Iterate through the nodes loading the various items node = e.firstChild(); @@ -548,11 +548,11 @@ KivioShape *KivioShape::loadShapeRectangle( const TQDomElement &e ) // Read the fill style if( nodeName == "KivioFillStyle" ) { - pShape->m_tqshapeData.m_pFillStyle->loadXML( node.toElement() ); + pShape->m_shapeData.m_pFillStyle->loadXML( node.toElement() ); } else if( nodeName == "KivioLineStyle" ) { - pShape->m_tqshapeData.m_pLineStyle->loadXML( node.toElement() ); + pShape->m_shapeData.m_pLineStyle->loadXML( node.toElement() ); } node = node.nextSibling(); @@ -564,7 +564,7 @@ KivioShape *KivioShape::loadShapeRectangle( const TQDomElement &e ) /** - * Loads a tqshape of type round rectangle. + * Loads a shape of type round rectangle. * * @param e The element to load from. * @returns A newly allocated KivioShape, or NULL on error. @@ -577,20 +577,20 @@ KivioShape *KivioShape::loadShapeRoundRectangle( const TQDomElement &e ) TQString nodeName; - // Create the new tqshape to load into + // Create the new shape to load into pShape = new KivioShape(); // Load the type, name, and lineWidth properties - pShape->m_tqshapeData.m_tqshapeType = KivioShapeData::kstRoundRectangle; - pShape->m_tqshapeData.m_name = XmlReadString( e, "name", "" ); + pShape->m_shapeData.m_shapeType = KivioShapeData::kstRoundRectangle; + pShape->m_shapeData.m_name = XmlReadString( e, "name", "" ); - pShape->m_tqshapeData.m_position.set( XmlReadFloat( e, "x", 0.0f ), XmlReadFloat( e, "y", 0.0f ) ); - pShape->m_tqshapeData.m_dimensions.set( XmlReadFloat( e, "w", 72.0f ), XmlReadFloat( e, "h", 72.0f ) ); + pShape->m_shapeData.m_position.set( XmlReadFloat( e, "x", 0.0f ), XmlReadFloat( e, "y", 0.0f ) ); + pShape->m_shapeData.m_dimensions.set( XmlReadFloat( e, "w", 72.0f ), XmlReadFloat( e, "h", 72.0f ) ); // Read and store the radii of the curves pPoint = new KivioPoint(0.0f, 0.0f); pPoint->set( XmlReadFloat( e, "r1", 1.0f ), XmlReadFloat( e, "r2", 1.0f ) ); - pShape->m_tqshapeData.m_pOriginalPointList->append( pPoint ); + pShape->m_shapeData.m_pOriginalPointList->append( pPoint ); // Iterate through the nodes loading the various items node = e.firstChild(); @@ -601,11 +601,11 @@ KivioShape *KivioShape::loadShapeRoundRectangle( const TQDomElement &e ) // Read the fill style if( nodeName == "KivioFillStyle" ) { - pShape->m_tqshapeData.m_pFillStyle->loadXML( node.toElement() ); + pShape->m_shapeData.m_pFillStyle->loadXML( node.toElement() ); } else if( nodeName == "KivioLineStyle" ) { - pShape->m_tqshapeData.m_pLineStyle->loadXML( node.toElement() ); + pShape->m_shapeData.m_pLineStyle->loadXML( node.toElement() ); } node = node.nextSibling(); @@ -616,7 +616,7 @@ KivioShape *KivioShape::loadShapeRoundRectangle( const TQDomElement &e ) /** - * Loads a tqshape of type textbox. + * Loads a shape of type textbox. * * @param e The element to load from. * @returns A newly allocated KivioShape, or NULL on error. @@ -630,17 +630,17 @@ KivioShape *KivioShape::loadShapeTextBox( const TQDomElement &e ) TQString name; - // Create the new tqshape to load into + // Create the new shape to load into pShape = new KivioShape(); // Load the type and name - pShape->m_tqshapeData.setShapeType(KivioShapeData::kstTextBox); - pShape->m_tqshapeData.setName( XmlReadString( e, "name", "" ) ); - pShape->m_tqshapeData.setTextColor(XmlReadColor(e,"color",TQColor(0,0,0))); + pShape->m_shapeData.setShapeType(KivioShapeData::kstTextBox); + pShape->m_shapeData.setName( XmlReadString( e, "name", "" ) ); + pShape->m_shapeData.setTextColor(XmlReadColor(e,"color",TQColor(0,0,0))); - pShape->m_tqshapeData.m_position.set( + pShape->m_shapeData.m_position.set( XmlReadFloat( e, "x", 0.0f ), XmlReadFloat( e, "y", 0.0f ) ); - pShape->m_tqshapeData.m_dimensions.set( + pShape->m_shapeData.m_dimensions.set( XmlReadFloat( e, "w", 72.0f ), XmlReadFloat( e, "h", 72.0f ) ); // Now look for the KivioTextStyle @@ -651,13 +651,13 @@ KivioShape *KivioShape::loadShapeTextBox( const TQDomElement &e ) if( nodeName == "KivioTextStyle" ) { ts.loadXML( node.toElement() ); - pShape->m_tqshapeData.setTextStyle( &ts ); + pShape->m_shapeData.setTextStyle( &ts ); } node = node.nextSibling(); } // TQString text = XmlReadString( e, "text", "" ); -// pShape->m_tqshapeData.setText( text ); +// pShape->m_shapeData.setText( text ); return pShape; |