|
|
|
@ -248,6 +248,68 @@ void TQPainter::drawWinFocusRect( int x, int y, int w, int h, bool xorPaint, con
|
|
|
|
|
setPen( old_pen );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
Draws the polyline defined by the \a npoints points in \a a
|
|
|
|
|
starting at \a a[index]. (\a index defaults to 0.)
|
|
|
|
|
|
|
|
|
|
If \a npoints is -1 (the default) all points until the end of the
|
|
|
|
|
array are used (i.e. a.size()-index-1 line segments are drawn).
|
|
|
|
|
|
|
|
|
|
\warning On X11, coordinates that do not fit into 16-bit signed
|
|
|
|
|
values are truncated. This limitation is expected to go away in
|
|
|
|
|
TQt 4.
|
|
|
|
|
|
|
|
|
|
\sa drawLineSegments(), drawPolygon(), TQPen
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
void TQPainter::tqdrawPolyline( const TQPointArray &a, int index, int npoints )
|
|
|
|
|
{
|
|
|
|
|
if ( npoints < 0 )
|
|
|
|
|
npoints = a.size() - index;
|
|
|
|
|
if ( index + npoints > (int)a.size() )
|
|
|
|
|
npoints = a.size() - index;
|
|
|
|
|
if ( !isActive() || npoints < 2 || index < 0 )
|
|
|
|
|
return;
|
|
|
|
|
TQPointArray pa = a;
|
|
|
|
|
if ( testf(ExtDev|VxF|WxF) ) {
|
|
|
|
|
if ( testf(ExtDev) ) {
|
|
|
|
|
// if ( npoints != (int)pa.size() ) {
|
|
|
|
|
// pa = TQPointArray( npoints );
|
|
|
|
|
// for ( int i=0; i<npoints; i++ )
|
|
|
|
|
// pa.setPoint( i, a.point(index+i) );
|
|
|
|
|
// index = 0;
|
|
|
|
|
// }
|
|
|
|
|
// TQPDevCmdParam param[1];
|
|
|
|
|
// param[0].ptarr = (TQPointArray*)&pa;
|
|
|
|
|
// if ( !pdev->cmd(TQPaintDevice::PdcDrawPolyline, this, param) || !hd )
|
|
|
|
|
// return;
|
|
|
|
|
printf("[FIXME] TQPainter::drawPolyline not yet supported on external paint devices\n\r");
|
|
|
|
|
}
|
|
|
|
|
#if 0
|
|
|
|
|
if ( txop != TxNone ) {
|
|
|
|
|
pa = xForm( pa, index, npoints );
|
|
|
|
|
if ( pa.size() != a.size() ) {
|
|
|
|
|
index = 0;
|
|
|
|
|
npoints = pa.size();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if ( cpen.style() != Qt::NoPen ) {
|
|
|
|
|
while(npoints>65535) {
|
|
|
|
|
XDrawLines( dpy, hd, gc, (XPoint*)(pa.shortPoints( index, 65535 )),
|
|
|
|
|
65535, CoordModeOrigin );
|
|
|
|
|
npoints-=65535;
|
|
|
|
|
index+=65535;
|
|
|
|
|
}
|
|
|
|
|
XDrawLines( dpy, hd, gc, (XPoint*)(pa.shortPoints( index, npoints )),
|
|
|
|
|
npoints, CoordModeOrigin );
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
}
|
|
|
|
|
printf("[WARNING] TQPainter::tqdrawPolyline UNIMPLEMENTED\n\r");
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#else // USE_QT4
|
|
|
|
|
|
|
|
|
|
// paintevent magic to provide Windows semantics on X11
|
|
|
|
|