summaryrefslogtreecommitdiffstats
path: root/kivio/kiviopart/kiviosdk/kivio_py_stencil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kivio/kiviopart/kiviosdk/kivio_py_stencil.cpp')
-rw-r--r--kivio/kiviopart/kiviosdk/kivio_py_stencil.cpp50
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 cc8eb0e3..f966dc07 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 <tqbrush.h>
+#include <brush.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","tqshapes");
+ "x", m_x, "y", m_y, "w", m_w, "h", m_h, "x2", x2, "y2", y2 , "style","connectors","connector_targets","shapes");
resizeCode = "";
}
@@ -406,45 +406,45 @@ void KivioPyStencil::paint( KivioIntraStencilData *d, bool outlined )
{
KoZoomHandler* zoomHandler = d->zoomHandler;
- PyObject *tqshapes = PyDict_Values( PyDict_GetItemString( vars, "tqshapes" ) );
+ PyObject *shapes = PyDict_Values( PyDict_GetItemString( vars, "shapes" ) );
- if ( !tqshapes ) {
+ if ( !shapes ) {
return;
}
- int size = PyList_Size( tqshapes );
+ int size = PyList_Size( shapes );
for ( int i=0; i<size; i++ ) {
- PyObject *tqshape = PyList_GetItem( tqshapes, i );
- if ( !PyDict_Check(tqshape) )
+ PyObject *shape = PyList_GetItem( shapes, i );
+ if ( !PyDict_Check(shape) )
continue;
int fill = KivioFillStyle::kcsNone;
- // if style dosn't defined for tqshape, applay default for stencil
+ // if style dosn't defined for shape, applay default for stencil
setStyle( d, PyDict_GetItemString( vars, "style" ) , fill );
- setStyle( d, tqshape, fill );
+ setStyle( d, shape, fill );
if ( isSelected() )
- setStyle( d, PyDict_GetItemString( tqshape, "selected" ) , fill );
+ setStyle( d, PyDict_GetItemString( shape, "selected" ) , fill );
if ( outlined )
fill = KivioFillStyle::kcsNone;
- TQString stype = getStringFromDict( tqshape, "type" );
+ TQString stype = getStringFromDict( shape, "type" );
stype = stype.lower();
- 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"));
+ 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"));
// get points list
TQPtrList<KivioPoint> points;
points.setAutoDelete(true);
- PyObject *pyPoints = PyDict_GetItemString( tqshape, "points" );
+ PyObject *pyPoints = PyDict_GetItemString( shape, "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(tqshape,"text");
+ TQString text = getStringFromDict(shape,"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(tqshape,"a1");
- double a2 = getDoubleFromDict(tqshape,"a2");
+ double a1 = getDoubleFromDict(shape,"a1");
+ double a2 = getDoubleFromDict(shape,"a2");
d->painter->drawArc(x,y,w,h,a1,a2);
}
if ( stype == "roundrect" ) {
- double rx = zoomHandler->zoomItX(getDoubleFromDict(tqshape,"rx"));
- double ry = zoomHandler->zoomItY(getDoubleFromDict(tqshape,"ry"));
+ double rx = zoomHandler->zoomItX(getDoubleFromDict(shape,"rx"));
+ double ry = zoomHandler->zoomItY(getDoubleFromDict(shape,"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,"tqshapes"), "text" );
+ PyObject *to = PyDict_GetItemString( PyDict_GetItemString(vars,"shapes"), "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,"tqshapes"), "text" );
+ PyObject *to = PyDict_GetItemString( PyDict_GetItemString(vars,"shapes"), "text" );
if ( to ) {
return getStringFromDict(to, "text");
}