diff options
Diffstat (limited to 'kivio/kiviopart/kiviosdk/kivio_py_stencil.cpp')
-rw-r--r-- | kivio/kiviopart/kiviosdk/kivio_py_stencil.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/kivio/kiviopart/kiviosdk/kivio_py_stencil.cpp b/kivio/kiviopart/kiviosdk/kivio_py_stencil.cpp index f966dc07..cc8eb0e3 100644 --- a/kivio/kiviopart/kiviosdk/kivio_py_stencil.cpp +++ b/kivio/kiviopart/kiviosdk/kivio_py_stencil.cpp @@ -25,7 +25,7 @@ KivioView *view; #include "kivio_page.h" #include <tqpainter.h> -#include <brush.h> +#include <tqbrush.h> #include <tqcolor.h> #include <kdebug.h> #include <math.h> @@ -63,7 +63,7 @@ KivioPyStencil::KivioPyStencil() vars = Py_BuildValue( "{s:d,s:d,s:d,s:d,s:d,s:d,s:{},s:[],s:[],s:{}}", - "x", m_x, "y", m_y, "w", m_w, "h", m_h, "x2", x2, "y2", y2 , "style","connectors","connector_targets","shapes"); + "x", m_x, "y", m_y, "w", m_w, "h", m_h, "x2", x2, "y2", y2 , "style","connectors","connector_targets","tqshapes"); resizeCode = ""; } @@ -406,45 +406,45 @@ void KivioPyStencil::paint( KivioIntraStencilData *d, bool outlined ) { KoZoomHandler* zoomHandler = d->zoomHandler; - PyObject *shapes = PyDict_Values( PyDict_GetItemString( vars, "shapes" ) ); + PyObject *tqshapes = PyDict_Values( PyDict_GetItemString( vars, "tqshapes" ) ); - if ( !shapes ) { + if ( !tqshapes ) { return; } - int size = PyList_Size( shapes ); + int size = PyList_Size( tqshapes ); for ( int i=0; i<size; i++ ) { - PyObject *shape = PyList_GetItem( shapes, i ); - if ( !PyDict_Check(shape) ) + PyObject *tqshape = PyList_GetItem( tqshapes, i ); + if ( !PyDict_Check(tqshape) ) continue; int fill = KivioFillStyle::kcsNone; - // if style dosn't defined for shape, applay default for stencil + // if style dosn't defined for tqshape, applay default for stencil setStyle( d, PyDict_GetItemString( vars, "style" ) , fill ); - setStyle( d, shape, fill ); + setStyle( d, tqshape, fill ); if ( isSelected() ) - setStyle( d, PyDict_GetItemString( shape, "selected" ) , fill ); + setStyle( d, PyDict_GetItemString( tqshape, "selected" ) , fill ); if ( outlined ) fill = KivioFillStyle::kcsNone; - TQString stype = getStringFromDict( shape, "type" ); + TQString stype = getStringFromDict( tqshape, "type" ); stype = stype.lower(); - double x = zoomHandler->zoomItX(getDoubleFromDict(shape,"x")); - double y = zoomHandler->zoomItY(getDoubleFromDict(shape,"y")); - double w = zoomHandler->zoomItX(getDoubleFromDict(shape,"w")); - double h = zoomHandler->zoomItY(getDoubleFromDict(shape,"h")); - //double x2 = zoomHandler->zoomItX(getDoubleFromDict(shape,"x2")); - //double y2 = zoomHandler->zoomItY(getDoubleFromDict(shape,"y2")); + double x = zoomHandler->zoomItX(getDoubleFromDict(tqshape,"x")); + double y = zoomHandler->zoomItY(getDoubleFromDict(tqshape,"y")); + double w = zoomHandler->zoomItX(getDoubleFromDict(tqshape,"w")); + double h = zoomHandler->zoomItY(getDoubleFromDict(tqshape,"h")); + //double x2 = zoomHandler->zoomItX(getDoubleFromDict(tqshape,"x2")); + //double y2 = zoomHandler->zoomItY(getDoubleFromDict(tqshape,"y2")); // get points list TQPtrList<KivioPoint> points; points.setAutoDelete(true); - PyObject *pyPoints = PyDict_GetItemString( shape, "points" ); + PyObject *pyPoints = PyDict_GetItemString( tqshape, "points" ); if ( pyPoints && PyList_Check(pyPoints) ) { int size = PyList_Size(pyPoints); for ( int i=0; i<size; i++ ) { @@ -470,7 +470,7 @@ void KivioPyStencil::paint( KivioIntraStencilData *d, bool outlined ) f.setPointSizeFloat(f.pointSizeFloat() * (((float)zoomHandler->zoom()) / 100.0)); d->painter->setFont( f ); - TQString text = getStringFromDict(shape,"text"); + TQString text = getStringFromDict(tqshape,"text"); if ( !text.isEmpty() ) { d->painter->drawText( int( x ), int( y ), int( w ), int( h ), tf | TQt::WordBreak, text ); @@ -478,14 +478,14 @@ void KivioPyStencil::paint( KivioIntraStencilData *d, bool outlined ) } if ( stype == "arc" ) { - double a1 = getDoubleFromDict(shape,"a1"); - double a2 = getDoubleFromDict(shape,"a2"); + double a1 = getDoubleFromDict(tqshape,"a1"); + double a2 = getDoubleFromDict(tqshape,"a2"); d->painter->drawArc(x,y,w,h,a1,a2); } if ( stype == "roundrect" ) { - double rx = zoomHandler->zoomItX(getDoubleFromDict(shape,"rx")); - double ry = zoomHandler->zoomItY(getDoubleFromDict(shape,"ry")); + double rx = zoomHandler->zoomItX(getDoubleFromDict(tqshape,"rx")); + double ry = zoomHandler->zoomItY(getDoubleFromDict(tqshape,"ry")); if (fill) { d->painter->fillRoundRect( x, y, w, h, rx, ry ); @@ -924,7 +924,7 @@ void KivioPyStencil::setLineWidth( double w ) void KivioPyStencil::setText( const TQString &s ) { - PyObject *to = PyDict_GetItemString( PyDict_GetItemString(vars,"shapes"), "text" ); + PyObject *to = PyDict_GetItemString( PyDict_GetItemString(vars,"tqshapes"), "text" ); if ( to ) PyDict_SetItemString(to, "text", Py_BuildValue("s", s.latin1() )); } @@ -932,7 +932,7 @@ void KivioPyStencil::setText( const TQString &s ) TQString KivioPyStencil::text() { - PyObject *to = PyDict_GetItemString( PyDict_GetItemString(vars,"shapes"), "text" ); + PyObject *to = PyDict_GetItemString( PyDict_GetItemString(vars,"tqshapes"), "text" ); if ( to ) { return getStringFromDict(to, "text"); } |