From 68b81013e8668f50fc18b7e26a520ec93a7a1251 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Fri, 31 May 2024 11:32:43 +0900 Subject: Rename nt* canvas related files to equivalent tq* Signed-off-by: Michele Calgaro --- doc/canvas.doc | 44 +- doc/classchart.doc | 22 +- doc/features.doc | 2 +- doc/html/abstractwidgets.html | 2 +- doc/html/annotated.html | 28 +- doc/html/canvas-chart-example.html | 8 +- doc/html/canvas-example.html | 258 +- doc/html/canvas.html | 38 +- doc/html/chart-canvastext-h.html | 10 +- doc/html/chart-canvasview-cpp.html | 6 +- doc/html/chart-canvasview-h.html | 10 +- doc/html/chart-chartform-cpp.html | 4 +- doc/html/chart-chartform-h.html | 2 +- doc/html/chart-chartform_canvas-cpp.html | 78 +- doc/html/classchart.html | 22 +- doc/html/classes.html | 28 +- doc/html/emb-features.html | 2 +- doc/html/functions.html | 242 +- doc/html/graphics.html | 28 +- doc/html/headerfilesynonyms | 26 +- doc/html/headers.html | 2 +- doc/html/hierarchy.html | 28 +- doc/html/images.html | 28 +- doc/html/index | 380 +- doc/html/mainclasses.html | 2 +- doc/html/ntqcanvas.html | 588 --- doc/html/ntqgridview.html | 2 +- doc/html/ntqpixmap.html | 2 +- doc/html/ntqpointarray.html | 4 +- doc/html/ntqscrollview.html | 4 +- doc/html/ntqt.html | 2 +- doc/html/ntqvaluelist.html | 2 +- doc/html/ntqwidget.html | 2 +- doc/html/porting.html | 12 +- doc/html/qcanvas-h.html | 861 ----- doc/html/qcanvas-members.html | 124 - doc/html/qcanvas.png | Bin 53983 -> 0 bytes doc/html/qcanvasellipse-members.html | 104 - doc/html/qcanvasellipse.html | 169 - doc/html/qcanvasellipse.png | Bin 3092 -> 0 bytes doc/html/qcanvasitem-members.html | 87 - doc/html/qcanvasitem.html | 480 --- doc/html/qcanvasitemlist-members.html | 80 - doc/html/qcanvasitemlist.html | 72 - doc/html/qcanvasline-members.html | 101 - doc/html/qcanvasline.html | 109 - doc/html/qcanvaspixmap-members.html | 111 - doc/html/qcanvaspixmap.html | 128 - doc/html/qcanvaspixmaparray-members.html | 55 - doc/html/qcanvaspixmaparray.html | 192 - doc/html/qcanvaspolygon-members.html | 100 - doc/html/qcanvaspolygon.html | 126 - doc/html/qcanvaspolygonalitem-members.html | 98 - doc/html/qcanvaspolygonalitem.html | 235 -- doc/html/qcanvasrectangle-members.html | 104 - doc/html/qcanvasrectangle.html | 147 - doc/html/qcanvasspline-members.html | 103 - doc/html/qcanvasspline.html | 121 - doc/html/qcanvassprite-members.html | 100 - doc/html/qcanvassprite.html | 303 -- doc/html/qcanvastext-members.html | 95 - doc/html/qcanvastext.html | 169 - doc/html/qcanvasview-members.html | 429 --- doc/html/qcanvasview.html | 190 - doc/html/qt.dcf | 490 +-- doc/html/titleindex | 58 +- doc/html/tqcanvas-h.html | 861 +++++ doc/html/tqcanvas-members.html | 124 + doc/html/tqcanvas.html | 588 +++ doc/html/tqcanvas.png | Bin 0 -> 53983 bytes doc/html/tqcanvasellipse-members.html | 104 + doc/html/tqcanvasellipse.html | 169 + doc/html/tqcanvasellipse.png | Bin 0 -> 3092 bytes doc/html/tqcanvasitem-members.html | 87 + doc/html/tqcanvasitem.html | 480 +++ doc/html/tqcanvasitemlist-members.html | 80 + doc/html/tqcanvasitemlist.html | 72 + doc/html/tqcanvasline-members.html | 101 + doc/html/tqcanvasline.html | 109 + doc/html/tqcanvaspixmap-members.html | 111 + doc/html/tqcanvaspixmap.html | 128 + doc/html/tqcanvaspixmaparray-members.html | 55 + doc/html/tqcanvaspixmaparray.html | 192 + doc/html/tqcanvaspolygon-members.html | 100 + doc/html/tqcanvaspolygon.html | 126 + doc/html/tqcanvaspolygonalitem-members.html | 98 + doc/html/tqcanvaspolygonalitem.html | 235 ++ doc/html/tqcanvasrectangle-members.html | 104 + doc/html/tqcanvasrectangle.html | 147 + doc/html/tqcanvasspline-members.html | 103 + doc/html/tqcanvasspline.html | 121 + doc/html/tqcanvassprite-members.html | 100 + doc/html/tqcanvassprite.html | 303 ++ doc/html/tqcanvastext-members.html | 95 + doc/html/tqcanvastext.html | 169 + doc/html/tqcanvasview-members.html | 429 +++ doc/html/tqcanvasview.html | 190 + doc/html/tqobject.html | 2 +- doc/html/tutorial2-02.html | 6 +- doc/html/tutorial2-05.html | 14 +- doc/html/tutorial2-06.html | 64 +- doc/html/whatsthis | 28 +- doc/man/man3/tqcanvas.3qt | 158 +- doc/man/man3/tqcanvasellipse.3qt | 56 +- doc/man/man3/tqcanvasitem.3qt | 186 +- doc/man/man3/tqcanvasitemlist.3qt | 18 +- doc/man/man3/tqcanvasline.3qt | 38 +- doc/man/man3/tqcanvaspixmap.3qt | 50 +- doc/man/man3/tqcanvaspixmaparray.3qt | 66 +- doc/man/man3/tqcanvaspolygon.3qt | 50 +- doc/man/man3/tqcanvaspolygonalitem.3qt | 86 +- doc/man/man3/tqcanvasrectangle.3qt | 58 +- doc/man/man3/tqcanvasspline.3qt | 38 +- doc/man/man3/tqcanvassprite.3qt | 116 +- doc/man/man3/tqcanvastext.3qt | 68 +- doc/man/man3/tqcanvasview.3qt | 70 +- doc/man/man3/tqgridview.3qt | 2 +- doc/man/man3/tqobject.3qt | 2 +- doc/man/man3/tqpixmap.3qt | 2 +- doc/man/man3/tqscrollview.3qt | 4 +- doc/man/man3/tqt.3qt | 2 +- doc/man/man3/tqvaluelist.3qt | 2 +- doc/man/man3/tqwidget.3qt | 2 +- doc/porting3.doc | 12 +- doc/tutorial2.doc | 42 +- examples/README | 10 +- examples/canvas/canvas.doc | 4 +- examples/canvas/canvas.h | 2 +- examples/chart/canvastext.h | 2 +- examples/chart/canvasview.h | 2 +- examples/chart/chart.doc | 2 +- examples/chart/chartform_canvas.cpp | 2 +- examples/chart/images/chart-forms.sk | 2 +- examples/demo/graph.cpp | 2 +- examples/demo/qasteroids/sprites.h | 2 +- examples/demo/qasteroids/view.h | 2 +- examples/demo/translations/demo_ar.ts | 12 +- examples/demo/translations/demo_de.ts | 10 +- examples/demo/translations/demo_fr.ts | 6 +- examples/demo/translations/demo_he.ts | 12 +- include/ntqcanvas.h | 1 - include/tqcanvas.h | 1 + src/canvas/ntqcanvas.h | 816 ---- src/canvas/qcanvas.cpp | 5415 --------------------------- src/canvas/qt_canvas.pri | 4 +- src/canvas/tqcanvas.cpp | 5415 +++++++++++++++++++++++++++ src/canvas/tqcanvas.h | 816 ++++ src/kernel/ntqt.h | 2 +- src/kernel/qpointarray.cpp | 4 +- src/tools/ntqwinexport.h | 2 +- src/tools/qfeatures.txt | 2 +- src/tools/qwinexport.cpp | 2 +- 152 files changed, 13417 insertions(+), 13417 deletions(-) delete mode 100644 doc/html/ntqcanvas.html delete mode 100644 doc/html/qcanvas-h.html delete mode 100644 doc/html/qcanvas-members.html delete mode 100644 doc/html/qcanvas.png delete mode 100644 doc/html/qcanvasellipse-members.html delete mode 100644 doc/html/qcanvasellipse.html delete mode 100644 doc/html/qcanvasellipse.png delete mode 100644 doc/html/qcanvasitem-members.html delete mode 100644 doc/html/qcanvasitem.html delete mode 100644 doc/html/qcanvasitemlist-members.html delete mode 100644 doc/html/qcanvasitemlist.html delete mode 100644 doc/html/qcanvasline-members.html delete mode 100644 doc/html/qcanvasline.html delete mode 100644 doc/html/qcanvaspixmap-members.html delete mode 100644 doc/html/qcanvaspixmap.html delete mode 100644 doc/html/qcanvaspixmaparray-members.html delete mode 100644 doc/html/qcanvaspixmaparray.html delete mode 100644 doc/html/qcanvaspolygon-members.html delete mode 100644 doc/html/qcanvaspolygon.html delete mode 100644 doc/html/qcanvaspolygonalitem-members.html delete mode 100644 doc/html/qcanvaspolygonalitem.html delete mode 100644 doc/html/qcanvasrectangle-members.html delete mode 100644 doc/html/qcanvasrectangle.html delete mode 100644 doc/html/qcanvasspline-members.html delete mode 100644 doc/html/qcanvasspline.html delete mode 100644 doc/html/qcanvassprite-members.html delete mode 100644 doc/html/qcanvassprite.html delete mode 100644 doc/html/qcanvastext-members.html delete mode 100644 doc/html/qcanvastext.html delete mode 100644 doc/html/qcanvasview-members.html delete mode 100644 doc/html/qcanvasview.html create mode 100644 doc/html/tqcanvas-h.html create mode 100644 doc/html/tqcanvas-members.html create mode 100644 doc/html/tqcanvas.html create mode 100644 doc/html/tqcanvas.png create mode 100644 doc/html/tqcanvasellipse-members.html create mode 100644 doc/html/tqcanvasellipse.html create mode 100644 doc/html/tqcanvasellipse.png create mode 100644 doc/html/tqcanvasitem-members.html create mode 100644 doc/html/tqcanvasitem.html create mode 100644 doc/html/tqcanvasitemlist-members.html create mode 100644 doc/html/tqcanvasitemlist.html create mode 100644 doc/html/tqcanvasline-members.html create mode 100644 doc/html/tqcanvasline.html create mode 100644 doc/html/tqcanvaspixmap-members.html create mode 100644 doc/html/tqcanvaspixmap.html create mode 100644 doc/html/tqcanvaspixmaparray-members.html create mode 100644 doc/html/tqcanvaspixmaparray.html create mode 100644 doc/html/tqcanvaspolygon-members.html create mode 100644 doc/html/tqcanvaspolygon.html create mode 100644 doc/html/tqcanvaspolygonalitem-members.html create mode 100644 doc/html/tqcanvaspolygonalitem.html create mode 100644 doc/html/tqcanvasrectangle-members.html create mode 100644 doc/html/tqcanvasrectangle.html create mode 100644 doc/html/tqcanvasspline-members.html create mode 100644 doc/html/tqcanvasspline.html create mode 100644 doc/html/tqcanvassprite-members.html create mode 100644 doc/html/tqcanvassprite.html create mode 100644 doc/html/tqcanvastext-members.html create mode 100644 doc/html/tqcanvastext.html create mode 100644 doc/html/tqcanvasview-members.html create mode 100644 doc/html/tqcanvasview.html delete mode 120000 include/ntqcanvas.h create mode 120000 include/tqcanvas.h delete mode 100644 src/canvas/ntqcanvas.h delete mode 100644 src/canvas/qcanvas.cpp create mode 100644 src/canvas/tqcanvas.cpp create mode 100644 src/canvas/tqcanvas.h diff --git a/doc/canvas.doc b/doc/canvas.doc index c8801ef8..6b34d792 100644 --- a/doc/canvas.doc +++ b/doc/canvas.doc @@ -47,49 +47,49 @@ This module is part of the \link commercialeditions.html TQt Enterprise Edition \endif The canvas module provides a highly optimized 2D graphic area called -\l QCanvas. The canvas can contain an arbitrary number of \link -QCanvasItem QCanvasItems \endlink. Canvas items can have an arbitrary +\l TQCanvas. The canvas can contain an arbitrary number of \link +TQCanvasItem TQCanvasItems \endlink. Canvas items can have an arbitrary shape, size and content, can be freely moved around in the canvas, and can be checked for collisions. Canvas items can be set to move across the canvas automatically and animated canvas items are -supported with QCanvasSprite. (If you require 3D graphics see Qt's +supported with TQCanvasSprite. (If you require 3D graphics see Qt's \link opengl.html OpenGL module \endlink.) -The canvas module uses a document/view model. The \l QCanvasView class +The canvas module uses a document/view model. The \l TQCanvasView class is used to show a particular view of a canvas. Multiple views can operate on the same canvas at the same time. Every view can use an arbitrary transformation matrix on the canvas which makes it easy to implement features such as zooming. -
-Screenshot of a canvas
+
+Screenshot of a canvas
-Qt provides a number of predefined \l QCanvas items as listed below. +Qt provides a number of predefined \l TQCanvas items as listed below. \list -\i QCanvasItem -- An abstract base class for all canvas items. -\i QCanvasEllipse -- An ellipse or "pie segment". -\i QCanvasLine -- A line segment. -\i QCanvasPolygon -- A polygon. -\i QCanvasPolygonalItem -- A base class for items that have a +\i TQCanvasItem -- An abstract base class for all canvas items. +\i TQCanvasEllipse -- An ellipse or "pie segment". +\i TQCanvasLine -- A line segment. +\i TQCanvasPolygon -- A polygon. +\i TQCanvasPolygonalItem -- A base class for items that have a non-rectangular shape. Most canvas items derive from this class. -\i QCanvasRectangle -- A rectangle. The rectangle cannot be tilted or -rotated. Rotated rectangles can be drawn using QCanvasPolygon. -\i QCanvasSpline -- A multi-bezier spline. -\i QCanvasSprite -- An animated pixmap. -\i QCanvasText -- A text string. +\i TQCanvasRectangle -- A rectangle. The rectangle cannot be tilted or +rotated. Rotated rectangles can be drawn using TQCanvasPolygon. +\i TQCanvasSpline -- A multi-bezier spline. +\i TQCanvasSprite -- An animated pixmap. +\i TQCanvasText -- A text string. \endlist -The two classes \l QCanvasPixmap and \l QCanvasPixmapArray are used -by \l QCanvasSprite to show animated and moving pixmaps on the +The two classes \l TQCanvasPixmap and \l TQCanvasPixmapArray are used +by \l TQCanvasSprite to show animated and moving pixmaps on the canvas. More specialized items can be created by inheriting from one of the canvas item classes. It is easiest to inherit from one of -QCanvasItem's derived classes (usually \l QCanvasPolygonalItem) rather -than inherit QCanvasItem directly. +TQCanvasItem's derived classes (usually \l TQCanvasPolygonalItem) rather +than inherit TQCanvasItem directly. -See \c examples/canvas for an example that shows off some of QCanvas's +See \c examples/canvas for an example that shows off some of TQCanvas's capabilities. */ diff --git a/doc/classchart.doc b/doc/classchart.doc index 36ee5683..20dbd86b 100644 --- a/doc/classchart.doc +++ b/doc/classchart.doc @@ -53,15 +53,15 @@ - - - - - - - - - + + + + + + + + + @@ -108,7 +108,7 @@ - + @@ -164,7 +164,7 @@ - + diff --git a/doc/features.doc b/doc/features.doc index 81b491d6..b7e7b4bb 100644 --- a/doc/features.doc +++ b/doc/features.doc @@ -210,7 +210,7 @@ The available options are: \i Lists of information (\l QListView) \i TQT_NO_WIDGETS \row \i TQT_NO_CANVAS - \i Object canvas (\l QCanvas) + \i Object canvas (\l TQCanvas) \i TQT_NO_WIDGETS \row \i TQT_NO_DIAL \i Value control (\l QDial) diff --git a/doc/html/abstractwidgets.html b/doc/html/abstractwidgets.html index b925e573..1a727518 100644 --- a/doc/html/abstractwidgets.html +++ b/doc/html/abstractwidgets.html @@ -38,7 +38,7 @@ these classes.

TQButtonThe abstract base class of button widgets, providing functionality common to buttons -
TQCanvas2D area that can contain TQCanvasItem objects +
TQCanvas2D area that can contain TQCanvasItem objects
TQDialogThe base class of dialog windows
TQFrameThe base class of widgets that can have a frame
TQGridViewAbstract base for fixed-size grids diff --git a/doc/html/annotated.html b/doc/html/annotated.html index 95e713b6..a0105ef7 100644 --- a/doc/html/annotated.html +++ b/doc/html/annotated.html @@ -71,20 +71,20 @@ body { background: #ffffff; color: black; }
TQCStringAbstraction of the classic C zero-terminated char array (char *)
TQCacheTemplate class that provides a cache based on TQString keys
TQCacheIteratorIterator for TQCache collections -
TQCanvas2D area that can contain TQCanvasItem objects -
TQCanvasEllipseEllipse or ellipse segment on a TQCanvas -
TQCanvasItemAbstract graphic object on a TQCanvas -
TQCanvasItemListList of TQCanvasItems -
TQCanvasLineLine on a TQCanvas -
TQCanvasPixmapPixmaps for TQCanvasSprites -
TQCanvasPixmapArrayArray of TQCanvasPixmaps -
TQCanvasPolygonPolygon on a TQCanvas -
TQCanvasPolygonalItemPolygonal canvas item on a TQCanvas -
TQCanvasRectangleRectangle on a TQCanvas -
TQCanvasSplineMulti-bezier splines on a TQCanvas -
TQCanvasSpriteAnimated canvas item on a TQCanvas -
TQCanvasTextText object on a TQCanvas -
TQCanvasViewOn-screen view of a TQCanvas +
TQCanvas2D area that can contain TQCanvasItem objects +
TQCanvasEllipseEllipse or ellipse segment on a TQCanvas +
TQCanvasItemAbstract graphic object on a TQCanvas +
TQCanvasItemListList of TQCanvasItems +
TQCanvasLineLine on a TQCanvas +
TQCanvasPixmapPixmaps for TQCanvasSprites +
TQCanvasPixmapArrayArray of TQCanvasPixmaps +
TQCanvasPolygonPolygon on a TQCanvas +
TQCanvasPolygonalItemPolygonal canvas item on a TQCanvas +
TQCanvasRectangleRectangle on a TQCanvas +
TQCanvasSplineMulti-bezier splines on a TQCanvas +
TQCanvasSpriteAnimated canvas item on a TQCanvas +
TQCanvasTextText object on a TQCanvas +
TQCanvasViewOn-screen view of a TQCanvas
TQCharLightweight Unicode character
TQCharRefHelper class for TQString
TQCheckBoxCheckbox with a text label diff --git a/doc/html/canvas-chart-example.html b/doc/html/canvas-chart-example.html index ade0c27a..b72768c0 100644 --- a/doc/html/canvas-chart-example.html +++ b/doc/html/canvas-chart-example.html @@ -35,7 +35,7 @@ body { background: #ffffff; color: black; }

This is a complete example program with a main window, menus and -toolbars. The main widget is a TQCanvas, and this example +toolbars. The main widget is a TQCanvas, and this example demonstrates basic canvas usage.


@@ -228,7 +228,7 @@ private: TQString m_filename; TQStringList m_recentFiles; - TQCanvas *m_canvas; + TQCanvas *m_canvas; CanvasView *m_canvasView; bool m_changed; ElementVector m_elements; @@ -466,8 +466,8 @@ const TQString APP_KEY = "/Chart/"; if ( windowX != -1 || windowY != -1 ) move( windowX, windowY ); - m_canvas = new TQCanvas( this ); - m_canvas->resize( width(), height() ); + m_canvas = new TQCanvas( this ); + m_canvas->resize( width(), height() ); m_canvasView = new CanvasView( m_canvas, &m_elements, this ); setCentralWidget( m_canvasView ); m_canvasView->show(); diff --git a/doc/html/canvas-example.html b/doc/html/canvas-example.html index 665b0f7e..0c072685 100644 --- a/doc/html/canvas-example.html +++ b/doc/html/canvas-example.html @@ -33,7 +33,7 @@ body { background: #ffffff; color: black; }

-This example shows a TQCanvas and some TQCanvasItems in action. +This example shows a TQCanvas and some TQCanvasItems in action. You can do a lot more with TQCanvas than we show here, but the example provides a taste of what can be done.


@@ -44,9 +44,9 @@ example provides a taste of what can be done. #include <ntqpopupmenu.h> #include <ntqmainwindow.h> #include <ntqintdict.h> -#include <ntqcanvas.h> +#include <tqcanvas.h> -class BouncyLogo : public TQCanvasSprite { +class BouncyLogo : public TQCanvasSprite { void initPos(); void initSpeed(); public: @@ -56,7 +56,7 @@ public: }; -class FigureEditor : public TQCanvasView { +class FigureEditor : public TQCanvasView { TQ_OBJECT public: @@ -71,7 +71,7 @@ signals: void status(const TQString&); private: - TQCanvasItem* moving; + TQCanvasItem* moving; TQPoint moving_start; }; @@ -120,7 +120,7 @@ private slots: void toggleDoubleBuffer(); private: - TQCanvas& canvas; + TQCanvas& canvas; FigureEditor *editor; TQPopupMenu* options; @@ -156,7 +156,7 @@ static TQPen *tp = 0; class EdgeItem; class NodeItem; -class EdgeItem: public TQCanvasLine +class EdgeItem: public TQCanvasLine { public: EdgeItem( NodeItem*, NodeItem*, TQCanvas *canvas ); @@ -171,7 +171,7 @@ private: static const int imageRTTI = 984376; -class ImageItem: public TQCanvasRectangle +class ImageItem: public TQCanvasRectangle { public: ImageItem( TQImage img, TQCanvas *canvas ); @@ -186,9 +186,9 @@ private: ImageItem::ImageItem( TQImage img, TQCanvas *canvas ) - : TQCanvasRectangle( canvas ), image(img) + : TQCanvasRectangle( canvas ), image(img) { - setSize( image.width(), image.height() ); + setSize( image.width(), image.height() ); #if !defined(TQ_WS_QWS) pixmap.convertFromImage(image, OrderedAlphaDither); @@ -196,31 +196,31 @@ private: } -void ImageItem::drawShape( TQPainter &p ) +void ImageItem::drawShape( TQPainter &p ) { // On TQt/Embedded, we can paint a TQImage as fast as a TQPixmap, // but on other platforms, we need to use a TQPixmap. #if defined(TQ_WS_QWS) - p.drawImage( int(x()), int(y()), image, 0, 0, -1, -1, OrderedAlphaDither ); + p.drawImage( int(x()), int(y()), image, 0, 0, -1, -1, OrderedAlphaDither ); #else - p.drawPixmap( int(x()), int(y()), pixmap ); + p.drawPixmap( int(x()), int(y()), pixmap ); #endif } bool ImageItem::hit( const TQPoint &p ) const { - int ix = p.x()-int(x()); - int iy = p.y()-int(y()); + int ix = p.x()-int(x()); + int iy = p.y()-int(y()); if ( !image.valid( ix , iy ) ) return FALSE; TQRgb pixel = image.pixel( ix, iy ); return tqAlpha( pixel ) != 0; } -class NodeItem: public TQCanvasEllipse +class NodeItem: public TQCanvasEllipse { public: - NodeItem( TQCanvas *canvas ); + NodeItem( TQCanvas *canvas ); ~NodeItem() {} void addInEdge( EdgeItem *edge ) { inList.append( edge ); } @@ -238,20 +238,20 @@ private: int EdgeItem::c = 0; -void EdgeItem::moveBy(double, double) +void EdgeItem::moveBy(double, double) { //nothing } EdgeItem::EdgeItem( NodeItem *from, NodeItem *to, TQCanvas *canvas ) - : TQCanvasLine( canvas ) + : TQCanvasLine( canvas ) { c++; setPen( *tp ); setBrush( *tb ); from->addOutEdge( this ); to->addInEdge( this ); - setPoints( int(from->x()), int(from->y()), int(to->x()), int(to->y()) ); + setPoints( int(from->x()), int(from->y()), int(to->x()), int(to->y()) ); setZ( 127 ); } @@ -267,42 +267,42 @@ void EdgeItem::setToPoint( int x, int y ) -void NodeItem::moveBy(double dx, double dy) +void NodeItem::moveBy(double dx, double dy) { - TQCanvasEllipse::moveBy( dx, dy ); + TQCanvasEllipse::moveBy( dx, dy ); TQPtrListIterator<EdgeItem> it1( inList ); EdgeItem *edge; while (( edge = it1.current() )) { ++it1; - edge->setToPoint( int(x()), int(y()) ); + edge->setToPoint( int(x()), int(y()) ); } TQPtrListIterator<EdgeItem> it2( outList ); while (( edge = it2.current() )) { ++it2; - edge->setFromPoint( int(x()), int(y()) ); + edge->setFromPoint( int(x()), int(y()) ); } } -NodeItem::NodeItem( TQCanvas *canvas ) - : TQCanvasEllipse( 6, 6, canvas ) +NodeItem::NodeItem( TQCanvas *canvas ) + : TQCanvasEllipse( 6, 6, canvas ) { setPen( *tp ); setBrush( *tb ); - setZ( 128 ); + setZ( 128 ); } FigureEditor::FigureEditor( - TQCanvas& c, TQWidget* parent, + TQCanvas& c, TQWidget* parent, const char* name, WFlags f) : - TQCanvasView(&c,parent,name,f) + TQCanvasView(&c,parent,name,f) { } void FigureEditor::contentsMousePressEvent(TQMouseEvent* e) { TQPoint p = inverseWorldMatrix().map(e->pos()); - TQCanvasItemList l=canvas()->collisions(p); + TQCanvasItemList l=canvas()->collisions(p); for (TQCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { if ( (*it)->rtti() == imageRTTI ) { ImageItem *item= (ImageItem*)(*it); @@ -318,7 +318,7 @@ void NodeItem::moveBy(double dx, double dy void FigureEditor::clear() { - TQCanvasItemList list = canvas()->allItems(); + TQCanvasItemList list = canvas()->allItems(); TQCanvasItemList::Iterator it = list.begin(); for (; it != list.end(); ++it) { if ( *it ) @@ -333,25 +333,25 @@ void FigureEditor::clear() moving->moveBy(p.x() - moving_start.x(), p.y() - moving_start.y()); moving_start = p; - canvas()->update(); + canvas()->update(); } } BouncyLogo::BouncyLogo(TQCanvas* canvas) : - TQCanvasSprite(0,canvas) + TQCanvasSprite(0,canvas) { static TQCanvasPixmapArray logo("qt-trans.xpm"); - setSequence(&logo); - setAnimated(TRUE); + setSequence(&logo); + setAnimated(TRUE); initPos(); } const int logo_rtti = 1234; -int BouncyLogo::rtti() const +int BouncyLogo::rtti() const { return logo_rtti; } @@ -361,7 +361,7 @@ void BouncyLogo::initPos() initSpeed(); int trial=1000; do { - move(rand()%canvas()->width(),rand()%canvas()->height()); + move(rand()%canvas()->width(),rand()%canvas()->height()); advance(0); } while (trial-- && xVelocity()==0.0 && yVelocity()==0.0); } @@ -373,7 +373,7 @@ void BouncyLogo::initSpeed() setVelocity( d*speed*2-speed, (1-d)*speed*2-speed ); } -void BouncyLogo::advance(int stage) +void BouncyLogo::advance(int stage) { switch ( stage ) { case 0: { @@ -396,10 +396,10 @@ void BouncyLogo::initSpeed() vy = -vy; for (int bounce=0; bounce<4; bounce++) { - TQCanvasItemList l=collisions(FALSE); + TQCanvasItemList l=collisions(FALSE); for (TQCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { - TQCanvasItem *hit = *it; - if ( hit->rtti()==logo_rtti && hit->collidesWith(this) ) { + TQCanvasItem *hit = *it; + if ( hit->rtti()==logo_rtti && hit->collidesWith(this) ) { switch ( bounce ) { case 0: vx = -vx; @@ -431,7 +431,7 @@ void BouncyLogo::initSpeed() setVelocity(vx,vy); } break; case 1: - TQCanvasItem::advance(stage); + TQCanvasItem::advance(stage); break; } } @@ -518,13 +518,13 @@ void Main::init() logoimg = 0; int i; - for ( i=0; i<canvas.width() / 56; i++) { + for ( i=0; i<canvas.width() / 56; i++) { addButterfly(); } - for ( i=0; i<canvas.width() / 85; i++) { + for ( i=0; i<canvas.width() / 85; i++) { addHexagon(); } - for ( i=0; i<canvas.width() / 128; i++) { + for ( i=0; i<canvas.width() / 128; i++) { addLogo(); } } @@ -578,80 +578,80 @@ void Main::toggleDoubleBuffer() { bool s = !options->isItemChecked(dbf_id); options->setItemChecked(dbf_id,s); - canvas.setDoubleBuffering(s); + canvas.setDoubleBuffering(s); } void Main::enlarge() { - canvas.resize(canvas.width()*4/3, canvas.height()*4/3); + canvas.resize(canvas.width()*4/3, canvas.height()*4/3); } void Main::shrink() { - canvas.resize(canvas.width()*3/4, canvas.height()*3/4); + canvas.resize(canvas.width()*3/4, canvas.height()*3/4); } void Main::rotateClockwise() { - TQWMatrix m = editor->worldMatrix(); + TQWMatrix m = editor->worldMatrix(); m.rotate( 22.5 ); - editor->setWorldMatrix( m ); + editor->setWorldMatrix( m ); } void Main::rotateCounterClockwise() { - TQWMatrix m = editor->worldMatrix(); + TQWMatrix m = editor->worldMatrix(); m.rotate( -22.5 ); - editor->setWorldMatrix( m ); + editor->setWorldMatrix( m ); } void Main::zoomIn() { - TQWMatrix m = editor->worldMatrix(); + TQWMatrix m = editor->worldMatrix(); m.scale( 2.0, 2.0 ); - editor->setWorldMatrix( m ); + editor->setWorldMatrix( m ); } void Main::zoomOut() { - TQWMatrix m = editor->worldMatrix(); + TQWMatrix m = editor->worldMatrix(); m.scale( 0.5, 0.5 ); - editor->setWorldMatrix( m ); + editor->setWorldMatrix( m ); } void Main::mirror() { - TQWMatrix m = editor->worldMatrix(); + TQWMatrix m = editor->worldMatrix(); m.scale( -1, 1 ); - editor->setWorldMatrix( m ); + editor->setWorldMatrix( m ); } void Main::moveL() { - TQWMatrix m = editor->worldMatrix(); + TQWMatrix m = editor->worldMatrix(); m.translate( -16, 0 ); - editor->setWorldMatrix( m ); + editor->setWorldMatrix( m ); } void Main::moveR() { - TQWMatrix m = editor->worldMatrix(); + TQWMatrix m = editor->worldMatrix(); m.translate( +16, 0 ); - editor->setWorldMatrix( m ); + editor->setWorldMatrix( m ); } void Main::moveU() { - TQWMatrix m = editor->worldMatrix(); + TQWMatrix m = editor->worldMatrix(); m.translate( 0, -16 ); - editor->setWorldMatrix( m ); + editor->setWorldMatrix( m ); } void Main::moveD() { - TQWMatrix m = editor->worldMatrix(); + TQWMatrix m = editor->worldMatrix(); m.translate( 0, +16 ); - editor->setWorldMatrix( m ); + editor->setWorldMatrix( m ); } void Main::print() @@ -659,16 +659,16 @@ void Main::print() if ( !printer ) printer = new TQPrinter; if ( printer->setup(this) ) { TQPainter pp(printer); - canvas.drawArea(TQRect(0,0,canvas.width(),canvas.height()),&pp,FALSE); + canvas.drawArea(TQRect(0,0,canvas.width(),canvas.height()),&pp,FALSE); } } void Main::addSprite() { - TQCanvasItem* i = new BouncyLogo(&canvas); - i->setZ(rand()%256); - i->show(); + TQCanvasItem* i = new BouncyLogo(&canvas); + i->setZ(rand()%256); + i->show(); } TQString butterfly_fn; @@ -689,11 +689,11 @@ void Main::addButterfly() butterflyimg[3] = butterflyimg[0].smoothScale( int(butterflyimg[0].width()*0.25), int(butterflyimg[0].height()*0.25) ); } - TQCanvasPolygonalItem* i = new ImageItem(butterflyimg[rand()%4],&canvas); - i->move(rand()%(canvas.width()-butterflyimg->width()), - rand()%(canvas.height()-butterflyimg->height())); - i->setZ(rand()%256+250); - i->show(); + TQCanvasPolygonalItem* i = new ImageItem(butterflyimg[rand()%4],&canvas); + i->move(rand()%(canvas.width()-butterflyimg->width()), + rand()%(canvas.height()-butterflyimg->height())); + i->setZ(rand()%256+250); + i->show(); } void Main::addLogo() @@ -710,28 +710,28 @@ void Main::addLogo() logoimg[3] = logoimg[0].smoothScale( int(logoimg[0].width()*0.25), int(logoimg[0].height()*0.25) ); } - TQCanvasPolygonalItem* i = new ImageItem(logoimg[rand()%4],&canvas); - i->move(rand()%(canvas.width()-logoimg->width()), - rand()%(canvas.height()-logoimg->width())); - i->setZ(rand()%256+256); - i->show(); + TQCanvasPolygonalItem* i = new ImageItem(logoimg[rand()%4],&canvas); + i->move(rand()%(canvas.width()-logoimg->width()), + rand()%(canvas.height()-logoimg->width())); + i->setZ(rand()%256+256); + i->show(); } void Main::addCircle() { - TQCanvasPolygonalItem* i = new TQCanvasEllipse(50,50,&canvas); - i->setBrush( TQColor(rand()%32*8,rand()%32*8,rand()%32*8) ); - i->move(rand()%canvas.width(),rand()%canvas.height()); - i->setZ(rand()%256); - i->show(); + TQCanvasPolygonalItem* i = new TQCanvasEllipse(50,50,&canvas); + i->setBrush( TQColor(rand()%32*8,rand()%32*8,rand()%32*8) ); + i->move(rand()%canvas.width(),rand()%canvas.height()); + i->setZ(rand()%256); + i->show(); } void Main::addHexagon() { - TQCanvasPolygon* i = new TQCanvasPolygon(&canvas); - const int size = canvas.width() / 25; + TQCanvasPolygon* i = new TQCanvasPolygon(&canvas); + const int size = canvas.width() / 25; TQPointArray pa(6); pa[0] = TQPoint(2*size,0); pa[1] = TQPoint(size,-size*173/100); @@ -739,17 +739,17 @@ void Main::addHexagon() pa[3] = TQPoint(-2*size,0); pa[4] = TQPoint(-size,size*173/100); pa[5] = TQPoint(size,size*173/100); - i->setPoints(pa); - i->setBrush( TQColor(rand()%32*8,rand()%32*8,rand()%32*8) ); - i->move(rand()%canvas.width(),rand()%canvas.height()); - i->setZ(rand()%256); - i->show(); + i->setPoints(pa); + i->setBrush( TQColor(rand()%32*8,rand()%32*8,rand()%32*8) ); + i->move(rand()%canvas.width(),rand()%canvas.height()); + i->setZ(rand()%256); + i->show(); } void Main::addPolygon() { - TQCanvasPolygon* i = new TQCanvasPolygon(&canvas); - const int size = canvas.width()/2; + TQCanvasPolygon* i = new TQCanvasPolygon(&canvas); + const int size = canvas.width()/2; TQPointArray pa(6); pa[0] = TQPoint(0,0); pa[1] = TQPoint(size,size/5); @@ -757,17 +757,17 @@ void Main::addPolygon() pa[3] = TQPoint(size/6,size*5/4); pa[4] = TQPoint(size*3/4,size*3/4); pa[5] = TQPoint(size*3/4,size/4); - i->setPoints(pa); - i->setBrush( TQColor(rand()%32*8,rand()%32*8,rand()%32*8) ); - i->move(rand()%canvas.width(),rand()%canvas.height()); - i->setZ(rand()%256); - i->show(); + i->setPoints(pa); + i->setBrush( TQColor(rand()%32*8,rand()%32*8,rand()%32*8) ); + i->move(rand()%canvas.width(),rand()%canvas.height()); + i->setZ(rand()%256); + i->show(); } void Main::addSpline() { - TQCanvasSpline* i = new TQCanvasSpline(&canvas); - const int size = canvas.width()/6; + TQCanvasSpline* i = new TQCanvasSpline(&canvas); + const int size = canvas.width()/6; TQPointArray pa(12); pa[0] = TQPoint(0,0); pa[1] = TQPoint(size/2,0); @@ -781,30 +781,30 @@ void Main::addSpline() pa[9] = TQPoint(0,size); pa[10]= TQPoint(-size/4,size/2); pa[11]= TQPoint(-size/2,0); - i->setControlPoints(pa); - i->setBrush( TQColor(rand()%32*8,rand()%32*8,rand()%32*8) ); - i->move(rand()%canvas.width(),rand()%canvas.height()); - i->setZ(rand()%256); - i->show(); + i->setControlPoints(pa); + i->setBrush( TQColor(rand()%32*8,rand()%32*8,rand()%32*8) ); + i->move(rand()%canvas.width(),rand()%canvas.height()); + i->setZ(rand()%256); + i->show(); } void Main::addText() { - TQCanvasText* i = new TQCanvasText(&canvas); - i->setText("TQCanvasText"); - i->move(rand()%canvas.width(),rand()%canvas.height()); - i->setZ(rand()%256); - i->show(); + TQCanvasText* i = new TQCanvasText(&canvas); + i->setText("TQCanvasText"); + i->move(rand()%canvas.width(),rand()%canvas.height()); + i->setZ(rand()%256); + i->show(); } void Main::addLine() { - TQCanvasLine* i = new TQCanvasLine(&canvas); - i->setPoints( rand()%canvas.width(), rand()%canvas.height(), - rand()%canvas.width(), rand()%canvas.height() ); - i->setPen( TQPen(TQColor(rand()%32*8,rand()%32*8,rand()%32*8), 6) ); - i->setZ(rand()%256); - i->show(); + TQCanvasLine* i = new TQCanvasLine(&canvas); + i->setPoints( rand()%canvas.width(), rand()%canvas.height(), + rand()%canvas.width(), rand()%canvas.height() ); + i->setPen( TQPen(TQColor(rand()%32*8,rand()%32*8,rand()%32*8), 6) ); + i->setZ(rand()%256); + i->show(); } void Main::addMesh() @@ -817,8 +817,8 @@ void Main::addMesh() int nodecount = 0; - int w = canvas.width(); - int h = canvas.height(); + int w = canvas.width(); + int h = canvas.height(); const int dist = 30; int rows = h / dist; @@ -839,7 +839,7 @@ void Main::addMesh() int r = rand(); int xrand = r %20; int yrand = (r/20) %20; - el->move( xrand + x0 + i*dist + (j%2 ? dist/2 : 0 ), + el->move( xrand + x0 + i*dist + (j%2 ? dist/2 : 0 ), yrand + y0 + j*dist ); if ( j > 0 ) { @@ -855,7 +855,7 @@ void Main::addMesh() } if ( i > 0 ) lastRow[i-1] = prev; prev = el; - el->show(); + el->show(); } lastRow[n-1]=prev; #ifndef TQT_NO_PROGRESSDIALOG @@ -872,13 +872,13 @@ void Main::addMesh() void Main::addRectangle() { - TQCanvasPolygonalItem *i = new TQCanvasRectangle( rand()%canvas.width(),rand()%canvas.height(), - canvas.width()/5,canvas.width()/5,&canvas); + TQCanvasPolygonalItem *i = new TQCanvasRectangle( rand()%canvas.width(),rand()%canvas.height(), + canvas.width()/5,canvas.width()/5,&canvas); int z = rand()%256; - i->setBrush( TQColor(z,z,z) ); - i->setPen( TQPen(TQColor(rand()%32*8,rand()%32*8,rand()%32*8), 6) ); - i->setZ(z); - i->show(); + i->setBrush( TQColor(z,z,z) ); + i->setPen( TQPen(TQColor(rand()%32*8,rand()%32*8,rand()%32*8), 6) ); + i->setZ(z); + i->show(); } @@ -911,8 +911,8 @@ int main(int argc, char** argv) else logo_fn = "qtlogo.png"; - TQCanvas canvas(800,600); - canvas.setAdvancePeriod(30); + TQCanvas canvas(800,600); + canvas.setAdvancePeriod(30); Main m(canvas); m.resize(m.sizeHint()); m.setCaption("TQt Example - Canvas"); diff --git a/doc/html/canvas.html b/doc/html/canvas.html index e40bafdd..8df99f85 100644 --- a/doc/html/canvas.html +++ b/doc/html/canvas.html @@ -35,41 +35,41 @@ body { background: #ffffff; color: black; }

The canvas module provides a highly optimized 2D graphic area called -TQCanvas. The canvas can contain an arbitrary number of TQCanvasItems. Canvas items can have an arbitrary +TQCanvas. The canvas can contain an arbitrary number of TQCanvasItems. Canvas items can have an arbitrary shape, size and content, can be freely moved around in the canvas, and can be checked for collisions. Canvas items can be set to move across the canvas automatically and animated canvas items are -supported with TQCanvasSprite. (If you require 3D graphics see TQt's +supported with TQCanvasSprite. (If you require 3D graphics see TQt's OpenGL module.) -

The canvas module uses a document/view model. The TQCanvasView class +

The canvas module uses a document/view model. The TQCanvasView class is used to show a particular view of a canvas. Multiple views can operate on the same canvas at the same time. Every view can use an arbitrary transformation matrix on the canvas which makes it easy to implement features such as zooming. -

-Screenshot of a canvas
-

TQt provides a number of predefined TQCanvas items as listed below. +

+Screenshot of a canvas
+

TQt provides a number of predefined TQCanvas items as listed below.

-

The two classes TQCanvasPixmap and TQCanvasPixmapArray are used -by TQCanvasSprite to show animated and moving pixmaps on the +

The two classes TQCanvasPixmap and TQCanvasPixmapArray are used +by TQCanvasSprite to show animated and moving pixmaps on the canvas.

More specialized items can be created by inheriting from one of the canvas item classes. It is easiest to inherit from one of -TQCanvasItem's derived classes (usually TQCanvasPolygonalItem) rather +TQCanvasItem's derived classes (usually TQCanvasPolygonalItem) rather than inherit TQCanvasItem directly. -

See examples/canvas for an example that shows off some of TQCanvas's +

See examples/canvas for an example that shows off some of TQCanvas's capabilities.

diff --git a/doc/html/chart-canvastext-h.html b/doc/html/chart-canvastext-h.html index 3313a6a0..8e625208 100644 --- a/doc/html/chart-canvastext-h.html +++ b/doc/html/chart-canvastext-h.html @@ -35,22 +35,22 @@ body { background: #ffffff; color: black; }

#ifndef CANVASTEXT_H
 #define CANVASTEXT_H
 
-#include <ntqcanvas.h>
+#include <tqcanvas.h>
 
 class TQFont;
 
 
-class CanvasText : public TQCanvasText
+class CanvasText : public TQCanvasText
 {
 public:
     enum { CANVAS_TEXT = 1100 };
 
     CanvasText( int index, TQCanvas *canvas )
-        : TQCanvasText( canvas ), m_index( index ) {}
+        : TQCanvasText( canvas ), m_index( index ) {}
     CanvasText( int index, const TQString& text, TQCanvas *canvas )
-        : TQCanvasText( text, canvas ), m_index( index ) {}
+        : TQCanvasText( text, canvas ), m_index( index ) {}
     CanvasText( int index, const TQString& text, TQFont font, TQCanvas *canvas )
-        : TQCanvasText( text, font, canvas ), m_index( index ) {}
+        : TQCanvasText( text, font, canvas ), m_index( index ) {}
 
     int index() const { return m_index; }
     void setIndex( int index ) { m_index = index; }
diff --git a/doc/html/chart-canvasview-cpp.html b/doc/html/chart-canvasview-cpp.html
index 35033962..064fb312 100644
--- a/doc/html/chart-canvasview-cpp.html
+++ b/doc/html/chart-canvasview-cpp.html
@@ -49,14 +49,14 @@ void CanvasView::contentsC
 
 void CanvasView::viewportResizeEvent( TQResizeEvent *e )
 {
-    canvas()->resize( e->size().width(), e->size().height() );
+    canvas()->resize( e->size().width(), e->size().height() );
     ((ChartForm*)parent())->drawElements();
 }
 
 
 void CanvasView::contentsMousePressEvent( TQMouseEvent *e )
 {
-    TQCanvasItemList list = canvas()->collisions( e->pos() );
+    TQCanvasItemList list = canvas()->collisions( e->pos() );
     for ( TQCanvasItemList::iterator it = list.begin(); it != list.end(); ++it )
         if ( (*it)->rtti() == CanvasText::CANVAS_TEXT ) {
             m_movingItem = *it;
@@ -82,7 +82,7 @@ void CanvasView::contentsMou
         (*m_elements)[i].setProX( chartType, item->x() / canvas()->width() );
         (*m_elements)[i].setProY( chartType, item->y() / canvas()->height() );
 
-        canvas()->update();
+        canvas()->update();
     }
 }
 
diff --git a/doc/html/chart-canvasview-h.html b/doc/html/chart-canvasview-h.html
index 9fd16d90..a27d89bf 100644
--- a/doc/html/chart-canvasview-h.html
+++ b/doc/html/chart-canvasview-h.html
@@ -38,20 +38,20 @@ body { background: #ffffff; color: black; }
 #include "element.h"
 #include "canvastext.h"
 
-#include <ntqcanvas.h>
+#include <tqcanvas.h>
 
 
 class TQPoint;
 
 
-class CanvasView : public TQCanvasView
+class CanvasView : public TQCanvasView
 {
     TQ_OBJECT
 public:
-    CanvasView( TQCanvas *canvas, ElementVector *elements,
+    CanvasView( TQCanvas *canvas, ElementVector *elements,
                 TQWidget* parent = 0, const char* name = "canvas view",
                 WFlags f = 0 )
-        : TQCanvasView( canvas, parent, name, f ), m_movingItem(0),
+        : TQCanvasView( canvas, parent, name, f ), m_movingItem(0),
           m_elements( elements ) {}
 
 protected:
@@ -61,7 +61,7 @@ protected:
     void contentsContextMenuEvent( TQContextMenuEvent *e );
 
 private:
-    TQCanvasItem *m_movingItem;
+    TQCanvasItem *m_movingItem;
     TQPoint m_pos;
     ElementVector *m_elements;
 };
diff --git a/doc/html/chart-chartform-cpp.html b/doc/html/chart-chartform-cpp.html
index f09f0e9b..cbb61428 100644
--- a/doc/html/chart-chartform-cpp.html
+++ b/doc/html/chart-chartform-cpp.html
@@ -254,8 +254,8 @@ const TQString APP_KEY = "/Chart/";
     if ( windowX != -1 || windowY != -1 )
         move( windowX, windowY );
 
-    m_canvas = new TQCanvas( this );
-    m_canvas->resize( width(), height() );
+    m_canvas = new TQCanvas( this );
+    m_canvas->resize( width(), height() );
     m_canvasView = new CanvasView( m_canvas, &m_elements, this );
     setCentralWidget( m_canvasView );
     m_canvasView->show();
diff --git a/doc/html/chart-chartform-h.html b/doc/html/chart-chartform-h.html
index b4a91c07..f96be589 100644
--- a/doc/html/chart-chartform-h.html
+++ b/doc/html/chart-chartform-h.html
@@ -110,7 +110,7 @@ private:
 
     TQString m_filename;
     TQStringList m_recentFiles;
-    TQCanvas *m_canvas;
+    TQCanvas *m_canvas;
     CanvasView *m_canvasView;
     bool m_changed;
     ElementVector m_elements;
diff --git a/doc/html/chart-chartform_canvas-cpp.html b/doc/html/chart-chartform_canvas-cpp.html
index 2b219656..2a8975ed 100644
--- a/doc/html/chart-chartform_canvas-cpp.html
+++ b/doc/html/chart-chartform_canvas-cpp.html
@@ -36,7 +36,7 @@ body { background: #ffffff; color: black; }
 #include "chartform.h"
 
 #include <ntqbrush.h>
-#include <ntqcanvas.h>
+#include <tqcanvas.h>
 
 #include <math.h> // sin, cos
 
@@ -46,7 +46,7 @@ body { background: #ffffff; color: black; }
 
 void ChartForm::drawElements()
 {
-    TQCanvasItemList list = m_canvas->allItems();
+    TQCanvasItemList list = m_canvas->allItems();
     for ( TQCanvasItemList::iterator it = list.begin(); it != list.end(); ++it )
         delete *it;
 
@@ -108,14 +108,14 @@ void ChartForm::drawPieChart( const double scales[], double t
     for ( int i = 0; i < MAX_ELEMENTS; ++i ) {
         if ( m_elements[i].isValid() ) {
             int extent = int(scales[i]);
-            TQCanvasEllipse *arc = new TQCanvasEllipse(
+            TQCanvasEllipse *arc = new TQCanvasEllipse(
                                             size, size, angle, extent, m_canvas );
-            arc->setX( x );
-            arc->setY( y );
-            arc->setZ( 0 );
-            arc->setBrush( TQBrush( m_elements[i].valueColor(),
+            arc->setX( x );
+            arc->setY( y );
+            arc->setZ( 0 );
+            arc->setBrush( TQBrush( m_elements[i].valueColor(),
                                    BrushStyle(m_elements[i].valuePattern()) ) );
-            arc->show();
+            arc->show();
             angle += extent;
             TQString label = m_elements[i].label();
             if ( !label.isEmpty() || m_addValues != NO ) {
@@ -125,22 +125,22 @@ void ChartForm::drawPieChart( const double scales[], double t
                 double proY = m_elements[i].proY( PIE );
                 if ( proX < 0 || proY < 0 ) {
                     // Find the centre of the pie segment
-                    TQRect rect = arc->boundingRect();
-                    proX = ( rect.width() / 2 ) + rect.x();
-                    proY = ( rect.height() / 2 ) + rect.y();
+                    TQRect rect = arc->boundingRect();
+                    proX = ( rect.width() / 2 ) + rect.x();
+                    proY = ( rect.height() / 2 ) + rect.y();
                     // Centre text over the centre of the pie segment
-                    rect = text->boundingRect();
-                    proX -= ( rect.width() / 2 );
-                    proY -= ( rect.height() / 2 );
+                    rect = text->boundingRect();
+                    proX -= ( rect.width() / 2 );
+                    proY -= ( rect.height() / 2 );
                     // Make proportional
                     proX /= width;
                     proY /= height;
                 }
-                text->setColor( m_elements[i].labelColor() );
-                text->setX( proX * width );
-                text->setY( proY * height );
-                text->setZ( 1 );
-                text->show();
+                text->setColor( m_elements[i].labelColor() );
+                text->setX( proX * width );
+                text->setY( proY * height );
+                text->setZ( 1 );
+                text->show();
                 m_elements[i].setProX( PIE, proX );
                 m_elements[i].setProY( PIE, proY );
             }
@@ -163,13 +163,13 @@ void ChartForm::drawVerticalBarChart(
         if ( m_elements[i].isValid() ) {
             int extent = int(scales[i]);
             int y = int(height - extent);
-            TQCanvasRectangle *rect = new TQCanvasRectangle(
+            TQCanvasRectangle *rect = new TQCanvasRectangle(
                                             x, y, prowidth, extent, m_canvas );
-            rect->setBrush( TQBrush( m_elements[i].valueColor(),
+            rect->setBrush( TQBrush( m_elements[i].valueColor(),
                                     BrushStyle(m_elements[i].valuePattern()) ) );
-            rect->setPen( pen );
-            rect->setZ( 0 );
-            rect->show();
+            rect->setPen( pen );
+            rect->setZ( 0 );
+            rect->show();
             TQString label = m_elements[i].label();
             if ( !label.isEmpty() || m_addValues != NO ) {
                 double proX = m_elements[i].proX( VERTICAL_BAR );
@@ -180,11 +180,11 @@ void ChartForm::drawVerticalBarChart(
                 }
                 label = valueLabel( label, m_elements[i].value(), total );
                 CanvasText *text = new CanvasText( i, label, m_font, m_canvas );
-                text->setColor( m_elements[i].labelColor() );
-                text->setX( proX * width );
-                text->setY( proY * height );
-                text->setZ( 1 );
-                text->show();
+                text->setColor( m_elements[i].labelColor() );
+                text->setX( proX * width );
+                text->setY( proY * height );
+                text->setZ( 1 );
+                text->show();
                 m_elements[i].setProX( VERTICAL_BAR, proX );
                 m_elements[i].setProY( VERTICAL_BAR, proY );
             }
@@ -207,13 +207,13 @@ void ChartForm::drawHorizontalBarChart(
     for ( int i = 0; i < MAX_ELEMENTS; ++i ) {
         if ( m_elements[i].isValid() ) {
             int extent = int(scales[i]);
-            TQCanvasRectangle *rect = new TQCanvasRectangle(
+            TQCanvasRectangle *rect = new TQCanvasRectangle(
                                             0, y, extent, proheight, m_canvas );
-            rect->setBrush( TQBrush( m_elements[i].valueColor(),
+            rect->setBrush( TQBrush( m_elements[i].valueColor(),
                                     BrushStyle(m_elements[i].valuePattern()) ) );
-            rect->setPen( pen );
-            rect->setZ( 0 );
-            rect->show();
+            rect->setPen( pen );
+            rect->setZ( 0 );
+            rect->show();
             TQString label = m_elements[i].label();
             if ( !label.isEmpty() || m_addValues != NO ) {
                 double proX = m_elements[i].proX( HORIZONTAL_BAR );
@@ -224,11 +224,11 @@ void ChartForm::drawHorizontalBarChart(
                 }
                 label = valueLabel( label, m_elements[i].value(), total );
                 CanvasText *text = new CanvasText( i, label, m_font, m_canvas );
-                text->setColor( m_elements[i].labelColor() );
-                text->setX( proX * width );
-                text->setY( proY * height );
-                text->setZ( 1 );
-                text->show();
+                text->setColor( m_elements[i].labelColor() );
+                text->setX( proX * width );
+                text->setY( proY * height );
+                text->setZ( 1 );
+                text->show();
                 m_elements[i].setProX( HORIZONTAL_BAR, proX );
                 m_elements[i].setProY( HORIZONTAL_BAR, proY );
             }
diff --git a/doc/html/classchart.html b/doc/html/classchart.html
index a88e8b04..fa553bae 100644
--- a/doc/html/classchart.html
+++ b/doc/html/classchart.html
@@ -43,15 +43,15 @@ body { background: #ffffff; color: black; }
 
 
 
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
 
 
 
@@ -98,7 +98,7 @@ body { background: #ffffff; color: black; }
 
 
 
-
+
 
 
 
@@ -154,7 +154,7 @@ body { background: #ffffff; color: black; }
 
 
 
-
+
 
 
 
diff --git a/doc/html/classes.html b/doc/html/classes.html
index fc95aeb0..5830b891 100644
--- a/doc/html/classes.html
+++ b/doc/html/classes.html
@@ -412,7 +412,7 @@ classes, see TQt's Main Classes.
 
TQUrlInfo
-TQCanvas +TQCanvas TQEvent @@ -423,7 +423,7 @@ classes, see TQt's Main Classes. TQUrlOperator
-TQCanvasEllipse +TQCanvasEllipse TQEventLoop @@ -434,7 +434,7 @@ classes, see TQt's Main Classes. TQUuid
-TQCanvasItem +TQCanvasItem F TQFile @@ -445,7 +445,7 @@ classes, see TQt's Main Classes. TQValidator
-TQCanvasItemList +TQCanvasItemList TQFileDialog @@ -456,7 +456,7 @@ classes, see TQt's Main Classes. TQValueList
-TQCanvasLine +TQCanvasLine TQFileIconProvider @@ -467,7 +467,7 @@ classes, see TQt's Main Classes. TQValueListConstIterator
-TQCanvasPixmap +TQCanvasPixmap TQFileInfo M @@ -478,7 +478,7 @@ classes, see TQt's Main Classes. TQValueListIterator
-TQCanvasPixmapArray +TQCanvasPixmapArray TQFilePreview @@ -489,7 +489,7 @@ classes, see TQt's Main Classes. TQValueStack
-TQCanvasPolygon +TQCanvasPolygon TQFocusData @@ -500,7 +500,7 @@ classes, see TQt's Main Classes. TQValueVector
-TQCanvasPolygonalItem +TQCanvasPolygonalItem TQFocusEvent @@ -511,7 +511,7 @@ classes, see TQt's Main Classes. TQVariant
-TQCanvasRectangle +TQCanvasRectangle TQFont @@ -522,7 +522,7 @@ classes, see TQt's Main Classes. TQVBox
-TQCanvasSpline +TQCanvasSpline TQFontDatabase @@ -533,7 +533,7 @@ classes, see TQt's Main Classes. TQVBoxLayout
-TQCanvasSprite +TQCanvasSprite TQFontDialog @@ -544,7 +544,7 @@ classes, see TQt's Main Classes. TQVButtonGroup
-TQCanvasText +TQCanvasText TQFontInfo @@ -555,7 +555,7 @@ classes, see TQt's Main Classes. TQVGroupBox
-TQCanvasView +TQCanvasView TQFontManager * diff --git a/doc/html/emb-features.html b/doc/html/emb-features.html index ba76e2ec..d5798305 100644 --- a/doc/html/emb-features.html +++ b/doc/html/emb-features.html @@ -187,7 +187,7 @@ translation (TQWMatrix) Lists of information (TQListView) TQT_NO_WIDGETS
TQT_NO_CANVAS -Object canvas (TQCanvas) +Object canvas (TQCanvas) TQT_NO_WIDGETS
TQT_NO_DIAL Value control (TQDial) diff --git a/doc/html/functions.html b/doc/html/functions.html index c803f2c2..2a4680d5 100644 --- a/doc/html/functions.html +++ b/doc/html/functions.html @@ -130,14 +130,14 @@ abort: TQSplitter
  • adjustRow: TQTable
  • adjustSize: TQMessageBox TQSimpleRichText TQWidget
  • advance: - TQCanvas TQCanvasItem TQCanvasSprite
  • afterSeek: + TQCanvas TQCanvasItem TQCanvasSprite
  • afterSeek: TQSqlQuery
  • alignment: TQGroupBox TQLabel TQLayoutItem TQLineEdit TQMultiLineEdit TQStyleSheetItem TQTableItem TQTextEdit
  • alignmentRect: TQLayout
  • all: TQMacMime TQWindowsMime
  • allColumnsShowFocus: TQListView
  • allGray: TQImage
  • allItems: - TQCanvas
  • allWidgets: + TQCanvas
  • allWidgets: TQApplication
  • alloc: TQColor TQScreen
  • allocation: TQWSWindow
  • allowedInContext: @@ -149,10 +149,10 @@ abort: TQTextBrowser
  • anchorCol: TQTableSelection
  • anchorRow: TQTableSelection
  • angleLength: - TQCanvasEllipse
  • angleStart: - TQCanvasEllipse
  • animateClick: + TQCanvasEllipse
  • angleStart: + TQCanvasEllipse
  • animateClick: TQButton
  • animated: - TQCanvasItem
  • answerRect: + TQCanvasItem
  • answerRect: TQDragMoveEvent
  • appID: TQAxFactory
  • append: TQCString TQIconDrag TQPtrList TQSqlCursor TQSqlIndex TQSqlRecord TQString TQTextEdit TQValueList TQValueVector TQXmlAttributes
  • appendChild: @@ -164,8 +164,8 @@ abort: TQTabDialog
  • appropriate: TQMainWindow TQWizard
  • area: TQDockWindow
  • areaPoints: - TQCanvasPolygon TQCanvasPolygonalItem
  • areaPointsAdvanced: - TQCanvasPolygonalItem
  • arg: + TQCanvasPolygon TQCanvasPolygonalItem
  • areaPointsAdvanced: + TQCanvasPolygonalItem
  • arg: TQNPInstance TQNetworkOperation TQString
  • argc: TQApplication TQNPInstance
  • argn: TQNPInstance
  • arguments: @@ -248,10 +248,10 @@ back: TQWizard
  • background: TQColorGroup
  • backgroundBrush: TQWidget
  • backgroundColor: - TQCanvas TQMovie TQPainter
  • backgroundMode: + TQCanvas TQMovie TQPainter
  • backgroundMode: TQPainter TQWidget
  • backgroundOrigin: TQWidget
  • backgroundPixmap: - TQCanvas
  • backspace: + TQCanvas
  • backspace: TQLineEdit TQMultiLineEdit
  • backward: TQTextBrowser
  • backwardAvailable: TQTextBrowser
  • base: @@ -282,7 +282,7 @@ back: TQFont TQFontDatabase TQFontInfo TQTextEdit
  • bottom: TQDoubleValidator TQIntValidator TQRect
  • bottomDock: TQMainWindow
  • bottomEdge: - TQCanvasSprite
  • bottomLeft: + TQCanvasSprite
  • bottomLeft: TQRect
  • bottomMargin: TQScrollView
  • bottomRight: TQRect
  • bottomRow: @@ -293,11 +293,11 @@ back: TQDataBrowser
  • boundaryChecking: TQDataBrowser
  • boundedTo: TQSize
  • boundingRect: - TQCanvasItem TQCanvasPolygonalItem TQCanvasSprite TQCanvasText TQFontMetrics TQPainter TQPicture TQPointArray TQRegion
  • boundingRectAdvanced: - TQCanvasItem
  • boxLayout: + TQCanvasItem TQCanvasPolygonalItem TQCanvasSprite TQCanvasText TQFontMetrics TQPainter TQPicture TQPointArray TQRegion
  • boundingRectAdvanced: + TQCanvasItem
  • boxLayout: TQDockWindow
  • brightText: TQColorGroup
  • brush: - TQCanvasPolygonalItem TQColorGroup TQPainter TQPalette
  • brushOrigin: + TQCanvasPolygonalItem TQColorGroup TQPainter TQPalette
  • brushOrigin: TQPainter
  • bsearch: TQMemArray TQPtrVector
  • buddy: TQLabel
  • buffer: @@ -336,7 +336,7 @@ c: TQProgressDialog
  • canonicalName: TQDns
  • canonicalPath: TQDir
  • canvas: - TQCanvasItem TQCanvasView
  • cap: + TQCanvasItem TQCanvasView
  • cap: TQRegExp
  • capStyle: TQPen
  • capacity: TQString TQValueVector
  • caption: @@ -388,8 +388,8 @@ c: TQGLContext
  • choosePixelFormat: TQGLContext
  • chooseVisual: TQGLContext
  • chunkSize: - TQCanvas
  • chunks: - TQCanvasRectangle
  • classID: + TQCanvas
  • chunks: + TQCanvasRectangle
  • classID: TQAxFactory
  • classInfo: TQMetaObject
  • className: TQMetaObject TQObject
  • cleanDirPath: @@ -435,7 +435,7 @@ c: TQDockWindow
  • closeMouse: TQWSServer
  • closeStdin: TQProcess
  • closed: - TQCanvasSpline
  • closingDown: + TQCanvasSpline
  • closingDown: TQApplication
  • clut: TQScreen
  • cmd: TQPaintDevice
  • codec: @@ -452,9 +452,9 @@ c: TQTableItem
  • colStretch: TQGridLayout
  • collapsed: TQListView
  • collidesWith: - TQCanvasItem
  • collisions: - TQCanvas TQCanvasItem
  • color: - TQBrush TQCanvasText TQColorGroup TQImage TQPalette TQPen TQStyleOption TQStyleSheetItem TQTextEdit
  • colorGroup: + TQCanvasItem
  • collisions: + TQCanvas TQCanvasItem
  • color: + TQBrush TQCanvasText TQColorGroup TQImage TQPalette TQPen TQStyleOption TQStyleSheetItem TQTextEdit
  • colorGroup: TQWidget
  • colorMode: TQPrinter
  • colorNames: TQColor
  • colorSpec: @@ -538,7 +538,7 @@ c: TQStyleSheetItem
  • control: TQAxBase
  • controlAt: TQAccessibleInterface
  • controlPoints: - TQCanvasSpline
  • controllingUnknown: + TQCanvasSpline
  • controllingUnknown: TQAxAggregated
  • convertBitOrder: TQImage
  • convertDepth: TQImage
  • convertDepthWithPalette: @@ -558,7 +558,7 @@ c: TQTextEdit
  • copyBlt: TQPixmap
  • cornerWidget: TQScrollView TQTabWidget
  • count: - TQAccel TQAsciiCache TQAsciiCacheIterator TQAsciiDict TQAsciiDictIterator TQButtonGroup TQCache TQCacheIterator TQCanvasPixmapArray TQComboBox TQComboTableItem TQDict TQDictIterator TQDir TQDockArea TQDomNamedNodeMap TQDomNodeList TQFocusData TQHeader TQIconView TQIntCache TQIntCacheIterator TQIntDict TQIntDictIterator TQKeyEvent TQKeySequence TQListBox TQMap TQMemArray TQMenuData TQPtrCollection TQPtrDict TQPtrDictIterator TQPtrList TQPtrListIterator TQPtrQueue TQPtrStack TQPtrVector TQSqlForm TQSqlRecord TQTabBar TQTabWidget TQToolBox TQValueList TQValueVector TQXmlAttributes
  • countCf: + TQAccel TQAsciiCache TQAsciiCacheIterator TQAsciiDict TQAsciiDictIterator TQButtonGroup TQCache TQCacheIterator TQCanvasPixmapArray TQComboBox TQComboTableItem TQDict TQDictIterator TQDir TQDockArea TQDomNamedNodeMap TQDomNodeList TQFocusData TQHeader TQIconView TQIntCache TQIntCacheIterator TQIntDict TQIntDictIterator TQKeyEvent TQKeySequence TQListBox TQMap TQMemArray TQMenuData TQPtrCollection TQPtrDict TQPtrDictIterator TQPtrList TQPtrListIterator TQPtrQueue TQPtrStack TQPtrVector TQSqlForm TQSqlRecord TQTabBar TQTabWidget TQToolBox TQValueList TQValueVector TQXmlAttributes
  • countCf: TQWindowsMime
  • countFlavors: TQMacMime
  • country: TQLocale
  • countryToString: @@ -791,23 +791,23 @@ dark: TQWidget
  • dragObject: TQIconView TQListView TQTable
  • draggingSlider: TQScrollBar
  • draw: - TQCanvasItem TQCanvasPolygonalItem TQCanvasSprite TQCanvasText TQSimpleRichText
  • drawArc: + TQCanvasItem TQCanvasPolygonalItem TQCanvasSprite TQCanvasText TQSimpleRichText
  • drawArc: TQPainter
  • drawArea: - TQCanvas
  • drawBackground: - TQCanvas TQIconView
  • drawButton: + TQCanvas
  • drawBackground: + TQCanvas TQIconView
  • drawButton: TQButton
  • drawButtonLabel: TQButton
  • drawChord: TQPainter
  • drawComplexControl: TQStyle
  • drawComplexControlMask: TQStyle
  • drawContents: - TQCanvasView TQFrame TQLCDNumber TQLabel TQMenuBar TQPopupMenu TQScrollView TQSplashScreen TQTable
  • drawContentsOffset: + TQCanvasView TQFrame TQLCDNumber TQLabel TQMenuBar TQPopupMenu TQScrollView TQSplashScreen TQTable
  • drawContentsOffset: TQListView TQScrollView
  • drawControl: TQStyle
  • drawControlMask: TQStyle
  • drawConvexPolygon: TQPainter
  • drawCubicBezier: TQPainter
  • drawEllipse: TQPainter
  • drawForeground: - TQCanvas
  • drawFrame: + TQCanvas
  • drawFrame: TQFrame
  • drawImage: TQPainter
  • drawItem: TQPopupMenu TQStyle
  • drawLine: @@ -825,7 +825,7 @@ dark: TQPlatinumStyle
  • drawRoundRect: TQPainter
  • drawRubber: TQIconView
  • drawShape: - TQCanvasEllipse TQCanvasPolygon TQCanvasPolygonalItem TQCanvasRectangle
  • drawText: + TQCanvasEllipse TQCanvasPolygon TQCanvasPolygonalItem TQCanvasRectangle
  • drawText: TQPainter TQWidget
  • drawTiledPixmap: TQPainter
  • drawWinFocusRect: TQPainter
  • driver: @@ -876,7 +876,7 @@ echoMode: TQXmlContentHandler
  • endEntity: TQXmlLexicalHandler
  • endGroup: TQSettings
  • endPoint: - TQCanvasLine
  • endPrefixMapping: + TQCanvasLine
  • endPrefixMapping: TQXmlContentHandler
  • endsWith: TQString
  • enforceSortOrder: TQListViewItem
  • enqueue: @@ -998,7 +998,7 @@ falseText: TQMacStyle
  • focusStyle: TQTable
  • focusWidget: TQApplication TQFocusData TQWidget
  • font: - TQApplication TQCanvasText TQFontDatabase TQPainter TQToolTip TQWidget
  • fontChange: + TQApplication TQCanvasText TQFontDatabase TQPainter TQToolTip TQWidget
  • fontChange: TQWidget
  • fontFamily: TQStyleSheetItem
  • fontInfo: TQPainter TQWidget
  • fontItalic: @@ -1017,10 +1017,10 @@ falseText: TQSqlDriver
  • forward: TQTextBrowser
  • forwardAvailable: TQTextBrowser
  • frame: - TQCanvasSprite TQLineEdit
  • frameBuffer: + TQCanvasSprite TQLineEdit
  • frameBuffer: TQDirectPainter
  • frameChanged: TQFrame
  • frameCount: - TQCanvasSprite
  • frameDone: + TQCanvasSprite
  • frameDone: TQImageConsumer
  • frameGeometry: TQWidget
  • frameImage: TQMovie
  • frameNumber: @@ -1169,7 +1169,7 @@ hScrollBarMode: TQListView
  • headerSection: TQStyleOption
  • headerWidth: TQHeader
  • height: - TQCanvas TQCanvasEllipse TQCanvasRectangle TQCanvasSprite TQDirectPainter TQFontMetrics TQIconViewItem TQImage TQListBoxItem TQListBoxPixmap TQListBoxText TQListViewItem TQPaintDeviceMetrics TQPixmap TQRect TQScreen TQSimpleRichText TQSize TQWidget
  • heightForWidth: + TQCanvas TQCanvasEllipse TQCanvasRectangle TQCanvasSprite TQDirectPainter TQFontMetrics TQIconViewItem TQImage TQListBoxItem TQListBoxPixmap TQListBoxText TQListViewItem TQPaintDeviceMetrics TQPixmap TQRect TQScreen TQSimpleRichText TQSize TQWidget
  • heightForWidth: TQBoxLayout TQGridLayout TQLayoutItem TQMenuBar TQTextEdit TQWidget
  • heightMM: TQPaintDeviceMetrics
  • help: TQWizard
  • helpButton: @@ -1178,7 +1178,7 @@ hScrollBarMode: TQWizard
  • heuristicContentMatch: TQTextCodec
  • heuristicNameMatch: TQTextCodec
  • hide: - TQCanvasItem TQMenuBar TQToolTip TQWSWindow TQWidget
  • hideColumn: + TQCanvasItem TQMenuBar TQToolTip TQWSWindow TQWidget
  • hideColumn: TQListView TQTable
  • hideEvent: TQScrollBar TQWidget
  • hideOrShow: TQStatusBar
  • hideRow: @@ -1221,8 +1221,8 @@ icon: TQWidget
  • imEndEvent: TQWidget
  • imStartEvent: TQWidget
  • image: - TQCanvasPixmapArray TQCanvasSprite TQClipboard TQImageDecoder TQImageIO
  • imageAdvanced: - TQCanvasSprite
  • imageFormat: + TQCanvasPixmapArray TQCanvasSprite TQClipboard TQImageDecoder TQImageIO
  • imageAdvanced: + TQCanvasSprite
  • imageFormat: TQImage TQImageIO TQPixmap
  • implementation: TQDomDocument
  • importNode: TQDomDocument
  • inFont: @@ -1300,9 +1300,9 @@ icon: TQSpinBox
  • intersect: TQRect TQRegion
  • intersects: TQIconViewItem TQRect
  • invalidate: - TQBoxLayout TQCanvasPolygonalItem TQGridLayout TQLayout TQLayoutItem
  • invalidateHeight: + TQBoxLayout TQCanvasPolygonalItem TQGridLayout TQLayout TQLayoutItem
  • invalidateHeight: TQListViewItem
  • inverseWorldMatrix: - TQCanvasView
  • invert: + TQCanvasView
  • invert: TQWMatrix
  • invertPixels: TQImage
  • invertSelection: TQIconView TQListBox TQListView
  • ioDevice: @@ -1310,7 +1310,7 @@ icon: TQObject
  • isAccepted: TQCloseEvent TQContextMenuEvent TQDropEvent TQIMEvent TQIconDragEvent TQKeyEvent TQMouseEvent TQTabletEvent TQWheelEvent
  • isActionAccepted: TQDropEvent
  • isActive: - TQAccessible TQCanvasItem TQPainter TQSqlQuery TQSqlResult TQTableSelection TQTimer
  • isActiveWindow: + TQAccessible TQCanvasItem TQPainter TQSqlQuery TQSqlResult TQTableSelection TQTimer
  • isActiveWindow: TQWidget TQXtWidget
  • isAnchor: TQStyleSheetItem
  • isAsynchronous: TQIODevice
  • isAttr: @@ -1360,7 +1360,7 @@ icon: TQApplication
  • isElement: TQDomElement TQDomNode
  • isEmpty: TQAsciiCache TQAsciiCacheIterator TQAsciiDict TQAsciiDictIterator TQCString TQCache TQCacheIterator TQDict TQDictIterator TQDockArea TQGLColormap TQIntCache TQIntCacheIterator TQIntDict TQIntDictIterator TQKeySequence TQLayout TQLayoutItem TQMap TQMemArray TQObjectCleanupHandler TQPtrDict TQPtrDictIterator TQPtrList TQPtrListIterator TQPtrQueue TQPtrStack TQPtrVector TQRect TQRegExp TQRegion TQSize TQSpacerItem TQSqlRecord TQString TQTableSelection TQTranslator TQValueList TQValueVector TQWidgetItem
  • isEnabled: - TQAccel TQAction TQCanvasItem TQLayout TQListViewItem TQSocketNotifier TQTab TQTableItem TQWidget
  • isEnabledTo: + TQAccel TQAction TQCanvasItem TQLayout TQListViewItem TQSocketNotifier TQTab TQTableItem TQWidget
  • isEnabledTo: TQWidget
  • isEntity: TQDomEntity TQDomNode
  • isEntityReference: TQDomEntityReference TQDomNode
  • isEnumType: @@ -1446,7 +1446,7 @@ icon: TQFontDatabase
  • isSelect: TQSqlQuery TQSqlResult
  • isSelectable: TQIconViewItem TQListBoxItem TQListViewItem
  • isSelected: - TQCanvasItem TQIconViewItem TQListBox TQListBoxItem TQListView TQListViewItem TQTable
  • isSeparator: + TQCanvasItem TQIconViewItem TQListBox TQListBoxItem TQListView TQListViewItem TQTable
  • isSeparator: TQCustomMenuItem
  • isSequentialAccess: TQIODevice
  • isServer: TQAxFactory
  • isService: @@ -1477,11 +1477,11 @@ icon: TQLineEdit TQTextEdit
  • isUndoRedoEnabled: TQTextEdit
  • isUpdatesEnabled: TQWidget
  • isValid: - TQAccessibleInterface TQAxScriptEngine TQCanvasPixmapArray TQCanvasPolygonalItem TQColor TQDate TQDateTime TQGLContext TQGLWidget TQHttpHeader TQRect TQRegExp TQSize TQSocketDevice TQSqlQuery TQSqlResult TQTime TQUrl TQUrlInfo TQVariant
  • isVerticalSliderPressed: + TQAccessibleInterface TQAxScriptEngine TQCanvasPixmapArray TQCanvasPolygonalItem TQColor TQDate TQDateTime TQGLContext TQGLWidget TQHttpHeader TQRect TQRegExp TQSize TQSocketDevice TQSqlQuery TQSqlResult TQTime TQUrl TQUrlInfo TQVariant
  • isVerticalSliderPressed: TQScrollView
  • isVerticallyStretchable: TQDockWindow
  • isVirtualDesktop: TQDesktopWidget
  • isVisible: - TQAction TQCanvasItem TQListViewItem TQWSWindow TQWidget
  • isVisibleTo: + TQAction TQCanvasItem TQListViewItem TQWSWindow TQWidget
  • isVisibleTo: TQWidget
  • isWidgetType: TQObject
  • isWorking: TQDns
  • isWritable: @@ -1563,7 +1563,7 @@ label: TQFontMetrics
  • leftCol: TQTableSelection
  • leftDock: TQMainWindow
  • leftEdge: - TQCanvasSprite
  • leftJustify: + TQCanvasSprite
  • leftJustify: TQCString TQString
  • leftMargin: TQScrollView
  • length: TQCString TQDomCharacterData TQDomNamedNodeMap TQDomNodeList TQSqlFieldInfo TQString TQTextEdit TQXmlAttributes
  • lessThan: @@ -1745,11 +1745,11 @@ m11: TQSizeGrip TQWidget
  • mousePressEvent: TQSizeGrip TQWidget
  • mouseReleaseEvent: TQWidget
  • move: - TQCanvasItem TQCanvasSprite TQIconViewItem TQWidget
  • moveBottom: + TQCanvasItem TQCanvasSprite TQIconViewItem TQWidget
  • moveBottom: TQRect
  • moveBottomLeft: TQRect
  • moveBottomRight: TQRect
  • moveBy: - TQCanvasItem TQIconViewItem TQRect
  • moveCenter: + TQCanvasItem TQIconViewItem TQRect
  • moveCenter: TQRect
  • moveChild: TQScrollView
  • moveCursor: TQTextEdit
  • moveDockWindow: @@ -1840,14 +1840,14 @@ object: TQAccessibleObject TQAxAggregated
  • objectTrees: TQObject
  • offset: TQDirectPainter TQDockWindow TQHeader TQImage
  • offsetX: - TQCanvasPixmap
  • offsetY: - TQCanvasPixmap
  • ok: + TQCanvasPixmap
  • offsetY: + TQCanvasPixmap
  • ok: TQServerSocket
  • okRename: TQListViewItem
  • okay: TQNPStream
  • oldPos: TQMoveEvent
  • oldSize: TQResizeEvent
  • onCanvas: - TQCanvas
  • onCard: + TQCanvas
  • onCard: TQScreen
  • onItem: TQIconView TQListBox TQListView
  • onViewport: TQIconView TQListBox TQListView
  • opType: @@ -1883,7 +1883,7 @@ object: TQAsciiCacheIterator TQAsciiDictIterator TQCacheIterator TQDictIterator TQIntCacheIterator TQIntDictIterator TQPtrDictIterator TQPtrListIterator
  • operator*: TQGuardedPtr TQListViewItemIterator TQMapConstIterator TQMapIterator TQPoint TQPtrListIterator TQSize TQValueListConstIterator TQValueListIterator
  • operator*=: TQPoint TQSize TQWMatrix
  • operator+: - TQCString TQCanvasItemList TQPoint TQRegion TQSize TQString TQValueList
  • operator++: + TQCString TQCanvasItemList TQPoint TQRegion TQSize TQString TQValueList
  • operator++: TQAsciiCacheIterator TQAsciiDictIterator TQCacheIterator TQDictIterator TQIntCacheIterator TQIntDictIterator TQLayoutIterator TQListViewItemIterator TQMapConstIterator TQMapIterator TQPtrDictIterator TQPtrListIterator TQSemaphore TQValueListConstIterator TQValueListIterator
  • operator+=: TQAsciiCacheIterator TQAsciiDictIterator TQCString TQCacheIterator TQIntCacheIterator TQIntDictIterator TQListViewItemIterator TQPoint TQPtrDictIterator TQPtrListIterator TQRegion TQSemaphore TQSize TQString TQValueList TQValueListIterator
  • operator-: TQPoint TQRegion TQSize
  • operator--: @@ -1982,7 +1982,7 @@ packImage: TQSocket TQSocketDevice
  • peerName: TQSocket
  • peerPort: TQSocket TQSocketDevice
  • pen: - TQCanvasPolygonalItem TQPainter
  • percentageVisible: + TQCanvasPolygonalItem TQPainter
  • percentageVisible: TQProgressBar
  • permission: TQFileInfo
  • permissions: TQUrlInfo
  • picture: @@ -2008,7 +2008,7 @@ packImage: TQFont TQFontInfo TQTextEdit
  • pointSizeFloat: TQFont
  • pointSizes: TQFontDatabase
  • points: - TQCanvasPolygon
  • polish: + TQCanvasPolygon
  • polish: TQApplication TQStyle TQWidget
  • polishPopupMenu: TQStyle
  • pop: TQPtrStack TQValueStack
  • popContext: @@ -2157,7 +2157,7 @@ rBottom: TQSettings
  • readBufferSize: TQSocket
  • readBytes: TQDataStream
  • readCollisionMasks: - TQCanvasPixmapArray
  • readDoubleEntry: + TQCanvasPixmapArray
  • readDoubleEntry: TQSettings
  • readEntry: TQSettings
  • readField: TQSqlForm
  • readFields: @@ -2168,7 +2168,7 @@ rBottom: TQFileInfo
  • readListEntry: TQSettings
  • readNumEntry: TQSettings
  • readPixmaps: - TQCanvasPixmapArray
  • readRawBytes: + TQCanvasPixmapArray
  • readRawBytes: TQDataStream TQTextStream
  • readStderr: TQProcess
  • readStdout: TQProcess
  • ready: @@ -2186,7 +2186,7 @@ rBottom: TQDataView TQSqlDatabase TQSqlDriver
  • recordInfo: TQSqlDatabase TQSqlDriver
  • recordType: TQDns
  • rect: - TQAccessibleInterface TQCanvas TQCanvasRectangle TQDirectPainter TQIconViewItem TQImage TQPaintEvent TQPixmap TQRect TQStyleOption TQTab TQWidget
  • rects: + TQAccessibleInterface TQCanvas TQCanvasRectangle TQDirectPainter TQIconViewItem TQImage TQPaintEvent TQPixmap TQRect TQStyleOption TQTab TQWidget
  • rects: TQRegion
  • red: TQColor
  • redirect: TQPainter
  • redo: @@ -2289,7 +2289,7 @@ rBottom: TQFocusEvent
  • resetStatus: TQIODevice
  • resetXForm: TQPainter
  • resize: - TQAsciiDict TQBitArray TQCString TQCanvas TQDict TQIntDict TQMemArray TQPixmap TQPtrDict TQPtrVector TQValueVector TQWidget
  • resizeContents: + TQAsciiDict TQBitArray TQCString TQCanvas TQDict TQIntDict TQMemArray TQPixmap TQPtrDict TQPtrVector TQValueVector TQWidget
  • resizeContents: TQScrollView
  • resizeData: TQTable
  • resizeEvent: TQFrame TQGLWidget TQListView TQWidget
  • resizeGL: @@ -2298,7 +2298,7 @@ rBottom: TQGLWidget
  • resizePolicy: TQScrollView
  • resizeSection: TQHeader
  • resized: - TQCanvas TQDesktopWidget
  • resolution: + TQCanvas TQDesktopWidget
  • resolution: TQPrinter
  • resolve: TQFont TQLibrary
  • resolveEntity: TQXmlEntityResolver
  • resortDir: @@ -2311,7 +2311,7 @@ rBottom: TQApplication
  • result: TQDialog TQSqlQuery
  • resultsReady: TQDns
  • retune: - TQCanvas
  • returnPressed: + TQCanvas
  • returnPressed: TQIconView TQLineEdit TQListBox TQListView TQTextEdit
  • reverseLayout: TQApplication
  • rewind: TQDataSource TQIODeviceSource
  • rewindable: @@ -2325,7 +2325,7 @@ rBottom: TQIconView TQListBox TQListView
  • rightCol: TQTableSelection
  • rightDock: TQMainWindow
  • rightEdge: - TQCanvasSprite
  • rightJustify: + TQCanvasSprite
  • rightJustify: TQCString TQString
  • rightMargin: TQScrollView
  • rmdir: TQDir TQFtp
  • role: @@ -2347,7 +2347,7 @@ rBottom: TQGridLayout
  • rowSpan: TQTableItem
  • rowStretch: TQGridLayout
  • rtti: - TQCanvasEllipse TQCanvasItem TQCanvasLine TQCanvasPolygon TQCanvasPolygonalItem TQCanvasRectangle TQCanvasSpline TQCanvasSprite TQCanvasText TQCheckListItem TQCheckTableItem TQComboTableItem TQIconViewItem TQListBoxItem TQListViewItem TQTableItem
  • run: + TQCanvasEllipse TQCanvasItem TQCanvasLine TQCanvasPolygon TQCanvasPolygonalItem TQCanvasRectangle TQCanvasSpline TQCanvasSprite TQCanvasText TQCheckListItem TQCheckTableItem TQComboTableItem TQIconViewItem TQListBoxItem TQListViewItem TQTableItem
  • run: TQThread
  • running: TQMovie TQThread
  • rwidth: TQSize
  • rx: @@ -2438,20 +2438,20 @@ sRect: TQWidget
  • setAccum: TQGLFormat
  • setAction: TQDropEvent
  • setActive: - TQCanvasItem TQPalette TQSqlResult
  • setActiveItem: + TQCanvasItem TQPalette TQSqlResult
  • setActiveItem: TQPopupMenu
  • setActiveWindow: TQWSWindow TQWidget TQXtWidget
  • setAddress: TQHostAddress
  • setAddressReusable: TQSocketDevice
  • setAdvancePeriod: - TQCanvas
  • setAlignment: + TQCanvas
  • setAlignment: TQGroupBox TQLabel TQLayoutItem TQLineEdit TQMultiLineEdit TQStyleSheetItem TQTextEdit
  • setAllChanged: - TQCanvas
  • setAllColumnsShowFocus: + TQCanvas
  • setAllColumnsShowFocus: TQListView
  • setAlpha: TQGLFormat
  • setAlphaBuffer: TQImage
  • setAnchor: TQStyleSheetItem
  • setAngles: - TQCanvasEllipse
  • setAnimated: - TQCanvasItem
  • setApplyButton: + TQCanvasEllipse
  • setAnimated: + TQCanvasItem
  • setApplyButton: TQTabDialog
  • setAppropriate: TQMainWindow TQWizard
  • setAreaChanged: TQDirectPainter
  • setArg: @@ -2480,10 +2480,10 @@ sRect: TQProgressDialog
  • setAutoUnload: TQLibrary
  • setBackEnabled: TQWizard
  • setBackgroundColor: - TQCanvas TQMovie TQPainter
  • setBackgroundMode: + TQCanvas TQMovie TQPainter
  • setBackgroundMode: TQPainter TQWidget
  • setBackgroundOrigin: TQWidget
  • setBackgroundPixmap: - TQCanvas
  • setBar: + TQCanvas
  • setBar: TQProgressDialog
  • setBaseSize: TQWidget
  • setBinMode: TQLCDNumber
  • setBit: @@ -2496,7 +2496,7 @@ sRect: TQRect
  • setBoundaryChecking: TQDataBrowser
  • setBoundingRect: TQPicture
  • setBrush: - TQCanvasPolygonalItem TQColorGroup TQPainter TQPalette
  • setBrushOrigin: + TQCanvasPolygonalItem TQColorGroup TQPainter TQPalette
  • setBrushOrigin: TQPainter
  • setBuddy: TQLabel
  • setBuffer: TQBuffer
  • setButton: @@ -2509,7 +2509,7 @@ sRect: TQSqlCursor TQSqlFieldInfo
  • setCancelButton: TQProgressDialog TQTabDialog
  • setCancelButtonText: TQProgressDialog
  • setCanvas: - TQCanvasItem TQCanvasView
  • setCapStyle: + TQCanvasItem TQCanvasView
  • setCapStyle: TQPen
  • setCaption: TQWidget
  • setCaseSensitive: TQRegExp
  • setCellContentFromEditor: @@ -2519,7 +2519,7 @@ sRect: TQGridView
  • setCenterIndicator: TQProgressBar
  • setCentralWidget: TQMainWindow
  • setChanged: - TQCanvas
  • setCheckable: + TQCanvas
  • setCheckable: TQGroupBox TQPopupMenu
  • setChecked: TQCheckBox TQCheckTableItem TQGroupBox TQRadioButton
  • setChildGeometries: TQWidgetStack
  • setChildrenCollapsible: @@ -2537,7 +2537,7 @@ sRect: TQGridLayout
  • setColStretch: TQGridLayout
  • setCollapsible: TQSplitter
  • setColor: - TQBrush TQCanvasText TQColorDrag TQColorGroup TQImage TQPalette TQPen TQStyleSheetItem TQTextEdit
  • setColorMode: + TQBrush TQCanvasText TQColorDrag TQColorGroup TQImage TQPalette TQPen TQStyleSheetItem TQTextEdit
  • setColorMode: TQPrinter
  • setColorSpec: TQApplication
  • setColormap: TQGLWidget
  • setColumn: @@ -2570,7 +2570,7 @@ sRect: TQFileDialog
  • setContexts: TQStyleSheetItem
  • setControl: TQAxBase
  • setControlPoints: - TQCanvasSpline
  • setCoords: + TQCanvasSpline
  • setCoords: TQRect
  • setCornerWidget: TQScrollView TQTabWidget
  • setCreator: TQPrinter
  • setCurrent: @@ -2636,7 +2636,7 @@ sRect: TQImage
  • setDotsPerMeterY: TQImage
  • setDoubleBuffer: TQGLFormat
  • setDoubleBuffering: - TQCanvas
  • setDoubleClickInterval: + TQCanvas
  • setDoubleClickInterval: TQApplication
  • setDown: TQButton TQCheckBox TQPushButton TQRadioButton
  • setDragAutoScroll: TQScrollView
  • setDragEnabled: @@ -2650,7 +2650,7 @@ sRect: TQComboBox TQComboTableItem
  • setEdited: TQMultiLineEdit
  • setEffectEnabled: TQApplication
  • setEnabled: - TQAccel TQAction TQCanvasItem TQLayout TQListViewItem TQSocketNotifier TQTab TQTableItem TQToolTipGroup TQWidget
  • setEncodedData: + TQAccel TQAction TQCanvasItem TQLayout TQListViewItem TQSocketNotifier TQTab TQTableItem TQToolTipGroup TQWidget
  • setEncodedData: TQStoredDrag
  • setEncodedPathAndQuery: TQUrl
  • setEncoding: TQTextStream
  • setEncodingFunction: @@ -2692,7 +2692,7 @@ sRect: TQWidget
  • setFocusRectPolicy: TQMacStyle
  • setFocusStyle: TQTable
  • setFont: - TQApplication TQCanvasText TQComboBox TQCustomMenuItem TQLabel TQPainter TQTabDialog TQToolTip TQWSInputMethod TQWhatsThis TQWidget
  • setFontFamily: + TQApplication TQCanvasText TQComboBox TQCustomMenuItem TQLabel TQPainter TQTabDialog TQToolTip TQWSInputMethod TQWhatsThis TQWidget
  • setFontFamily: TQStyleSheetItem
  • setFontItalic: TQStyleSheetItem
  • setFontSize: TQStyleSheetItem
  • setFontStrikeOut: @@ -2702,8 +2702,8 @@ sRect: TQDataBrowser TQDataView
  • setFormat: TQGLContext TQImageIO TQSyntaxHighlighter
  • setForwardOnly: TQSqlQuery TQSqlResult
  • setFrame: - TQCanvasSprite TQLineEdit
  • setFrameAnimation: - TQCanvasSprite
  • setFramePeriod: + TQCanvasSprite TQLineEdit
  • setFrameAnimation: + TQCanvasSprite
  • setFramePeriod: TQImageConsumer
  • setFrameRect: TQFrame
  • setFrameShadow: TQFrame
  • setFrameShape: @@ -2746,7 +2746,7 @@ sRect: TQWidget
  • setId: TQMenuData
  • setIdentifier: TQTab
  • setImage: - TQCanvasPixmapArray TQClipboard TQImageDrag TQImageIO TQMimeSourceFactory
  • setInactive: + TQCanvasPixmapArray TQClipboard TQImageDrag TQImageIO TQMimeSourceFactory
  • setInactive: TQPalette
  • setIndent: TQLabel
  • setIndicator: TQProgressBar
  • setIndicatorFollowsStyle: @@ -2861,7 +2861,7 @@ sRect: TQGridView TQTable
  • setNumber: TQSqlError
  • setOctMode: TQLCDNumber
  • setOffset: - TQCanvasPixmap TQDockWindow TQHeader TQImage
  • setOkButton: + TQCanvasPixmap TQDockWindow TQHeader TQImage
  • setOkButton: TQTabDialog
  • setOn: TQAction TQButton TQCheckListItem TQPushButton TQToolButton
  • setOpaqueMoving: TQDockWindow TQMainWindow
  • setOpaqueResize: @@ -2896,7 +2896,7 @@ sRect: TQSqlDatabase TQUrl
  • setPath: TQDir TQSettings TQUrl
  • setPattern: TQRegExp
  • setPen: - TQCanvasPolygonalItem TQPainter
  • setPercentageVisible: + TQCanvasPolygonalItem TQPainter
  • setPercentageVisible: TQProgressBar
  • setPermissions: TQUrlInfo
  • setPicture: TQIconViewItem TQLabel
  • setPixel: @@ -2909,7 +2909,7 @@ sRect: TQDropEvent TQPointArray
  • setPointSize: TQFont TQTextEdit
  • setPointSizeFloat: TQFont
  • setPoints: - TQCanvasLine TQCanvasPolygon
  • setPopup: + TQCanvasLine TQCanvasPolygon
  • setPopup: TQPushButton TQToolButton
  • setPopupDelay: TQToolButton
  • setPort: TQSqlDatabase TQUrl
  • setPos: @@ -2980,7 +2980,7 @@ sRect: TQLCDNumber
  • setSelect: TQSqlResult
  • setSelectable: TQIconViewItem TQListBoxItem TQListViewItem
  • setSelected: - TQAccessibleInterface TQCanvasItem TQIconView TQIconViewItem TQListBox TQListView TQListViewItem
  • setSelectedFilter: + TQAccessibleInterface TQCanvasItem TQIconView TQIconViewItem TQListBox TQListView TQListViewItem
  • setSelectedFilter: TQFileDialog
  • setSelection: TQFileDialog TQLineEdit TQTextEdit
  • setSelectionAnchor: TQListView
  • setSelectionAttributes: @@ -2989,14 +2989,14 @@ sRect: TQStyleSheetItem
  • setSendBufferSize: TQSocketDevice
  • setSeparator: TQDateEdit TQTimeEdit
  • setSequence: - TQCanvasSprite
  • setShape: + TQCanvasSprite
  • setShape: TQCursor TQTabBar
  • setShowGrid: TQTable
  • setShowHiddenFiles: TQFileDialog
  • setShowSortIndicator: TQListView
  • setShowToolTips: TQIconView TQListView
  • setShown: TQWidget
  • setSize: - TQCanvasEllipse TQCanvasRectangle TQDataTable TQImageConsumer TQRect TQUrlInfo
  • setSizeGripEnabled: + TQCanvasEllipse TQCanvasRectangle TQDataTable TQImageConsumer TQRect TQUrlInfo
  • setSizeGripEnabled: TQDialog TQStatusBar
  • setSizeIncrement: TQWidget
  • setSizeLimit: TQComboBox
  • setSizePolicy: @@ -3055,16 +3055,16 @@ sRect: TQPainter
  • setTabToolTip: TQTabWidget
  • setTagName: TQDomElement
  • setText: - TQAccessibleInterface TQAction TQButton TQCanvasText TQCheckBox TQClipboard TQIconViewItem TQImage TQLabel TQLineEdit TQListBoxItem TQListViewItem TQMessageBox TQMimeSourceFactory TQPushButton TQRadioButton TQTab TQTable TQTableItem TQTextDrag TQTextEdit
  • setTextFlags: - TQCanvasText
  • setTextFormat: + TQAccessibleInterface TQAction TQButton TQCanvasText TQCheckBox TQClipboard TQIconViewItem TQImage TQLabel TQLineEdit TQListBoxItem TQListViewItem TQMessageBox TQMimeSourceFactory TQPushButton TQRadioButton TQTab TQTable TQTableItem TQTextDrag TQTextEdit
  • setTextFlags: + TQCanvasText
  • setTextFormat: TQLabel TQMessageBox TQTextEdit
  • setTextLabel: TQToolButton
  • setTextPosition: TQToolButton
  • setTextRect: TQIconViewItem
  • setTickInterval: TQSlider
  • setTickmarks: TQSlider
  • setTile: - TQCanvas
  • setTiles: - TQCanvas
  • setTime: + TQCanvas
  • setTiles: + TQCanvas
  • setTime: TQDateTime TQTimeEdit
  • setTime_t: TQDateTime
  • setTitle: TQGroupBox TQWizard
  • setTitleFont: @@ -3088,7 +3088,7 @@ sRect: TQCheckBox TQCheckListItem
  • setTrueText: TQDataTable
  • setType: TQIODevice TQSqlError
  • setUnchanged: - TQCanvas
  • setUnderline: + TQCanvas
  • setUnderline: TQFont TQTextEdit
  • setUndoDepth: TQTextEdit
  • setUndoRedoEnabled: TQTextEdit
  • setUnicode: @@ -3096,7 +3096,7 @@ sRect: TQString
  • setUnicodeUris: TQUriDrag
  • setUpLayout: TQMainWindow
  • setUpdatePeriod: - TQCanvas
  • setUpdatesEnabled: + TQCanvas
  • setUpdatesEnabled: TQWidget
  • setUris: TQUriDrag
  • setUrl: TQFileDialog TQNetworkProtocol
  • setUseHighlightColors: @@ -3113,7 +3113,7 @@ sRect: TQDial TQDomAttr TQHttpHeader TQHttpRequestHeader TQRangeControl TQScrollBar TQSignal TQSlider TQSpinBox TQSqlField TQSqlRecord
  • setVariableHeight: TQListBox
  • setVariableWidth: TQListBox
  • setVelocity: - TQCanvasItem
  • setVerData: + TQCanvasItem
  • setVerData: TQSizePolicy
  • setVerStretch: TQSizePolicy
  • setVersion: TQDataStream
  • setVerticalAlignment: @@ -3122,7 +3122,7 @@ sRect: TQFileDialog
  • setViewXForm: TQPainter
  • setViewport: TQPainter
  • setVisible: - TQAction TQCanvasItem TQListViewItem
  • setWFlags: + TQAction TQCanvasItem TQListViewItem
  • setWFlags: TQWidget
  • setWakeUpDelay: TQToolTip
  • setWeight: TQFont
  • setWhatsThis: @@ -3134,7 +3134,7 @@ sRect: TQPen TQRect TQSimpleRichText TQSize
  • setWildcard: TQRegExp
  • setWinPageSize: TQPrinter
  • setWinding: - TQCanvasPolygonalItem
  • setWindow: + TQCanvasPolygonalItem
  • setWindow: TQPainter
  • setWindowCreated: TQGLContext
  • setWindowOpacity: TQWidget
  • setWindowState: @@ -3142,19 +3142,19 @@ sRect: TQTableItem TQTextEdit
  • setWordWrapIconText: TQIconView
  • setWorkingDirectory: TQProcess
  • setWorldMatrix: - TQCanvasView TQPainter
  • setWorldXForm: + TQCanvasView TQPainter
  • setWorldXForm: TQPainter
  • setWrapColumnOrWidth: TQTextEdit
  • setWrapPolicy: TQTextEdit
  • setWrapping: TQDial TQSpinBox
  • setWritable: TQUrlInfo
  • setX: - TQCanvasItem TQPoint TQRect
  • setXVelocity: - TQCanvasItem
  • setY: - TQCanvasItem TQPoint TQRect
  • setYMD: + TQCanvasItem TQPoint TQRect
  • setXVelocity: + TQCanvasItem
  • setY: + TQCanvasItem TQPoint TQRect
  • setYMD: TQDate
  • setYVelocity: - TQCanvasItem
  • setYear: + TQCanvasItem
  • setYear: TQDateEdit
  • setZ: - TQCanvasItem
  • setf: + TQCanvasItem
  • setf: TQTextStream
  • setup: TQListViewItem TQPrinter
  • shadow: TQColorGroup
  • shape: @@ -3164,7 +3164,7 @@ sRect: TQDate
  • shortMonthName: TQDate
  • shortcutKey: TQAccel
  • show: - TQCanvasItem TQDialog TQMenuBar TQWSWindow TQWidget
  • showColumn: + TQCanvasItem TQDialog TQMenuBar TQWSWindow TQWidget
  • showColumn: TQTable
  • showDockMenu: TQMainWindow
  • showEvent: TQWidget
  • showExtension: @@ -3187,10 +3187,10 @@ sRect: TQTextCodec
  • simplifyWhiteSpace: TQCString TQString
  • singleShot: TQTimer
  • size: - TQAsciiCache TQAsciiDict TQBitArray TQCache TQCanvas TQCanvasRectangle TQDict TQDirectPainter TQFile TQFileInfo TQFontMetrics TQGLColormap TQIODevice TQIconViewItem TQImage TQIntCache TQIntDict TQMap TQMemArray TQPicture TQPixmap TQPtrDict TQPtrVector TQRect TQResizeEvent TQSocket TQSqlQuery TQSqlResult TQUrlInfo TQValueList TQValueVector TQWidget
  • sizeChange: + TQAsciiCache TQAsciiDict TQBitArray TQCache TQCanvas TQCanvasRectangle TQDict TQDirectPainter TQFile TQFileInfo TQFontMetrics TQGLColormap TQIODevice TQIconViewItem TQImage TQIntCache TQIntDict TQMap TQMemArray TQPicture TQPixmap TQPtrDict TQPtrVector TQRect TQResizeEvent TQSocket TQSqlQuery TQSqlResult TQUrlInfo TQValueList TQValueVector TQWidget
  • sizeChange: TQHeader
  • sizeFromContents: TQStyle
  • sizeHint: - TQBoxLayout TQCanvasView TQCustomMenuItem TQGridLayout TQLayoutItem TQLineEdit TQProgressDialog TQSizeGrip TQSpacerItem TQTableItem TQWidget TQWidgetItem
  • sizeIncrement: + TQBoxLayout TQCanvasView TQCustomMenuItem TQGridLayout TQLayoutItem TQLineEdit TQProgressDialog TQSizeGrip TQSpacerItem TQTableItem TQWidget TQWidgetItem
  • sizeIncrement: TQWidget
  • sizeLimit: TQComboBox
  • sizePolicy: TQWidget
  • sizes: @@ -3248,7 +3248,7 @@ sRect: TQApplication
  • startElement: TQXmlContentHandler
  • startEntity: TQXmlLexicalHandler
  • startPoint: - TQCanvasLine
  • startPrefixMapping: + TQCanvasLine
  • startPrefixMapping: TQXmlContentHandler
  • startRename: TQListViewItem
  • startServer: TQAxFactory
  • startTimer: @@ -3351,11 +3351,11 @@ tab: TQBitArray
  • testOption: TQGLFormat
  • testWFlags: TQWidget
  • text: - TQAccessibleInterface TQAction TQButton TQCanvasText TQCheckBox TQCheckListItem TQClipboard TQColorGroup TQComboBox TQComboTableItem TQDataTable TQDomElement TQIMEvent TQIconViewItem TQImage TQKeyEvent TQLabel TQLineEdit TQListBox TQListBoxItem TQListViewItem TQMenuData TQMessageBox TQPopupMenu TQPushButton TQRadioButton TQSpinBox TQSqlError TQTab TQTable TQTableItem TQTextEdit TQWhatsThis
  • textChanged: + TQAccessibleInterface TQAction TQButton TQCanvasText TQCheckBox TQCheckListItem TQClipboard TQColorGroup TQComboBox TQComboTableItem TQDataTable TQDomElement TQIMEvent TQIconViewItem TQImage TQKeyEvent TQLabel TQLineEdit TQListBox TQListBoxItem TQListViewItem TQMenuData TQMessageBox TQPopupMenu TQPushButton TQRadioButton TQSpinBox TQSqlError TQTab TQTable TQTableItem TQTextEdit TQWhatsThis
  • textChanged: TQComboBox TQLineEdit TQSpinBox TQTextEdit
  • textCursor: TQTextEdit
  • textEdit: TQSyntaxHighlighter
  • textFlags: - TQCanvasText
  • textFor: + TQCanvasText
  • textFor: TQToolTip TQWhatsThis
  • textFormat: TQLabel TQMessageBox TQTextEdit
  • textKeys: TQImage
  • textLabel: @@ -3368,11 +3368,11 @@ tab: TQDns
  • tickInterval: TQSlider
  • tickmarks: TQSlider
  • tile: - TQCanvas TQWorkspace
  • tileHeight: - TQCanvas
  • tileWidth: - TQCanvas
  • tilesHorizontally: - TQCanvas
  • tilesVertically: - TQCanvas
  • time: + TQCanvas TQWorkspace
  • tileHeight: + TQCanvas
  • tileWidth: + TQCanvas
  • tilesHorizontally: + TQCanvas
  • tilesVertically: + TQCanvas
  • time: TQDateTime TQTimeEdit
  • timeEdit: TQDateTimeEdit
  • timeToWait: TQEventLoop
  • timeout: @@ -3454,7 +3454,7 @@ tab: TQMainWindow
  • top: TQDoubleValidator TQIntValidator TQPtrStack TQRect TQValueStack
  • topDock: TQMainWindow
  • topEdge: - TQCanvasSprite
  • topItem: + TQCanvasSprite
  • topItem: TQListBox
  • topLeft: TQRect
  • topLevelWidget: TQWidget
  • topLevelWidgets: @@ -3521,7 +3521,7 @@ ucs2: TQTranslator
  • unuseJavaClass: TQNPlugin
  • upRect: TQSpinBox
  • update: - TQCanvas TQCanvasItem TQDataBrowser TQSqlCursor TQWidget
  • updateAccessibility: + TQCanvas TQCanvasItem TQDataBrowser TQSqlCursor TQWidget
  • updateAccessibility: TQAccessible
  • updateBoundary: TQDataBrowser
  • updateButtons: TQDateEdit
  • updateCell: @@ -3556,7 +3556,7 @@ ucs2: vScrollBarMode: TQScrollView
  • valid: TQImage
  • validChunk: - TQCanvas
  • validate: + TQCanvas
  • validate: TQDoubleValidator TQIntValidator TQRegExpValidator TQValidator
  • validateLicenseKey: TQAxFactory
  • validator: TQComboBox TQLineEdit TQSpinBox
  • value: @@ -3610,7 +3610,7 @@ wait: TQMacStyle
  • widgetToField: TQSqlForm
  • widgets: TQWidgetFactory
  • width: - TQCanvas TQCanvasEllipse TQCanvasRectangle TQCanvasSprite TQDirectPainter TQFontMetrics TQIconViewItem TQImage TQListBoxItem TQListBoxPixmap TQListBoxText TQListViewItem TQPaintDeviceMetrics TQPen TQPixmap TQRect TQScreen TQSimpleRichText TQSize TQTextStream TQWidget
  • widthChanged: + TQCanvas TQCanvasEllipse TQCanvasRectangle TQCanvasSprite TQDirectPainter TQFontMetrics TQIconViewItem TQImage TQListBoxItem TQListBoxPixmap TQListBoxText TQListViewItem TQPaintDeviceMetrics TQPen TQPixmap TQRect TQScreen TQSimpleRichText TQSize TQTextStream TQWidget
  • widthChanged: TQListViewItem
  • widthMM: TQPaintDeviceMetrics
  • widthUsed: TQSimpleRichText
  • wildcard: @@ -3620,7 +3620,7 @@ wait: TQApplication
  • winId: TQWSWindow TQWidget
  • winPageSize: TQPrinter
  • winding: - TQCanvasPolygonalItem
  • window: + TQCanvasPolygonalItem
  • window: TQPainter
  • windowActivated: TQWorkspace
  • windowActivationChange: TQWidget
  • windowAt: @@ -3633,7 +3633,7 @@ wait: TQTableItem TQTextEdit
  • wordWrapIconText: TQIconView
  • workingDirectory: TQProcess
  • worldMatrix: - TQCanvasView TQPainter
  • wrapColumnOrWidth: + TQCanvasView TQPainter
  • wrapColumnOrWidth: TQTextEdit
  • wrapPolicy: TQTextEdit
  • wrapping: TQDial TQSpinBox
  • writable: @@ -3649,7 +3649,7 @@ wait: TQProcess
  • wroteToStdin: TQProcess
  • x: - TQCanvasItem TQContextMenuEvent TQIconViewItem TQMouseEvent TQPoint TQRect TQTabletEvent TQWheelEvent TQWidget
  • x11AppCells: + TQCanvasItem TQContextMenuEvent TQIconViewItem TQMouseEvent TQPoint TQRect TQTabletEvent TQWheelEvent TQWidget
  • x11AppCells: TQPaintDevice
  • x11AppColormap: TQPaintDevice
  • x11AppDefaultColormap: TQPaintDevice
  • x11AppDefaultVisual: @@ -3678,16 +3678,16 @@ x: TQPainter
  • xOffset: TQDirectPainter
  • xTilt: TQTabletEvent
  • xVelocity: - TQCanvasItem
  • xtWidget: + TQCanvasItem
  • xtWidget: TQXtWidget
  • y: - TQCanvasItem TQContextMenuEvent TQIconViewItem TQMouseEvent TQPoint TQRect TQTabletEvent TQWheelEvent TQWidget
  • yOffset: + TQCanvasItem TQContextMenuEvent TQIconViewItem TQMouseEvent TQPoint TQRect TQTabletEvent TQWheelEvent TQWidget
  • yOffset: TQDirectPainter
  • yTilt: TQTabletEvent
  • yVelocity: - TQCanvasItem
  • year: + TQCanvasItem
  • year: TQDate
  • z: - TQCanvasItem
  • zoomIn: + TQCanvasItem
  • zoomIn: TQTextEdit
  • zoomOut: TQTextEdit
  • zoomTo: TQTextEdit diff --git a/doc/html/graphics.html b/doc/html/graphics.html index fef572f9..dc0b7881 100644 --- a/doc/html/graphics.html +++ b/doc/html/graphics.html @@ -40,20 +40,20 @@ coordinate system.

    TQBitmapMonochrome (1-bit depth) pixmaps
    TQBrushDefines the fill pattern of shapes drawn by a TQPainter -
    TQCanvas2D area that can contain TQCanvasItem objects -
    TQCanvasEllipseEllipse or ellipse segment on a TQCanvas -
    TQCanvasItemAbstract graphic object on a TQCanvas -
    TQCanvasItemListList of TQCanvasItems -
    TQCanvasLineLine on a TQCanvas -
    TQCanvasPixmapPixmaps for TQCanvasSprites -
    TQCanvasPixmapArrayArray of TQCanvasPixmaps -
    TQCanvasPolygonPolygon on a TQCanvas -
    TQCanvasPolygonalItemPolygonal canvas item on a TQCanvas -
    TQCanvasRectangleRectangle on a TQCanvas -
    TQCanvasSplineMulti-bezier splines on a TQCanvas -
    TQCanvasSpriteAnimated canvas item on a TQCanvas -
    TQCanvasTextText object on a TQCanvas -
    TQCanvasViewOn-screen view of a TQCanvas +
    TQCanvas2D area that can contain TQCanvasItem objects +
    TQCanvasEllipseEllipse or ellipse segment on a TQCanvas +
    TQCanvasItemAbstract graphic object on a TQCanvas +
    TQCanvasItemListList of TQCanvasItems +
    TQCanvasLineLine on a TQCanvas +
    TQCanvasPixmapPixmaps for TQCanvasSprites +
    TQCanvasPixmapArrayArray of TQCanvasPixmaps +
    TQCanvasPolygonPolygon on a TQCanvas +
    TQCanvasPolygonalItemPolygonal canvas item on a TQCanvas +
    TQCanvasRectangleRectangle on a TQCanvas +
    TQCanvasSplineMulti-bezier splines on a TQCanvas +
    TQCanvasSpriteAnimated canvas item on a TQCanvas +
    TQCanvasTextText object on a TQCanvas +
    TQCanvasViewOn-screen view of a TQCanvas
    TQColorColors based on RGB or HSV values
    TQColorDialogDialog widget for specifying colors
    TQColorGroupGroup of widget colors diff --git a/doc/html/headerfilesynonyms b/doc/html/headerfilesynonyms index 3528c7a2..cf0b24f8 100644 --- a/doc/html/headerfilesynonyms +++ b/doc/html/headerfilesynonyms @@ -13,19 +13,19 @@ qaxscriptmanager.h qaxscript.h qbig5hkscscodec.h ntqbig5codec.h qbitval.h ntqbitarray.h qcacheiterator.h ntqcache.h -qcanvasitemlist.h ntqcanvas.h -qcanvasitem.h ntqcanvas.h -qcanvasview.h ntqcanvas.h -qcanvaspixmap.h ntqcanvas.h -qcanvaspixmaparray.h ntqcanvas.h -qcanvassprite.h ntqcanvas.h -qcanvaspolygonalitem.h ntqcanvas.h -qcanvasrectangle.h ntqcanvas.h -qcanvaspolygon.h ntqcanvas.h -qcanvasspline.h ntqcanvas.h -qcanvasline.h ntqcanvas.h -qcanvasellipse.h ntqcanvas.h -qcanvastext.h ntqcanvas.h +tqcanvasitemlist.h tqcanvas.h +tqcanvasitem.h tqcanvas.h +tqcanvasview.h tqcanvas.h +tqcanvaspixmap.h tqcanvas.h +tqcanvaspixmaparray.h tqcanvas.h +tqcanvassprite.h tqcanvas.h +tqcanvaspolygonalitem.h tqcanvas.h +tqcanvasrectangle.h tqcanvas.h +tqcanvaspolygon.h tqcanvas.h +tqcanvasspline.h tqcanvas.h +tqcanvasline.h tqcanvas.h +tqcanvasellipse.h tqcanvas.h +tqcanvastext.h tqcanvas.h qbytearray.h ntqcstring.h qdate.h ntqdatetime.h qtime.h ntqdatetime.h diff --git a/doc/html/headers.html b/doc/html/headers.html index 1ba18f37..a68fd0b7 100644 --- a/doc/html/headers.html +++ b/doc/html/headers.html @@ -58,7 +58,7 @@ body { background: #ffffff; color: black; }
  • ntqbutton.h
  • ntqbuttongroup.h
  • ntqcache.h -
  • ntqcanvas.h +
  • tqcanvas.h
  • ntqcdestyle.h
  • ntqcheckbox.h
  • ntqclipboard.h diff --git a/doc/html/hierarchy.html b/doc/html/hierarchy.html index 87932873..80a50ded 100644 --- a/doc/html/hierarchy.html +++ b/doc/html/hierarchy.html @@ -57,7 +57,7 @@ classes in the TQt API.
  • TQAxFactory
  • TQBitVal
  • TQCacheIterator -
  • TQCanvasPixmapArray +
  • TQCanvasPixmapArray
  • TQChar
  • TQCharRef
  • TQColor @@ -182,7 +182,7 @@ classes in the TQt API.
  • TQPixmap
  • TQPrinter @@ -253,20 +253,20 @@ classes in the TQt API.
  • TQt
  • TQAxScript
  • TQAxScriptManager -
  • TQCanvas +
  • TQCanvas
  • TQClipboard
  • TQCopChannel
  • TQDataPump @@ -466,7 +466,7 @@ classes in the TQt API.
  • TQProgressBar
  • TQScrollView
      -
    • TQCanvasView +
    • TQCanvasView
    • TQGridView
    • TQIconView
    • TQListBox @@ -554,7 +554,7 @@ classes in the TQt API.
    • TQUuid
    • TQValueList diff --git a/doc/html/images.html b/doc/html/images.html index 891a2025..8f4f6075 100644 --- a/doc/html/images.html +++ b/doc/html/images.html @@ -37,20 +37,20 @@ body { background: #ffffff; color: black; }

      TQBitmapMonochrome (1-bit depth) pixmaps
      TQBrushDefines the fill pattern of shapes drawn by a TQPainter -
      TQCanvas2D area that can contain TQCanvasItem objects -
      TQCanvasEllipseEllipse or ellipse segment on a TQCanvas -
      TQCanvasItemAbstract graphic object on a TQCanvas -
      TQCanvasItemListList of TQCanvasItems -
      TQCanvasLineLine on a TQCanvas -
      TQCanvasPixmapPixmaps for TQCanvasSprites -
      TQCanvasPixmapArrayArray of TQCanvasPixmaps -
      TQCanvasPolygonPolygon on a TQCanvas -
      TQCanvasPolygonalItemPolygonal canvas item on a TQCanvas -
      TQCanvasRectangleRectangle on a TQCanvas -
      TQCanvasSplineMulti-bezier splines on a TQCanvas -
      TQCanvasSpriteAnimated canvas item on a TQCanvas -
      TQCanvasTextText object on a TQCanvas -
      TQCanvasViewOn-screen view of a TQCanvas +
      TQCanvas2D area that can contain TQCanvasItem objects +
      TQCanvasEllipseEllipse or ellipse segment on a TQCanvas +
      TQCanvasItemAbstract graphic object on a TQCanvas +
      TQCanvasItemListList of TQCanvasItems +
      TQCanvasLineLine on a TQCanvas +
      TQCanvasPixmapPixmaps for TQCanvasSprites +
      TQCanvasPixmapArrayArray of TQCanvasPixmaps +
      TQCanvasPolygonPolygon on a TQCanvas +
      TQCanvasPolygonalItemPolygonal canvas item on a TQCanvas +
      TQCanvasRectangleRectangle on a TQCanvas +
      TQCanvasSplineMulti-bezier splines on a TQCanvas +
      TQCanvasSpriteAnimated canvas item on a TQCanvas +
      TQCanvasTextText object on a TQCanvas +
      TQCanvasViewOn-screen view of a TQCanvas
      TQColorColors based on RGB or HSV values
      TQColorGroupGroup of widget colors
      TQGLNamespace for miscellaneous identifiers in the TQt OpenGL module diff --git a/doc/html/index b/doc/html/index index 7ee9267d..9cdf8adc 100644 --- a/doc/html/index +++ b/doc/html/index @@ -729,196 +729,196 @@ "QCacheIterator::operator=" qcacheiterator.html#operator-eq "QCacheIterator::toFirst" qcacheiterator.html#toFirst "QCacheIterator::toLast" qcacheiterator.html#toLast -"QCanvas" ntqcanvas.html -"QCanvas::advance" ntqcanvas.html#advance -"QCanvas::allItems" ntqcanvas.html#allItems -"QCanvas::backgroundColor" ntqcanvas.html#backgroundColor -"QCanvas::backgroundPixmap" ntqcanvas.html#backgroundPixmap -"QCanvas::chunkSize" ntqcanvas.html#chunkSize -"QCanvas::collisions" ntqcanvas.html#collisions -"QCanvas::drawArea" ntqcanvas.html#drawArea -"QCanvas::drawBackground" ntqcanvas.html#drawBackground -"QCanvas::drawForeground" ntqcanvas.html#drawForeground -"QCanvas::height" ntqcanvas.html#height -"QCanvas::onCanvas" ntqcanvas.html#onCanvas -"QCanvas::rect" ntqcanvas.html#rect -"QCanvas::resize" ntqcanvas.html#resize -"QCanvas::resized" ntqcanvas.html#resized -"QCanvas::retune" ntqcanvas.html#retune -"QCanvas::setAdvancePeriod" ntqcanvas.html#setAdvancePeriod -"QCanvas::setAllChanged" ntqcanvas.html#setAllChanged -"QCanvas::setBackgroundColor" ntqcanvas.html#setBackgroundColor -"QCanvas::setBackgroundPixmap" ntqcanvas.html#setBackgroundPixmap -"QCanvas::setChanged" ntqcanvas.html#setChanged -"QCanvas::setDoubleBuffering" ntqcanvas.html#setDoubleBuffering -"QCanvas::setTile" ntqcanvas.html#setTile -"QCanvas::setTiles" ntqcanvas.html#setTiles -"QCanvas::setUnchanged" ntqcanvas.html#setUnchanged -"QCanvas::setUpdatePeriod" ntqcanvas.html#setUpdatePeriod -"QCanvas::size" ntqcanvas.html#size -"QCanvas::tile" ntqcanvas.html#tile -"QCanvas::tileHeight" ntqcanvas.html#tileHeight -"QCanvas::tileWidth" ntqcanvas.html#tileWidth -"QCanvas::tilesHorizontally" ntqcanvas.html#tilesHorizontally -"QCanvas::tilesVertically" ntqcanvas.html#tilesVertically -"QCanvas::update" ntqcanvas.html#update -"QCanvas::validChunk" ntqcanvas.html#validChunk -"QCanvas::width" ntqcanvas.html#width -"QCanvas::~QCanvas" ntqcanvas.html#~QCanvas -"QCanvasEllipse" qcanvasellipse.html -"QCanvasEllipse::angleLength" qcanvasellipse.html#angleLength -"QCanvasEllipse::angleStart" qcanvasellipse.html#angleStart -"QCanvasEllipse::drawShape" qcanvasellipse.html#drawShape -"QCanvasEllipse::height" qcanvasellipse.html#height -"QCanvasEllipse::rtti" qcanvasellipse.html#rtti -"QCanvasEllipse::setAngles" qcanvasellipse.html#setAngles -"QCanvasEllipse::setSize" qcanvasellipse.html#setSize -"QCanvasEllipse::width" qcanvasellipse.html#width -"QCanvasEllipse::~QCanvasEllipse" qcanvasellipse.html#~QCanvasEllipse -"QCanvasItem" qcanvasitem.html -"QCanvasItem::RttiValues" qcanvasitem.html#RttiValues -"QCanvasItem::advance" qcanvasitem.html#advance -"QCanvasItem::animated" qcanvasitem.html#animated -"QCanvasItem::boundingRect" qcanvasitem.html#boundingRect -"QCanvasItem::boundingRectAdvanced" qcanvasitem.html#boundingRectAdvanced -"QCanvasItem::canvas" qcanvasitem.html#canvas -"QCanvasItem::collidesWith" qcanvasitem.html#collidesWith -"QCanvasItem::collisions" qcanvasitem.html#collisions -"QCanvasItem::draw" qcanvasitem.html#draw -"QCanvasItem::hide" qcanvasitem.html#hide -"QCanvasItem::isActive" qcanvasitem.html#isActive -"QCanvasItem::isEnabled" qcanvasitem.html#isEnabled -"QCanvasItem::isSelected" qcanvasitem.html#isSelected -"QCanvasItem::isVisible" qcanvasitem.html#isVisible -"QCanvasItem::move" qcanvasitem.html#move -"QCanvasItem::moveBy" qcanvasitem.html#moveBy -"QCanvasItem::rtti" qcanvasitem.html#rtti -"QCanvasItem::setActive" qcanvasitem.html#setActive -"QCanvasItem::setAnimated" qcanvasitem.html#setAnimated -"QCanvasItem::setCanvas" qcanvasitem.html#setCanvas -"QCanvasItem::setEnabled" qcanvasitem.html#setEnabled -"QCanvasItem::setSelected" qcanvasitem.html#setSelected -"QCanvasItem::setVelocity" qcanvasitem.html#setVelocity -"QCanvasItem::setVisible" qcanvasitem.html#setVisible -"QCanvasItem::setX" qcanvasitem.html#setX -"QCanvasItem::setXVelocity" qcanvasitem.html#setXVelocity -"QCanvasItem::setY" qcanvasitem.html#setY -"QCanvasItem::setYVelocity" qcanvasitem.html#setYVelocity -"QCanvasItem::setZ" qcanvasitem.html#setZ -"QCanvasItem::show" qcanvasitem.html#show -"QCanvasItem::update" qcanvasitem.html#update -"QCanvasItem::x" qcanvasitem.html#x -"QCanvasItem::xVelocity" qcanvasitem.html#xVelocity -"QCanvasItem::y" qcanvasitem.html#y -"QCanvasItem::yVelocity" qcanvasitem.html#yVelocity -"QCanvasItem::z" qcanvasitem.html#z -"QCanvasItem::~QCanvasItem" qcanvasitem.html#~QCanvasItem -"QCanvasItemList" qcanvasitemlist.html -"QCanvasItemList::operator+" qcanvasitemlist.html#operator+ -"QCanvasLine" qcanvasline.html -"QCanvasLine::endPoint" qcanvasline.html#endPoint -"QCanvasLine::rtti" qcanvasline.html#rtti -"QCanvasLine::setPoints" qcanvasline.html#setPoints -"QCanvasLine::startPoint" qcanvasline.html#startPoint -"QCanvasLine::~QCanvasLine" qcanvasline.html#~QCanvasLine -"QCanvasPixmap" qcanvaspixmap.html -"QCanvasPixmap::offsetX" qcanvaspixmap.html#offsetX -"QCanvasPixmap::offsetY" qcanvaspixmap.html#offsetY -"QCanvasPixmap::setOffset" qcanvaspixmap.html#setOffset -"QCanvasPixmap::~QCanvasPixmap" qcanvaspixmap.html#~QCanvasPixmap -"QCanvasPixmapArray" qcanvaspixmaparray.html -"QCanvasPixmapArray::count" qcanvaspixmaparray.html#count -"QCanvasPixmapArray::image" qcanvaspixmaparray.html#image -"QCanvasPixmapArray::isValid" qcanvaspixmaparray.html#isValid -"QCanvasPixmapArray::readCollisionMasks" qcanvaspixmaparray.html#readCollisionMasks -"QCanvasPixmapArray::readPixmaps" qcanvaspixmaparray.html#readPixmaps -"QCanvasPixmapArray::setImage" qcanvaspixmaparray.html#setImage -"QCanvasPixmapArray::~QCanvasPixmapArray" qcanvaspixmaparray.html#~QCanvasPixmapArray -"QCanvasPolygon" qcanvaspolygon.html -"QCanvasPolygon::areaPoints" qcanvaspolygon.html#areaPoints -"QCanvasPolygon::drawShape" qcanvaspolygon.html#drawShape -"QCanvasPolygon::points" qcanvaspolygon.html#points -"QCanvasPolygon::rtti" qcanvaspolygon.html#rtti -"QCanvasPolygon::setPoints" qcanvaspolygon.html#setPoints -"QCanvasPolygon::~QCanvasPolygon" qcanvaspolygon.html#~QCanvasPolygon -"QCanvasPolygonalItem" qcanvaspolygonalitem.html -"QCanvasPolygonalItem::areaPoints" qcanvaspolygonalitem.html#areaPoints -"QCanvasPolygonalItem::areaPointsAdvanced" qcanvaspolygonalitem.html#areaPointsAdvanced -"QCanvasPolygonalItem::boundingRect" qcanvaspolygonalitem.html#boundingRect -"QCanvasPolygonalItem::brush" qcanvaspolygonalitem.html#brush -"QCanvasPolygonalItem::draw" qcanvaspolygonalitem.html#draw -"QCanvasPolygonalItem::drawShape" qcanvaspolygonalitem.html#drawShape -"QCanvasPolygonalItem::invalidate" qcanvaspolygonalitem.html#invalidate -"QCanvasPolygonalItem::isValid" qcanvaspolygonalitem.html#isValid -"QCanvasPolygonalItem::pen" qcanvaspolygonalitem.html#pen -"QCanvasPolygonalItem::rtti" qcanvaspolygonalitem.html#rtti -"QCanvasPolygonalItem::setBrush" qcanvaspolygonalitem.html#setBrush -"QCanvasPolygonalItem::setPen" qcanvaspolygonalitem.html#setPen -"QCanvasPolygonalItem::setWinding" qcanvaspolygonalitem.html#setWinding -"QCanvasPolygonalItem::winding" qcanvaspolygonalitem.html#winding -"QCanvasPolygonalItem::~QCanvasPolygonalItem" qcanvaspolygonalitem.html#~QCanvasPolygonalItem -"QCanvasRectangle" qcanvasrectangle.html -"QCanvasRectangle::chunks" qcanvasrectangle.html#chunks -"QCanvasRectangle::drawShape" qcanvasrectangle.html#drawShape -"QCanvasRectangle::height" qcanvasrectangle.html#height -"QCanvasRectangle::rect" qcanvasrectangle.html#rect -"QCanvasRectangle::rtti" qcanvasrectangle.html#rtti -"QCanvasRectangle::setSize" qcanvasrectangle.html#setSize -"QCanvasRectangle::size" qcanvasrectangle.html#size -"QCanvasRectangle::width" qcanvasrectangle.html#width -"QCanvasRectangle::~QCanvasRectangle" qcanvasrectangle.html#~QCanvasRectangle -"QCanvasSpline" qcanvasspline.html -"QCanvasSpline::closed" qcanvasspline.html#closed -"QCanvasSpline::controlPoints" qcanvasspline.html#controlPoints -"QCanvasSpline::rtti" qcanvasspline.html#rtti -"QCanvasSpline::setControlPoints" qcanvasspline.html#setControlPoints -"QCanvasSpline::~QCanvasSpline" qcanvasspline.html#~QCanvasSpline -"QCanvasSprite" qcanvassprite.html -"QCanvasSprite::FrameAnimationType" qcanvassprite.html#FrameAnimationType -"QCanvasSprite::advance" qcanvassprite.html#advance -"QCanvasSprite::bottomEdge" qcanvassprite.html#bottomEdge -"QCanvasSprite::boundingRect" qcanvassprite.html#boundingRect -"QCanvasSprite::collidesWith" qcanvassprite.html#collidesWith -"QCanvasSprite::draw" qcanvassprite.html#draw -"QCanvasSprite::frame" qcanvassprite.html#frame -"QCanvasSprite::frameCount" qcanvassprite.html#frameCount -"QCanvasSprite::height" qcanvassprite.html#height -"QCanvasSprite::image" qcanvassprite.html#image -"QCanvasSprite::imageAdvanced" qcanvassprite.html#imageAdvanced -"QCanvasSprite::leftEdge" qcanvassprite.html#leftEdge -"QCanvasSprite::move" qcanvassprite.html#move -"QCanvasSprite::rightEdge" qcanvassprite.html#rightEdge -"QCanvasSprite::rtti" qcanvassprite.html#rtti -"QCanvasSprite::setFrame" qcanvassprite.html#setFrame -"QCanvasSprite::setFrameAnimation" qcanvassprite.html#setFrameAnimation -"QCanvasSprite::setSequence" qcanvassprite.html#setSequence -"QCanvasSprite::topEdge" qcanvassprite.html#topEdge -"QCanvasSprite::width" qcanvassprite.html#width -"QCanvasSprite::~QCanvasSprite" qcanvassprite.html#~QCanvasSprite -"QCanvasText" qcanvastext.html -"QCanvasText::addToChunks" qcanvastext.html#addToChunks -"QCanvasText::boundingRect" qcanvastext.html#boundingRect -"QCanvasText::color" qcanvastext.html#color -"QCanvasText::draw" qcanvastext.html#draw -"QCanvasText::font" qcanvastext.html#font -"QCanvasText::removeFromChunks" qcanvastext.html#removeFromChunks -"QCanvasText::rtti" qcanvastext.html#rtti -"QCanvasText::setColor" qcanvastext.html#setColor -"QCanvasText::setFont" qcanvastext.html#setFont -"QCanvasText::setText" qcanvastext.html#setText -"QCanvasText::setTextFlags" qcanvastext.html#setTextFlags -"QCanvasText::text" qcanvastext.html#text -"QCanvasText::textFlags" qcanvastext.html#textFlags -"QCanvasText::~QCanvasText" qcanvastext.html#~QCanvasText -"QCanvasView" qcanvasview.html -"QCanvasView::canvas" qcanvasview.html#canvas -"QCanvasView::drawContents" qcanvasview.html#drawContents -"QCanvasView::inverseWorldMatrix" qcanvasview.html#inverseWorldMatrix -"QCanvasView::setCanvas" qcanvasview.html#setCanvas -"QCanvasView::setWorldMatrix" qcanvasview.html#setWorldMatrix -"QCanvasView::sizeHint" qcanvasview.html#sizeHint -"QCanvasView::worldMatrix" qcanvasview.html#worldMatrix -"QCanvasView::~QCanvasView" qcanvasview.html#~QCanvasView +"TQCanvas" tqcanvas.html +"TQCanvas::advance" tqcanvas.html#advance +"TQCanvas::allItems" tqcanvas.html#allItems +"TQCanvas::backgroundColor" tqcanvas.html#backgroundColor +"TQCanvas::backgroundPixmap" tqcanvas.html#backgroundPixmap +"TQCanvas::chunkSize" tqcanvas.html#chunkSize +"TQCanvas::collisions" tqcanvas.html#collisions +"TQCanvas::drawArea" tqcanvas.html#drawArea +"TQCanvas::drawBackground" tqcanvas.html#drawBackground +"TQCanvas::drawForeground" tqcanvas.html#drawForeground +"TQCanvas::height" tqcanvas.html#height +"TQCanvas::onCanvas" tqcanvas.html#onCanvas +"TQCanvas::rect" tqcanvas.html#rect +"TQCanvas::resize" tqcanvas.html#resize +"TQCanvas::resized" tqcanvas.html#resized +"TQCanvas::retune" tqcanvas.html#retune +"TQCanvas::setAdvancePeriod" tqcanvas.html#setAdvancePeriod +"TQCanvas::setAllChanged" tqcanvas.html#setAllChanged +"TQCanvas::setBackgroundColor" tqcanvas.html#setBackgroundColor +"TQCanvas::setBackgroundPixmap" tqcanvas.html#setBackgroundPixmap +"TQCanvas::setChanged" tqcanvas.html#setChanged +"TQCanvas::setDoubleBuffering" tqcanvas.html#setDoubleBuffering +"TQCanvas::setTile" tqcanvas.html#setTile +"TQCanvas::setTiles" tqcanvas.html#setTiles +"TQCanvas::setUnchanged" tqcanvas.html#setUnchanged +"TQCanvas::setUpdatePeriod" tqcanvas.html#setUpdatePeriod +"TQCanvas::size" tqcanvas.html#size +"TQCanvas::tile" tqcanvas.html#tile +"TQCanvas::tileHeight" tqcanvas.html#tileHeight +"TQCanvas::tileWidth" tqcanvas.html#tileWidth +"TQCanvas::tilesHorizontally" tqcanvas.html#tilesHorizontally +"TQCanvas::tilesVertically" tqcanvas.html#tilesVertically +"TQCanvas::update" tqcanvas.html#update +"TQCanvas::validChunk" tqcanvas.html#validChunk +"TQCanvas::width" tqcanvas.html#width +"TQCanvas::~TQCanvas" tqcanvas.html#~TQCanvas +"TQCanvasEllipse" tqcanvasellipse.html +"TQCanvasEllipse::angleLength" tqcanvasellipse.html#angleLength +"TQCanvasEllipse::angleStart" tqcanvasellipse.html#angleStart +"TQCanvasEllipse::drawShape" tqcanvasellipse.html#drawShape +"TQCanvasEllipse::height" tqcanvasellipse.html#height +"TQCanvasEllipse::rtti" tqcanvasellipse.html#rtti +"TQCanvasEllipse::setAngles" tqcanvasellipse.html#setAngles +"TQCanvasEllipse::setSize" tqcanvasellipse.html#setSize +"TQCanvasEllipse::width" tqcanvasellipse.html#width +"TQCanvasEllipse::~TQCanvasEllipse" tqcanvasellipse.html#~TQCanvasEllipse +"TQCanvasItem" tqcanvasitem.html +"TQCanvasItem::RttiValues" tqcanvasitem.html#RttiValues +"TQCanvasItem::advance" tqcanvasitem.html#advance +"TQCanvasItem::animated" tqcanvasitem.html#animated +"TQCanvasItem::boundingRect" tqcanvasitem.html#boundingRect +"TQCanvasItem::boundingRectAdvanced" tqcanvasitem.html#boundingRectAdvanced +"TQCanvasItem::canvas" tqcanvasitem.html#canvas +"TQCanvasItem::collidesWith" tqcanvasitem.html#collidesWith +"TQCanvasItem::collisions" tqcanvasitem.html#collisions +"TQCanvasItem::draw" tqcanvasitem.html#draw +"TQCanvasItem::hide" tqcanvasitem.html#hide +"TQCanvasItem::isActive" tqcanvasitem.html#isActive +"TQCanvasItem::isEnabled" tqcanvasitem.html#isEnabled +"TQCanvasItem::isSelected" tqcanvasitem.html#isSelected +"TQCanvasItem::isVisible" tqcanvasitem.html#isVisible +"TQCanvasItem::move" tqcanvasitem.html#move +"TQCanvasItem::moveBy" tqcanvasitem.html#moveBy +"TQCanvasItem::rtti" tqcanvasitem.html#rtti +"TQCanvasItem::setActive" tqcanvasitem.html#setActive +"TQCanvasItem::setAnimated" tqcanvasitem.html#setAnimated +"TQCanvasItem::setCanvas" tqcanvasitem.html#setCanvas +"TQCanvasItem::setEnabled" tqcanvasitem.html#setEnabled +"TQCanvasItem::setSelected" tqcanvasitem.html#setSelected +"TQCanvasItem::setVelocity" tqcanvasitem.html#setVelocity +"TQCanvasItem::setVisible" tqcanvasitem.html#setVisible +"TQCanvasItem::setX" tqcanvasitem.html#setX +"TQCanvasItem::setXVelocity" tqcanvasitem.html#setXVelocity +"TQCanvasItem::setY" tqcanvasitem.html#setY +"TQCanvasItem::setYVelocity" tqcanvasitem.html#setYVelocity +"TQCanvasItem::setZ" tqcanvasitem.html#setZ +"TQCanvasItem::show" tqcanvasitem.html#show +"TQCanvasItem::update" tqcanvasitem.html#update +"TQCanvasItem::x" tqcanvasitem.html#x +"TQCanvasItem::xVelocity" tqcanvasitem.html#xVelocity +"TQCanvasItem::y" tqcanvasitem.html#y +"TQCanvasItem::yVelocity" tqcanvasitem.html#yVelocity +"TQCanvasItem::z" tqcanvasitem.html#z +"TQCanvasItem::~TQCanvasItem" tqcanvasitem.html#~TQCanvasItem +"TQCanvasItemList" tqcanvasitemlist.html +"TQCanvasItemList::operator+" tqcanvasitemlist.html#operator+ +"TQCanvasLine" tqcanvasline.html +"TQCanvasLine::endPoint" tqcanvasline.html#endPoint +"TQCanvasLine::rtti" tqcanvasline.html#rtti +"TQCanvasLine::setPoints" tqcanvasline.html#setPoints +"TQCanvasLine::startPoint" tqcanvasline.html#startPoint +"TQCanvasLine::~TQCanvasLine" tqcanvasline.html#~TQCanvasLine +"TQCanvasPixmap" tqcanvaspixmap.html +"TQCanvasPixmap::offsetX" tqcanvaspixmap.html#offsetX +"TQCanvasPixmap::offsetY" tqcanvaspixmap.html#offsetY +"TQCanvasPixmap::setOffset" tqcanvaspixmap.html#setOffset +"TQCanvasPixmap::~TQCanvasPixmap" tqcanvaspixmap.html#~TQCanvasPixmap +"TQCanvasPixmapArray" tqcanvaspixmaparray.html +"TQCanvasPixmapArray::count" tqcanvaspixmaparray.html#count +"TQCanvasPixmapArray::image" tqcanvaspixmaparray.html#image +"TQCanvasPixmapArray::isValid" tqcanvaspixmaparray.html#isValid +"TQCanvasPixmapArray::readCollisionMasks" tqcanvaspixmaparray.html#readCollisionMasks +"TQCanvasPixmapArray::readPixmaps" tqcanvaspixmaparray.html#readPixmaps +"TQCanvasPixmapArray::setImage" tqcanvaspixmaparray.html#setImage +"TQCanvasPixmapArray::~TQCanvasPixmapArray" tqcanvaspixmaparray.html#~TQCanvasPixmapArray +"TQCanvasPolygon" tqcanvaspolygon.html +"TQCanvasPolygon::areaPoints" tqcanvaspolygon.html#areaPoints +"TQCanvasPolygon::drawShape" tqcanvaspolygon.html#drawShape +"TQCanvasPolygon::points" tqcanvaspolygon.html#points +"TQCanvasPolygon::rtti" tqcanvaspolygon.html#rtti +"TQCanvasPolygon::setPoints" tqcanvaspolygon.html#setPoints +"TQCanvasPolygon::~TQCanvasPolygon" tqcanvaspolygon.html#~TQCanvasPolygon +"TQCanvasPolygonalItem" tqcanvaspolygonalitem.html +"TQCanvasPolygonalItem::areaPoints" tqcanvaspolygonalitem.html#areaPoints +"TQCanvasPolygonalItem::areaPointsAdvanced" tqcanvaspolygonalitem.html#areaPointsAdvanced +"TQCanvasPolygonalItem::boundingRect" tqcanvaspolygonalitem.html#boundingRect +"TQCanvasPolygonalItem::brush" tqcanvaspolygonalitem.html#brush +"TQCanvasPolygonalItem::draw" tqcanvaspolygonalitem.html#draw +"TQCanvasPolygonalItem::drawShape" tqcanvaspolygonalitem.html#drawShape +"TQCanvasPolygonalItem::invalidate" tqcanvaspolygonalitem.html#invalidate +"TQCanvasPolygonalItem::isValid" tqcanvaspolygonalitem.html#isValid +"TQCanvasPolygonalItem::pen" tqcanvaspolygonalitem.html#pen +"TQCanvasPolygonalItem::rtti" tqcanvaspolygonalitem.html#rtti +"TQCanvasPolygonalItem::setBrush" tqcanvaspolygonalitem.html#setBrush +"TQCanvasPolygonalItem::setPen" tqcanvaspolygonalitem.html#setPen +"TQCanvasPolygonalItem::setWinding" tqcanvaspolygonalitem.html#setWinding +"TQCanvasPolygonalItem::winding" tqcanvaspolygonalitem.html#winding +"TQCanvasPolygonalItem::~TQCanvasPolygonalItem" tqcanvaspolygonalitem.html#~TQCanvasPolygonalItem +"TQCanvasRectangle" tqcanvasrectangle.html +"TQCanvasRectangle::chunks" tqcanvasrectangle.html#chunks +"TQCanvasRectangle::drawShape" tqcanvasrectangle.html#drawShape +"TQCanvasRectangle::height" tqcanvasrectangle.html#height +"TQCanvasRectangle::rect" tqcanvasrectangle.html#rect +"TQCanvasRectangle::rtti" tqcanvasrectangle.html#rtti +"TQCanvasRectangle::setSize" tqcanvasrectangle.html#setSize +"TQCanvasRectangle::size" tqcanvasrectangle.html#size +"TQCanvasRectangle::width" tqcanvasrectangle.html#width +"TQCanvasRectangle::~TQCanvasRectangle" tqcanvasrectangle.html#~TQCanvasRectangle +"TQCanvasSpline" tqcanvasspline.html +"TQCanvasSpline::closed" tqcanvasspline.html#closed +"TQCanvasSpline::controlPoints" tqcanvasspline.html#controlPoints +"TQCanvasSpline::rtti" tqcanvasspline.html#rtti +"TQCanvasSpline::setControlPoints" tqcanvasspline.html#setControlPoints +"TQCanvasSpline::~TQCanvasSpline" tqcanvasspline.html#~TQCanvasSpline +"TQCanvasSprite" tqcanvassprite.html +"TQCanvasSprite::FrameAnimationType" tqcanvassprite.html#FrameAnimationType +"TQCanvasSprite::advance" tqcanvassprite.html#advance +"TQCanvasSprite::bottomEdge" tqcanvassprite.html#bottomEdge +"TQCanvasSprite::boundingRect" tqcanvassprite.html#boundingRect +"TQCanvasSprite::collidesWith" tqcanvassprite.html#collidesWith +"TQCanvasSprite::draw" tqcanvassprite.html#draw +"TQCanvasSprite::frame" tqcanvassprite.html#frame +"TQCanvasSprite::frameCount" tqcanvassprite.html#frameCount +"TQCanvasSprite::height" tqcanvassprite.html#height +"TQCanvasSprite::image" tqcanvassprite.html#image +"TQCanvasSprite::imageAdvanced" tqcanvassprite.html#imageAdvanced +"TQCanvasSprite::leftEdge" tqcanvassprite.html#leftEdge +"TQCanvasSprite::move" tqcanvassprite.html#move +"TQCanvasSprite::rightEdge" tqcanvassprite.html#rightEdge +"TQCanvasSprite::rtti" tqcanvassprite.html#rtti +"TQCanvasSprite::setFrame" tqcanvassprite.html#setFrame +"TQCanvasSprite::setFrameAnimation" tqcanvassprite.html#setFrameAnimation +"TQCanvasSprite::setSequence" tqcanvassprite.html#setSequence +"TQCanvasSprite::topEdge" tqcanvassprite.html#topEdge +"TQCanvasSprite::width" tqcanvassprite.html#width +"TQCanvasSprite::~TQCanvasSprite" tqcanvassprite.html#~TQCanvasSprite +"TQCanvasText" tqcanvastext.html +"TQCanvasText::addToChunks" tqcanvastext.html#addToChunks +"TQCanvasText::boundingRect" tqcanvastext.html#boundingRect +"TQCanvasText::color" tqcanvastext.html#color +"TQCanvasText::draw" tqcanvastext.html#draw +"TQCanvasText::font" tqcanvastext.html#font +"TQCanvasText::removeFromChunks" tqcanvastext.html#removeFromChunks +"TQCanvasText::rtti" tqcanvastext.html#rtti +"TQCanvasText::setColor" tqcanvastext.html#setColor +"TQCanvasText::setFont" tqcanvastext.html#setFont +"TQCanvasText::setText" tqcanvastext.html#setText +"TQCanvasText::setTextFlags" tqcanvastext.html#setTextFlags +"TQCanvasText::text" tqcanvastext.html#text +"TQCanvasText::textFlags" tqcanvastext.html#textFlags +"TQCanvasText::~TQCanvasText" tqcanvastext.html#~TQCanvasText +"TQCanvasView" tqcanvasview.html +"TQCanvasView::canvas" tqcanvasview.html#canvas +"TQCanvasView::drawContents" tqcanvasview.html#drawContents +"TQCanvasView::inverseWorldMatrix" tqcanvasview.html#inverseWorldMatrix +"TQCanvasView::setCanvas" tqcanvasview.html#setCanvas +"TQCanvasView::setWorldMatrix" tqcanvasview.html#setWorldMatrix +"TQCanvasView::sizeHint" tqcanvasview.html#sizeHint +"TQCanvasView::worldMatrix" tqcanvasview.html#worldMatrix +"TQCanvasView::~TQCanvasView" tqcanvasview.html#~TQCanvasView "TQChar" qchar.html "TQChar::Category" qchar.html#Category "TQChar::CombiningClass" qchar.html#CombiningClass diff --git a/doc/html/mainclasses.html b/doc/html/mainclasses.html index 2c55a9ec..28dc551e 100644 --- a/doc/html/mainclasses.html +++ b/doc/html/mainclasses.html @@ -72,7 +72,7 @@ classes), see TQt's Classes. TQToolBox
      C -TQCanvas +TQCanvas G TQGLWidget O diff --git a/doc/html/ntqcanvas.html b/doc/html/ntqcanvas.html deleted file mode 100644 index 9b9d3735..00000000 --- a/doc/html/ntqcanvas.html +++ /dev/null @@ -1,588 +0,0 @@ - - - - - -TQCanvas Class - - - - - - - -
      - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

      TQCanvas Class Reference
      [canvas module]

      - -

      The TQCanvas class provides a 2D area that can contain TQCanvasItem objects. -More... -

      #include <ntqcanvas.h> -

      Inherits TQObject. -

      List of all member functions. -

      Public Members

      - -

      Public Slots

      - -

      Signals

      - -

      Protected Members

      -
        -
      • virtual void drawBackground ( TQPainter & painter, const TQRect & clip )
      • -
      • virtual void drawForeground ( TQPainter & painter, const TQRect & clip )
      • -
      -

      Detailed Description

      - - -The TQCanvas class provides a 2D area that can contain TQCanvasItem objects. - -

      - - - - -

      The TQCanvas class manages its 2D graphic area and all the canvas -items the area contains. The canvas has no visual appearance of -its own. Instead, it is displayed on screen using a TQCanvasView. -Multiple TQCanvasView widgets may be associated with a canvas to -provide multiple views of the same canvas. -

      The canvas is optimized for large numbers of items, particularly -where only a small percentage of the items change at any -one time. If the entire display changes very frequently, you should -consider using your own custom TQScrollView subclass. -

      TQt provides a rich -set of canvas item classes, e.g. TQCanvasEllipse, TQCanvasLine, -TQCanvasPolygon, TQCanvasPolygonalItem, TQCanvasRectangle, TQCanvasSpline, -TQCanvasSprite and TQCanvasText. You can subclass to create your own -canvas items; TQCanvasPolygonalItem is the most common base class used -for this purpose. -

      Items appear on the canvas after their show() function has been called (or setVisible(TRUE)), and after -update() has been called. The canvas only shows items that are -visible, and then only if -update() is called. (By default the canvas is white and so are -canvas items, so if nothing appears try changing colors.) -

      If you created the canvas without passing a width and height to -the constructor you must also call resize(). -

      Although a canvas may appear to be similar to a widget with child -widgets, there are several notable differences: -

        -
      • Canvas items are usually much faster to manipulate and redraw than -child widgets, with the speed advantage becoming especially great when -there are many canvas items and non-rectangular items. In most -situations canvas items are also a lot more memory efficient than child -widgets. -

      • It's easy to detect overlapping items (collision detection). -

      • The canvas can be larger than a widget. A million-by-million canvas -is perfectly possible. At such a size a widget might be very -inefficient, and some window systems might not support it at all, -whereas TQCanvas scales well. Even with a billion pixels and a million -items, finding a particular canvas item, detecting collisions, etc., -is still fast (though the memory consumption may be prohibitive -at such extremes). -

      • Two or more TQCanvasView objects can view the same canvas. -

      • An arbitrary transformation matrix can be set on each TQCanvasView -which makes it easy to zoom, rotate or shear the viewed canvas. -

      • Widgets provide a lot more functionality, such as input (TQKeyEvent, -TQMouseEvent etc.) and layout management (TQGridLayout etc.). -

      -

      A canvas consists of a background, a number of canvas items organized by -x, y and z coordinates, and a foreground. A canvas item's z coordinate -can be treated as a layer number -- canvas items with a higher z -coordinate appear in front of canvas items with a lower z coordinate. -

      The background is white by default, but can be set to a different color -using setBackgroundColor(), or to a repeated pixmap using -setBackgroundPixmap() or to a mosaic of smaller pixmaps using -setTiles(). Individual tiles can be set with setTile(). There -are corresponding get functions, e.g. backgroundColor() and -backgroundPixmap(). -

      Note that TQCanvas does not inherit from TQWidget, even though it has some -functions which provide the same functionality as those in TQWidget. One -of these is setBackgroundPixmap(); some others are resize(), size(), -width() and height(). TQCanvasView is the widget used to display a -canvas on the screen. -

      Canvas items are added to a canvas by constructing them and passing the -canvas to the canvas item's constructor. An item can be moved to a -different canvas using TQCanvasItem::setCanvas(). -

      Canvas items are movable (and in the case of TQCanvasSprites, animated) -objects that inherit TQCanvasItem. Each canvas item has a position on the -canvas (x, y coordinates) and a height (z coordinate), all of which are -held as floating-point numbers. Moving canvas items also have x and y -velocities. It's possible for a canvas item to be outside the canvas -(for example TQCanvasItem::x() is greater than width()). When a canvas -item is off the canvas, onCanvas() returns FALSE and the canvas -disregards the item. (Canvas items off the canvas do not slow down any -of the common operations on the canvas.) -

      Canvas items can be moved with TQCanvasItem::move(). The advance() -function moves all TQCanvasItem::animated() canvas items and -setAdvancePeriod() makes TQCanvas move them automatically on a periodic -basis. In the context of the TQCanvas classes, to `animate' a canvas item -is to set it in motion, i.e. using TQCanvasItem::setVelocity(). Animation -of a canvas item itself, i.e. items which change over time, is enabled -by calling TQCanvasSprite::setFrameAnimation(), or more generally by -subclassing and reimplementing TQCanvasItem::advance(). To detect collisions -use one of the TQCanvasItem::collisions() functions. -

      The changed parts of the canvas are redrawn (if they are visible in a -canvas view) whenever update() is called. You can either call update() -manually after having changed the contents of the canvas, or force -periodic updates using setUpdatePeriod(). If you have moving objects on -the canvas, you must call advance() every time the objects should -move one step further. Periodic calls to advance() can be forced using -setAdvancePeriod(). The advance() function will call -TQCanvasItem::advance() on every item that is animated and trigger an update of the -affected areas afterwards. (A canvas item that is `animated' is simply -a canvas item that is in motion.) -

      TQCanvas organizes its canvas items into chunks; these are areas on -the canvas that are used to speed up most operations. Many operations -start by eliminating most chunks (i.e. those which haven't changed) -and then process only the canvas items that are in the few interesting -(i.e. changed) chunks. A valid chunk, validChunk(), is one which is on -the canvas. -

      The chunk size is a key factor to TQCanvas's speed: if there are too many -chunks, the speed benefit of grouping canvas items into chunks is -reduced. If the chunks are too large, it takes too long to process each -one. The TQCanvas constructor tries to pick a suitable size, but you -can call retune() to change it at any time. The chunkSize() function -returns the current chunk size. The canvas items always make sure -they're in the right chunks; all you need to make sure of is that -the canvas uses the right chunk size. A good rule of thumb is that -the size should be a bit smaller than the average canvas item -size. If you have moving objects, the chunk size should be a bit -smaller than the average size of the moving items. -

      The foreground is normally nothing, but if you reimplement -drawForeground(), you can draw things in front of all the canvas -items. -

      Areas can be set as changed with setChanged() and set unchanged with -setUnchanged(). The entire canvas can be set as changed with -setAllChanged(). A list of all the items on the canvas is returned by -allItems(). -

      An area can be copied (painted) to a TQPainter with drawArea(). -

      If the canvas is resized it emits the resized() signal. -

      The examples/canvas application and the 2D graphics page of the -examples/demo application demonstrate many of TQCanvas's facilities. -

      See also TQCanvasView, TQCanvasItem, Abstract Widget Classes, Graphics Classes, and Image Processing Classes. - -


      Member Function Documentation

      -

      TQCanvas::TQCanvas ( TQObject * parent = 0, const char * name = 0 ) -

      -Create a TQCanvas with no size. parent and name are passed to -the TQObject superclass. -

      Warning: You must call resize() at some time after creation to -be able to use the canvas. - -

      TQCanvas::TQCanvas ( int w, int h ) -

      -Constructs a TQCanvas that is w pixels wide and h pixels high. - -

      TQCanvas::TQCanvas ( TQPixmap p, int h, int v, int tilewidth, int tileheight ) -

      -Constructs a TQCanvas which will be composed of h tiles -horizontally and v tiles vertically. Each tile will be an image -tilewidth by tileheight pixels taken from pixmap p. -

      The pixmap p is a list of tiles, arranged left to right, (and -in the case of pixmaps that have multiple rows of tiles, top to -bottom), with tile 0 in the top-left corner, tile 1 next to the -right, and so on, e.g. -

      -
      0 1 2 3 -
      4 5 6 7 -
      -

      The TQCanvas is initially sized to show exactly the given number of -tiles horizontally and vertically. If it is resized to be larger, -the entire matrix of tiles will be repeated as often as necessary -to cover the area. If it is smaller, tiles to the right and bottom -will not be visible. -

      See also setTiles(). - -

      TQCanvas::~TQCanvas () [virtual] -

      -Destroys the canvas and all the canvas's canvas items. - -

      void TQCanvas::advance () [virtual slot] -

      -Moves all TQCanvasItem::animated() canvas items on the canvas and -refreshes all changes to all views of the canvas. (An `animated' -item is an item that is in motion; see setVelocity().) -

      The advance takes place in two phases. In phase 0, the -TQCanvasItem::advance() function of each TQCanvasItem::animated() -canvas item is called with paramater 0. Then all these canvas -items are called again, with parameter 1. In phase 0, the canvas -items should not change position, merely examine other items on -the canvas for which special processing is required, such as -collisions between items. In phase 1, all canvas items should -change positions, ignoring any other items on the canvas. This -two-phase approach allows for considerations of "fairness", -although no TQCanvasItem subclasses supplied with TQt do anything -interesting in phase 0. -

      The canvas can be configured to call this function periodically -with setAdvancePeriod(). -

      See also update(). - -

      TQCanvasItemList TQCanvas::allItems () -

      -Returns a list of all the items in the canvas. - -

      TQColor TQCanvas::backgroundColor () const -

      -Returns the color set by setBackgroundColor(). By default, this is -white. -

      This function is not a reimplementation of -TQWidget::backgroundColor() (TQCanvas is not a subclass of TQWidget), -but all TQCanvasViews that are viewing the canvas will set their -backgrounds to this color. -

      See also setBackgroundColor() and backgroundPixmap(). - -

      TQPixmap TQCanvas::backgroundPixmap () const -

      -Returns the pixmap set by setBackgroundPixmap(). By default, -this is a null pixmap. -

      See also setBackgroundPixmap() and backgroundColor(). - -

      int TQCanvas::chunkSize () const -

      - -

      Returns the chunk size of the canvas. -

      See also retune(). - -

      TQCanvasItemList TQCanvas::collisions ( const TQPoint & p ) const -

      -Returns a list of canvas items that collide with the point p. -The list is ordered by z coordinates, from highest z coordinate -(front-most item) to lowest z coordinate (rear-most item). - -

      TQCanvasItemList TQCanvas::collisions ( const TQRect & r ) const -

      -This is an overloaded member function, provided for convenience. It behaves essentially like the above function. -

      Returns a list of items which collide with the rectangle r. The -list is ordered by z coordinates, from highest z coordinate -(front-most item) to lowest z coordinate (rear-most item). - -

      TQCanvasItemList TQCanvas::collisions ( const TQPointArray & chunklist, const TQCanvasItem * item, bool exact ) const -

      -This is an overloaded member function, provided for convenience. It behaves essentially like the above function. -

      Returns a list of canvas items which intersect with the chunks -listed in chunklist, excluding item. If exact is TRUE, -only those which actually collide with item are returned; otherwise canvas items -are included just for being in the chunks. -

      This is a utility function mainly used to implement the simpler -TQCanvasItem::collisions() function. - -

      void TQCanvas::drawArea ( const TQRect & clip, TQPainter * painter, bool dbuf = FALSE ) -

      -Paints all canvas items that are in the area clip to painter, using double-buffering if dbuf is TRUE. -

      e.g. to print the canvas to a printer: -

      -    TQPrinter pr;
      -    if ( pr.setup() ) {
      -        TQPainter p(&pr);
      -        canvas.drawArea( canvas.rect(), &p );
      -    }
      -    
      - - -

      Example: canvas/canvas.cpp. -

      void TQCanvas::drawBackground ( TQPainter & painter, const TQRect & clip ) [virtual protected] -

      -This virtual function is called for all updates of the canvas. It -renders any background graphics using the painter painter, in -the area clip. If the canvas has a background pixmap or a tiled -background, that graphic is used, otherwise the canvas is cleared -using the background color. -

      If the graphics for an area change, you must explicitly call -setChanged(const TQRect&) for the result to be visible when -update() is next called. -

      See also setBackgroundColor(), setBackgroundPixmap(), and setTiles(). - -

      void TQCanvas::drawForeground ( TQPainter & painter, const TQRect & clip ) [virtual protected] -

      -This virtual function is called for all updates of the canvas. It -renders any foreground graphics using the painter painter, in -the area clip. -

      If the graphics for an area change, you must explicitly call -setChanged(const TQRect&) for the result to be visible when -update() is next called. -

      The default is to draw nothing. - -

      int TQCanvas::height () const -

      - -

      Returns the height of the canvas, in pixels. - -

      Example: canvas/canvas.cpp. -

      bool TQCanvas::onCanvas ( int x, int y ) const -

      - -

      Returns TRUE if the pixel position (x, y) is on the canvas; -otherwise returns FALSE. -

      See also validChunk(). - -

      bool TQCanvas::onCanvas ( const TQPoint & p ) const -

      - -This is an overloaded member function, provided for convenience. It behaves essentially like the above function. -

      Returns TRUE if the pixel position p is on the canvas; -otherwise returns FALSE. -

      See also validChunk(). - -

      TQRect TQCanvas::rect () const -

      - -

      Returns a rectangle the size of the canvas. - -

      void TQCanvas::resize ( int w, int h ) [virtual] -

      -Changes the size of the canvas to have a width of w and a -height of h. This is a slow operation. - -

      Examples: canvas/canvas.cpp and chart/chartform.cpp. -

      void TQCanvas::resized () [signal] -

      - -

      This signal is emitted whenever the canvas is resized. Each -TQCanvasView connects to this signal to keep the scrollview's size -correct. - -

      void TQCanvas::retune ( int chunksze, int mxclusters = 100 ) [virtual] -

      -Change the efficiency tuning parameters to mxclusters clusters, -each of size chunksze. This is a slow operation if there are -many objects on the canvas. -

      The canvas is divided into chunks which are rectangular areas chunksze wide by chunksze high. Use a chunk size which is about -the average size of the canvas items. If you choose a chunk size -which is too small it will increase the amount of calculation -required when drawing since each change will affect many chunks. -If you choose a chunk size which is too large the amount of -drawing required will increase because for each change, a lot of -drawing will be required since there will be many (unchanged) -canvas items which are in the same chunk as the changed canvas -items. -

      Internally, a canvas uses a low-resolution "chunk matrix" to keep -track of all the items in the canvas. A 64x64 chunk matrix is the -default for a 1024x1024 pixel canvas, where each chunk collects -canvas items in a 16x16 pixel square. This default is also -affected by setTiles(). You can tune this default using this -function. For example if you have a very large canvas and want to -trade off speed for memory then you might set the chunk size to 32 -or 64. -

      The mxclusters argument is the number of rectangular groups of -chunks that will be separately drawn. If the canvas has a large -number of small, dispersed items, this should be about that -number. Our testing suggests that a large number of clusters is -almost always best. -

      -

      void TQCanvas::setAdvancePeriod ( int ms ) [virtual] -

      -Sets the canvas to call advance() every ms milliseconds. Any -previous setting by setAdvancePeriod() or setUpdatePeriod() is -overridden. -

      If ms is less than 0 advancing will be stopped. - -

      Example: canvas/main.cpp. -

      void TQCanvas::setAllChanged () [virtual] -

      -Marks the whole canvas as changed. -All views of the canvas will be entirely redrawn when -update() is called next. - -

      void TQCanvas::setBackgroundColor ( const TQColor & c ) [virtual] -

      -Sets the solid background to be the color c. -

      See also backgroundColor(), setBackgroundPixmap(), and setTiles(). - -

      void TQCanvas::setBackgroundPixmap ( const TQPixmap & p ) [virtual] -

      -Sets the solid background to be the pixmap p repeated as -necessary to cover the entire canvas. -

      See also backgroundPixmap(), setBackgroundColor(), and setTiles(). - -

      void TQCanvas::setChanged ( const TQRect & area ) [virtual] -

      -Marks area as changed. This area will be redrawn in all -views that are showing it when update() is called next. - -

      void TQCanvas::setDoubleBuffering ( bool y ) [virtual] -

      -If y is TRUE (the default) double-buffering is switched on; -otherwise double-buffering is switched off. -

      Turning off double-buffering causes the redrawn areas to flicker a -little and also gives a (usually small) performance improvement. - -

      Example: canvas/canvas.cpp. -

      void TQCanvas::setTile ( int x, int y, int tilenum ) [virtual] -

      -Sets the tile at (x, y) to use tile number tilenum, which -is an index into the tile pixmaps. The canvas will update -appropriately when update() is next called. -

      The images are taken from the pixmap set by setTiles() and are -arranged left to right, (and in the case of pixmaps that have -multiple rows of tiles, top to bottom), with tile 0 in the -top-left corner, tile 1 next to the right, and so on, e.g. -

      -
      0 1 2 3 -
      4 5 6 7 -
      -

      See also tile() and setTiles(). - -

      void TQCanvas::setTiles ( TQPixmap p, int h, int v, int tilewidth, int tileheight ) [virtual] -

      -Sets the TQCanvas to be composed of h tiles horizontally and v tiles vertically. Each tile will be an image tilewidth by tileheight pixels from pixmap p. -

      The pixmap p is a list of tiles, arranged left to right, (and -in the case of pixmaps that have multiple rows of tiles, top to -bottom), with tile 0 in the top-left corner, tile 1 next to the -right, and so on, e.g. -

      -
      0 1 2 3 -
      4 5 6 7 -
      -

      If the canvas is larger than the matrix of tiles, the entire -matrix is repeated as necessary to cover the whole canvas. If it -is smaller, tiles to the right and bottom are not visible. -

      The width and height of p must be a multiple of tilewidth -and tileheight. If they are not the function will do nothing. -

      If you want to unset any tiling set, then just pass in a null -pixmap and 0 for h, v, tilewidth, and -tileheight. - -

      void TQCanvas::setUnchanged ( const TQRect & area ) [virtual] -

      -Marks area as unchanged. The area will not be redrawn in -the views for the next update(), unless it is marked or changed -again before the next call to update(). - -

      void TQCanvas::setUpdatePeriod ( int ms ) [virtual] -

      -Sets the canvas to call update() every ms milliseconds. Any -previous setting by setAdvancePeriod() or setUpdatePeriod() is -overridden. -

      If ms is less than 0 automatic updating will be stopped. - -

      TQSize TQCanvas::size () const -

      - -

      Returns the size of the canvas, in pixels. - -

      int TQCanvas::tile ( int x, int y ) const -

      - -

      Returns the tile at position (x, y). Initially, all tiles -are 0. -

      The parameters must be within range, i.e. -0 < x < tilesHorizontally() and -0 < y < tilesVertically(). -

      See also setTile(). - -

      int TQCanvas::tileHeight () const -

      - -

      Returns the height of each tile. - -

      int TQCanvas::tileWidth () const -

      - -

      Returns the width of each tile. - -

      int TQCanvas::tilesHorizontally () const -

      - -

      Returns the number of tiles horizontally. - -

      int TQCanvas::tilesVertically () const -

      - -

      Returns the number of tiles vertically. - -

      void TQCanvas::update () [virtual slot] -

      -Repaints changed areas in all views of the canvas. -

      See also advance(). - -

      bool TQCanvas::validChunk ( int x, int y ) const -

      - -

      Returns TRUE if the chunk position (x, y) is on the canvas; -otherwise returns FALSE. -

      See also onCanvas(). - -

      bool TQCanvas::validChunk ( const TQPoint & p ) const -

      - -This is an overloaded member function, provided for convenience. It behaves essentially like the above function. -

      Returns TRUE if the chunk position p is on the canvas; otherwise -returns FALSE. -

      See also onCanvas(). - -

      int TQCanvas::width () const -

      - -

      Returns the width of the canvas, in pixels. - -

      Example: canvas/canvas.cpp. - -


      -This file is part of the TQt toolkit. -Copyright © 1995-2007 -Trolltech. All Rights Reserved.


      - -
      Copyright © 2007 -TrolltechTrademarks -
      TQt 3.3.8
      -
      - diff --git a/doc/html/ntqgridview.html b/doc/html/ntqgridview.html index 4124c750..9807f929 100644 --- a/doc/html/ntqgridview.html +++ b/doc/html/ntqgridview.html @@ -101,7 +101,7 @@ columns with different sizes, use a TQTable instead. simple list of items, use a TQListBox. If you need to present hierachical data use a TQListView, and if you need random objects at random positions, consider using either a TQIconView or a -TQCanvas. +TQCanvas.

      See also Abstract Widget Classes.


      Member Function Documentation

      diff --git a/doc/html/ntqpixmap.html b/doc/html/ntqpixmap.html index 68859144..967ec91f 100644 --- a/doc/html/ntqpixmap.html +++ b/doc/html/ntqpixmap.html @@ -35,7 +35,7 @@ body { background: #ffffff; color: black; } More...

      #include <ntqpixmap.h>

      Inherits TQPaintDevice and TQt. -

      Inherited by TQBitmap and TQCanvasPixmap. +

      Inherited by TQBitmap and TQCanvasPixmap.

      List of all member functions.

      Public Members

        diff --git a/doc/html/ntqpointarray.html b/doc/html/ntqpointarray.html index 7a82d214..ef3c2539 100644 --- a/doc/html/ntqpointarray.html +++ b/doc/html/ntqpointarray.html @@ -158,7 +158,7 @@ parameter). equals 5760 (16*360). Positive values mean counter-clockwise, whereas negative values mean the clockwise direction. Zero degrees is at the 3 o'clock position. -

        See the angle diagram. +

        See the angle diagram.

        void TQPointArray::makeArc ( int x, int y, int w, int h, int a1, int a2, const TQWMatrix & xf )

        @@ -172,7 +172,7 @@ sufficient resolution for pixel accuracy. equals 5760 (16*360). Positive values mean counter-clockwise, whereas negative values mean the clockwise direction. Zero degrees is at the 3 o'clock position. -

        See the angle diagram. +

        See the angle diagram.

        void TQPointArray::makeEllipse ( int x, int y, int w, int h )

        diff --git a/doc/html/ntqscrollview.html b/doc/html/ntqscrollview.html index ad17beb3..e6ebd59f 100644 --- a/doc/html/ntqscrollview.html +++ b/doc/html/ntqscrollview.html @@ -35,7 +35,7 @@ body { background: #ffffff; color: black; } More...

        #include <ntqscrollview.h>

        Inherits TQFrame. -

        Inherited by TQCanvasView, TQTable, TQGridView, TQIconView, TQListBox, TQListView, and TQTextEdit. +

        Inherited by TQCanvasView, TQTable, TQGridView, TQIconView, TQListBox, TQListView, and TQTextEdit.

        List of all member functions.

        Public Members

          @@ -558,7 +558,7 @@ rectangle is in the scrollview's coordinates. set appropriately.

          Example: qdir/qdir.cpp. -

          Reimplemented in TQCanvasView and TQTable. +

          Reimplemented in TQCanvasView and TQTable.

          void TQScrollView::drawContentsOffset ( TQPainter * p, int offsetx, int offsety, int clipx, int clipy, int clipw, int cliph ) [virtual protected]

          For backward-compatibility only. It is easier to use diff --git a/doc/html/ntqt.html b/doc/html/ntqt.html index 091efc0f..f06bcfa6 100644 --- a/doc/html/ntqt.html +++ b/doc/html/ntqt.html @@ -35,7 +35,7 @@ body { background: #ffffff; color: black; } that need to be global-like. More...

          #include <ntqnamespace.h> -

          Inherited by TQObject, TQPixmap, TQBrush, TQCanvasItem, TQCursor, TQPainter, TQEvent, TQIconViewItem, TQKeySequence, TQListViewItem, TQCustomMenuItem, TQPen, TQStyleSheetItem, TQSyntaxHighlighter, TQTab, TQTableItem, TQThread, TQToolTip, and TQWhatsThis. +

          Inherited by TQObject, TQPixmap, TQBrush, TQCanvasItem, TQCursor, TQPainter, TQEvent, TQIconViewItem, TQKeySequence, TQListViewItem, TQCustomMenuItem, TQPen, TQStyleSheetItem, TQSyntaxHighlighter, TQTab, TQTableItem, TQThread, TQToolTip, and TQWhatsThis.

          List of all member functions.

          Public Members

            diff --git a/doc/html/ntqvaluelist.html b/doc/html/ntqvaluelist.html index 95275796..eafd2d6f 100644 --- a/doc/html/ntqvaluelist.html +++ b/doc/html/ntqvaluelist.html @@ -36,7 +36,7 @@ provides lists. More...

            All the functions in this class are reentrant when TQt is built with thread support.

            #include <ntqvaluelist.h> -

            Inherited by TQCanvasItemList, TQStringList, and TQValueStack. +

            Inherited by TQCanvasItemList, TQStringList, and TQValueStack.

            List of all member functions.

            Public Members

              diff --git a/doc/html/ntqwidget.html b/doc/html/ntqwidget.html index 10e22604..d49881dc 100644 --- a/doc/html/ntqwidget.html +++ b/doc/html/ntqwidget.html @@ -1617,7 +1617,7 @@ reasons. to, but some slow widgets need to optimize by painting only the requested region: TQPaintEvent::region(). This speed optimization does not change the result, as painting is clipped to that region -during event processing. TQListView and TQCanvas do this, for +during event processing. TQListView and TQCanvas do this, for example.

              TQt also tries to speed up painting by merging multiple paint events into one. When update() is called several times or the diff --git a/doc/html/porting.html b/doc/html/porting.html index f9168ada..8c651811 100644 --- a/doc/html/porting.html +++ b/doc/html/porting.html @@ -301,12 +301,12 @@ new code.

            • TQAccel::keyToString( TQKeySequence k )
            • TQAccel::stringToKey( const TQString & s )
            • TQActionGroup::insert( TQAction *a ) -
            • TQCanvasItem::active() const -
            • TQCanvasItem::enabled() const -
            • TQCanvasItem::selected() const -
            • TQCanvasItem::visible() const -
            • TQCanvasPixmapArray::TQCanvasPixmapArray( TQPtrList<TQPixmap> list, TQPtrList<TQPoint> hotspots ) -
            • TQCanvasPixmapArray::operator!() +
            • TQCanvasItem::active() const +
            • TQCanvasItem::enabled() const +
            • TQCanvasItem::selected() const +
            • TQCanvasItem::visible() const +
            • TQCanvasPixmapArray::TQCanvasPixmapArray( TQPtrList<TQPixmap> list, TQPtrList<TQPoint> hotspots ) +
            • TQCanvasPixmapArray::operator!()
            • TQColorGroup::TQColorGroup( const TQColor & foreground, const TQColor & background, const TQColor & light, const TQColor & dark, const TQColor & mid, const TQColor & text, const TQColor & base )
            • TQComboBox::autoResize() const
            • TQComboBox::setAutoResize( bool ) diff --git a/doc/html/qcanvas-h.html b/doc/html/qcanvas-h.html deleted file mode 100644 index 7790f434..00000000 --- a/doc/html/qcanvas-h.html +++ /dev/null @@ -1,861 +0,0 @@ - - - - - -ntqcanvas.h Include File - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              ntqcanvas.h

              - -

              This is the verbatim text of the ntqcanvas.h include file. It is provided only for illustration; the copyright remains with Trolltech. -


              -
              -/**********************************************************************
              -** $Id: qt/ntqcanvas.h   3.3.8   edited Jan 11 14:46 $
              -**
              -** Definition of TQCanvas classes
              -**
              -** Created : 991211
              -**
              -** Copyright (C) 1999-2007 Trolltech ASA.  All rights reserved.
              -**
              -** This file is part of the canvas module of the TQt GUI Toolkit.
              -**
              -** This file may be used under the terms of the GNU General Public
              -** License versions 2.0 or 3.0 as published by the Free Software
              -** Foundation and appearing in the file LICENSE.GPL included in the
              -** packaging of this file. Alternatively you may (at your option) use any
              -** later version of the GNU General Public License if such license has
              -** been publicly approved by Trolltech ASA (or its successors, if any)
              -** and the KDE Free TQt Foundation.
              -**
              -** Please review the following information to ensure GNU General
              -** Public Licensing requirements will be met:
              -** http://trolltech.com/products/qt/licenses/licensing/opensource/.
              -** If you are unsure which license is appropriate for your use, please
              -** review the following information:
              -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
              -** or contact the sales department at sales@trolltech.com.
              -**
              -** This file may be used under the terms of the Q Public License as
              -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL
              -** included in the packaging of this file.  Licensees holding valid TQt
              -** Commercial licenses may use this file in accordance with the TQt
              -** Commercial License Agreement provided with the Software.
              -**
              -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
              -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
              -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
              -** herein.
              -**
              -**********************************************************************/
              -
              -#ifndef TQCANVAS_H
              -#define TQCANVAS_H
              -
              -#ifndef QT_H
              -#include "ntqscrollview.h"
              -#include "ntqpixmap.h"
              -#include "ntqptrlist.h"
              -#include "ntqbrush.h"
              -#include "ntqpen.h"
              -#include "ntqvaluelist.h"
              -#include "ntqpointarray.h"
              -#endif // QT_H
              -
              -#if !defined( TQT_MODULE_CANVAS ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_CANVAS )
              -#define TQM_EXPORT_CANVAS
              -#define TQM_TEMPLATE_EXTERN_CANVAS
              -#else
              -#define TQM_EXPORT_CANVAS TQ_EXPORT
              -#define TQM_TEMPLATE_EXTERN_CANVAS Q_TEMPLATE_EXTERN
              -#endif
              -
              -#ifndef TQT_NO_CANVAS
              -
              -
              -class TQCanvasSprite;
              -class TQCanvasPolygonalItem;
              -class TQCanvasRectangle;
              -class TQCanvasPolygon;
              -class TQCanvasEllipse;
              -class TQCanvasText;
              -class TQCanvasLine;
              -class TQCanvasChunk;
              -class TQCanvas;
              -class TQCanvasItem;
              -class TQCanvasView;
              -class TQCanvasPixmap;
              -
              -#if defined(Q_TEMPLATEDLL) && ( !defined(Q_CC_BOR) || !defined(QT_MAKEDLL) || defined(Q_EXPORT_TEMPLATES) )
              -// MOC_SKIP_BEGIN
              -TQM_TEMPLATE_EXTERN_CANVAS template class TQM_EXPORT_CANVAS TQValueListIterator< TQCanvasItem* >;
              -TQM_TEMPLATE_EXTERN_CANVAS template class TQM_EXPORT_CANVAS TQValueList< TQCanvasItem* >;
              -// MOC_SKIP_END
              -#endif
              -
              -class TQM_EXPORT_CANVAS TQCanvasItemList : public TQValueList<TQCanvasItem*> {
              -public:
              -    void sort();
              -    void drawUnique( TQPainter& painter );
              -    TQCanvasItemList operator+(const TQCanvasItemList &l) const;
              -};
              -
              -
              -class TQCanvasItemExtra;
              -
              -class TQM_EXPORT_CANVAS TQCanvasItem : public TQt
              -{
              -public:
              -    TQCanvasItem(TQCanvas* canvas);
              -    virtual ~TQCanvasItem();
              -
              -    double x() const
              -	{ return myx; }
              -    double y() const
              -	{ return myy; }
              -    double z() const
              -	{ return myz; } // (depth)
              -
              -    virtual void moveBy(double dx, double dy);
              -    void move(double x, double y);
              -    void setX(double a) { move(a,y()); }
              -    void setY(double a) { move(x(),a); }
              -    void setZ(double a) { myz=a; changeChunks(); }
              -
              -    bool animated() const;
              -    virtual void setAnimated(bool y);
              -    virtual void setVelocity( double vx, double vy);
              -    void setXVelocity( double vx ) { setVelocity(vx,yVelocity()); }
              -    void setYVelocity( double vy ) { setVelocity(xVelocity(),vy); }
              -    double xVelocity() const;
              -    double yVelocity() const;
              -    virtual void advance(int stage);
              -
              -    virtual bool collidesWith( const TQCanvasItem* ) const=0;
              -
              -    TQCanvasItemList collisions(bool exact /* NO DEFAULT */ ) const;
              -
              -    virtual void setCanvas(TQCanvas*);
              -
              -    virtual void draw(TQPainter&)=0;
              -
              -    void show();
              -    void hide();
              -
              -    virtual void setVisible(bool yes);
              -    bool isVisible() const
              -	{ return (bool)vis; }
              -    virtual void setSelected(bool yes);
              -    bool isSelected() const
              -	{ return (bool)sel; }
              -    virtual void setEnabled(bool yes);
              -    bool isEnabled() const
              -	{ return (bool)ena; }
              -    virtual void setActive(bool yes);
              -    bool isActive() const
              -	{ return (bool)act; }
              -#ifndef TQT_NO_COMPAT
              -    bool visible() const
              -	{ return (bool)vis; }
              -    bool selected() const
              -	{ return (bool)sel; }
              -    bool enabled() const
              -	{ return (bool)ena; }
              -    bool active() const
              -	{ return (bool)act; }
              -#endif
              -
              -    enum RttiValues {
              -	Rtti_Item = 0,
              -	Rtti_Sprite = 1,
              -	Rtti_PolygonalItem = 2,
              -	Rtti_Text = 3,
              -	Rtti_Polygon = 4,
              -	Rtti_Rectangle = 5,
              -	Rtti_Ellipse = 6,
              -	Rtti_Line = 7,
              -	Rtti_Spline = 8
              -    };
              -
              -    virtual int rtti() const;
              -    static int RTTI;
              -
              -    virtual TQRect boundingRect() const=0;
              -    virtual TQRect boundingRectAdvanced() const;
              -
              -    TQCanvas* canvas() const
              -	{ return cnv; }
              -
              -protected:
              -    void update() { changeChunks(); }
              -
              -private:
              -    // For friendly subclasses...
              -
              -    friend class TQCanvasPolygonalItem;
              -    friend class TQCanvasSprite;
              -    friend class TQCanvasRectangle;
              -    friend class TQCanvasPolygon;
              -    friend class TQCanvasEllipse;
              -    friend class TQCanvasText;
              -    friend class TQCanvasLine;
              -
              -    virtual TQPointArray chunks() const;
              -    virtual void addToChunks();
              -    virtual void removeFromChunks();
              -    virtual void changeChunks();
              -    virtual bool collidesWith( const TQCanvasSprite*,
              -			       const TQCanvasPolygonalItem*,
              -			       const TQCanvasRectangle*,
              -			       const TQCanvasEllipse*,
              -			       const TQCanvasText* ) const = 0;
              -    // End of friend stuff
              -
              -    TQCanvas* cnv;
              -    static TQCanvas* current_canvas;
              -    double myx,myy,myz;
              -    TQCanvasItemExtra *ext;
              -    TQCanvasItemExtra& extra();
              -    uint ani:1;
              -    uint vis:1;
              -    uint val:1;
              -    uint sel:1;
              -    uint ena:1;
              -    uint act:1;
              -};
              -
              -
              -class TQCanvasData;
              -
              -class TQM_EXPORT_CANVAS TQCanvas : public TQObject
              -{
              -    TQ_OBJECT
              -public:
              -    TQCanvas( TQObject* parent = 0, const char* name = 0 );
              -    TQCanvas(int w, int h);
              -    TQCanvas( TQPixmap p, int h, int v, int tilewidth, int tileheight );
              -
              -    virtual ~TQCanvas();
              -
              -    virtual void setTiles( TQPixmap tiles, int h, int v,
              -			   int tilewidth, int tileheight );
              -    virtual void setBackgroundPixmap( const TQPixmap& p );
              -    TQPixmap backgroundPixmap() const;
              -
              -    virtual void setBackgroundColor( const TQColor& c );
              -    TQColor backgroundColor() const;
              -
              -    virtual void setTile( int x, int y, int tilenum );
              -    int tile( int x, int y ) const
              -	{ return grid[x+y*htiles]; }
              -
              -    int tilesHorizontally() const
              -	{ return htiles; }
              -    int tilesVertically() const
              -	{ return vtiles; }
              -
              -    int tileWidth() const
              -	{ return tilew; }
              -    int tileHeight() const
              -	{ return tileh; }
              -
              -    virtual void resize(int width, int height);
              -    int width() const
              -	{ return awidth; }
              -    int height() const
              -	{ return aheight; }
              -    TQSize size() const
              -	{ return TQSize(awidth,aheight); }
              -    TQRect rect() const
              -	{ return TQRect( 0, 0, awidth, aheight ); }
              -    bool onCanvas( int x, int y ) const
              -	{ return x>=0 && y>=0 && x<awidth && y<aheight; }
              -    bool onCanvas( const TQPoint& p ) const
              -	{ return onCanvas(p.x(),p.y()); }
              -    bool validChunk( int x, int y ) const
              -	{ return x>=0 && y>=0 && x<chwidth && y<chheight; }
              -    bool validChunk( const TQPoint& p ) const
              -	{ return validChunk(p.x(),p.y()); }
              -
              -    int chunkSize() const
              -	{ return chunksize; }
              -    virtual void retune(int chunksize, int maxclusters=100);
              -
              -    bool sameChunk(int x1, int y1, int x2, int y2) const
              -	{ return x1/chunksize==x2/chunksize && y1/chunksize==y2/chunksize; }
              -    virtual void setChangedChunk(int i, int j);
              -    virtual void setChangedChunkContaining(int x, int y);
              -    virtual void setAllChanged();
              -    virtual void setChanged(const TQRect& area);
              -    virtual void setUnchanged(const TQRect& area);
              -
              -    // These call setChangedChunk.
              -    void addItemToChunk(TQCanvasItem*, int i, int j);
              -    void removeItemFromChunk(TQCanvasItem*, int i, int j);
              -    void addItemToChunkContaining(TQCanvasItem*, int x, int y);
              -    void removeItemFromChunkContaining(TQCanvasItem*, int x, int y);
              -
              -    TQCanvasItemList allItems();
              -    TQCanvasItemList collisions( const TQPoint&) const;
              -    TQCanvasItemList collisions( const TQRect&) const;
              -    TQCanvasItemList collisions( const TQPointArray& pa, const TQCanvasItem* item,
              -				bool exact) const;
              -
              -    void drawArea(const TQRect&, TQPainter* p, bool double_buffer=FALSE);
              -
              -    // These are for TQCanvasView to call
              -    virtual void addView(TQCanvasView*);
              -    virtual void removeView(TQCanvasView*);
              -    void drawCanvasArea(const TQRect&, TQPainter* p=0, bool double_buffer=TRUE);
              -    void drawViewArea( TQCanvasView* view, TQPainter* p, const TQRect& r, bool dbuf );
              -
              -    // These are for TQCanvasItem to call
              -    virtual void addItem(TQCanvasItem*);
              -    virtual void addAnimation(TQCanvasItem*);
              -    virtual void removeItem(TQCanvasItem*);
              -    virtual void removeAnimation(TQCanvasItem*);
              -
              -    virtual void setAdvancePeriod(int ms);
              -    virtual void setUpdatePeriod(int ms);
              -
              -    virtual void setDoubleBuffering(bool y);
              -
              -signals:
              -    void resized();
              -
              -public slots:
              -    virtual void advance();
              -    virtual void update();
              -
              -protected:
              -    virtual void drawBackground(TQPainter&, const TQRect& area);
              -    virtual void drawForeground(TQPainter&, const TQRect& area);
              -
              -private:
              -    void init(int w, int h, int chunksze=16, int maxclust=100);
              -
              -    TQCanvasChunk& chunk(int i, int j) const;
              -    TQCanvasChunk& chunkContaining(int x, int y) const;
              -
              -    TQRect changeBounds(const TQRect& inarea);
              -    void drawChanges(const TQRect& inarea);
              -
              -    TQPixmap offscr;
              -    int awidth,aheight;
              -    int chunksize;
              -    int maxclusters;
              -    int chwidth,chheight;
              -    TQCanvasChunk* chunks;
              -
              -    TQCanvasData* d;
              -
              -    void initTiles(TQPixmap p, int h, int v, int tilewidth, int tileheight);
              -    ushort *grid;
              -    ushort htiles;
              -    ushort vtiles;
              -    ushort tilew;
              -    ushort tileh;
              -    bool oneone;
              -    TQPixmap pm;
              -    TQTimer* update_timer;
              -    TQColor bgcolor;
              -    bool debug_redraw_areas;
              -    bool dblbuf;
              -
              -    friend void qt_unview(TQCanvas* c);
              -
              -#if defined(TQ_DISABLE_COPY) // Disabled copy constructor and operator=
              -    TQCanvas( const TQCanvas & );
              -    TQCanvas &operator=( const TQCanvas & );
              -#endif
              -};
              -
              -class TQCanvasViewData;
              -
              -class TQM_EXPORT_CANVAS TQCanvasView : public TQScrollView
              -{
              -    TQ_OBJECT
              -public:
              -
              -    TQCanvasView(TQWidget* parent=0, const char* name=0, WFlags f=0);
              -    TQCanvasView(TQCanvas* viewing, TQWidget* parent=0, const char* name=0, WFlags f=0);
              -    ~TQCanvasView();
              -
              -    TQCanvas* canvas() const
              -	{ return viewing; }
              -    void setCanvas(TQCanvas* v);
              -
              -    const TQWMatrix &worldMatrix() const;
              -    const TQWMatrix &inverseWorldMatrix() const;
              -    bool setWorldMatrix( const TQWMatrix & );
              -
              -protected:
              -    void drawContents( TQPainter*, int cx, int cy, int cw, int ch );
              -    TQSize sizeHint() const;
              -
              -private:
              -    void drawContents( TQPainter* );
              -    TQCanvas* viewing;
              -    TQCanvasViewData* d;
              -    friend void qt_unview(TQCanvas* c);
              -
              -private slots:
              -    void cMoving(int,int);
              -    void updateContentsSize();
              -
              -private:
              -#if defined(TQ_DISABLE_COPY) // Disabled copy constructor and operator=
              -    TQCanvasView( const TQCanvasView & );
              -    TQCanvasView &operator=( const TQCanvasView & );
              -#endif
              -};
              -
              -
              -class TQM_EXPORT_CANVAS TQCanvasPixmap : public TQPixmap
              -{
              -public:
              -#ifndef TQT_NO_IMAGEIO
              -    TQCanvasPixmap(const TQString& datafilename);
              -#endif
              -    TQCanvasPixmap(const TQImage& image);
              -    TQCanvasPixmap(const TQPixmap&, const TQPoint& hotspot);
              -    ~TQCanvasPixmap();
              -
              -    int offsetX() const
              -	{ return hotx; }
              -    int offsetY() const
              -	{ return hoty; }
              -    void setOffset(int x, int y) { hotx = x; hoty = y; }
              -
              -private:
              -#if defined(TQ_DISABLE_COPY)
              -    TQCanvasPixmap( const TQCanvasPixmap & );
              -    TQCanvasPixmap &operator=( const TQCanvasPixmap & );
              -#endif
              -    void init(const TQImage&);
              -    void init(const TQPixmap& pixmap, int hx, int hy);
              -
              -    friend class TQCanvasSprite;
              -    friend class TQCanvasPixmapArray;
              -    friend bool qt_testCollision(const TQCanvasSprite* s1, const TQCanvasSprite* s2);
              -
              -    int hotx,hoty;
              -
              -    TQImage* collision_mask;
              -};
              -
              -
              -class TQM_EXPORT_CANVAS TQCanvasPixmapArray
              -{
              -public:
              -    TQCanvasPixmapArray();
              -#ifndef TQT_NO_IMAGEIO
              -    TQCanvasPixmapArray(const TQString& datafilenamepattern, int framecount=0);
              -#endif
              -    // this form is deprecated
              -    TQCanvasPixmapArray(TQPtrList<TQPixmap>, TQPtrList<TQPoint> hotspots);
              -
              -    TQCanvasPixmapArray(TQValueList<TQPixmap>, TQPointArray hotspots = TQPointArray() );
              -    ~TQCanvasPixmapArray();
              -
              -#ifndef TQT_NO_IMAGEIO
              -    bool readPixmaps(const TQString& datafilenamepattern, int framecount=0);
              -    bool readCollisionMasks(const TQString& filenamepattern);
              -#endif
              -
              -    // deprecated
              -    bool operator!(); // Failure check.
              -    bool isValid() const;
              -
              -    TQCanvasPixmap* image(int i) const
              -	{ return img ? img[i] : 0; }
              -    void setImage(int i, TQCanvasPixmap* p);
              -    uint count() const
              -	{ return (uint)framecount; }
              -
              -private:
              -#if defined(TQ_DISABLE_COPY)
              -    TQCanvasPixmapArray( const TQCanvasPixmapArray & );
              -    TQCanvasPixmapArray &operator=( const TQCanvasPixmapArray & );
              -#endif
              -#ifndef TQT_NO_IMAGEIO
              -    bool readPixmaps(const TQString& datafilenamepattern, int framecount, bool maskonly);
              -#endif
              -
              -    void reset();
              -    int framecount;
              -    TQCanvasPixmap** img;
              -};
              -
              -
              -class TQM_EXPORT_CANVAS TQCanvasSprite : public TQCanvasItem
              -{
              -public:
              -    TQCanvasSprite(TQCanvasPixmapArray* array, TQCanvas* canvas);
              -
              -    void setSequence(TQCanvasPixmapArray* seq);
              -
              -    virtual ~TQCanvasSprite();
              -
              -    void move(double x, double y);
              -    virtual void move(double x, double y, int frame);
              -    void setFrame(int);
              -    enum FrameAnimationType { Cycle, Oscillate };
              -    virtual void setFrameAnimation(FrameAnimationType=Cycle, int step=1, int state=0);
              -    int frame() const
              -	{ return frm; }
              -    int frameCount() const
              -	{ return images->count(); }
              -
              -    int rtti() const;
              -    static int RTTI;
              -
              -    bool collidesWith( const TQCanvasItem* ) const;
              -
              -    TQRect boundingRect() const;
              -
              -    // is there a reason for these to be protected? Lars
              -//protected:
              -
              -    int width() const;
              -    int height() const;
              -
              -    int leftEdge() const;
              -    int topEdge() const;
              -    int rightEdge() const;
              -    int bottomEdge() const;
              -
              -    int leftEdge(int nx) const;
              -    int topEdge(int ny) const;
              -    int rightEdge(int nx) const;
              -    int bottomEdge(int ny) const;
              -    TQCanvasPixmap* image() const
              -	{ return images->image(frm); }
              -    virtual TQCanvasPixmap* imageAdvanced() const;
              -    TQCanvasPixmap* image(int f) const
              -	{ return images->image(f); }
              -    virtual void advance(int stage);
              -
              -public:
              -    void draw(TQPainter& painter);
              -
              -private:
              -#if defined(TQ_DISABLE_COPY)
              -    TQCanvasSprite( const TQCanvasSprite & );
              -    TQCanvasSprite &operator=( const TQCanvasSprite & );
              -#endif
              -    void addToChunks();
              -    void removeFromChunks();
              -    void changeChunks();
              -
              -    int frm;
              -    ushort anim_val;
              -    uint anim_state:2;
              -    uint anim_type:14;
              -    bool collidesWith( const TQCanvasSprite*,
              -		       const TQCanvasPolygonalItem*,
              -		       const TQCanvasRectangle*,
              -		       const TQCanvasEllipse*,
              -		       const TQCanvasText* ) const;
              -
              -    friend bool qt_testCollision( const TQCanvasSprite* s1,
              -				  const TQCanvasSprite* s2 );
              -
              -    TQCanvasPixmapArray* images;
              -};
              -
              -class TQPolygonalProcessor;
              -
              -class TQM_EXPORT_CANVAS TQCanvasPolygonalItem : public TQCanvasItem
              -{
              -public:
              -    TQCanvasPolygonalItem(TQCanvas* canvas);
              -    virtual ~TQCanvasPolygonalItem();
              -
              -    bool collidesWith( const TQCanvasItem* ) const;
              -
              -    virtual void setPen(TQPen p);
              -    virtual void setBrush(TQBrush b);
              -
              -    TQPen pen() const
              -	{ return pn; }
              -    TQBrush brush() const
              -	{ return br; }
              -
              -    virtual TQPointArray areaPoints() const=0;
              -    virtual TQPointArray areaPointsAdvanced() const;
              -    TQRect boundingRect() const;
              -
              -    int rtti() const;
              -    static int RTTI;
              -
              -protected:
              -    void draw(TQPainter &);
              -    virtual void drawShape(TQPainter &) = 0;
              -
              -    bool winding() const;
              -    void setWinding(bool);
              -
              -    void invalidate();
              -    bool isValid() const
              -	{ return (bool)val; }
              -
              -private:
              -    void scanPolygon( const TQPointArray& pa, int winding,
              -		      TQPolygonalProcessor& process ) const;
              -    TQPointArray chunks() const;
              -
              -    bool collidesWith( const TQCanvasSprite*,
              -		       const TQCanvasPolygonalItem*,
              -		       const TQCanvasRectangle*,
              -		       const TQCanvasEllipse*,
              -		       const TQCanvasText* ) const;
              -
              -    TQBrush br;
              -    TQPen pn;
              -    uint wind:1;
              -};
              -
              -
              -class TQM_EXPORT_CANVAS TQCanvasRectangle : public TQCanvasPolygonalItem
              -{
              -public:
              -    TQCanvasRectangle(TQCanvas* canvas);
              -    TQCanvasRectangle(const TQRect&, TQCanvas* canvas);
              -    TQCanvasRectangle(int x, int y, int width, int height, TQCanvas* canvas);
              -
              -    ~TQCanvasRectangle();
              -
              -    int width() const;
              -    int height() const;
              -    void setSize(int w, int h);
              -    TQSize size() const
              -	{ return TQSize(w,h); }
              -    TQPointArray areaPoints() const;
              -    TQRect rect() const
              -	{ return TQRect(int(x()),int(y()),w,h); }
              -
              -    bool collidesWith( const TQCanvasItem* ) const;
              -
              -    int rtti() const;
              -    static int RTTI;
              -
              -protected:
              -    void drawShape(TQPainter &);
              -    TQPointArray chunks() const;
              -
              -private:
              -    bool collidesWith(   const TQCanvasSprite*,
              -			 const TQCanvasPolygonalItem*,
              -			 const TQCanvasRectangle*,
              -			 const TQCanvasEllipse*,
              -			 const TQCanvasText* ) const;
              -
              -    int w, h;
              -};
              -
              -
              -class TQM_EXPORT_CANVAS TQCanvasPolygon : public TQCanvasPolygonalItem
              -{
              -public:
              -    TQCanvasPolygon(TQCanvas* canvas);
              -    ~TQCanvasPolygon();
              -    void setPoints(TQPointArray);
              -    TQPointArray points() const;
              -    void moveBy(double dx, double dy);
              -
              -    TQPointArray areaPoints() const;
              -
              -    int rtti() const;
              -    static int RTTI;
              -
              -protected:
              -    void drawShape(TQPainter &);
              -    TQPointArray poly;
              -};
              -
              -
              -class TQM_EXPORT_CANVAS TQCanvasSpline : public TQCanvasPolygon
              -{
              -public:
              -    TQCanvasSpline(TQCanvas* canvas);
              -    ~TQCanvasSpline();
              -
              -    void setControlPoints(TQPointArray, bool closed=TRUE);
              -    TQPointArray controlPoints() const;
              -    bool closed() const;
              -
              -    int rtti() const;
              -    static int RTTI;
              -
              -private:
              -    void recalcPoly();
              -    TQPointArray bez;
              -    bool cl;
              -};
              -
              -
              -class TQM_EXPORT_CANVAS TQCanvasLine : public TQCanvasPolygonalItem
              -{
              -public:
              -    TQCanvasLine(TQCanvas* canvas);
              -    ~TQCanvasLine();
              -    void setPoints(int x1, int y1, int x2, int y2);
              -
              -    TQPoint startPoint() const
              -	{ return TQPoint(x1,y1); }
              -    TQPoint endPoint() const
              -	{ return TQPoint(x2,y2); }
              -
              -    int rtti() const;
              -    static int RTTI;
              -
              -    void setPen(TQPen p);
              -    void moveBy(double dx, double dy);
              -
              -protected:
              -    void drawShape(TQPainter &);
              -    TQPointArray areaPoints() const;
              -
              -private:
              -    int x1,y1,x2,y2;
              -};
              -
              -
              -class TQM_EXPORT_CANVAS TQCanvasEllipse : public TQCanvasPolygonalItem
              -{
              -
              -public:
              -    TQCanvasEllipse( TQCanvas* canvas );
              -    TQCanvasEllipse( int width, int height, TQCanvas* canvas );
              -    TQCanvasEllipse( int width, int height, int startangle, int angle,
              -		    TQCanvas* canvas );
              -
              -    ~TQCanvasEllipse();
              -
              -    int width() const;
              -    int height() const;
              -    void setSize(int w, int h);
              -    void setAngles(int start, int length);
              -    int angleStart() const
              -	{ return a1; }
              -    int angleLength() const
              -	{ return a2; }
              -    TQPointArray areaPoints() const;
              -
              -    bool collidesWith( const TQCanvasItem* ) const;
              -
              -    int rtti() const;
              -    static int RTTI;
              -
              -protected:
              -    void drawShape(TQPainter &);
              -
              -private:
              -    bool collidesWith( const TQCanvasSprite*,
              -		       const TQCanvasPolygonalItem*,
              -		       const TQCanvasRectangle*,
              -		       const TQCanvasEllipse*,
              -		       const TQCanvasText* ) const;
              -    int w, h;
              -    int a1, a2;
              -};
              -
              -
              -class TQCanvasTextExtra;
              -
              -class TQM_EXPORT_CANVAS TQCanvasText : public TQCanvasItem
              -{
              -public:
              -    TQCanvasText(TQCanvas* canvas);
              -    TQCanvasText(const TQString&, TQCanvas* canvas);
              -    TQCanvasText(const TQString&, TQFont, TQCanvas* canvas);
              -
              -    virtual ~TQCanvasText();
              -
              -    void setText( const TQString& );
              -    void setFont( const TQFont& );
              -    void setColor( const TQColor& );
              -    TQString text() const;
              -    TQFont font() const;
              -    TQColor color() const;
              -
              -    void moveBy(double dx, double dy);
              -
              -    int textFlags() const
              -	{ return flags; }
              -    void setTextFlags(int);
              -
              -    TQRect boundingRect() const;
              -
              -    bool collidesWith( const TQCanvasItem* ) const;
              -
              -    int rtti() const;
              -    static int RTTI;
              -
              -protected:
              -    virtual void draw(TQPainter&);
              -
              -private:
              -#if defined(TQ_DISABLE_COPY)
              -    TQCanvasText( const TQCanvasText & );
              -    TQCanvasText &operator=( const TQCanvasText & );
              -#endif
              -    void addToChunks();
              -    void removeFromChunks();
              -    void changeChunks();
              -
              -    void setRect();
              -    TQRect brect;
              -    TQString txt;
              -    int flags;
              -    TQFont fnt;
              -    TQColor col;
              -    TQCanvasTextExtra* extra;
              -
              -    bool collidesWith(   const TQCanvasSprite*,
              -			 const TQCanvasPolygonalItem*,
              -			 const TQCanvasRectangle*,
              -			 const TQCanvasEllipse*,
              -			 const TQCanvasText* ) const;
              -};
              -
              -#define Q_DEFINED_QCANVAS
              -#include "ntqwinexport.h"
              -#endif // TQT_NO_CANVAS
              -
              -#endif // TQCANVAS_H
              -
              - -


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvas-members.html b/doc/html/qcanvas-members.html deleted file mode 100644 index 58452a98..00000000 --- a/doc/html/qcanvas-members.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - -TQCanvas Member List - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              Complete Member List for TQCanvas

              - -

              This is the complete list of member functions for -TQCanvas, including inherited members. - -

              - -


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvas.png b/doc/html/qcanvas.png deleted file mode 100644 index 50688f52..00000000 Binary files a/doc/html/qcanvas.png and /dev/null differ diff --git a/doc/html/qcanvasellipse-members.html b/doc/html/qcanvasellipse-members.html deleted file mode 100644 index f6da4698..00000000 --- a/doc/html/qcanvasellipse-members.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - -TQCanvasEllipse Member List - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              Complete Member List for TQCanvasEllipse

              - -

              This is the complete list of member functions for -TQCanvasEllipse, including inherited members. - -

              - -


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvasellipse.html b/doc/html/qcanvasellipse.html deleted file mode 100644 index 65dbef94..00000000 --- a/doc/html/qcanvasellipse.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - -TQCanvasEllipse Class - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              TQCanvasEllipse Class Reference
              [canvas module]

              - -

              The TQCanvasEllipse class provides an ellipse or ellipse segment on a TQCanvas. -More... -

              #include <ntqcanvas.h> -

              Inherits TQCanvasPolygonalItem. -

              List of all member functions. -

              Public Members

              - -

              Protected Members

              -
                -
              • virtual void drawShape ( TQPainter & p )
              • -
              -

              Detailed Description

              - - -The TQCanvasEllipse class provides an ellipse or ellipse segment on a TQCanvas. - -

              - - -

              A canvas item that paints an ellipse or ellipse segment with a TQBrush. -The ellipse's height, width, start angle and angle length can be set -at construction time. The size can be changed at runtime with -setSize(), and the angles can be changed (if you're displaying an -ellipse segment rather than a whole ellipse) with setAngles(). -

              Note that angles are specified in 16ths of a degree. -

              -

              Ellipse
              -

              If a start angle and length angle are set then an ellipse segment -will be drawn. The start angle is the angle that goes from zero in a -counter-clockwise direction (shown in green in the diagram). The -length angle is the angle from the start angle in a -counter-clockwise direction (shown in blue in the diagram). The blue -segment is the segment of the ellipse that would be drawn. If no -start angle and length angle are specified the entire ellipse is -drawn. -

              The ellipse can be drawn on a painter with drawShape(). -

              Like any other canvas item ellipses can be moved with move() and -moveBy(), or by setting coordinates with setX(), setY() and setZ(). -

              Note: TQCanvasEllipse does not use the pen. -

              See also Graphics Classes and Image Processing Classes. - -


              Member Function Documentation

              -

              TQCanvasEllipse::TQCanvasEllipse ( TQCanvas * canvas ) -

              -Constructs a 32x32 ellipse, centered at (0, 0) on canvas. - -

              TQCanvasEllipse::TQCanvasEllipse ( int width, int height, TQCanvas * canvas ) -

              -Constructs a width by height pixel ellipse, centered at -(0, 0) on canvas. - -

              TQCanvasEllipse::TQCanvasEllipse ( int width, int height, int startangle, int angle, TQCanvas * canvas ) -

              -Constructs a width by height pixel ellipse, centered at -(0, 0) on canvas. Only a segment of the ellipse is drawn, -starting at angle startangle, and extending for angle angle -(the angle length). -

              Note that angles are specified in -1/16ths of a degree. - -

              TQCanvasEllipse::~TQCanvasEllipse () -

              -Destroys the ellipse. - -

              int TQCanvasEllipse::angleLength () const -

              - -

              Returns the length angle (the extent of the ellipse segment) in -16ths of a degree. Initially this will be 360 * 16 (a complete -ellipse). -

              See also setAngles() and angleStart(). - -

              int TQCanvasEllipse::angleStart () const -

              - -

              Returns the start angle in 16ths of a degree. Initially -this will be 0. -

              See also setAngles() and angleLength(). - -

              void TQCanvasEllipse::drawShape ( TQPainter & p ) [virtual protected] -

              -Draws the ellipse, centered at x(), y() using the painter p. -

              Note that TQCanvasEllipse does not support an outline (the pen is -always NoPen). - -

              Reimplemented from TQCanvasPolygonalItem. -

              int TQCanvasEllipse::height () const -

              -Returns the height of the ellipse. - -

              int TQCanvasEllipse::rtti () const [virtual] -

              -Returns 6 (TQCanvasItem::Rtti_Ellipse). -

              See also TQCanvasItem::rtti(). - -

              Reimplemented from TQCanvasPolygonalItem. -

              void TQCanvasEllipse::setAngles ( int start, int length ) -

              -Sets the angles for the ellipse. The start angle is start and -the extent of the segment is length (the angle length) from the -start. The angles are specified in 16ths of a degree. By -default the ellipse will start at 0 and have an angle length of -360 * 16 (a complete ellipse). -

              See also angleStart() and angleLength(). - -

              void TQCanvasEllipse::setSize ( int width, int height ) -

              -Sets the width and height of the ellipse. - -

              int TQCanvasEllipse::width () const -

              -Returns the width of the ellipse. - - -

              -This file is part of the TQt toolkit. -Copyright © 1995-2007 -Trolltech. All Rights Reserved.


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvasellipse.png b/doc/html/qcanvasellipse.png deleted file mode 100644 index 59593518..00000000 Binary files a/doc/html/qcanvasellipse.png and /dev/null differ diff --git a/doc/html/qcanvasitem-members.html b/doc/html/qcanvasitem-members.html deleted file mode 100644 index b65da423..00000000 --- a/doc/html/qcanvasitem-members.html +++ /dev/null @@ -1,87 +0,0 @@ - - - - - -TQCanvasItem Member List - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              Complete Member List for TQCanvasItem

              - -

              This is the complete list of member functions for -TQCanvasItem, including inherited members. - -

              - -


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvasitem.html b/doc/html/qcanvasitem.html deleted file mode 100644 index 962edc5b..00000000 --- a/doc/html/qcanvasitem.html +++ /dev/null @@ -1,480 +0,0 @@ - - - - - -TQCanvasItem Class - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              TQCanvasItem Class Reference
              [canvas module]

              - -

              The TQCanvasItem class provides an abstract graphic object on a TQCanvas. -More... -

              #include <ntqcanvas.h> -

              Inherits TQt. -

              Inherited by TQCanvasSprite, TQCanvasPolygonalItem, and TQCanvasText. -

              List of all member functions. -

              Public Members

              -
                -
              • TQCanvasItem ( TQCanvas * canvas )
              • -
              • virtual ~TQCanvasItem ()
              • -
              • double x () const
              • -
              • double y () const
              • -
              • double z () const
              • -
              • virtual void moveBy ( double dx, double dy )
              • -
              • void move ( double x, double y )
              • -
              • void setX ( double x )
              • -
              • void setY ( double y )
              • -
              • void setZ ( double z )
              • -
              • bool animated () const
              • -
              • virtual void setAnimated ( bool y )
              • -
              • virtual void setVelocity ( double vx, double vy )
              • -
              • void setXVelocity ( double vx )
              • -
              • void setYVelocity ( double vy )
              • -
              • double xVelocity () const
              • -
              • double yVelocity () const
              • -
              • virtual void advance ( int phase )
              • -
              • virtual bool collidesWith ( const TQCanvasItem * other ) const = 0
              • -
              • TQCanvasItemList collisions ( bool exact ) const
              • -
              • virtual void setCanvas ( TQCanvas * c )
              • -
              • virtual void draw ( TQPainter & painter ) = 0
              • -
              • void show ()
              • -
              • void hide ()
              • -
              • virtual void setVisible ( bool yes )
              • -
              • bool isVisible () const
              • -
              • virtual void setSelected ( bool yes )
              • -
              • bool isSelected () const
              • -
              • virtual void setEnabled ( bool yes )
              • -
              • bool isEnabled () const
              • -
              • virtual void setActive ( bool yes )
              • -
              • bool isActive () const
              • -
              • bool visible () const  (obsolete)
              • -
              • bool selected () const  (obsolete)
              • -
              • bool enabled () const  (obsolete)
              • -
              • bool active () const  (obsolete)
              • -
              • enum RttiValues { Rtti_Item = 0, Rtti_Sprite = 1, Rtti_PolygonalItem = 2, Rtti_Text = 3, Rtti_Polygon = 4, Rtti_Rectangle = 5, Rtti_Ellipse = 6, Rtti_Line = 7, Rtti_Spline = 8 }
              • -
              • virtual int rtti () const
              • -
              • virtual TQRect boundingRect () const = 0
              • -
              • virtual TQRect boundingRectAdvanced () const
              • -
              • TQCanvas * canvas () const
              • -
              -

              Protected Members

              - -

              Detailed Description

              - - -The TQCanvasItem class provides an abstract graphic object on a TQCanvas. - -

              - - -

              A variety of TQCanvasItem subclasses provide immediately usable -behaviour. This class is a pure abstract superclass providing the -behaviour that is shared among all the concrete canvas item classes. -TQCanvasItem is not intended for direct subclassing. It is much easier -to subclass one of its subclasses, e.g. TQCanvasPolygonalItem (the -commonest base class), TQCanvasRectangle, TQCanvasSprite, TQCanvasEllipse -or TQCanvasText. -

              Canvas items are added to a canvas by constructing them and passing the -canvas to the canvas item's constructor. An item can be moved to a -different canvas using setCanvas(). -

              Items appear on the canvas after their show() -function has been called (or setVisible(TRUE)), and after update() has been called. The -canvas only shows items that are visible, -and then only if update() is called. If you created the canvas -without passing a width and height to the constructor you'll also need -to call resize(). Since the canvas -background defaults to white and canvas items default to white, -you may need to change colors to see your items. -

              A TQCanvasItem object can be moved in the x(), y() and z() dimensions -using functions such as move(), moveBy(), setX(), setY() and setZ(). A -canvas item can be set in motion, `animated', using setAnimated() and -given a velocity in the x and y directions with setXVelocity() and -setYVelocity() -- the same effect can be achieved by calling -setVelocity(). Use the collidesWith() function to see if the canvas item -will collide on the next advance(1) and use collisions() to see what -collisions have occurred. -

              Use TQCanvasSprite or your own subclass of TQCanvasSprite to create canvas -items which are animated, i.e. which change over time. -

              The size of a canvas item is given by boundingRect(). Use -boundingRectAdvanced() to see what the size of the canvas item will be -after the next advance(1) call. -

              The rtti() function is used for identifying subclasses of TQCanvasItem. -The canvas() function returns a pointer to the canvas which contains the -canvas item. -

              TQCanvasItem provides the show() and isVisible() functions like those in -TQWidget. -

              TQCanvasItem also provides the setEnabled(), setActive() and -setSelected() functions; these functions set the relevant boolean and -cause a repaint but the boolean values they set are not used in -TQCanvasItem itself. You can make use of these booleans in your subclasses. -

              By default, canvas items have no velocity, no size, and are not in -motion. The subclasses provided in TQt do not change these defaults -except where noted. -

              See also Graphics Classes and Image Processing Classes. - -


              Member Type Documentation

              -

              TQCanvasItem::RttiValues

              - -

              This enum is used to name the different types of canvas item. -

                -
              • TQCanvasItem::Rtti_Item - Canvas item abstract base class -
              • TQCanvasItem::Rtti_Ellipse -
              • TQCanvasItem::Rtti_Line -
              • TQCanvasItem::Rtti_Polygon -
              • TQCanvasItem::Rtti_PolygonalItem -
              • TQCanvasItem::Rtti_Rectangle -
              • TQCanvasItem::Rtti_Spline -
              • TQCanvasItem::Rtti_Sprite -
              • TQCanvasItem::Rtti_Text -

              -


              Member Function Documentation

              -

              TQCanvasItem::TQCanvasItem ( TQCanvas * canvas ) -

              -Constructs a TQCanvasItem on canvas canvas. -

              See also setCanvas(). - -

              TQCanvasItem::~TQCanvasItem () [virtual] -

              -Destroys the TQCanvasItem and removes it from its canvas. - -

              bool TQCanvasItem::active () const -

              -This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. -

              -Use isActive() instead. - -

              void TQCanvasItem::advance ( int phase ) [virtual] -

              -The default implementation moves the canvas item, if it is -animated(), by the preset velocity if phase is 1, and does -nothing if phase is 0. -

              Note that if you reimplement this function, the reimplementation -must not change the canvas in any way, for example it must not add -or remove items. -

              See also TQCanvas::advance() and setVelocity(). - -

              Example: canvas/canvas.cpp. -

              Reimplemented in TQCanvasSprite. -

              bool TQCanvasItem::animated () const -

              -Returns TRUE if the canvas item is in motion; otherwise returns -FALSE. -

              See also setVelocity() and setAnimated(). - -

              TQRect TQCanvasItem::boundingRect () const [pure virtual] -

              - -

              Returns the bounding rectangle in pixels that the canvas item covers. -

              See also boundingRectAdvanced(). - -

              Reimplemented in TQCanvasSprite, TQCanvasPolygonalItem, and TQCanvasText. -

              TQRect TQCanvasItem::boundingRectAdvanced () const [virtual] -

              -Returns the bounding rectangle of pixels that the canvas item will cover after advance(1) is called. -

              See also boundingRect(). - -

              TQCanvas * TQCanvasItem::canvas () const -

              - -

              Returns the canvas containing the canvas item. - -

              bool TQCanvasItem::collidesWith ( const TQCanvasItem * other ) const [pure virtual] -

              - -

              Returns TRUE if the canvas item will collide with the other -item after they have moved by their current velocities; -otherwise returns FALSE. -

              See also collisions(). - -

              Example: canvas/canvas.cpp. -

              TQCanvasItemList TQCanvasItem::collisions ( bool exact ) const -

              -Returns the list of canvas items that this canvas item has -collided with. -

              A collision is generally defined as occurring when the pixels of -one item draw on the pixels of another item, but not all -subclasses are so precise. Also, since pixel-wise collision -detection can be slow, this function works in either exact or -inexact mode, according to the exact parameter. -

              If exact is TRUE, the canvas items returned have been -accurately tested for collision with the canvas item. -

              If exact is FALSE, the canvas items returned are near the -canvas item. You can test the canvas items returned using -collidesWith() if any are interesting collision candidates. By -using this approach, you can ignore some canvas items for which -collisions are not relevant. -

              The returned list is a list of TQCanvasItems, but often you will -need to cast the items to their subclass types. The safe way to do -this is to use rtti() before casting. This provides some of the -functionality of the standard C++ dynamic cast operation even on -compilers where dynamic casts are not available. -

              Note that a canvas item may be `on' a canvas, e.g. it was created -with the canvas as parameter, even though its coordinates place it -beyond the edge of the canvas's area. Collision detection only -works for canvas items which are wholly or partly within the -canvas's area. -

              Note that if items have a velocity (see setVelocity()), then -collision testing is done based on where the item will be when -it moves, not its current location. For example, a "ball" item -doesn't need to actually embed into a "wall" item before a -collision is detected. For items without velocity, plain -intersection is used. - -

              void TQCanvasItem::draw ( TQPainter & painter ) [pure virtual] -

              - -

              This abstract virtual function draws the canvas item using painter. -

              Warning: When you reimplement this function, make sure that you -leave the painter in the same state as you found it. For example, -if you start by calling TQPainter::translate(50, 50), end your -code by calling TQPainter::translate(-50, -50). Be also aware that -the painter might already have some transformations set (i.e., -don't call TQPainter::resetXForm() when you're done). - -

              Reimplemented in TQCanvasSprite, TQCanvasPolygonalItem, and TQCanvasText. -

              bool TQCanvasItem::enabled () const -

              -This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. -

              -Use isEnabled() instead. - -

              void TQCanvasItem::hide () -

              Shorthand for setVisible(FALSE). -

              bool TQCanvasItem::isActive () const -

              - -

              Returns TRUE if the TQCanvasItem is active; otherwise returns FALSE. - -

              bool TQCanvasItem::isEnabled () const -

              - -

              Returns TRUE if the TQCanvasItem is enabled; otherwise returns FALSE. - -

              bool TQCanvasItem::isSelected () const -

              - -

              Returns TRUE if the canvas item is selected; otherwise returns FALSE. - -

              bool TQCanvasItem::isVisible () const -

              - -

              Returns TRUE if the canvas item is visible; otherwise returns -FALSE. -

              Note that in this context TRUE does not mean that the canvas -item is currently in a view, merely that if a view is showing the -area where the canvas item is positioned, and the item is not -obscured by items with higher z values, and the view is not -obscured by overlaying windows, it would be visible. -

              See also setVisible() and z(). - -

              void TQCanvasItem::move ( double x, double y ) -

              -Moves the canvas item to the absolute position (x, y). - -

              Example: canvas/canvas.cpp. -

              void TQCanvasItem::moveBy ( double dx, double dy ) [virtual] -

              -Moves the canvas item relative to its current position by (dx, -dy). - -

              Example: canvas/canvas.cpp. -

              int TQCanvasItem::rtti () const [virtual] -

              -Returns 0 (TQCanvasItem::Rtti_Item). -

              Make your derived classes return their own values for rtti(), so -that you can distinguish between objects returned by -TQCanvas::at(). You should use values greater than 1000 to allow -for extensions to this class. -

              Overuse of this functionality can damage it's extensibility. For -example, once you have identified a base class of a TQCanvasItem -found by TQCanvas::at(), cast it to that type and call meaningful -methods rather than acting upon the object based on its rtti -value. -

              For example: -

              -        TQCanvasItem* item;
              -        // Find an item, e.g. with TQCanvasItem::collisions().
              -        ...
              -        if (item->rtti() == MySprite::RTTI ) {
              -            MySprite* s = (MySprite*)item;
              -            if (s->isDamagable()) s->loseHitPoints(1000);
              -            if (s->isHot()) myself->loseHitPoints(1000);
              -            ...
              -        }
              -    
              - - -

              Example: canvas/canvas.cpp. -

              Reimplemented in TQCanvasSprite, TQCanvasPolygonalItem, and TQCanvasText. -

              bool TQCanvasItem::selected () const -

              -This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. -

              -Use isSelected() instead. - -

              void TQCanvasItem::setActive ( bool yes ) [virtual] -

              -Sets the active flag of the item to yes. If this changes the -item's active state the item will be redrawn when -TQCanvas::update() is next called. -

              The TQCanvas, TQCanvasItem and the TQt-supplied TQCanvasItem -subclasses do not make use of this value. The setActive() function -is supplied because many applications need it, but it is up to you -how you use the isActive() value. - -

              void TQCanvasItem::setAnimated ( bool y ) [virtual] -

              -Sets the canvas item to be in motion if y is TRUE, or not if y is FALSE. The speed and direction of the motion is set with -setVelocity(), or with setXVelocity() and setYVelocity(). -

              See also advance() and TQCanvas::advance(). - -

              void TQCanvasItem::setCanvas ( TQCanvas * c ) [virtual] -

              -Sets the TQCanvas upon which the canvas item is to be drawn to c. -

              See also canvas(). - -

              void TQCanvasItem::setEnabled ( bool yes ) [virtual] -

              -Sets the enabled flag of the item to yes. If this changes the -item's enabled state the item will be redrawn when -TQCanvas::update() is next called. -

              The TQCanvas, TQCanvasItem and the TQt-supplied TQCanvasItem -subclasses do not make use of this value. The setEnabled() -function is supplied because many applications need it, but it is -up to you how you use the isEnabled() value. - -

              void TQCanvasItem::setSelected ( bool yes ) [virtual] -

              -Sets the selected flag of the item to yes. If this changes the -item's selected state the item will be redrawn when -TQCanvas::update() is next called. -

              The TQCanvas, TQCanvasItem and the TQt-supplied TQCanvasItem -subclasses do not make use of this value. The setSelected() -function is supplied because many applications need it, but it is -up to you how you use the isSelected() value. - -

              void TQCanvasItem::setVelocity ( double vx, double vy ) [virtual] -

              -Sets the canvas item to be in motion, moving by vx and vy -pixels in the horizontal and vertical directions respectively. -

              See also advance(), setXVelocity(), and setYVelocity(). - -

              void TQCanvasItem::setVisible ( bool yes ) [virtual] -

              -Makes the canvas item visible if yes is TRUE, or invisible if -yes is FALSE. The change takes effect when TQCanvas::update() is -next called. - -

              void TQCanvasItem::setX ( double x ) -

              - -

              Moves the canvas item so that its x-position is x. -

              See also x() and move(). - -

              Example: chart/chartform_canvas.cpp. -

              void TQCanvasItem::setXVelocity ( double vx ) -

              - -

              Sets the horizontal component of the canvas item's velocity to vx. -

              See also setYVelocity() and setVelocity(). - -

              void TQCanvasItem::setY ( double y ) -

              - -

              Moves the canvas item so that its y-position is y. -

              See also y() and move(). - -

              Example: chart/chartform_canvas.cpp. -

              void TQCanvasItem::setYVelocity ( double vy ) -

              - -

              Sets the vertical component of the canvas item's velocity to vy. -

              See also setXVelocity() and setVelocity(). - -

              void TQCanvasItem::setZ ( double z ) -

              - -

              Sets the z index of the canvas item to z. Higher-z items -obscure (are in front of) lower-z items. -

              See also z() and move(). - -

              Examples: canvas/canvas.cpp and chart/chartform_canvas.cpp. -

              void TQCanvasItem::show () -

              Shorthand for setVisible(TRUE). -

              Examples: canvas/canvas.cpp and chart/chartform_canvas.cpp. -

              void TQCanvasItem::update () [protected] -

              - -

              Call this function to repaint the canvas's changed chunks. - -

              bool TQCanvasItem::visible () const -

              -This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. -

              -Use isVisible() instead. - -

              double TQCanvasItem::x () const -

              - -

              Returns the horizontal position of the canvas item. Note that -subclasses often have an origin other than the top-left corner. - -

              Example: canvas/canvas.cpp. -

              double TQCanvasItem::xVelocity () const -

              -Returns the horizontal velocity component of the canvas item. - -

              double TQCanvasItem::y () const -

              - -

              Returns the vertical position of the canvas item. Note that -subclasses often have an origin other than the top-left corner. - -

              Example: canvas/canvas.cpp. -

              double TQCanvasItem::yVelocity () const -

              -Returns the vertical velocity component of the canvas item. - -

              double TQCanvasItem::z () const -

              - -

              Returns the z index of the canvas item, which is used for visual -order: higher-z items obscure (are in front of) lower-z items. - - -


              -This file is part of the TQt toolkit. -Copyright © 1995-2007 -Trolltech. All Rights Reserved.


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvasitemlist-members.html b/doc/html/qcanvasitemlist-members.html deleted file mode 100644 index d9e444c6..00000000 --- a/doc/html/qcanvasitemlist-members.html +++ /dev/null @@ -1,80 +0,0 @@ - - - - - -TQCanvasItemList Member List - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              Complete Member List for TQCanvasItemList

              - -

              This is the complete list of member functions for -TQCanvasItemList, including inherited members. - -

              - -


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvasitemlist.html b/doc/html/qcanvasitemlist.html deleted file mode 100644 index fbe10cce..00000000 --- a/doc/html/qcanvasitemlist.html +++ /dev/null @@ -1,72 +0,0 @@ - - - - - -TQCanvasItemList Class - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              TQCanvasItemList Class Reference
              [canvas module]

              - -

              The TQCanvasItemList class is a list of TQCanvasItems. -More... -

              #include <ntqcanvas.h> -

              Inherits TQValueList<TQCanvasItem * >. -

              List of all member functions. -

              Public Members

              -
                -
              • TQCanvasItemList operator+ ( const TQCanvasItemList & l ) const
              • -
              -

              Detailed Description

              - - -The TQCanvasItemList class is a list of TQCanvasItems. - -

              - - -

              TQCanvasItemList is a TQValueList of pointers to TQCanvasItems. -This class is used by some methods in TQCanvas that need to return -a list of canvas items. -

              The TQValueList documentation describes how to use this list. -

              See also Graphics Classes and Image Processing Classes. - -


              Member Function Documentation

              -

              TQCanvasItemList TQCanvasItemList::operator+ ( const TQCanvasItemList & l ) const -

              -Returns the concatenation of this list and list l. - - -

              -This file is part of the TQt toolkit. -Copyright © 1995-2007 -Trolltech. All Rights Reserved.


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvasline-members.html b/doc/html/qcanvasline-members.html deleted file mode 100644 index 2ea70ea1..00000000 --- a/doc/html/qcanvasline-members.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - -TQCanvasLine Member List - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              Complete Member List for TQCanvasLine

              - -

              This is the complete list of member functions for -TQCanvasLine, including inherited members. - -

              - -


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvasline.html b/doc/html/qcanvasline.html deleted file mode 100644 index b216a922..00000000 --- a/doc/html/qcanvasline.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - -TQCanvasLine Class - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              TQCanvasLine Class Reference
              [canvas module]

              - -

              The TQCanvasLine class provides a line on a TQCanvas. -More... -

              #include <ntqcanvas.h> -

              Inherits TQCanvasPolygonalItem. -

              List of all member functions. -

              Public Members

              - -

              Detailed Description

              - - -The TQCanvasLine class provides a line on a TQCanvas. - -

              - - -

              The line inherits functionality from TQCanvasPolygonalItem, for -example the setPen() function. The start and end points of the -line are set with setPoints(). -

              Like any other canvas item lines can be moved with -TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting -coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and -TQCanvasItem::setZ(). -

              See also Graphics Classes and Image Processing Classes. - -


              Member Function Documentation

              -

              TQCanvasLine::TQCanvasLine ( TQCanvas * canvas ) -

              -Constructs a line from (0,0) to (0,0) on canvas. -

              See also setPoints(). - -

              TQCanvasLine::~TQCanvasLine () -

              -Destroys the line. - -

              TQPoint TQCanvasLine::endPoint () const -

              - -

              Returns the end point of the line. -

              See also setPoints() and startPoint(). - -

              int TQCanvasLine::rtti () const [virtual] -

              -Returns 7 (TQCanvasItem::Rtti_Line). -

              See also TQCanvasItem::rtti(). - -

              Reimplemented from TQCanvasPolygonalItem. -

              void TQCanvasLine::setPoints ( int xa, int ya, int xb, int yb ) -

              -Sets the line's start point to (xa, ya) and its end point to -(xb, yb). - -

              Example: canvas/canvas.cpp. -

              TQPoint TQCanvasLine::startPoint () const -

              - -

              Returns the start point of the line. -

              See also setPoints() and endPoint(). - - -


              -This file is part of the TQt toolkit. -Copyright © 1995-2007 -Trolltech. All Rights Reserved.


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvaspixmap-members.html b/doc/html/qcanvaspixmap-members.html deleted file mode 100644 index 8a8d86ac..00000000 --- a/doc/html/qcanvaspixmap-members.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - -TQCanvasPixmap Member List - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              Complete Member List for TQCanvasPixmap

              - -

              This is the complete list of member functions for -TQCanvasPixmap, including inherited members. - -

              - -


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvaspixmap.html b/doc/html/qcanvaspixmap.html deleted file mode 100644 index f110f26c..00000000 --- a/doc/html/qcanvaspixmap.html +++ /dev/null @@ -1,128 +0,0 @@ - - - - - -TQCanvasPixmap Class - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              TQCanvasPixmap Class Reference
              [canvas module]

              - -

              The TQCanvasPixmap class provides pixmaps for TQCanvasSprites. -More... -

              #include <ntqcanvas.h> -

              Inherits TQPixmap. -

              List of all member functions. -

              Public Members

              - -

              Detailed Description

              - - -The TQCanvasPixmap class provides pixmaps for TQCanvasSprites. - -

              - - -

              If you want to show a single pixmap on a TQCanvas use a -TQCanvasSprite with just one pixmap. -

              When pixmaps are inserted into a TQCanvasPixmapArray they are held -as TQCanvasPixmaps. TQCanvasSprites are used to show pixmaps on -TQCanvases and hold their pixmaps in a TQCanvasPixmapArray. If -you retrieve a frame (pixmap) from a TQCanvasSprite it will be -returned as a TQCanvasPixmap. -

              The pixmap is a TQPixmap and can only be set in the constructor. -There are three different constructors, one taking a TQPixmap, one -a TQImage and one a file name that refers to a file in any -supported file format (see TQImageIO). -

              TQCanvasPixmap can have a hotspot which is defined in terms of an (x, -y) offset. When you create a TQCanvasPixmap from a PNG file or from -a TQImage that has a TQImage::offset(), the offset() is initialized -appropriately, otherwise the constructor leaves it at (0, 0). You -can set it later using setOffset(). When the TQCanvasPixmap is used -in a TQCanvasSprite, the offset position is the point at -TQCanvasItem::x() and TQCanvasItem::y(), not the top-left corner of -the pixmap. -

              Note that for TQCanvasPixmap objects created by a TQCanvasSprite, the -position of each TQCanvasPixmap object is set so that the hotspot -stays in the same position. -

              See also TQCanvasPixmapArray, TQCanvasItem, TQCanvasSprite, Graphics Classes, and Image Processing Classes. - -


              Member Function Documentation

              -

              TQCanvasPixmap::TQCanvasPixmap ( const TQString & datafilename ) -

              -Constructs a TQCanvasPixmap that uses the image stored in datafilename. - -

              TQCanvasPixmap::TQCanvasPixmap ( const TQImage & image ) -

              -Constructs a TQCanvasPixmap from the image image. - -

              TQCanvasPixmap::TQCanvasPixmap ( const TQPixmap & pm, const TQPoint & offset ) -

              -Constructs a TQCanvasPixmap from the pixmap pm using the offset -offset. - -

              TQCanvasPixmap::~TQCanvasPixmap () -

              -Destroys the pixmap. - -

              int TQCanvasPixmap::offsetX () const -

              - -

              Returns the x-offset of the pixmap's hotspot. -

              See also setOffset(). - -

              int TQCanvasPixmap::offsetY () const -

              - -

              Returns the y-offset of the pixmap's hotspot. -

              See also setOffset(). - -

              void TQCanvasPixmap::setOffset ( int x, int y ) -

              - -

              Sets the offset of the pixmap's hotspot to (x, y). -

              Warning: Do not call this function if any TQCanvasSprites are -currently showing this pixmap. - - -


              -This file is part of the TQt toolkit. -Copyright © 1995-2007 -Trolltech. All Rights Reserved.


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvaspixmaparray-members.html b/doc/html/qcanvaspixmaparray-members.html deleted file mode 100644 index 4013a540..00000000 --- a/doc/html/qcanvaspixmaparray-members.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - -TQCanvasPixmapArray Member List - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              Complete Member List for TQCanvasPixmapArray

              - -

              This is the complete list of member functions for -TQCanvasPixmapArray, including inherited members. - -

              - -


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvaspixmaparray.html b/doc/html/qcanvaspixmaparray.html deleted file mode 100644 index 923141fc..00000000 --- a/doc/html/qcanvaspixmaparray.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - -TQCanvasPixmapArray Class - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              TQCanvasPixmapArray Class Reference
              [canvas module]

              - -

              The TQCanvasPixmapArray class provides an array of TQCanvasPixmaps. -More... -

              #include <ntqcanvas.h> -

              List of all member functions. -

              Public Members

              - -

              Detailed Description

              - - -The TQCanvasPixmapArray class provides an array of TQCanvasPixmaps. - -

              - - -

              This class is used by TQCanvasSprite to hold an array of pixmaps. -It is used to implement animated sprites, i.e. images that change -over time, with each pixmap in the array holding one frame. -

              Depending on the constructor you use you can load multiple pixmaps -into the array either from a directory (specifying a wildcard -pattern for the files), or from a list of TQPixmaps. You can also -read in a set of pixmaps after construction using readPixmaps(). -

              Individual pixmaps can be set with setImage() and retrieved with -image(). The number of pixmaps in the array is returned by -count(). -

              TQCanvasSprite uses an image's mask for collision detection. You -can change this by reading in a separate set of image masks using -readCollisionMasks(). -

              See also Graphics Classes and Image Processing Classes. - -


              Member Function Documentation

              -

              TQCanvasPixmapArray::TQCanvasPixmapArray () -

              -Constructs an invalid array (i.e. isValid() will return FALSE). -You must call readPixmaps() before being able to use this -TQCanvasPixmapArray. - -

              TQCanvasPixmapArray::TQCanvasPixmapArray ( const TQString & datafilenamepattern, int fc = 0 ) -

              -Constructs a TQCanvasPixmapArray from files. -

              The fc parameter sets the number of frames to be loaded for -this image. -

              If fc is not 0, datafilenamepattern should contain "%1", -e.g. "foo%1.png". The actual filenames are formed by replacing the -%1 with four-digit integers from 0 to (fc - 1), e.g. foo0000.png, -foo0001.png, foo0002.png, etc. -

              If fc is 0, datafilenamepattern is asssumed to be a -filename, and the image contained in this file will be loaded as -the first (and only) frame. -

              If datafilenamepattern does not exist, is not readable, isn't -an image, or some other error occurs, the array ends up empty and -isValid() returns FALSE. - -

              TQCanvasPixmapArray::TQCanvasPixmapArray ( TQPtrList<TQPixmap> list, TQPtrList<TQPoint> hotspots ) -

              -This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. -

              Use TQCanvasPixmapArray::TQCanvasPixmapArray( TQValueList, TQPointArray ) -instead. -

              Constructs a TQCanvasPixmapArray from the list of TQPixmaps list. The hotspots list has to be of the same size as list. - -

              TQCanvasPixmapArray::TQCanvasPixmapArray ( TQValueList<TQPixmap> list, TQPointArray hotspots = TQPointArray ( ) ) -

              -Constructs a TQCanvasPixmapArray from the list of TQPixmaps in the -list. Each pixmap will get a hotspot according to the hotspots array. If no hotspots are specified, each one is set to -be at position (0, 0). -

              If an error occurs, isValid() will return FALSE. - -

              TQCanvasPixmapArray::~TQCanvasPixmapArray () -

              -Destroys the pixmap array and all the pixmaps it contains. - -

              uint TQCanvasPixmapArray::count () const -

              - -

              Returns the number of pixmaps in the array. - -

              TQCanvasPixmap * TQCanvasPixmapArray::image ( int i ) const -

              - -

              Returns pixmap i in the array, if i is non-negative and less -than than count(), and returns an unspecified value otherwise. - -

              bool TQCanvasPixmapArray::isValid () const -

              -Returns TRUE if the pixmap array is valid; otherwise returns -FALSE. - -

              bool TQCanvasPixmapArray::operator! () -

              -This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. -

              Use isValid() instead. -

              This returns FALSE if the array is valid, and TRUE if it is not. - -

              bool TQCanvasPixmapArray::readCollisionMasks ( const TQString & filename ) -

              -Reads new collision masks for the array. -

              By default, TQCanvasSprite uses the image mask of a sprite to -detect collisions. Use this function to set your own collision -image masks. -

              If count() is 1 filename must specify a real filename to read -the mask from. If count() is greater than 1, the filename must -contain a "%1" that will get replaced by the number of the mask to -be loaded, just like TQCanvasPixmapArray::readPixmaps(). -

              All collision masks must be 1-bit images or this function call -will fail. -

              If the file isn't readable, contains the wrong number of images, -or there is some other error, this function will return FALSE, and -the array will be flagged as invalid; otherwise this function -returns TRUE. -

              See also isValid(). - -

              bool TQCanvasPixmapArray::readPixmaps ( const TQString & filenamepattern, int fc = 0 ) -

              -Reads one or more pixmaps into the pixmap array. -

              If fc is not 0, filenamepattern should contain "%1", e.g. -"foo%1.png". The actual filenames are formed by replacing the %1 -with four-digit integers from 0 to (fc - 1), e.g. foo0000.png, -foo0001.png, foo0002.png, etc. -

              If fc is 0, filenamepattern is asssumed to be a filename, -and the image contained in this file will be loaded as the first -(and only) frame. -

              If filenamepattern does not exist, is not readable, isn't an -image, or some other error occurs, this function will return -FALSE, and isValid() will return FALSE; otherwise this function -will return TRUE. -

              See also isValid(). - -

              void TQCanvasPixmapArray::setImage ( int i, TQCanvasPixmap * p ) -

              -Replaces the pixmap at index i with pixmap p. -

              The array takes ownership of p and will delete p when the -array itself is deleted. -

              If i is beyond the end of the array the array is extended to at -least i+1 elements, with elements count() to i-1 being initialized -to 0. - - -


              -This file is part of the TQt toolkit. -Copyright © 1995-2007 -Trolltech. All Rights Reserved.


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvaspolygon-members.html b/doc/html/qcanvaspolygon-members.html deleted file mode 100644 index bd65dc7f..00000000 --- a/doc/html/qcanvaspolygon-members.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - -TQCanvasPolygon Member List - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              Complete Member List for TQCanvasPolygon

              - -

              This is the complete list of member functions for -TQCanvasPolygon, including inherited members. - -

              - -


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvaspolygon.html b/doc/html/qcanvaspolygon.html deleted file mode 100644 index 68f9636b..00000000 --- a/doc/html/qcanvaspolygon.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - -TQCanvasPolygon Class - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              TQCanvasPolygon Class Reference
              [canvas module]

              - -

              The TQCanvasPolygon class provides a polygon on a TQCanvas. -More... -

              #include <ntqcanvas.h> -

              Inherits TQCanvasPolygonalItem. -

              Inherited by TQCanvasSpline. -

              List of all member functions. -

              Public Members

              - -

              Protected Members

              -
                -
              • virtual void drawShape ( TQPainter & p )
              • -
              -

              Detailed Description

              - - -The TQCanvasPolygon class provides a polygon on a TQCanvas. - -

              - - -

              Paints a polygon with a TQBrush. The polygon's points can be set in -the constructor or set or changed later using setPoints(). Use -points() to retrieve the points, or areaPoints() to retrieve the -points relative to the canvas's origin. -

              The polygon can be drawn on a painter with drawShape(). -

              Like any other canvas item polygons can be moved with -TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting -coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and -TQCanvasItem::setZ(). -

              Note: TQCanvasPolygon does not use the pen. -

              See also Graphics Classes and Image Processing Classes. - -


              Member Function Documentation

              -

              TQCanvasPolygon::TQCanvasPolygon ( TQCanvas * canvas ) -

              -Constructs a point-less polygon on the canvas canvas. You -should call setPoints() before using it further. - -

              TQCanvasPolygon::~TQCanvasPolygon () -

              -Destroys the polygon. - -

              TQPointArray TQCanvasPolygon::areaPoints () const [virtual] -

              -Returns the vertices of the polygon translated by the polygon's -current x(), y() position, i.e. relative to the canvas's origin. -

              See also setPoints() and points(). - -

              Reimplemented from TQCanvasPolygonalItem. -

              void TQCanvasPolygon::drawShape ( TQPainter & p ) [virtual protected] -

              -Draws the polygon using the painter p. -

              Note that TQCanvasPolygon does not support an outline (the pen is -always NoPen). - -

              Reimplemented from TQCanvasPolygonalItem. -

              TQPointArray TQCanvasPolygon::points () const -

              - -

              Returns the vertices of the polygon, not translated by the position. -

              See also setPoints() and areaPoints(). - -

              int TQCanvasPolygon::rtti () const [virtual] -

              -Returns 4 (TQCanvasItem::Rtti_Polygon). -

              See also TQCanvasItem::rtti(). - -

              Reimplemented from TQCanvasPolygonalItem. -

              Reimplemented in TQCanvasSpline. -

              void TQCanvasPolygon::setPoints ( TQPointArray pa ) -

              -Sets the points of the polygon to be pa. These points will have -their x and y coordinates automatically translated by x(), y() as -the polygon is moved. - - -

              -This file is part of the TQt toolkit. -Copyright © 1995-2007 -Trolltech. All Rights Reserved.


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvaspolygonalitem-members.html b/doc/html/qcanvaspolygonalitem-members.html deleted file mode 100644 index d5b92c82..00000000 --- a/doc/html/qcanvaspolygonalitem-members.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - -TQCanvasPolygonalItem Member List - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              Complete Member List for TQCanvasPolygonalItem

              - -

              This is the complete list of member functions for -TQCanvasPolygonalItem, including inherited members. - -

              - -


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvaspolygonalitem.html b/doc/html/qcanvaspolygonalitem.html deleted file mode 100644 index b9f74003..00000000 --- a/doc/html/qcanvaspolygonalitem.html +++ /dev/null @@ -1,235 +0,0 @@ - - - - - -TQCanvasPolygonalItem Class - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              TQCanvasPolygonalItem Class Reference
              [canvas module]

              - -

              The TQCanvasPolygonalItem class provides a polygonal canvas item -on a TQCanvas. -More... -

              #include <ntqcanvas.h> -

              Inherits TQCanvasItem. -

              Inherited by TQCanvasRectangle, TQCanvasPolygon, TQCanvasLine, and TQCanvasEllipse. -

              List of all member functions. -

              Public Members

              - -

              Protected Members

              - -

              Detailed Description

              - - -The TQCanvasPolygonalItem class provides a polygonal canvas item -on a TQCanvas. - -

              - - -

              The mostly rectangular classes, such as TQCanvasSprite and -TQCanvasText, use the object's bounding rectangle for movement, -repainting and collision calculations. For most other items, the -bounding rectangle can be far too large -- a diagonal line being -the worst case, and there are many other cases which are also bad. -TQCanvasPolygonalItem provides polygon-based bounding rectangle -handling, etc., which is much faster for non-rectangular items. -

              Derived classes should try to define as small an area as possible -to maximize efficiency, but the polygon must definitely be -contained completely within the polygonal area. Calculating the -exact requirements is usually difficult, but if you allow a small -overestimate it can be easy and quick, while still getting almost -all of TQCanvasPolygonalItem's speed. -

              Note that all subclasses must call hide() in their destructor -since hide() needs to be able to access areaPoints(). -

              Normally, TQCanvasPolygonalItem uses the odd-even algorithm for -determining whether an object intersects this object. You can -change this to the winding algorithm using setWinding(). -

              The bounding rectangle is available using boundingRect(). The -points bounding the polygonal item are retrieved with -areaPoints(). Use areaPointsAdvanced() to retrieve the bounding -points the polygonal item will have after -TQCanvasItem::advance(1) has been called. -

              If the shape of the polygonal item is about to change while the -item is visible, call invalidate() before updating with a -different result from areaPoints(). -

              By default, TQCanvasPolygonalItem objects have a black pen and no -brush (the default TQPen and TQBrush constructors). You can change -this with setPen() and setBrush(), but note that some -TQCanvasPolygonalItem subclasses only use the brush, ignoring the -pen setting. -

              The polygonal item can be drawn on a painter with draw(). -Subclasses must reimplement drawShape() to draw themselves. -

              Like any other canvas item polygonal items can be moved with -TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting coordinates -with TQCanvasItem::setX(), TQCanvasItem::setY() and TQCanvasItem::setZ(). -

              See also Graphics Classes and Image Processing Classes. - -


              Member Function Documentation

              -

              TQCanvasPolygonalItem::TQCanvasPolygonalItem ( TQCanvas * canvas ) -

              -Constructs a TQCanvasPolygonalItem on the canvas canvas. - -

              TQCanvasPolygonalItem::~TQCanvasPolygonalItem () [virtual] -

              -Note that all subclasses must call hide() in their destructor -since hide() needs to be able to access areaPoints(). - -

              TQPointArray TQCanvasPolygonalItem::areaPoints () const [pure virtual] -

              - -

              This function must be reimplemented by subclasses. It must -return the points bounding (i.e. outside and not touching) the -shape or drawing errors will occur. - -

              Reimplemented in TQCanvasPolygon. -

              TQPointArray TQCanvasPolygonalItem::areaPointsAdvanced () const [virtual] -

              -Returns the points the polygonal item will have after -TQCanvasItem::advance(1) is called, i.e. what the points are when -advanced by the current xVelocity() and yVelocity(). - -

              TQRect TQCanvasPolygonalItem::boundingRect () const [virtual] -

              -Returns the bounding rectangle of the polygonal item, based on -areaPoints(). - -

              Reimplemented from TQCanvasItem. -

              TQBrush TQCanvasPolygonalItem::brush () const -

              - -

              Returns the TQBrush used to fill the item, if filled. -

              See also setBrush(). - -

              void TQCanvasPolygonalItem::draw ( TQPainter & p ) [virtual protected] -

              -Reimplemented from TQCanvasItem, this draws the polygonal item by -setting the pen and brush for the item on the painter p and -calling drawShape(). - -

              Reimplemented from TQCanvasItem. -

              void TQCanvasPolygonalItem::drawShape ( TQPainter & p ) [pure virtual protected] -

              - -

              Subclasses must reimplement this function to draw their shape. The -pen and brush of p are already set to pen() and brush() prior -to calling this function. -

              Warning: When you reimplement this function, make sure that you -leave the painter in the same state as you found it. For example, -if you start by calling TQPainter::translate(50, 50), end your -code by calling TQPainter::translate(-50, -50). Be also aware that -the painter might already have some transformations set (i.e., -don't call TQPainter::resetXForm() when you're done). -

              See also draw(). - -

              Reimplemented in TQCanvasRectangle, TQCanvasPolygon, and TQCanvasEllipse. -

              void TQCanvasPolygonalItem::invalidate () [protected] -

              -Invalidates all information about the area covered by the canvas -item. The item will be updated automatically on the next call that -changes the item's status, for example, move() or update(). Call -this function if you are going to change the shape of the item (as -returned by areaPoints()) while the item is visible. - -

              bool TQCanvasPolygonalItem::isValid () const [protected] -

              - -

              Returns TRUE if the polygonal item's area information has not been -invalidated; otherwise returns FALSE. -

              See also invalidate(). - -

              TQPen TQCanvasPolygonalItem::pen () const -

              - -

              Returns the TQPen used to draw the outline of the item, if any. -

              See also setPen(). - -

              int TQCanvasPolygonalItem::rtti () const [virtual] -

              -Returns 2 (TQCanvasItem::Rtti_PolygonalItem). -

              See also TQCanvasItem::rtti(). - -

              Reimplemented from TQCanvasItem. -

              Reimplemented in TQCanvasRectangle, TQCanvasPolygon, TQCanvasLine, and TQCanvasEllipse. -

              void TQCanvasPolygonalItem::setBrush ( TQBrush b ) [virtual] -

              -Sets the TQBrush used when drawing the polygonal item to the brush b. -

              See also setPen(), brush(), and drawShape(). - -

              Examples: canvas/canvas.cpp and chart/chartform_canvas.cpp. -

              void TQCanvasPolygonalItem::setPen ( TQPen p ) [virtual] -

              -Sets the TQPen used when drawing the item to the pen p. -Note that many TQCanvasPolygonalItems do not use the pen value. -

              See also setBrush(), pen(), and drawShape(). - -

              Examples: canvas/canvas.cpp and chart/chartform_canvas.cpp. -

              void TQCanvasPolygonalItem::setWinding ( bool enable ) [protected] -

              -If enable is TRUE, the polygonal item will use the winding -algorithm to determine the "inside" of the polygon; otherwise the -odd-even algorithm will be used. -

              The default is to use the odd-even algorithm. -

              See also winding(). - -

              bool TQCanvasPolygonalItem::winding () const [protected] -

              -Returns TRUE if the polygonal item uses the winding algorithm to -determine the "inside" of the polygon. Returns FALSE if it uses -the odd-even algorithm. -

              The default is to use the odd-even algorithm. -

              See also setWinding(). - - -


              -This file is part of the TQt toolkit. -Copyright © 1995-2007 -Trolltech. All Rights Reserved.


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvasrectangle-members.html b/doc/html/qcanvasrectangle-members.html deleted file mode 100644 index 3e902585..00000000 --- a/doc/html/qcanvasrectangle-members.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - - -TQCanvasRectangle Member List - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              Complete Member List for TQCanvasRectangle

              - -

              This is the complete list of member functions for -TQCanvasRectangle, including inherited members. - -

              - -


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvasrectangle.html b/doc/html/qcanvasrectangle.html deleted file mode 100644 index 4db31396..00000000 --- a/doc/html/qcanvasrectangle.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - - -TQCanvasRectangle Class - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              TQCanvasRectangle Class Reference
              [canvas module]

              - -

              The TQCanvasRectangle class provides a rectangle on a TQCanvas. -More... -

              #include <ntqcanvas.h> -

              Inherits TQCanvasPolygonalItem. -

              List of all member functions. -

              Public Members

              - -

              Protected Members

              -
                -
              • virtual void drawShape ( TQPainter & p )
              • -
              • virtual TQPointArray chunks () const
              • -
              -

              Detailed Description

              - - -The TQCanvasRectangle class provides a rectangle on a TQCanvas. - -

              - - -

              This item paints a single rectangle which may have any pen() and -brush(), but may not be tilted/rotated. For rotated rectangles, -use TQCanvasPolygon. -

              The rectangle's size and initial position can be set in the -constructor. The size can be set or changed later using setSize(). -Use height() and width() to retrieve the rectangle's dimensions. -

              The rectangle can be drawn on a painter with drawShape(). -

              Like any other canvas item rectangles can be moved with -TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting -coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and -TQCanvasItem::setZ(). -

              See also Graphics Classes and Image Processing Classes. - -


              Member Function Documentation

              -

              TQCanvasRectangle::TQCanvasRectangle ( TQCanvas * canvas ) -

              -Constructs a rectangle at position (0,0) with both width and -height set to 32 pixels on canvas. - -

              TQCanvasRectangle::TQCanvasRectangle ( const TQRect & r, TQCanvas * canvas ) -

              -Constructs a rectangle positioned and sized by r on canvas. - -

              TQCanvasRectangle::TQCanvasRectangle ( int x, int y, int width, int height, TQCanvas * canvas ) -

              -Constructs a rectangle at position (x, y) and size width -by height, on canvas. - -

              TQCanvasRectangle::~TQCanvasRectangle () -

              -Destroys the rectangle. - -

              TQPointArray TQCanvasRectangle::chunks () const [virtual protected] -

              -Simply calls TQCanvasItem::chunks(). - -

              void TQCanvasRectangle::drawShape ( TQPainter & p ) [virtual protected] -

              -Draws the rectangle on painter p. - -

              Example: canvas/canvas.cpp. -

              Reimplemented from TQCanvasPolygonalItem. -

              int TQCanvasRectangle::height () const -

              -Returns the height of the rectangle. - -

              TQRect TQCanvasRectangle::rect () const -

              - -

              Returns the integer-converted x(), y() position and size() of the -rectangle as a TQRect. - -

              int TQCanvasRectangle::rtti () const [virtual] -

              -Returns 5 (TQCanvasItem::Rtti_Rectangle). -

              See also TQCanvasItem::rtti(). - -

              Reimplemented from TQCanvasPolygonalItem. -

              void TQCanvasRectangle::setSize ( int width, int height ) -

              -Sets the width and height of the rectangle. - -

              TQSize TQCanvasRectangle::size () const -

              - -

              Returns the width() and height() of the rectangle. -

              See also rect() and setSize(). - -

              int TQCanvasRectangle::width () const -

              -Returns the width of the rectangle. - - -

              -This file is part of the TQt toolkit. -Copyright © 1995-2007 -Trolltech. All Rights Reserved.


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvasspline-members.html b/doc/html/qcanvasspline-members.html deleted file mode 100644 index ba8abf06..00000000 --- a/doc/html/qcanvasspline-members.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - -TQCanvasSpline Member List - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              Complete Member List for TQCanvasSpline

              - -

              This is the complete list of member functions for -TQCanvasSpline, including inherited members. - -

              - -


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvasspline.html b/doc/html/qcanvasspline.html deleted file mode 100644 index 4bb75b54..00000000 --- a/doc/html/qcanvasspline.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - -TQCanvasSpline Class - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              TQCanvasSpline Class Reference
              [canvas module]

              - -

              The TQCanvasSpline class provides multi-bezier splines on a TQCanvas. -More... -

              #include <ntqcanvas.h> -

              Inherits TQCanvasPolygon. -

              List of all member functions. -

              Public Members

              - -

              Detailed Description

              - - -The TQCanvasSpline class provides multi-bezier splines on a TQCanvas. - -

              - - -

              A TQCanvasSpline is a sequence of 4-point bezier curves joined -together to make a curved shape. -

              You set the control points of the spline with setControlPoints(). -

              If the bezier is closed(), then the first control point will be -re-used as the last control point. Therefore, a closed bezier must -have a multiple of 3 control points and an open bezier must have -one extra point. -

              The beziers are not necessarily joined "smoothly". To ensure this, -set control points appropriately (general reference texts about -beziers will explain this in detail). -

              Like any other canvas item splines can be moved with -TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting -coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and -TQCanvasItem::setZ(). -

              See also Graphics Classes and Image Processing Classes. - -


              Member Function Documentation

              -

              TQCanvasSpline::TQCanvasSpline ( TQCanvas * canvas ) -

              -Create a spline with no control points on the canvas canvas. -

              See also setControlPoints(). - -

              TQCanvasSpline::~TQCanvasSpline () -

              -Destroy the spline. - -

              bool TQCanvasSpline::closed () const -

              -Returns TRUE if the control points are a closed set; otherwise -returns FALSE. - -

              TQPointArray TQCanvasSpline::controlPoints () const -

              -Returns the current set of control points. -

              See also setControlPoints() and closed(). - -

              int TQCanvasSpline::rtti () const [virtual] -

              -Returns 8 (TQCanvasItem::Rtti_Spline). -

              See also TQCanvasItem::rtti(). - -

              Reimplemented from TQCanvasPolygon. -

              void TQCanvasSpline::setControlPoints ( TQPointArray ctrl, bool close = TRUE ) -

              -Set the spline control points to ctrl. -

              If close is TRUE, then the first point in ctrl will be -re-used as the last point, and the number of control points must -be a multiple of 3. If close is FALSE, one additional control -point is required, and the number of control points must be one of -(4, 7, 10, 13, ...). -

              If the number of control points doesn't meet the above conditions, -the number of points will be truncated to the largest number of -points that do meet the requirement. - -

              Example: canvas/canvas.cpp. - -


              -This file is part of the TQt toolkit. -Copyright © 1995-2007 -Trolltech. All Rights Reserved.


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvassprite-members.html b/doc/html/qcanvassprite-members.html deleted file mode 100644 index 48df960a..00000000 --- a/doc/html/qcanvassprite-members.html +++ /dev/null @@ -1,100 +0,0 @@ - - - - - -TQCanvasSprite Member List - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              Complete Member List for TQCanvasSprite

              - -

              This is the complete list of member functions for -TQCanvasSprite, including inherited members. - -

              - -


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvassprite.html b/doc/html/qcanvassprite.html deleted file mode 100644 index b651264e..00000000 --- a/doc/html/qcanvassprite.html +++ /dev/null @@ -1,303 +0,0 @@ - - - - - -TQCanvasSprite Class - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              TQCanvasSprite Class Reference
              [canvas module]

              - -

              The TQCanvasSprite class provides an animated canvas item on a TQCanvas. -More... -

              #include <ntqcanvas.h> -

              Inherits TQCanvasItem. -

              List of all member functions. -

              Public Members

              - -

              Detailed Description

              - - -The TQCanvasSprite class provides an animated canvas item on a TQCanvas. - -

              - - -

              A canvas sprite is an object which can contain any number of images -(referred to as frames), only one of which is current, i.e. -displayed, at any one time. The images can be passed in the -constructor or set or changed later with setSequence(). If you -subclass TQCanvasSprite you can change the frame that is displayed -periodically, e.g. whenever TQCanvasItem::advance(1) is called to -create the effect of animation. -

              The current frame can be set with setFrame() or with move(). The -number of frames available is given by frameCount(). The bounding -rectangle of the current frame is returned by boundingRect(). -

              The current frame's image can be retrieved with image(); use -imageAdvanced() to retrieve the image for the frame that will be -shown after advance(1) is called. Use the image() overload passing -it an integer index to retrieve a particular image from the list of -frames. -

              Use width() and height() to retrieve the dimensions of the current -frame. -

              Use leftEdge() and rightEdge() to retrieve the current frame's -left-hand and right-hand x-coordinates respectively. Use -bottomEdge() and topEdge() to retrieve the current frame's bottom -and top y-coordinates respectively. These functions have an overload -which will accept an integer frame number to retrieve the -coordinates of a particular frame. -

              TQCanvasSprite draws very quickly, at the expense of memory. -

              The current frame's image can be drawn on a painter with draw(). -

              Like any other canvas item, canvas sprites can be moved with -move() which sets the x and y coordinates and the frame number, as -well as with TQCanvasItem::move() and TQCanvasItem::moveBy(), or by -setting coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() -and TQCanvasItem::setZ(). -

              See also Graphics Classes and Image Processing Classes. - -


              Member Type Documentation

              -

              TQCanvasSprite::FrameAnimationType

              - -

              This enum is used to identify the different types of frame -animation offered by TQCanvasSprite. -

                -
              • TQCanvasSprite::Cycle - at each advance the frame number will be incremented by -1 (modulo the frame count). -
              • TQCanvasSprite::Oscillate - at each advance the frame number will be -incremented by 1 up to the frame count then decremented to by 1 to -0, repeating this sequence forever. -
              -

              Member Function Documentation

              -

              TQCanvasSprite::TQCanvasSprite ( TQCanvasPixmapArray * a, TQCanvas * canvas ) -

              -Constructs a TQCanvasSprite which uses images from the -TQCanvasPixmapArray a. -

              The sprite in initially positioned at (0, 0) on canvas, using -frame 0. - -

              TQCanvasSprite::~TQCanvasSprite () [virtual] -

              -Destroys the sprite and removes it from the canvas. Does not -delete the images. - -

              void TQCanvasSprite::advance ( int phase ) [virtual] -

              -Extends the default TQCanvasItem implementation to provide the -functionality of setFrameAnimation(). -

              The phase is 0 or 1: see TQCanvasItem::advance() for details. -

              See also TQCanvasItem::advance() and setVelocity(). - -

              Example: canvas/canvas.cpp. -

              Reimplemented from TQCanvasItem. -

              int TQCanvasSprite::bottomEdge () const -

              -Returns the y-coordinate of the current bottom edge of the sprite. -(This may change as the sprite animates since different frames may -have different bottom edges.) -

              See also leftEdge(), rightEdge(), and topEdge(). - -

              int TQCanvasSprite::bottomEdge ( int ny ) const -

              -This is an overloaded member function, provided for convenience. It behaves essentially like the above function. -

              Returns what the y-coordinate of the top edge of the sprite would -be if the sprite (actually its hotspot) were moved to y-position -ny. -

              See also leftEdge(), rightEdge(), and topEdge(). - -

              TQRect TQCanvasSprite::boundingRect () const [virtual] -

              -Returns the bounding rectangle for the image in the sprite's -current frame. This assumes that the images are tightly cropped -(i.e. do not have transparent pixels all along a side). - -

              Reimplemented from TQCanvasItem. -

              void TQCanvasSprite::draw ( TQPainter & painter ) [virtual] -

              -Draws the current frame's image at the sprite's current position -on painter painter. - -

              Reimplemented from TQCanvasItem. -

              int TQCanvasSprite::frame () const -

              - -

              Returns the index of the current animation frame in the -TQCanvasSprite's TQCanvasPixmapArray. -

              See also setFrame() and move(). - -

              int TQCanvasSprite::frameCount () const -

              - -

              Returns the number of frames in the TQCanvasSprite's -TQCanvasPixmapArray. - -

              int TQCanvasSprite::height () const -

              -The height of the sprite for the current frame's image. -

              See also frame(). - -

              TQCanvasPixmap * TQCanvasSprite::image () const -

              - -

              Returns the current frame's image. -

              See also frame() and setFrame(). - -

              TQCanvasPixmap * TQCanvasSprite::image ( int f ) const -

              - -This is an overloaded member function, provided for convenience. It behaves essentially like the above function. -

              Returns the image for frame f. Does not do any bounds checking on f. - -

              TQCanvasPixmap * TQCanvasSprite::imageAdvanced () const [virtual] -

              -Returns the image the sprite will have after advance(1) is -called. By default this is the same as image(). - -

              int TQCanvasSprite::leftEdge () const -

              -Returns the x-coordinate of the current left edge of the sprite. -(This may change as the sprite animates since different frames may -have different left edges.) -

              See also rightEdge(), bottomEdge(), and topEdge(). - -

              int TQCanvasSprite::leftEdge ( int nx ) const -

              -This is an overloaded member function, provided for convenience. It behaves essentially like the above function. -

              Returns what the x-coordinate of the left edge of the sprite would -be if the sprite (actually its hotspot) were moved to x-position -nx. -

              See also rightEdge(), bottomEdge(), and topEdge(). - -

              void TQCanvasSprite::move ( double nx, double ny, int nf ) [virtual] -

              - -

              Set the position of the sprite to nx, ny and the current -frame to nf. nf will be ignored if it is larger than -frameCount() or smaller than 0. - -

              int TQCanvasSprite::rightEdge () const -

              -Returns the x-coordinate of the current right edge of the sprite. -(This may change as the sprite animates since different frames may -have different right edges.) -

              See also leftEdge(), bottomEdge(), and topEdge(). - -

              int TQCanvasSprite::rightEdge ( int nx ) const -

              -This is an overloaded member function, provided for convenience. It behaves essentially like the above function. -

              Returns what the x-coordinate of the right edge of the sprite -would be if the sprite (actually its hotspot) were moved to -x-position nx. -

              See also leftEdge(), bottomEdge(), and topEdge(). - -

              int TQCanvasSprite::rtti () const [virtual] -

              -Returns 1 (TQCanvasItem::Rtti_Sprite). -

              See also TQCanvasItem::rtti(). - -

              Example: canvas/canvas.cpp. -

              Reimplemented from TQCanvasItem. -

              void TQCanvasSprite::setFrame ( int f ) -

              -Sets the animation frame used for displaying the sprite to f, -an index into the TQCanvasSprite's TQCanvasPixmapArray. The call -will be ignored if f is larger than frameCount() or smaller -than 0. -

              See also frame() and move(). - -

              void TQCanvasSprite::setFrameAnimation ( FrameAnimationType type = Cycle, int step = 1, int state = 0 ) [virtual] -

              -Sets the animation characteristics for the sprite. -

              For type == Cycle, the frames will increase by step -at each advance, modulo the frameCount(). -

              For type == Oscillate, the frames will increase by step -at each advance, up to the frameCount(), then decrease by step -back to 0, repeating forever. -

              The state parameter is for internal use. - -

              void TQCanvasSprite::setSequence ( TQCanvasPixmapArray * a ) -

              -Set the array of images used for displaying the sprite to the -TQCanvasPixmapArray a. -

              If the current frame() is larger than the number of images in a, the current frame will be reset to 0. - -

              int TQCanvasSprite::topEdge () const -

              -Returns the y-coordinate of the top edge of the sprite. (This may -change as the sprite animates since different frames may have -different top edges.) -

              See also leftEdge(), rightEdge(), and bottomEdge(). - -

              int TQCanvasSprite::topEdge ( int ny ) const -

              -This is an overloaded member function, provided for convenience. It behaves essentially like the above function. -

              Returns what the y-coordinate of the top edge of the sprite would -be if the sprite (actually its hotspot) were moved to y-position -ny. -

              See also leftEdge(), rightEdge(), and bottomEdge(). - -

              int TQCanvasSprite::width () const -

              -The width of the sprite for the current frame's image. -

              See also frame(). - - -


              -This file is part of the TQt toolkit. -Copyright © 1995-2007 -Trolltech. All Rights Reserved.


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvastext-members.html b/doc/html/qcanvastext-members.html deleted file mode 100644 index 4dc99f5d..00000000 --- a/doc/html/qcanvastext-members.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - -TQCanvasText Member List - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              Complete Member List for TQCanvasText

              - -

              This is the complete list of member functions for -TQCanvasText, including inherited members. - -

              - -


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvastext.html b/doc/html/qcanvastext.html deleted file mode 100644 index 2a80b61e..00000000 --- a/doc/html/qcanvastext.html +++ /dev/null @@ -1,169 +0,0 @@ - - - - - -TQCanvasText Class - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              TQCanvasText Class Reference
              [canvas module]

              - -

              The TQCanvasText class provides a text object on a TQCanvas. -More... -

              #include <ntqcanvas.h> -

              Inherits TQCanvasItem. -

              List of all member functions. -

              Public Members

              - -

              Protected Members

              -
                -
              • virtual void draw ( TQPainter & painter )
              • -
              -

              Detailed Description

              - - -The TQCanvasText class provides a text object on a TQCanvas. - -

              - - -

              A canvas text item has text with font, color and alignment -attributes. The text and font can be set in the constructor or set -or changed later with setText() and setFont(). The color is set -with setColor() and the alignment with setTextFlags(). The text -item's bounding rectangle is retrieved with boundingRect(). -

              The text can be drawn on a painter with draw(). -

              Like any other canvas item text items can be moved with -TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting -coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and -TQCanvasItem::setZ(). -

              See also Graphics Classes and Image Processing Classes. - -


              Member Function Documentation

              -

              TQCanvasText::TQCanvasText ( TQCanvas * canvas ) -

              -Constructs a TQCanvasText with the text "<text>", on canvas. - -

              TQCanvasText::TQCanvasText ( const TQString & t, TQCanvas * canvas ) -

              -Constructs a TQCanvasText with the text t, on canvas canvas. - -

              TQCanvasText::TQCanvasText ( const TQString & t, TQFont f, TQCanvas * canvas ) -

              -Constructs a TQCanvasText with the text t and font f, on the -canvas canvas. - -

              TQCanvasText::~TQCanvasText () [virtual] -

              -Destroys the canvas text item. - -

              TQRect TQCanvasText::boundingRect () const [virtual] -

              -Returns the bounding rectangle of the text. - -

              Reimplemented from TQCanvasItem. -

              TQColor TQCanvasText::color () const -

              -Returns the color of the text. -

              See also setColor(). - -

              void TQCanvasText::draw ( TQPainter & painter ) [virtual protected] -

              -Draws the text using the painter painter. - -

              Reimplemented from TQCanvasItem. -

              TQFont TQCanvasText::font () const -

              -Returns the font in which the text is drawn. -

              See also setFont(). - -

              int TQCanvasText::rtti () const [virtual] -

              -Returns 3 (TQCanvasItem::Rtti_Text). -

              See also TQCanvasItem::rtti(). - -

              Reimplemented from TQCanvasItem. -

              void TQCanvasText::setColor ( const TQColor & c ) -

              -Sets the color of the text to the color c. -

              See also color() and setFont(). - -

              Example: chart/chartform_canvas.cpp. -

              void TQCanvasText::setFont ( const TQFont & f ) -

              -Sets the font in which the text is drawn to font f. -

              See also font(). - -

              void TQCanvasText::setText ( const TQString & t ) -

              -Sets the text item's text to t. The text may contain newlines. -

              See also text(), setFont(), setColor(), and setTextFlags(). - -

              Example: canvas/canvas.cpp. -

              void TQCanvasText::setTextFlags ( int f ) -

              -Sets the alignment flags to f. These are a bitwise OR of the -flags available to TQPainter::drawText() -- see the -TQt::AlignmentFlags. -

              See also setFont() and setColor(). - -

              TQString TQCanvasText::text () const -

              -Returns the text item's text. -

              See also setText(). - -

              int TQCanvasText::textFlags () const -

              - -

              Returns the currently set alignment flags. -

              See also setTextFlags() and TQt::AlignmentFlags. - - -


              -This file is part of the TQt toolkit. -Copyright © 1995-2007 -Trolltech. All Rights Reserved.


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvasview-members.html b/doc/html/qcanvasview-members.html deleted file mode 100644 index 5fca8ff8..00000000 --- a/doc/html/qcanvasview-members.html +++ /dev/null @@ -1,429 +0,0 @@ - - - - - -TQCanvasView Member List - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              Complete Member List for TQCanvasView

              - -

              This is the complete list of member functions for -TQCanvasView, including inherited members. - -

              - -


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qcanvasview.html b/doc/html/qcanvasview.html deleted file mode 100644 index 6ea947b6..00000000 --- a/doc/html/qcanvasview.html +++ /dev/null @@ -1,190 +0,0 @@ - - - - - -TQCanvasView Class - - - - - - - -
              - -Home - | -All Classes - | -Main Classes - | -Annotated - | -Grouped Classes - | -Functions -

              TQCanvasView Class Reference
              [canvas module]

              - -

              The TQCanvasView class provides an on-screen view of a TQCanvas. -More... -

              #include <ntqcanvas.h> -

              Inherits TQScrollView. -

              List of all member functions. -

              Public Members

              - -

              Protected Members

              -
                -
              • virtual void drawContents ( TQPainter * p, int cx, int cy, int cw, int ch )
              • -
              • virtual TQSize sizeHint () const
              • -
              -

              Detailed Description

              - - -The TQCanvasView class provides an on-screen view of a TQCanvas. - -

              - - -

              A TQCanvasView is widget which provides a view of a TQCanvas. -

              If you want users to be able to interact with a canvas view, -subclass TQCanvasView. You might then reimplement -TQScrollView::contentsMousePressEvent(). For example, assuming no -transformation matrix is set: -

              -    void MyCanvasView::contentsMousePressEvent( TQMouseEvent* e )
              -    {
              -        TQCanvasItemList l = canvas()->collisions(e->pos());
              -        for (TQCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) {
              -            if ( (*it)->rtti() == TQCanvasRectangle::RTTI )
              -                tqDebug("A TQCanvasRectangle lies somewhere at this point");
              -        }
              -    }
              -    
              - -

              The canvas view shows canvas canvas(); this can be changed using -setCanvas(). -

              A transformation matrix can be used to transform the view of the -canvas in various ways, for example, zooming in or out or rotating. -For example: -

              -    TQWMatrix wm;
              -    wm.scale( 2, 2 );   // Zooms in by 2 times
              -    wm.rotate( 90 );    // Rotates 90 degrees counter clockwise
              -                        // around the origin.
              -    wm.translate( 0, -canvas->height() );
              -                        // moves the canvas down so what was visible
              -                        // before is still visible.
              -    myCanvasView->setWorldMatrix( wm );
              -    
              - -

              Use setWorldMatrix() to set the canvas view's world matrix: you must -ensure that the world matrix is invertible. The current world matrix -is retrievable with worldMatrix(), and its inversion is retrievable -with inverseWorldMatrix(). -

              Example: -

              The following code finds the part of the canvas that is visible in -this view, i.e. the bounding rectangle of the view in canvas coordinates. -

              -    TQRect rc = TQRect( myCanvasView->contentsX(), myCanvasView->contentsY(),
              -                        myCanvasView->visibleWidth(), myCanvasView->visibleHeight() );
              -    TQRect canvasRect = myCanvasView->inverseWorldMatrix().mapRect(rc);
              -    
              - -

              See also TQWMatrix, TQPainter::setWorldMatrix(), Graphics Classes, and Image Processing Classes. - -

              -


              Member Function Documentation

              -

              TQCanvasView::TQCanvasView ( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 ) -

              -Constructs a TQCanvasView with parent parent, and name name, -using the widget flags f. The canvas view is not associated -with a canvas, so you must to call setCanvas() to view a -canvas. - -

              TQCanvasView::TQCanvasView ( TQCanvas * canvas, TQWidget * parent = 0, const char * name = 0, WFlags f = 0 ) -

              -This is an overloaded member function, provided for convenience. It behaves essentially like the above function. -

              Constructs a TQCanvasView which views canvas canvas, with parent -parent, and name name, using the widget flags f. - -

              TQCanvasView::~TQCanvasView () -

              -Destroys the canvas view. The associated canvas is not deleted. - -

              TQCanvas * TQCanvasView::canvas () const -

              - -

              Returns a pointer to the canvas which the TQCanvasView is currently -showing. - -

              void TQCanvasView::drawContents ( TQPainter * p, int cx, int cy, int cw, int ch ) [virtual protected] -

              -Repaints part of the TQCanvas that the canvas view is showing -starting at cx by cy, with a width of cw and a height of ch using the painter p. -

              Warning: When double buffering is enabled, drawContents() will -not respect the current settings of the painter when setting up -the painter for the double buffer (e.g., viewport() and -window()). Also, be aware that TQCanvas::update() bypasses -drawContents(), which means any reimplementation of -drawContents() is not called. -

              See also TQCanvas::setDoubleBuffering(). - -

              Reimplemented from TQScrollView. -

              const TQWMatrix & TQCanvasView::inverseWorldMatrix () const -

              -Returns a reference to the inverse of the canvas view's current -transformation matrix. -

              See also setWorldMatrix() and worldMatrix(). - -

              void TQCanvasView::setCanvas ( TQCanvas * canvas ) -

              -Sets the canvas that the TQCanvasView is showing to the canvas canvas. - -

              bool TQCanvasView::setWorldMatrix ( const TQWMatrix & wm ) -

              -Sets the transformation matrix of the TQCanvasView to wm. The -matrix must be invertible (i.e. if you create a world matrix that -zooms out by 2 times, then the inverse of this matrix is one that -will zoom in by 2 times). -

              When you use this, you should note that the performance of the -TQCanvasView will decrease considerably. -

              Returns FALSE if wm is not invertable; otherwise returns TRUE. -

              See also worldMatrix(), inverseWorldMatrix(), and TQWMatrix::isInvertible(). - -

              Example: canvas/canvas.cpp. -

              TQSize TQCanvasView::sizeHint () const [virtual protected] -

              -Suggests a size sufficient to view the entire canvas. - -

              const TQWMatrix & TQCanvasView::worldMatrix () const -

              -Returns a reference to the canvas view's current transformation matrix. -

              See also setWorldMatrix() and inverseWorldMatrix(). - -

              Example: canvas/canvas.cpp. - -


              -This file is part of the TQt toolkit. -Copyright © 1995-2007 -Trolltech. All Rights Reserved.


              - -
              Copyright © 2007 -TrolltechTrademarks -
              TQt 3.3.8
              -
              - diff --git a/doc/html/qt.dcf b/doc/html/qt.dcf index e6fd2c03..2dae1b0c 100644 --- a/doc/html/qt.dcf +++ b/doc/html/qt.dcf @@ -717,251 +717,251 @@
              -
              - QCanvas - advance - allItems - backgroundColor - backgroundPixmap - chunkSize - collisions - drawArea - drawBackground - drawForeground - height - onCanvas - rect - resize - resized - retune - setAdvancePeriod - setAllChanged - setBackgroundColor - setBackgroundPixmap - setChanged - setDoubleBuffering - setTile - setTiles - setUnchanged - setUpdatePeriod - size - tile - tileHeight - tileWidth - tilesHorizontally - tilesVertically - update - validChunk - width - ~QCanvas -
              -
              -
              -
              - QCanvasEllipse - angleLength - angleStart - drawShape - height - rtti - setAngles - setSize - width - ~QCanvasEllipse -
              -
              -
              -
              - QCanvasItem - RttiValues - advance - animated - boundingRect - boundingRectAdvanced - canvas - collidesWith - collisions - draw - hide - isActive - isEnabled - isSelected - isVisible - move - moveBy - rtti - setActive - setAnimated - setCanvas - setEnabled - setSelected - setVelocity - setVisible - setX - setXVelocity - setY - setYVelocity - setZ - show - update - x - xVelocity - y - yVelocity - z - ~QCanvasItem -
              -
              -
              -
              - QCanvasItemList - operator+ -
              -
              -
              -
              - QCanvasLine - endPoint - rtti - setPoints - startPoint - ~QCanvasLine -
              -
              -
              -
              - QCanvasPixmap - offsetX - offsetY - setOffset - ~QCanvasPixmap -
              -
              -
              -
              - QCanvasPixmapArray - count - image - isValid - readCollisionMasks - readPixmaps - setImage - ~QCanvasPixmapArray -
              -
              -
              -
              - QCanvasPolygon - areaPoints - drawShape - points - rtti - setPoints - ~QCanvasPolygon -
              -
              -
              -
              - QCanvasPolygonalItem - areaPoints - areaPointsAdvanced - boundingRect - brush - draw - drawShape - invalidate - isValid - pen - rtti - setBrush - setPen - setWinding - winding - ~QCanvasPolygonalItem -
              -
              -
              -
              - QCanvasRectangle - chunks - drawShape - height - rect - rtti - setSize - size - width - ~QCanvasRectangle -
              -
              -
              -
              - QCanvasSpline - closed - controlPoints - rtti - setControlPoints - ~QCanvasSpline -
              -
              -
              -
              - QCanvasSprite - FrameAnimationType - advance - bottomEdge - boundingRect - collidesWith - draw - frame - frameCount - height - image - imageAdvanced - leftEdge - move - rightEdge - rtti - setFrame - setFrameAnimation - setSequence - topEdge - width - ~QCanvasSprite -
              -
              -
              -
              - QCanvasText - addToChunks - boundingRect - color - draw - font - removeFromChunks - rtti - setColor - setFont - setText - setTextFlags - text - textFlags - ~QCanvasText -
              -
              -
              -
              - QCanvasView - canvas - drawContents - inverseWorldMatrix - setCanvas - setWorldMatrix - sizeHint - worldMatrix - ~QCanvasView -
              -
              +
              + TQCanvas + advance + allItems + backgroundColor + backgroundPixmap + chunkSize + collisions + drawArea + drawBackground + drawForeground + height + onCanvas + rect + resize + resized + retune + setAdvancePeriod + setAllChanged + setBackgroundColor + setBackgroundPixmap + setChanged + setDoubleBuffering + setTile + setTiles + setUnchanged + setUpdatePeriod + size + tile + tileHeight + tileWidth + tilesHorizontally + tilesVertically + update + validChunk + width + ~TQCanvas +
              +
              +
              +
              + TQCanvasEllipse + angleLength + angleStart + drawShape + height + rtti + setAngles + setSize + width + ~TQCanvasEllipse +
              +
              +
              +
              + TQCanvasItem + RttiValues + advance + animated + boundingRect + boundingRectAdvanced + canvas + collidesWith + collisions + draw + hide + isActive + isEnabled + isSelected + isVisible + move + moveBy + rtti + setActive + setAnimated + setCanvas + setEnabled + setSelected + setVelocity + setVisible + setX + setXVelocity + setY + setYVelocity + setZ + show + update + x + xVelocity + y + yVelocity + z + ~TQCanvasItem +
              +
              +
              +
              + TQCanvasItemList + operator+ +
              +
              +
              +
              + TQCanvasLine + endPoint + rtti + setPoints + startPoint + ~TQCanvasLine +
              +
              +
              +
              + TQCanvasPixmap + offsetX + offsetY + setOffset + ~TQCanvasPixmap +
              +
              +
              +
              + TQCanvasPixmapArray + count + image + isValid + readCollisionMasks + readPixmaps + setImage + ~TQCanvasPixmapArray +
              +
              +
              +
              + TQCanvasPolygon + areaPoints + drawShape + points + rtti + setPoints + ~TQCanvasPolygon +
              +
              +
              +
              + TQCanvasPolygonalItem + areaPoints + areaPointsAdvanced + boundingRect + brush + draw + drawShape + invalidate + isValid + pen + rtti + setBrush + setPen + setWinding + winding + ~TQCanvasPolygonalItem +
              +
              +
              +
              + TQCanvasRectangle + chunks + drawShape + height + rect + rtti + setSize + size + width + ~TQCanvasRectangle +
              +
              +
              +
              + TQCanvasSpline + closed + controlPoints + rtti + setControlPoints + ~TQCanvasSpline +
              +
              +
              +
              + TQCanvasSprite + FrameAnimationType + advance + bottomEdge + boundingRect + collidesWith + draw + frame + frameCount + height + image + imageAdvanced + leftEdge + move + rightEdge + rtti + setFrame + setFrameAnimation + setSequence + topEdge + width + ~TQCanvasSprite +
              +
              +
              +
              + TQCanvasText + addToChunks + boundingRect + color + draw + font + removeFromChunks + rtti + setColor + setFont + setText + setTextFlags + text + textFlags + ~TQCanvasText +
              +
              +
              +
              + TQCanvasView + canvas + drawContents + inverseWorldMatrix + setCanvas + setWorldMatrix + sizeHint + worldMatrix + ~TQCanvasView +
              +
              QCDEStyle diff --git a/doc/html/titleindex b/doc/html/titleindex index 0549f4b3..6a37ccf2 100644 --- a/doc/html/titleindex +++ b/doc/html/titleindex @@ -227,34 +227,34 @@ QCache Class | ntqcache.html QCache Member List | qcache-members.html QCacheIterator Class | qcacheiterator.html QCacheIterator Member List | qcacheiterator-members.html -QCanvas Class | ntqcanvas.html -QCanvas Member List | qcanvas-members.html -QCanvasEllipse Class | qcanvasellipse.html -QCanvasEllipse Member List | qcanvasellipse-members.html -QCanvasItem Class | qcanvasitem.html -QCanvasItem Member List | qcanvasitem-members.html -QCanvasItemList Class | qcanvasitemlist.html -QCanvasItemList Member List | qcanvasitemlist-members.html -QCanvasLine Class | qcanvasline.html -QCanvasLine Member List | qcanvasline-members.html -QCanvasPixmap Class | qcanvaspixmap.html -QCanvasPixmap Member List | qcanvaspixmap-members.html -QCanvasPixmapArray Class | qcanvaspixmaparray.html -QCanvasPixmapArray Member List | qcanvaspixmaparray-members.html -QCanvasPolygon Class | qcanvaspolygon.html -QCanvasPolygon Member List | qcanvaspolygon-members.html -QCanvasPolygonalItem Class | qcanvaspolygonalitem.html -QCanvasPolygonalItem Member List | qcanvaspolygonalitem-members.html -QCanvasRectangle Class | qcanvasrectangle.html -QCanvasRectangle Member List | qcanvasrectangle-members.html -QCanvasSpline Class | qcanvasspline.html -QCanvasSpline Member List | qcanvasspline-members.html -QCanvasSprite Class | qcanvassprite.html -QCanvasSprite Member List | qcanvassprite-members.html -QCanvasText Class | qcanvastext.html -QCanvasText Member List | qcanvastext-members.html -QCanvasView Class | qcanvasview.html -QCanvasView Member List | qcanvasview-members.html +TQCanvas Class | tqcanvas.html +TQCanvas Member List | tqcanvas-members.html +TQCanvasEllipse Class | tqcanvasellipse.html +TQCanvasEllipse Member List | tqcanvasellipse-members.html +TQCanvasItem Class | tqcanvasitem.html +TQCanvasItem Member List | tqcanvasitem-members.html +TQCanvasItemList Class | tqcanvasitemlist.html +TQCanvasItemList Member List | tqcanvasitemlist-members.html +TQCanvasLine Class | tqcanvasline.html +TQCanvasLine Member List | tqcanvasline-members.html +TQCanvasPixmap Class | tqcanvaspixmap.html +TQCanvasPixmap Member List | tqcanvaspixmap-members.html +TQCanvasPixmapArray Class | tqcanvaspixmaparray.html +TQCanvasPixmapArray Member List | tqcanvaspixmaparray-members.html +TQCanvasPolygon Class | tqcanvaspolygon.html +TQCanvasPolygon Member List | tqcanvaspolygon-members.html +TQCanvasPolygonalItem Class | tqcanvaspolygonalitem.html +TQCanvasPolygonalItem Member List | tqcanvaspolygonalitem-members.html +TQCanvasRectangle Class | tqcanvasrectangle.html +TQCanvasRectangle Member List | tqcanvasrectangle-members.html +TQCanvasSpline Class | tqcanvasspline.html +TQCanvasSpline Member List | tqcanvasspline-members.html +TQCanvasSprite Class | tqcanvassprite.html +TQCanvasSprite Member List | tqcanvassprite-members.html +TQCanvasText Class | tqcanvastext.html +TQCanvasText Member List | tqcanvastext-members.html +TQCanvasView Class | tqcanvasview.html +TQCanvasView Member List | tqcanvasview-members.html TQChar Class | qchar.html TQChar Member List | qchar-members.html QCharRef Class | qcharref.html @@ -1188,7 +1188,7 @@ ntqbuffer.h Include File | qbuffer-h.html ntqbutton.h Include File | qbutton-h.html ntqbuttongroup.h Include File | qbuttongroup-h.html ntqcache.h Include File | qcache-h.html -ntqcanvas.h Include File | qcanvas-h.html +tqcanvas.h Include File | tqcanvas-h.html ntqcdestyle.h Include File | qcdestyle-h.html ntqcheckbox.h Include File | qcheckbox-h.html ntqclipboard.h Include File | qclipboard-h.html diff --git a/doc/html/tqcanvas-h.html b/doc/html/tqcanvas-h.html new file mode 100644 index 00000000..85b997e9 --- /dev/null +++ b/doc/html/tqcanvas-h.html @@ -0,0 +1,861 @@ + + + + + +tqcanvas.h Include File + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              tqcanvas.h

              + +

              This is the verbatim text of the tqcanvas.h include file. It is provided only for illustration; the copyright remains with Trolltech. +


              +
              +/**********************************************************************
              +** $Id: qt/tqcanvas.h   3.3.8   edited Jan 11 14:46 $
              +**
              +** Definition of TQCanvas classes
              +**
              +** Created : 991211
              +**
              +** Copyright (C) 1999-2007 Trolltech ASA.  All rights reserved.
              +**
              +** This file is part of the canvas module of the TQt GUI Toolkit.
              +**
              +** This file may be used under the terms of the GNU General Public
              +** License versions 2.0 or 3.0 as published by the Free Software
              +** Foundation and appearing in the file LICENSE.GPL included in the
              +** packaging of this file. Alternatively you may (at your option) use any
              +** later version of the GNU General Public License if such license has
              +** been publicly approved by Trolltech ASA (or its successors, if any)
              +** and the KDE Free TQt Foundation.
              +**
              +** Please review the following information to ensure GNU General
              +** Public Licensing requirements will be met:
              +** http://trolltech.com/products/qt/licenses/licensing/opensource/.
              +** If you are unsure which license is appropriate for your use, please
              +** review the following information:
              +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
              +** or contact the sales department at sales@trolltech.com.
              +**
              +** This file may be used under the terms of the Q Public License as
              +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL
              +** included in the packaging of this file.  Licensees holding valid TQt
              +** Commercial licenses may use this file in accordance with the TQt
              +** Commercial License Agreement provided with the Software.
              +**
              +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
              +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
              +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted
              +** herein.
              +**
              +**********************************************************************/
              +
              +#ifndef TQCANVAS_H
              +#define TQCANVAS_H
              +
              +#ifndef QT_H
              +#include "ntqscrollview.h"
              +#include "ntqpixmap.h"
              +#include "ntqptrlist.h"
              +#include "ntqbrush.h"
              +#include "ntqpen.h"
              +#include "ntqvaluelist.h"
              +#include "ntqpointarray.h"
              +#endif // QT_H
              +
              +#if !defined( TQT_MODULE_CANVAS ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_CANVAS )
              +#define TQM_EXPORT_CANVAS
              +#define TQM_TEMPLATE_EXTERN_CANVAS
              +#else
              +#define TQM_EXPORT_CANVAS TQ_EXPORT
              +#define TQM_TEMPLATE_EXTERN_CANVAS Q_TEMPLATE_EXTERN
              +#endif
              +
              +#ifndef TQT_NO_CANVAS
              +
              +
              +class TQCanvasSprite;
              +class TQCanvasPolygonalItem;
              +class TQCanvasRectangle;
              +class TQCanvasPolygon;
              +class TQCanvasEllipse;
              +class TQCanvasText;
              +class TQCanvasLine;
              +class TQCanvasChunk;
              +class TQCanvas;
              +class TQCanvasItem;
              +class TQCanvasView;
              +class TQCanvasPixmap;
              +
              +#if defined(Q_TEMPLATEDLL) && ( !defined(Q_CC_BOR) || !defined(QT_MAKEDLL) || defined(Q_EXPORT_TEMPLATES) )
              +// MOC_SKIP_BEGIN
              +TQM_TEMPLATE_EXTERN_CANVAS template class TQM_EXPORT_CANVAS TQValueListIterator< TQCanvasItem* >;
              +TQM_TEMPLATE_EXTERN_CANVAS template class TQM_EXPORT_CANVAS TQValueList< TQCanvasItem* >;
              +// MOC_SKIP_END
              +#endif
              +
              +class TQM_EXPORT_CANVAS TQCanvasItemList : public TQValueList<TQCanvasItem*> {
              +public:
              +    void sort();
              +    void drawUnique( TQPainter& painter );
              +    TQCanvasItemList operator+(const TQCanvasItemList &l) const;
              +};
              +
              +
              +class TQCanvasItemExtra;
              +
              +class TQM_EXPORT_CANVAS TQCanvasItem : public TQt
              +{
              +public:
              +    TQCanvasItem(TQCanvas* canvas);
              +    virtual ~TQCanvasItem();
              +
              +    double x() const
              +	{ return myx; }
              +    double y() const
              +	{ return myy; }
              +    double z() const
              +	{ return myz; } // (depth)
              +
              +    virtual void moveBy(double dx, double dy);
              +    void move(double x, double y);
              +    void setX(double a) { move(a,y()); }
              +    void setY(double a) { move(x(),a); }
              +    void setZ(double a) { myz=a; changeChunks(); }
              +
              +    bool animated() const;
              +    virtual void setAnimated(bool y);
              +    virtual void setVelocity( double vx, double vy);
              +    void setXVelocity( double vx ) { setVelocity(vx,yVelocity()); }
              +    void setYVelocity( double vy ) { setVelocity(xVelocity(),vy); }
              +    double xVelocity() const;
              +    double yVelocity() const;
              +    virtual void advance(int stage);
              +
              +    virtual bool collidesWith( const TQCanvasItem* ) const=0;
              +
              +    TQCanvasItemList collisions(bool exact /* NO DEFAULT */ ) const;
              +
              +    virtual void setCanvas(TQCanvas*);
              +
              +    virtual void draw(TQPainter&)=0;
              +
              +    void show();
              +    void hide();
              +
              +    virtual void setVisible(bool yes);
              +    bool isVisible() const
              +	{ return (bool)vis; }
              +    virtual void setSelected(bool yes);
              +    bool isSelected() const
              +	{ return (bool)sel; }
              +    virtual void setEnabled(bool yes);
              +    bool isEnabled() const
              +	{ return (bool)ena; }
              +    virtual void setActive(bool yes);
              +    bool isActive() const
              +	{ return (bool)act; }
              +#ifndef TQT_NO_COMPAT
              +    bool visible() const
              +	{ return (bool)vis; }
              +    bool selected() const
              +	{ return (bool)sel; }
              +    bool enabled() const
              +	{ return (bool)ena; }
              +    bool active() const
              +	{ return (bool)act; }
              +#endif
              +
              +    enum RttiValues {
              +	Rtti_Item = 0,
              +	Rtti_Sprite = 1,
              +	Rtti_PolygonalItem = 2,
              +	Rtti_Text = 3,
              +	Rtti_Polygon = 4,
              +	Rtti_Rectangle = 5,
              +	Rtti_Ellipse = 6,
              +	Rtti_Line = 7,
              +	Rtti_Spline = 8
              +    };
              +
              +    virtual int rtti() const;
              +    static int RTTI;
              +
              +    virtual TQRect boundingRect() const=0;
              +    virtual TQRect boundingRectAdvanced() const;
              +
              +    TQCanvas* canvas() const
              +	{ return cnv; }
              +
              +protected:
              +    void update() { changeChunks(); }
              +
              +private:
              +    // For friendly subclasses...
              +
              +    friend class TQCanvasPolygonalItem;
              +    friend class TQCanvasSprite;
              +    friend class TQCanvasRectangle;
              +    friend class TQCanvasPolygon;
              +    friend class TQCanvasEllipse;
              +    friend class TQCanvasText;
              +    friend class TQCanvasLine;
              +
              +    virtual TQPointArray chunks() const;
              +    virtual void addToChunks();
              +    virtual void removeFromChunks();
              +    virtual void changeChunks();
              +    virtual bool collidesWith( const TQCanvasSprite*,
              +			       const TQCanvasPolygonalItem*,
              +			       const TQCanvasRectangle*,
              +			       const TQCanvasEllipse*,
              +			       const TQCanvasText* ) const = 0;
              +    // End of friend stuff
              +
              +    TQCanvas* cnv;
              +    static TQCanvas* current_canvas;
              +    double myx,myy,myz;
              +    TQCanvasItemExtra *ext;
              +    TQCanvasItemExtra& extra();
              +    uint ani:1;
              +    uint vis:1;
              +    uint val:1;
              +    uint sel:1;
              +    uint ena:1;
              +    uint act:1;
              +};
              +
              +
              +class TQCanvasData;
              +
              +class TQM_EXPORT_CANVAS TQCanvas : public TQObject
              +{
              +    TQ_OBJECT
              +public:
              +    TQCanvas( TQObject* parent = 0, const char* name = 0 );
              +    TQCanvas(int w, int h);
              +    TQCanvas( TQPixmap p, int h, int v, int tilewidth, int tileheight );
              +
              +    virtual ~TQCanvas();
              +
              +    virtual void setTiles( TQPixmap tiles, int h, int v,
              +			   int tilewidth, int tileheight );
              +    virtual void setBackgroundPixmap( const TQPixmap& p );
              +    TQPixmap backgroundPixmap() const;
              +
              +    virtual void setBackgroundColor( const TQColor& c );
              +    TQColor backgroundColor() const;
              +
              +    virtual void setTile( int x, int y, int tilenum );
              +    int tile( int x, int y ) const
              +	{ return grid[x+y*htiles]; }
              +
              +    int tilesHorizontally() const
              +	{ return htiles; }
              +    int tilesVertically() const
              +	{ return vtiles; }
              +
              +    int tileWidth() const
              +	{ return tilew; }
              +    int tileHeight() const
              +	{ return tileh; }
              +
              +    virtual void resize(int width, int height);
              +    int width() const
              +	{ return awidth; }
              +    int height() const
              +	{ return aheight; }
              +    TQSize size() const
              +	{ return TQSize(awidth,aheight); }
              +    TQRect rect() const
              +	{ return TQRect( 0, 0, awidth, aheight ); }
              +    bool onCanvas( int x, int y ) const
              +	{ return x>=0 && y>=0 && x<awidth && y<aheight; }
              +    bool onCanvas( const TQPoint& p ) const
              +	{ return onCanvas(p.x(),p.y()); }
              +    bool validChunk( int x, int y ) const
              +	{ return x>=0 && y>=0 && x<chwidth && y<chheight; }
              +    bool validChunk( const TQPoint& p ) const
              +	{ return validChunk(p.x(),p.y()); }
              +
              +    int chunkSize() const
              +	{ return chunksize; }
              +    virtual void retune(int chunksize, int maxclusters=100);
              +
              +    bool sameChunk(int x1, int y1, int x2, int y2) const
              +	{ return x1/chunksize==x2/chunksize && y1/chunksize==y2/chunksize; }
              +    virtual void setChangedChunk(int i, int j);
              +    virtual void setChangedChunkContaining(int x, int y);
              +    virtual void setAllChanged();
              +    virtual void setChanged(const TQRect& area);
              +    virtual void setUnchanged(const TQRect& area);
              +
              +    // These call setChangedChunk.
              +    void addItemToChunk(TQCanvasItem*, int i, int j);
              +    void removeItemFromChunk(TQCanvasItem*, int i, int j);
              +    void addItemToChunkContaining(TQCanvasItem*, int x, int y);
              +    void removeItemFromChunkContaining(TQCanvasItem*, int x, int y);
              +
              +    TQCanvasItemList allItems();
              +    TQCanvasItemList collisions( const TQPoint&) const;
              +    TQCanvasItemList collisions( const TQRect&) const;
              +    TQCanvasItemList collisions( const TQPointArray& pa, const TQCanvasItem* item,
              +				bool exact) const;
              +
              +    void drawArea(const TQRect&, TQPainter* p, bool double_buffer=FALSE);
              +
              +    // These are for TQCanvasView to call
              +    virtual void addView(TQCanvasView*);
              +    virtual void removeView(TQCanvasView*);
              +    void drawCanvasArea(const TQRect&, TQPainter* p=0, bool double_buffer=TRUE);
              +    void drawViewArea( TQCanvasView* view, TQPainter* p, const TQRect& r, bool dbuf );
              +
              +    // These are for TQCanvasItem to call
              +    virtual void addItem(TQCanvasItem*);
              +    virtual void addAnimation(TQCanvasItem*);
              +    virtual void removeItem(TQCanvasItem*);
              +    virtual void removeAnimation(TQCanvasItem*);
              +
              +    virtual void setAdvancePeriod(int ms);
              +    virtual void setUpdatePeriod(int ms);
              +
              +    virtual void setDoubleBuffering(bool y);
              +
              +signals:
              +    void resized();
              +
              +public slots:
              +    virtual void advance();
              +    virtual void update();
              +
              +protected:
              +    virtual void drawBackground(TQPainter&, const TQRect& area);
              +    virtual void drawForeground(TQPainter&, const TQRect& area);
              +
              +private:
              +    void init(int w, int h, int chunksze=16, int maxclust=100);
              +
              +    TQCanvasChunk& chunk(int i, int j) const;
              +    TQCanvasChunk& chunkContaining(int x, int y) const;
              +
              +    TQRect changeBounds(const TQRect& inarea);
              +    void drawChanges(const TQRect& inarea);
              +
              +    TQPixmap offscr;
              +    int awidth,aheight;
              +    int chunksize;
              +    int maxclusters;
              +    int chwidth,chheight;
              +    TQCanvasChunk* chunks;
              +
              +    TQCanvasData* d;
              +
              +    void initTiles(TQPixmap p, int h, int v, int tilewidth, int tileheight);
              +    ushort *grid;
              +    ushort htiles;
              +    ushort vtiles;
              +    ushort tilew;
              +    ushort tileh;
              +    bool oneone;
              +    TQPixmap pm;
              +    TQTimer* update_timer;
              +    TQColor bgcolor;
              +    bool debug_redraw_areas;
              +    bool dblbuf;
              +
              +    friend void qt_unview(TQCanvas* c);
              +
              +#if defined(TQ_DISABLE_COPY) // Disabled copy constructor and operator=
              +    TQCanvas( const TQCanvas & );
              +    TQCanvas &operator=( const TQCanvas & );
              +#endif
              +};
              +
              +class TQCanvasViewData;
              +
              +class TQM_EXPORT_CANVAS TQCanvasView : public TQScrollView
              +{
              +    TQ_OBJECT
              +public:
              +
              +    TQCanvasView(TQWidget* parent=0, const char* name=0, WFlags f=0);
              +    TQCanvasView(TQCanvas* viewing, TQWidget* parent=0, const char* name=0, WFlags f=0);
              +    ~TQCanvasView();
              +
              +    TQCanvas* canvas() const
              +	{ return viewing; }
              +    void setCanvas(TQCanvas* v);
              +
              +    const TQWMatrix &worldMatrix() const;
              +    const TQWMatrix &inverseWorldMatrix() const;
              +    bool setWorldMatrix( const TQWMatrix & );
              +
              +protected:
              +    void drawContents( TQPainter*, int cx, int cy, int cw, int ch );
              +    TQSize sizeHint() const;
              +
              +private:
              +    void drawContents( TQPainter* );
              +    TQCanvas* viewing;
              +    TQCanvasViewData* d;
              +    friend void qt_unview(TQCanvas* c);
              +
              +private slots:
              +    void cMoving(int,int);
              +    void updateContentsSize();
              +
              +private:
              +#if defined(TQ_DISABLE_COPY) // Disabled copy constructor and operator=
              +    TQCanvasView( const TQCanvasView & );
              +    TQCanvasView &operator=( const TQCanvasView & );
              +#endif
              +};
              +
              +
              +class TQM_EXPORT_CANVAS TQCanvasPixmap : public TQPixmap
              +{
              +public:
              +#ifndef TQT_NO_IMAGEIO
              +    TQCanvasPixmap(const TQString& datafilename);
              +#endif
              +    TQCanvasPixmap(const TQImage& image);
              +    TQCanvasPixmap(const TQPixmap&, const TQPoint& hotspot);
              +    ~TQCanvasPixmap();
              +
              +    int offsetX() const
              +	{ return hotx; }
              +    int offsetY() const
              +	{ return hoty; }
              +    void setOffset(int x, int y) { hotx = x; hoty = y; }
              +
              +private:
              +#if defined(TQ_DISABLE_COPY)
              +    TQCanvasPixmap( const TQCanvasPixmap & );
              +    TQCanvasPixmap &operator=( const TQCanvasPixmap & );
              +#endif
              +    void init(const TQImage&);
              +    void init(const TQPixmap& pixmap, int hx, int hy);
              +
              +    friend class TQCanvasSprite;
              +    friend class TQCanvasPixmapArray;
              +    friend bool qt_testCollision(const TQCanvasSprite* s1, const TQCanvasSprite* s2);
              +
              +    int hotx,hoty;
              +
              +    TQImage* collision_mask;
              +};
              +
              +
              +class TQM_EXPORT_CANVAS TQCanvasPixmapArray
              +{
              +public:
              +    TQCanvasPixmapArray();
              +#ifndef TQT_NO_IMAGEIO
              +    TQCanvasPixmapArray(const TQString& datafilenamepattern, int framecount=0);
              +#endif
              +    // this form is deprecated
              +    TQCanvasPixmapArray(TQPtrList<TQPixmap>, TQPtrList<TQPoint> hotspots);
              +
              +    TQCanvasPixmapArray(TQValueList<TQPixmap>, TQPointArray hotspots = TQPointArray() );
              +    ~TQCanvasPixmapArray();
              +
              +#ifndef TQT_NO_IMAGEIO
              +    bool readPixmaps(const TQString& datafilenamepattern, int framecount=0);
              +    bool readCollisionMasks(const TQString& filenamepattern);
              +#endif
              +
              +    // deprecated
              +    bool operator!(); // Failure check.
              +    bool isValid() const;
              +
              +    TQCanvasPixmap* image(int i) const
              +	{ return img ? img[i] : 0; }
              +    void setImage(int i, TQCanvasPixmap* p);
              +    uint count() const
              +	{ return (uint)framecount; }
              +
              +private:
              +#if defined(TQ_DISABLE_COPY)
              +    TQCanvasPixmapArray( const TQCanvasPixmapArray & );
              +    TQCanvasPixmapArray &operator=( const TQCanvasPixmapArray & );
              +#endif
              +#ifndef TQT_NO_IMAGEIO
              +    bool readPixmaps(const TQString& datafilenamepattern, int framecount, bool maskonly);
              +#endif
              +
              +    void reset();
              +    int framecount;
              +    TQCanvasPixmap** img;
              +};
              +
              +
              +class TQM_EXPORT_CANVAS TQCanvasSprite : public TQCanvasItem
              +{
              +public:
              +    TQCanvasSprite(TQCanvasPixmapArray* array, TQCanvas* canvas);
              +
              +    void setSequence(TQCanvasPixmapArray* seq);
              +
              +    virtual ~TQCanvasSprite();
              +
              +    void move(double x, double y);
              +    virtual void move(double x, double y, int frame);
              +    void setFrame(int);
              +    enum FrameAnimationType { Cycle, Oscillate };
              +    virtual void setFrameAnimation(FrameAnimationType=Cycle, int step=1, int state=0);
              +    int frame() const
              +	{ return frm; }
              +    int frameCount() const
              +	{ return images->count(); }
              +
              +    int rtti() const;
              +    static int RTTI;
              +
              +    bool collidesWith( const TQCanvasItem* ) const;
              +
              +    TQRect boundingRect() const;
              +
              +    // is there a reason for these to be protected? Lars
              +//protected:
              +
              +    int width() const;
              +    int height() const;
              +
              +    int leftEdge() const;
              +    int topEdge() const;
              +    int rightEdge() const;
              +    int bottomEdge() const;
              +
              +    int leftEdge(int nx) const;
              +    int topEdge(int ny) const;
              +    int rightEdge(int nx) const;
              +    int bottomEdge(int ny) const;
              +    TQCanvasPixmap* image() const
              +	{ return images->image(frm); }
              +    virtual TQCanvasPixmap* imageAdvanced() const;
              +    TQCanvasPixmap* image(int f) const
              +	{ return images->image(f); }
              +    virtual void advance(int stage);
              +
              +public:
              +    void draw(TQPainter& painter);
              +
              +private:
              +#if defined(TQ_DISABLE_COPY)
              +    TQCanvasSprite( const TQCanvasSprite & );
              +    TQCanvasSprite &operator=( const TQCanvasSprite & );
              +#endif
              +    void addToChunks();
              +    void removeFromChunks();
              +    void changeChunks();
              +
              +    int frm;
              +    ushort anim_val;
              +    uint anim_state:2;
              +    uint anim_type:14;
              +    bool collidesWith( const TQCanvasSprite*,
              +		       const TQCanvasPolygonalItem*,
              +		       const TQCanvasRectangle*,
              +		       const TQCanvasEllipse*,
              +		       const TQCanvasText* ) const;
              +
              +    friend bool qt_testCollision( const TQCanvasSprite* s1,
              +				  const TQCanvasSprite* s2 );
              +
              +    TQCanvasPixmapArray* images;
              +};
              +
              +class TQPolygonalProcessor;
              +
              +class TQM_EXPORT_CANVAS TQCanvasPolygonalItem : public TQCanvasItem
              +{
              +public:
              +    TQCanvasPolygonalItem(TQCanvas* canvas);
              +    virtual ~TQCanvasPolygonalItem();
              +
              +    bool collidesWith( const TQCanvasItem* ) const;
              +
              +    virtual void setPen(TQPen p);
              +    virtual void setBrush(TQBrush b);
              +
              +    TQPen pen() const
              +	{ return pn; }
              +    TQBrush brush() const
              +	{ return br; }
              +
              +    virtual TQPointArray areaPoints() const=0;
              +    virtual TQPointArray areaPointsAdvanced() const;
              +    TQRect boundingRect() const;
              +
              +    int rtti() const;
              +    static int RTTI;
              +
              +protected:
              +    void draw(TQPainter &);
              +    virtual void drawShape(TQPainter &) = 0;
              +
              +    bool winding() const;
              +    void setWinding(bool);
              +
              +    void invalidate();
              +    bool isValid() const
              +	{ return (bool)val; }
              +
              +private:
              +    void scanPolygon( const TQPointArray& pa, int winding,
              +		      TQPolygonalProcessor& process ) const;
              +    TQPointArray chunks() const;
              +
              +    bool collidesWith( const TQCanvasSprite*,
              +		       const TQCanvasPolygonalItem*,
              +		       const TQCanvasRectangle*,
              +		       const TQCanvasEllipse*,
              +		       const TQCanvasText* ) const;
              +
              +    TQBrush br;
              +    TQPen pn;
              +    uint wind:1;
              +};
              +
              +
              +class TQM_EXPORT_CANVAS TQCanvasRectangle : public TQCanvasPolygonalItem
              +{
              +public:
              +    TQCanvasRectangle(TQCanvas* canvas);
              +    TQCanvasRectangle(const TQRect&, TQCanvas* canvas);
              +    TQCanvasRectangle(int x, int y, int width, int height, TQCanvas* canvas);
              +
              +    ~TQCanvasRectangle();
              +
              +    int width() const;
              +    int height() const;
              +    void setSize(int w, int h);
              +    TQSize size() const
              +	{ return TQSize(w,h); }
              +    TQPointArray areaPoints() const;
              +    TQRect rect() const
              +	{ return TQRect(int(x()),int(y()),w,h); }
              +
              +    bool collidesWith( const TQCanvasItem* ) const;
              +
              +    int rtti() const;
              +    static int RTTI;
              +
              +protected:
              +    void drawShape(TQPainter &);
              +    TQPointArray chunks() const;
              +
              +private:
              +    bool collidesWith(   const TQCanvasSprite*,
              +			 const TQCanvasPolygonalItem*,
              +			 const TQCanvasRectangle*,
              +			 const TQCanvasEllipse*,
              +			 const TQCanvasText* ) const;
              +
              +    int w, h;
              +};
              +
              +
              +class TQM_EXPORT_CANVAS TQCanvasPolygon : public TQCanvasPolygonalItem
              +{
              +public:
              +    TQCanvasPolygon(TQCanvas* canvas);
              +    ~TQCanvasPolygon();
              +    void setPoints(TQPointArray);
              +    TQPointArray points() const;
              +    void moveBy(double dx, double dy);
              +
              +    TQPointArray areaPoints() const;
              +
              +    int rtti() const;
              +    static int RTTI;
              +
              +protected:
              +    void drawShape(TQPainter &);
              +    TQPointArray poly;
              +};
              +
              +
              +class TQM_EXPORT_CANVAS TQCanvasSpline : public TQCanvasPolygon
              +{
              +public:
              +    TQCanvasSpline(TQCanvas* canvas);
              +    ~TQCanvasSpline();
              +
              +    void setControlPoints(TQPointArray, bool closed=TRUE);
              +    TQPointArray controlPoints() const;
              +    bool closed() const;
              +
              +    int rtti() const;
              +    static int RTTI;
              +
              +private:
              +    void recalcPoly();
              +    TQPointArray bez;
              +    bool cl;
              +};
              +
              +
              +class TQM_EXPORT_CANVAS TQCanvasLine : public TQCanvasPolygonalItem
              +{
              +public:
              +    TQCanvasLine(TQCanvas* canvas);
              +    ~TQCanvasLine();
              +    void setPoints(int x1, int y1, int x2, int y2);
              +
              +    TQPoint startPoint() const
              +	{ return TQPoint(x1,y1); }
              +    TQPoint endPoint() const
              +	{ return TQPoint(x2,y2); }
              +
              +    int rtti() const;
              +    static int RTTI;
              +
              +    void setPen(TQPen p);
              +    void moveBy(double dx, double dy);
              +
              +protected:
              +    void drawShape(TQPainter &);
              +    TQPointArray areaPoints() const;
              +
              +private:
              +    int x1,y1,x2,y2;
              +};
              +
              +
              +class TQM_EXPORT_CANVAS TQCanvasEllipse : public TQCanvasPolygonalItem
              +{
              +
              +public:
              +    TQCanvasEllipse( TQCanvas* canvas );
              +    TQCanvasEllipse( int width, int height, TQCanvas* canvas );
              +    TQCanvasEllipse( int width, int height, int startangle, int angle,
              +		    TQCanvas* canvas );
              +
              +    ~TQCanvasEllipse();
              +
              +    int width() const;
              +    int height() const;
              +    void setSize(int w, int h);
              +    void setAngles(int start, int length);
              +    int angleStart() const
              +	{ return a1; }
              +    int angleLength() const
              +	{ return a2; }
              +    TQPointArray areaPoints() const;
              +
              +    bool collidesWith( const TQCanvasItem* ) const;
              +
              +    int rtti() const;
              +    static int RTTI;
              +
              +protected:
              +    void drawShape(TQPainter &);
              +
              +private:
              +    bool collidesWith( const TQCanvasSprite*,
              +		       const TQCanvasPolygonalItem*,
              +		       const TQCanvasRectangle*,
              +		       const TQCanvasEllipse*,
              +		       const TQCanvasText* ) const;
              +    int w, h;
              +    int a1, a2;
              +};
              +
              +
              +class TQCanvasTextExtra;
              +
              +class TQM_EXPORT_CANVAS TQCanvasText : public TQCanvasItem
              +{
              +public:
              +    TQCanvasText(TQCanvas* canvas);
              +    TQCanvasText(const TQString&, TQCanvas* canvas);
              +    TQCanvasText(const TQString&, TQFont, TQCanvas* canvas);
              +
              +    virtual ~TQCanvasText();
              +
              +    void setText( const TQString& );
              +    void setFont( const TQFont& );
              +    void setColor( const TQColor& );
              +    TQString text() const;
              +    TQFont font() const;
              +    TQColor color() const;
              +
              +    void moveBy(double dx, double dy);
              +
              +    int textFlags() const
              +	{ return flags; }
              +    void setTextFlags(int);
              +
              +    TQRect boundingRect() const;
              +
              +    bool collidesWith( const TQCanvasItem* ) const;
              +
              +    int rtti() const;
              +    static int RTTI;
              +
              +protected:
              +    virtual void draw(TQPainter&);
              +
              +private:
              +#if defined(TQ_DISABLE_COPY)
              +    TQCanvasText( const TQCanvasText & );
              +    TQCanvasText &operator=( const TQCanvasText & );
              +#endif
              +    void addToChunks();
              +    void removeFromChunks();
              +    void changeChunks();
              +
              +    void setRect();
              +    TQRect brect;
              +    TQString txt;
              +    int flags;
              +    TQFont fnt;
              +    TQColor col;
              +    TQCanvasTextExtra* extra;
              +
              +    bool collidesWith(   const TQCanvasSprite*,
              +			 const TQCanvasPolygonalItem*,
              +			 const TQCanvasRectangle*,
              +			 const TQCanvasEllipse*,
              +			 const TQCanvasText* ) const;
              +};
              +
              +#define Q_DEFINED_QCANVAS
              +#include "ntqwinexport.h"
              +#endif // TQT_NO_CANVAS
              +
              +#endif // TQCANVAS_H
              +
              + +


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvas-members.html b/doc/html/tqcanvas-members.html new file mode 100644 index 00000000..2ba148f1 --- /dev/null +++ b/doc/html/tqcanvas-members.html @@ -0,0 +1,124 @@ + + + + + +TQCanvas Member List + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              Complete Member List for TQCanvas

              + +

              This is the complete list of member functions for +TQCanvas, including inherited members. + +

              + +


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvas.html b/doc/html/tqcanvas.html new file mode 100644 index 00000000..69653726 --- /dev/null +++ b/doc/html/tqcanvas.html @@ -0,0 +1,588 @@ + + + + + +TQCanvas Class + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              TQCanvas Class Reference
              [canvas module]

              + +

              The TQCanvas class provides a 2D area that can contain TQCanvasItem objects. +More... +

              #include <tqcanvas.h> +

              Inherits TQObject. +

              List of all member functions. +

              Public Members

              + +

              Public Slots

              + +

              Signals

              + +

              Protected Members

              +
                +
              • virtual void drawBackground ( TQPainter & painter, const TQRect & clip )
              • +
              • virtual void drawForeground ( TQPainter & painter, const TQRect & clip )
              • +
              +

              Detailed Description

              + + +The TQCanvas class provides a 2D area that can contain TQCanvasItem objects. + +

              + + + + +

              The TQCanvas class manages its 2D graphic area and all the canvas +items the area contains. The canvas has no visual appearance of +its own. Instead, it is displayed on screen using a TQCanvasView. +Multiple TQCanvasView widgets may be associated with a canvas to +provide multiple views of the same canvas. +

              The canvas is optimized for large numbers of items, particularly +where only a small percentage of the items change at any +one time. If the entire display changes very frequently, you should +consider using your own custom TQScrollView subclass. +

              TQt provides a rich +set of canvas item classes, e.g. TQCanvasEllipse, TQCanvasLine, +TQCanvasPolygon, TQCanvasPolygonalItem, TQCanvasRectangle, TQCanvasSpline, +TQCanvasSprite and TQCanvasText. You can subclass to create your own +canvas items; TQCanvasPolygonalItem is the most common base class used +for this purpose. +

              Items appear on the canvas after their show() function has been called (or setVisible(TRUE)), and after +update() has been called. The canvas only shows items that are +visible, and then only if +update() is called. (By default the canvas is white and so are +canvas items, so if nothing appears try changing colors.) +

              If you created the canvas without passing a width and height to +the constructor you must also call resize(). +

              Although a canvas may appear to be similar to a widget with child +widgets, there are several notable differences: +

                +
              • Canvas items are usually much faster to manipulate and redraw than +child widgets, with the speed advantage becoming especially great when +there are many canvas items and non-rectangular items. In most +situations canvas items are also a lot more memory efficient than child +widgets. +

              • It's easy to detect overlapping items (collision detection). +

              • The canvas can be larger than a widget. A million-by-million canvas +is perfectly possible. At such a size a widget might be very +inefficient, and some window systems might not support it at all, +whereas TQCanvas scales well. Even with a billion pixels and a million +items, finding a particular canvas item, detecting collisions, etc., +is still fast (though the memory consumption may be prohibitive +at such extremes). +

              • Two or more TQCanvasView objects can view the same canvas. +

              • An arbitrary transformation matrix can be set on each TQCanvasView +which makes it easy to zoom, rotate or shear the viewed canvas. +

              • Widgets provide a lot more functionality, such as input (TQKeyEvent, +TQMouseEvent etc.) and layout management (TQGridLayout etc.). +

              +

              A canvas consists of a background, a number of canvas items organized by +x, y and z coordinates, and a foreground. A canvas item's z coordinate +can be treated as a layer number -- canvas items with a higher z +coordinate appear in front of canvas items with a lower z coordinate. +

              The background is white by default, but can be set to a different color +using setBackgroundColor(), or to a repeated pixmap using +setBackgroundPixmap() or to a mosaic of smaller pixmaps using +setTiles(). Individual tiles can be set with setTile(). There +are corresponding get functions, e.g. backgroundColor() and +backgroundPixmap(). +

              Note that TQCanvas does not inherit from TQWidget, even though it has some +functions which provide the same functionality as those in TQWidget. One +of these is setBackgroundPixmap(); some others are resize(), size(), +width() and height(). TQCanvasView is the widget used to display a +canvas on the screen. +

              Canvas items are added to a canvas by constructing them and passing the +canvas to the canvas item's constructor. An item can be moved to a +different canvas using TQCanvasItem::setCanvas(). +

              Canvas items are movable (and in the case of TQCanvasSprites, animated) +objects that inherit TQCanvasItem. Each canvas item has a position on the +canvas (x, y coordinates) and a height (z coordinate), all of which are +held as floating-point numbers. Moving canvas items also have x and y +velocities. It's possible for a canvas item to be outside the canvas +(for example TQCanvasItem::x() is greater than width()). When a canvas +item is off the canvas, onCanvas() returns FALSE and the canvas +disregards the item. (Canvas items off the canvas do not slow down any +of the common operations on the canvas.) +

              Canvas items can be moved with TQCanvasItem::move(). The advance() +function moves all TQCanvasItem::animated() canvas items and +setAdvancePeriod() makes TQCanvas move them automatically on a periodic +basis. In the context of the TQCanvas classes, to `animate' a canvas item +is to set it in motion, i.e. using TQCanvasItem::setVelocity(). Animation +of a canvas item itself, i.e. items which change over time, is enabled +by calling TQCanvasSprite::setFrameAnimation(), or more generally by +subclassing and reimplementing TQCanvasItem::advance(). To detect collisions +use one of the TQCanvasItem::collisions() functions. +

              The changed parts of the canvas are redrawn (if they are visible in a +canvas view) whenever update() is called. You can either call update() +manually after having changed the contents of the canvas, or force +periodic updates using setUpdatePeriod(). If you have moving objects on +the canvas, you must call advance() every time the objects should +move one step further. Periodic calls to advance() can be forced using +setAdvancePeriod(). The advance() function will call +TQCanvasItem::advance() on every item that is animated and trigger an update of the +affected areas afterwards. (A canvas item that is `animated' is simply +a canvas item that is in motion.) +

              TQCanvas organizes its canvas items into chunks; these are areas on +the canvas that are used to speed up most operations. Many operations +start by eliminating most chunks (i.e. those which haven't changed) +and then process only the canvas items that are in the few interesting +(i.e. changed) chunks. A valid chunk, validChunk(), is one which is on +the canvas. +

              The chunk size is a key factor to TQCanvas's speed: if there are too many +chunks, the speed benefit of grouping canvas items into chunks is +reduced. If the chunks are too large, it takes too long to process each +one. The TQCanvas constructor tries to pick a suitable size, but you +can call retune() to change it at any time. The chunkSize() function +returns the current chunk size. The canvas items always make sure +they're in the right chunks; all you need to make sure of is that +the canvas uses the right chunk size. A good rule of thumb is that +the size should be a bit smaller than the average canvas item +size. If you have moving objects, the chunk size should be a bit +smaller than the average size of the moving items. +

              The foreground is normally nothing, but if you reimplement +drawForeground(), you can draw things in front of all the canvas +items. +

              Areas can be set as changed with setChanged() and set unchanged with +setUnchanged(). The entire canvas can be set as changed with +setAllChanged(). A list of all the items on the canvas is returned by +allItems(). +

              An area can be copied (painted) to a TQPainter with drawArea(). +

              If the canvas is resized it emits the resized() signal. +

              The examples/canvas application and the 2D graphics page of the +examples/demo application demonstrate many of TQCanvas's facilities. +

              See also TQCanvasView, TQCanvasItem, Abstract Widget Classes, Graphics Classes, and Image Processing Classes. + +


              Member Function Documentation

              +

              TQCanvas::TQCanvas ( TQObject * parent = 0, const char * name = 0 ) +

              +Create a TQCanvas with no size. parent and name are passed to +the TQObject superclass. +

              Warning: You must call resize() at some time after creation to +be able to use the canvas. + +

              TQCanvas::TQCanvas ( int w, int h ) +

              +Constructs a TQCanvas that is w pixels wide and h pixels high. + +

              TQCanvas::TQCanvas ( TQPixmap p, int h, int v, int tilewidth, int tileheight ) +

              +Constructs a TQCanvas which will be composed of h tiles +horizontally and v tiles vertically. Each tile will be an image +tilewidth by tileheight pixels taken from pixmap p. +

              The pixmap p is a list of tiles, arranged left to right, (and +in the case of pixmaps that have multiple rows of tiles, top to +bottom), with tile 0 in the top-left corner, tile 1 next to the +right, and so on, e.g. +

              +
              0 1 2 3 +
              4 5 6 7 +
              +

              The TQCanvas is initially sized to show exactly the given number of +tiles horizontally and vertically. If it is resized to be larger, +the entire matrix of tiles will be repeated as often as necessary +to cover the area. If it is smaller, tiles to the right and bottom +will not be visible. +

              See also setTiles(). + +

              TQCanvas::~TQCanvas () [virtual] +

              +Destroys the canvas and all the canvas's canvas items. + +

              void TQCanvas::advance () [virtual slot] +

              +Moves all TQCanvasItem::animated() canvas items on the canvas and +refreshes all changes to all views of the canvas. (An `animated' +item is an item that is in motion; see setVelocity().) +

              The advance takes place in two phases. In phase 0, the +TQCanvasItem::advance() function of each TQCanvasItem::animated() +canvas item is called with paramater 0. Then all these canvas +items are called again, with parameter 1. In phase 0, the canvas +items should not change position, merely examine other items on +the canvas for which special processing is required, such as +collisions between items. In phase 1, all canvas items should +change positions, ignoring any other items on the canvas. This +two-phase approach allows for considerations of "fairness", +although no TQCanvasItem subclasses supplied with TQt do anything +interesting in phase 0. +

              The canvas can be configured to call this function periodically +with setAdvancePeriod(). +

              See also update(). + +

              TQCanvasItemList TQCanvas::allItems () +

              +Returns a list of all the items in the canvas. + +

              TQColor TQCanvas::backgroundColor () const +

              +Returns the color set by setBackgroundColor(). By default, this is +white. +

              This function is not a reimplementation of +TQWidget::backgroundColor() (TQCanvas is not a subclass of TQWidget), +but all TQCanvasViews that are viewing the canvas will set their +backgrounds to this color. +

              See also setBackgroundColor() and backgroundPixmap(). + +

              TQPixmap TQCanvas::backgroundPixmap () const +

              +Returns the pixmap set by setBackgroundPixmap(). By default, +this is a null pixmap. +

              See also setBackgroundPixmap() and backgroundColor(). + +

              int TQCanvas::chunkSize () const +

              + +

              Returns the chunk size of the canvas. +

              See also retune(). + +

              TQCanvasItemList TQCanvas::collisions ( const TQPoint & p ) const +

              +Returns a list of canvas items that collide with the point p. +The list is ordered by z coordinates, from highest z coordinate +(front-most item) to lowest z coordinate (rear-most item). + +

              TQCanvasItemList TQCanvas::collisions ( const TQRect & r ) const +

              +This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +

              Returns a list of items which collide with the rectangle r. The +list is ordered by z coordinates, from highest z coordinate +(front-most item) to lowest z coordinate (rear-most item). + +

              TQCanvasItemList TQCanvas::collisions ( const TQPointArray & chunklist, const TQCanvasItem * item, bool exact ) const +

              +This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +

              Returns a list of canvas items which intersect with the chunks +listed in chunklist, excluding item. If exact is TRUE, +only those which actually collide with item are returned; otherwise canvas items +are included just for being in the chunks. +

              This is a utility function mainly used to implement the simpler +TQCanvasItem::collisions() function. + +

              void TQCanvas::drawArea ( const TQRect & clip, TQPainter * painter, bool dbuf = FALSE ) +

              +Paints all canvas items that are in the area clip to painter, using double-buffering if dbuf is TRUE. +

              e.g. to print the canvas to a printer: +

              +    TQPrinter pr;
              +    if ( pr.setup() ) {
              +        TQPainter p(&pr);
              +        canvas.drawArea( canvas.rect(), &p );
              +    }
              +    
              + + +

              Example: canvas/canvas.cpp. +

              void TQCanvas::drawBackground ( TQPainter & painter, const TQRect & clip ) [virtual protected] +

              +This virtual function is called for all updates of the canvas. It +renders any background graphics using the painter painter, in +the area clip. If the canvas has a background pixmap or a tiled +background, that graphic is used, otherwise the canvas is cleared +using the background color. +

              If the graphics for an area change, you must explicitly call +setChanged(const TQRect&) for the result to be visible when +update() is next called. +

              See also setBackgroundColor(), setBackgroundPixmap(), and setTiles(). + +

              void TQCanvas::drawForeground ( TQPainter & painter, const TQRect & clip ) [virtual protected] +

              +This virtual function is called for all updates of the canvas. It +renders any foreground graphics using the painter painter, in +the area clip. +

              If the graphics for an area change, you must explicitly call +setChanged(const TQRect&) for the result to be visible when +update() is next called. +

              The default is to draw nothing. + +

              int TQCanvas::height () const +

              + +

              Returns the height of the canvas, in pixels. + +

              Example: canvas/canvas.cpp. +

              bool TQCanvas::onCanvas ( int x, int y ) const +

              + +

              Returns TRUE if the pixel position (x, y) is on the canvas; +otherwise returns FALSE. +

              See also validChunk(). + +

              bool TQCanvas::onCanvas ( const TQPoint & p ) const +

              + +This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +

              Returns TRUE if the pixel position p is on the canvas; +otherwise returns FALSE. +

              See also validChunk(). + +

              TQRect TQCanvas::rect () const +

              + +

              Returns a rectangle the size of the canvas. + +

              void TQCanvas::resize ( int w, int h ) [virtual] +

              +Changes the size of the canvas to have a width of w and a +height of h. This is a slow operation. + +

              Examples: canvas/canvas.cpp and chart/chartform.cpp. +

              void TQCanvas::resized () [signal] +

              + +

              This signal is emitted whenever the canvas is resized. Each +TQCanvasView connects to this signal to keep the scrollview's size +correct. + +

              void TQCanvas::retune ( int chunksze, int mxclusters = 100 ) [virtual] +

              +Change the efficiency tuning parameters to mxclusters clusters, +each of size chunksze. This is a slow operation if there are +many objects on the canvas. +

              The canvas is divided into chunks which are rectangular areas chunksze wide by chunksze high. Use a chunk size which is about +the average size of the canvas items. If you choose a chunk size +which is too small it will increase the amount of calculation +required when drawing since each change will affect many chunks. +If you choose a chunk size which is too large the amount of +drawing required will increase because for each change, a lot of +drawing will be required since there will be many (unchanged) +canvas items which are in the same chunk as the changed canvas +items. +

              Internally, a canvas uses a low-resolution "chunk matrix" to keep +track of all the items in the canvas. A 64x64 chunk matrix is the +default for a 1024x1024 pixel canvas, where each chunk collects +canvas items in a 16x16 pixel square. This default is also +affected by setTiles(). You can tune this default using this +function. For example if you have a very large canvas and want to +trade off speed for memory then you might set the chunk size to 32 +or 64. +

              The mxclusters argument is the number of rectangular groups of +chunks that will be separately drawn. If the canvas has a large +number of small, dispersed items, this should be about that +number. Our testing suggests that a large number of clusters is +almost always best. +

              +

              void TQCanvas::setAdvancePeriod ( int ms ) [virtual] +

              +Sets the canvas to call advance() every ms milliseconds. Any +previous setting by setAdvancePeriod() or setUpdatePeriod() is +overridden. +

              If ms is less than 0 advancing will be stopped. + +

              Example: canvas/main.cpp. +

              void TQCanvas::setAllChanged () [virtual] +

              +Marks the whole canvas as changed. +All views of the canvas will be entirely redrawn when +update() is called next. + +

              void TQCanvas::setBackgroundColor ( const TQColor & c ) [virtual] +

              +Sets the solid background to be the color c. +

              See also backgroundColor(), setBackgroundPixmap(), and setTiles(). + +

              void TQCanvas::setBackgroundPixmap ( const TQPixmap & p ) [virtual] +

              +Sets the solid background to be the pixmap p repeated as +necessary to cover the entire canvas. +

              See also backgroundPixmap(), setBackgroundColor(), and setTiles(). + +

              void TQCanvas::setChanged ( const TQRect & area ) [virtual] +

              +Marks area as changed. This area will be redrawn in all +views that are showing it when update() is called next. + +

              void TQCanvas::setDoubleBuffering ( bool y ) [virtual] +

              +If y is TRUE (the default) double-buffering is switched on; +otherwise double-buffering is switched off. +

              Turning off double-buffering causes the redrawn areas to flicker a +little and also gives a (usually small) performance improvement. + +

              Example: canvas/canvas.cpp. +

              void TQCanvas::setTile ( int x, int y, int tilenum ) [virtual] +

              +Sets the tile at (x, y) to use tile number tilenum, which +is an index into the tile pixmaps. The canvas will update +appropriately when update() is next called. +

              The images are taken from the pixmap set by setTiles() and are +arranged left to right, (and in the case of pixmaps that have +multiple rows of tiles, top to bottom), with tile 0 in the +top-left corner, tile 1 next to the right, and so on, e.g. +

              +
              0 1 2 3 +
              4 5 6 7 +
              +

              See also tile() and setTiles(). + +

              void TQCanvas::setTiles ( TQPixmap p, int h, int v, int tilewidth, int tileheight ) [virtual] +

              +Sets the TQCanvas to be composed of h tiles horizontally and v tiles vertically. Each tile will be an image tilewidth by tileheight pixels from pixmap p. +

              The pixmap p is a list of tiles, arranged left to right, (and +in the case of pixmaps that have multiple rows of tiles, top to +bottom), with tile 0 in the top-left corner, tile 1 next to the +right, and so on, e.g. +

              +
              0 1 2 3 +
              4 5 6 7 +
              +

              If the canvas is larger than the matrix of tiles, the entire +matrix is repeated as necessary to cover the whole canvas. If it +is smaller, tiles to the right and bottom are not visible. +

              The width and height of p must be a multiple of tilewidth +and tileheight. If they are not the function will do nothing. +

              If you want to unset any tiling set, then just pass in a null +pixmap and 0 for h, v, tilewidth, and +tileheight. + +

              void TQCanvas::setUnchanged ( const TQRect & area ) [virtual] +

              +Marks area as unchanged. The area will not be redrawn in +the views for the next update(), unless it is marked or changed +again before the next call to update(). + +

              void TQCanvas::setUpdatePeriod ( int ms ) [virtual] +

              +Sets the canvas to call update() every ms milliseconds. Any +previous setting by setAdvancePeriod() or setUpdatePeriod() is +overridden. +

              If ms is less than 0 automatic updating will be stopped. + +

              TQSize TQCanvas::size () const +

              + +

              Returns the size of the canvas, in pixels. + +

              int TQCanvas::tile ( int x, int y ) const +

              + +

              Returns the tile at position (x, y). Initially, all tiles +are 0. +

              The parameters must be within range, i.e. +0 < x < tilesHorizontally() and +0 < y < tilesVertically(). +

              See also setTile(). + +

              int TQCanvas::tileHeight () const +

              + +

              Returns the height of each tile. + +

              int TQCanvas::tileWidth () const +

              + +

              Returns the width of each tile. + +

              int TQCanvas::tilesHorizontally () const +

              + +

              Returns the number of tiles horizontally. + +

              int TQCanvas::tilesVertically () const +

              + +

              Returns the number of tiles vertically. + +

              void TQCanvas::update () [virtual slot] +

              +Repaints changed areas in all views of the canvas. +

              See also advance(). + +

              bool TQCanvas::validChunk ( int x, int y ) const +

              + +

              Returns TRUE if the chunk position (x, y) is on the canvas; +otherwise returns FALSE. +

              See also onCanvas(). + +

              bool TQCanvas::validChunk ( const TQPoint & p ) const +

              + +This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +

              Returns TRUE if the chunk position p is on the canvas; otherwise +returns FALSE. +

              See also onCanvas(). + +

              int TQCanvas::width () const +

              + +

              Returns the width of the canvas, in pixels. + +

              Example: canvas/canvas.cpp. + +


              +This file is part of the TQt toolkit. +Copyright © 1995-2007 +Trolltech. All Rights Reserved.


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvas.png b/doc/html/tqcanvas.png new file mode 100644 index 00000000..50688f52 Binary files /dev/null and b/doc/html/tqcanvas.png differ diff --git a/doc/html/tqcanvasellipse-members.html b/doc/html/tqcanvasellipse-members.html new file mode 100644 index 00000000..b02997d8 --- /dev/null +++ b/doc/html/tqcanvasellipse-members.html @@ -0,0 +1,104 @@ + + + + + +TQCanvasEllipse Member List + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              Complete Member List for TQCanvasEllipse

              + +

              This is the complete list of member functions for +TQCanvasEllipse, including inherited members. + +

              + +


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvasellipse.html b/doc/html/tqcanvasellipse.html new file mode 100644 index 00000000..50920ce3 --- /dev/null +++ b/doc/html/tqcanvasellipse.html @@ -0,0 +1,169 @@ + + + + + +TQCanvasEllipse Class + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              TQCanvasEllipse Class Reference
              [canvas module]

              + +

              The TQCanvasEllipse class provides an ellipse or ellipse segment on a TQCanvas. +More... +

              #include <tqcanvas.h> +

              Inherits TQCanvasPolygonalItem. +

              List of all member functions. +

              Public Members

              + +

              Protected Members

              +
                +
              • virtual void drawShape ( TQPainter & p )
              • +
              +

              Detailed Description

              + + +The TQCanvasEllipse class provides an ellipse or ellipse segment on a TQCanvas. + +

              + + +

              A canvas item that paints an ellipse or ellipse segment with a TQBrush. +The ellipse's height, width, start angle and angle length can be set +at construction time. The size can be changed at runtime with +setSize(), and the angles can be changed (if you're displaying an +ellipse segment rather than a whole ellipse) with setAngles(). +

              Note that angles are specified in 16ths of a degree. +

              +

              Ellipse
              +

              If a start angle and length angle are set then an ellipse segment +will be drawn. The start angle is the angle that goes from zero in a +counter-clockwise direction (shown in green in the diagram). The +length angle is the angle from the start angle in a +counter-clockwise direction (shown in blue in the diagram). The blue +segment is the segment of the ellipse that would be drawn. If no +start angle and length angle are specified the entire ellipse is +drawn. +

              The ellipse can be drawn on a painter with drawShape(). +

              Like any other canvas item ellipses can be moved with move() and +moveBy(), or by setting coordinates with setX(), setY() and setZ(). +

              Note: TQCanvasEllipse does not use the pen. +

              See also Graphics Classes and Image Processing Classes. + +


              Member Function Documentation

              +

              TQCanvasEllipse::TQCanvasEllipse ( TQCanvas * canvas ) +

              +Constructs a 32x32 ellipse, centered at (0, 0) on canvas. + +

              TQCanvasEllipse::TQCanvasEllipse ( int width, int height, TQCanvas * canvas ) +

              +Constructs a width by height pixel ellipse, centered at +(0, 0) on canvas. + +

              TQCanvasEllipse::TQCanvasEllipse ( int width, int height, int startangle, int angle, TQCanvas * canvas ) +

              +Constructs a width by height pixel ellipse, centered at +(0, 0) on canvas. Only a segment of the ellipse is drawn, +starting at angle startangle, and extending for angle angle +(the angle length). +

              Note that angles are specified in +1/16ths of a degree. + +

              TQCanvasEllipse::~TQCanvasEllipse () +

              +Destroys the ellipse. + +

              int TQCanvasEllipse::angleLength () const +

              + +

              Returns the length angle (the extent of the ellipse segment) in +16ths of a degree. Initially this will be 360 * 16 (a complete +ellipse). +

              See also setAngles() and angleStart(). + +

              int TQCanvasEllipse::angleStart () const +

              + +

              Returns the start angle in 16ths of a degree. Initially +this will be 0. +

              See also setAngles() and angleLength(). + +

              void TQCanvasEllipse::drawShape ( TQPainter & p ) [virtual protected] +

              +Draws the ellipse, centered at x(), y() using the painter p. +

              Note that TQCanvasEllipse does not support an outline (the pen is +always NoPen). + +

              Reimplemented from TQCanvasPolygonalItem. +

              int TQCanvasEllipse::height () const +

              +Returns the height of the ellipse. + +

              int TQCanvasEllipse::rtti () const [virtual] +

              +Returns 6 (TQCanvasItem::Rtti_Ellipse). +

              See also TQCanvasItem::rtti(). + +

              Reimplemented from TQCanvasPolygonalItem. +

              void TQCanvasEllipse::setAngles ( int start, int length ) +

              +Sets the angles for the ellipse. The start angle is start and +the extent of the segment is length (the angle length) from the +start. The angles are specified in 16ths of a degree. By +default the ellipse will start at 0 and have an angle length of +360 * 16 (a complete ellipse). +

              See also angleStart() and angleLength(). + +

              void TQCanvasEllipse::setSize ( int width, int height ) +

              +Sets the width and height of the ellipse. + +

              int TQCanvasEllipse::width () const +

              +Returns the width of the ellipse. + + +

              +This file is part of the TQt toolkit. +Copyright © 1995-2007 +Trolltech. All Rights Reserved.


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvasellipse.png b/doc/html/tqcanvasellipse.png new file mode 100644 index 00000000..59593518 Binary files /dev/null and b/doc/html/tqcanvasellipse.png differ diff --git a/doc/html/tqcanvasitem-members.html b/doc/html/tqcanvasitem-members.html new file mode 100644 index 00000000..a826ac2e --- /dev/null +++ b/doc/html/tqcanvasitem-members.html @@ -0,0 +1,87 @@ + + + + + +TQCanvasItem Member List + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              Complete Member List for TQCanvasItem

              + +

              This is the complete list of member functions for +TQCanvasItem, including inherited members. + +

              + +


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvasitem.html b/doc/html/tqcanvasitem.html new file mode 100644 index 00000000..17e5f807 --- /dev/null +++ b/doc/html/tqcanvasitem.html @@ -0,0 +1,480 @@ + + + + + +TQCanvasItem Class + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              TQCanvasItem Class Reference
              [canvas module]

              + +

              The TQCanvasItem class provides an abstract graphic object on a TQCanvas. +More... +

              #include <tqcanvas.h> +

              Inherits TQt. +

              Inherited by TQCanvasSprite, TQCanvasPolygonalItem, and TQCanvasText. +

              List of all member functions. +

              Public Members

              +
                +
              • TQCanvasItem ( TQCanvas * canvas )
              • +
              • virtual ~TQCanvasItem ()
              • +
              • double x () const
              • +
              • double y () const
              • +
              • double z () const
              • +
              • virtual void moveBy ( double dx, double dy )
              • +
              • void move ( double x, double y )
              • +
              • void setX ( double x )
              • +
              • void setY ( double y )
              • +
              • void setZ ( double z )
              • +
              • bool animated () const
              • +
              • virtual void setAnimated ( bool y )
              • +
              • virtual void setVelocity ( double vx, double vy )
              • +
              • void setXVelocity ( double vx )
              • +
              • void setYVelocity ( double vy )
              • +
              • double xVelocity () const
              • +
              • double yVelocity () const
              • +
              • virtual void advance ( int phase )
              • +
              • virtual bool collidesWith ( const TQCanvasItem * other ) const = 0
              • +
              • TQCanvasItemList collisions ( bool exact ) const
              • +
              • virtual void setCanvas ( TQCanvas * c )
              • +
              • virtual void draw ( TQPainter & painter ) = 0
              • +
              • void show ()
              • +
              • void hide ()
              • +
              • virtual void setVisible ( bool yes )
              • +
              • bool isVisible () const
              • +
              • virtual void setSelected ( bool yes )
              • +
              • bool isSelected () const
              • +
              • virtual void setEnabled ( bool yes )
              • +
              • bool isEnabled () const
              • +
              • virtual void setActive ( bool yes )
              • +
              • bool isActive () const
              • +
              • bool visible () const  (obsolete)
              • +
              • bool selected () const  (obsolete)
              • +
              • bool enabled () const  (obsolete)
              • +
              • bool active () const  (obsolete)
              • +
              • enum RttiValues { Rtti_Item = 0, Rtti_Sprite = 1, Rtti_PolygonalItem = 2, Rtti_Text = 3, Rtti_Polygon = 4, Rtti_Rectangle = 5, Rtti_Ellipse = 6, Rtti_Line = 7, Rtti_Spline = 8 }
              • +
              • virtual int rtti () const
              • +
              • virtual TQRect boundingRect () const = 0
              • +
              • virtual TQRect boundingRectAdvanced () const
              • +
              • TQCanvas * canvas () const
              • +
              +

              Protected Members

              + +

              Detailed Description

              + + +The TQCanvasItem class provides an abstract graphic object on a TQCanvas. + +

              + + +

              A variety of TQCanvasItem subclasses provide immediately usable +behaviour. This class is a pure abstract superclass providing the +behaviour that is shared among all the concrete canvas item classes. +TQCanvasItem is not intended for direct subclassing. It is much easier +to subclass one of its subclasses, e.g. TQCanvasPolygonalItem (the +commonest base class), TQCanvasRectangle, TQCanvasSprite, TQCanvasEllipse +or TQCanvasText. +

              Canvas items are added to a canvas by constructing them and passing the +canvas to the canvas item's constructor. An item can be moved to a +different canvas using setCanvas(). +

              Items appear on the canvas after their show() +function has been called (or setVisible(TRUE)), and after update() has been called. The +canvas only shows items that are visible, +and then only if update() is called. If you created the canvas +without passing a width and height to the constructor you'll also need +to call resize(). Since the canvas +background defaults to white and canvas items default to white, +you may need to change colors to see your items. +

              A TQCanvasItem object can be moved in the x(), y() and z() dimensions +using functions such as move(), moveBy(), setX(), setY() and setZ(). A +canvas item can be set in motion, `animated', using setAnimated() and +given a velocity in the x and y directions with setXVelocity() and +setYVelocity() -- the same effect can be achieved by calling +setVelocity(). Use the collidesWith() function to see if the canvas item +will collide on the next advance(1) and use collisions() to see what +collisions have occurred. +

              Use TQCanvasSprite or your own subclass of TQCanvasSprite to create canvas +items which are animated, i.e. which change over time. +

              The size of a canvas item is given by boundingRect(). Use +boundingRectAdvanced() to see what the size of the canvas item will be +after the next advance(1) call. +

              The rtti() function is used for identifying subclasses of TQCanvasItem. +The canvas() function returns a pointer to the canvas which contains the +canvas item. +

              TQCanvasItem provides the show() and isVisible() functions like those in +TQWidget. +

              TQCanvasItem also provides the setEnabled(), setActive() and +setSelected() functions; these functions set the relevant boolean and +cause a repaint but the boolean values they set are not used in +TQCanvasItem itself. You can make use of these booleans in your subclasses. +

              By default, canvas items have no velocity, no size, and are not in +motion. The subclasses provided in TQt do not change these defaults +except where noted. +

              See also Graphics Classes and Image Processing Classes. + +


              Member Type Documentation

              +

              TQCanvasItem::RttiValues

              + +

              This enum is used to name the different types of canvas item. +

                +
              • TQCanvasItem::Rtti_Item - Canvas item abstract base class +
              • TQCanvasItem::Rtti_Ellipse +
              • TQCanvasItem::Rtti_Line +
              • TQCanvasItem::Rtti_Polygon +
              • TQCanvasItem::Rtti_PolygonalItem +
              • TQCanvasItem::Rtti_Rectangle +
              • TQCanvasItem::Rtti_Spline +
              • TQCanvasItem::Rtti_Sprite +
              • TQCanvasItem::Rtti_Text +

              +


              Member Function Documentation

              +

              TQCanvasItem::TQCanvasItem ( TQCanvas * canvas ) +

              +Constructs a TQCanvasItem on canvas canvas. +

              See also setCanvas(). + +

              TQCanvasItem::~TQCanvasItem () [virtual] +

              +Destroys the TQCanvasItem and removes it from its canvas. + +

              bool TQCanvasItem::active () const +

              +This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. +

              +Use isActive() instead. + +

              void TQCanvasItem::advance ( int phase ) [virtual] +

              +The default implementation moves the canvas item, if it is +animated(), by the preset velocity if phase is 1, and does +nothing if phase is 0. +

              Note that if you reimplement this function, the reimplementation +must not change the canvas in any way, for example it must not add +or remove items. +

              See also TQCanvas::advance() and setVelocity(). + +

              Example: canvas/canvas.cpp. +

              Reimplemented in TQCanvasSprite. +

              bool TQCanvasItem::animated () const +

              +Returns TRUE if the canvas item is in motion; otherwise returns +FALSE. +

              See also setVelocity() and setAnimated(). + +

              TQRect TQCanvasItem::boundingRect () const [pure virtual] +

              + +

              Returns the bounding rectangle in pixels that the canvas item covers. +

              See also boundingRectAdvanced(). + +

              Reimplemented in TQCanvasSprite, TQCanvasPolygonalItem, and TQCanvasText. +

              TQRect TQCanvasItem::boundingRectAdvanced () const [virtual] +

              +Returns the bounding rectangle of pixels that the canvas item will cover after advance(1) is called. +

              See also boundingRect(). + +

              TQCanvas * TQCanvasItem::canvas () const +

              + +

              Returns the canvas containing the canvas item. + +

              bool TQCanvasItem::collidesWith ( const TQCanvasItem * other ) const [pure virtual] +

              + +

              Returns TRUE if the canvas item will collide with the other +item after they have moved by their current velocities; +otherwise returns FALSE. +

              See also collisions(). + +

              Example: canvas/canvas.cpp. +

              TQCanvasItemList TQCanvasItem::collisions ( bool exact ) const +

              +Returns the list of canvas items that this canvas item has +collided with. +

              A collision is generally defined as occurring when the pixels of +one item draw on the pixels of another item, but not all +subclasses are so precise. Also, since pixel-wise collision +detection can be slow, this function works in either exact or +inexact mode, according to the exact parameter. +

              If exact is TRUE, the canvas items returned have been +accurately tested for collision with the canvas item. +

              If exact is FALSE, the canvas items returned are near the +canvas item. You can test the canvas items returned using +collidesWith() if any are interesting collision candidates. By +using this approach, you can ignore some canvas items for which +collisions are not relevant. +

              The returned list is a list of TQCanvasItems, but often you will +need to cast the items to their subclass types. The safe way to do +this is to use rtti() before casting. This provides some of the +functionality of the standard C++ dynamic cast operation even on +compilers where dynamic casts are not available. +

              Note that a canvas item may be `on' a canvas, e.g. it was created +with the canvas as parameter, even though its coordinates place it +beyond the edge of the canvas's area. Collision detection only +works for canvas items which are wholly or partly within the +canvas's area. +

              Note that if items have a velocity (see setVelocity()), then +collision testing is done based on where the item will be when +it moves, not its current location. For example, a "ball" item +doesn't need to actually embed into a "wall" item before a +collision is detected. For items without velocity, plain +intersection is used. + +

              void TQCanvasItem::draw ( TQPainter & painter ) [pure virtual] +

              + +

              This abstract virtual function draws the canvas item using painter. +

              Warning: When you reimplement this function, make sure that you +leave the painter in the same state as you found it. For example, +if you start by calling TQPainter::translate(50, 50), end your +code by calling TQPainter::translate(-50, -50). Be also aware that +the painter might already have some transformations set (i.e., +don't call TQPainter::resetXForm() when you're done). + +

              Reimplemented in TQCanvasSprite, TQCanvasPolygonalItem, and TQCanvasText. +

              bool TQCanvasItem::enabled () const +

              +This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. +

              +Use isEnabled() instead. + +

              void TQCanvasItem::hide () +

              Shorthand for setVisible(FALSE). +

              bool TQCanvasItem::isActive () const +

              + +

              Returns TRUE if the TQCanvasItem is active; otherwise returns FALSE. + +

              bool TQCanvasItem::isEnabled () const +

              + +

              Returns TRUE if the TQCanvasItem is enabled; otherwise returns FALSE. + +

              bool TQCanvasItem::isSelected () const +

              + +

              Returns TRUE if the canvas item is selected; otherwise returns FALSE. + +

              bool TQCanvasItem::isVisible () const +

              + +

              Returns TRUE if the canvas item is visible; otherwise returns +FALSE. +

              Note that in this context TRUE does not mean that the canvas +item is currently in a view, merely that if a view is showing the +area where the canvas item is positioned, and the item is not +obscured by items with higher z values, and the view is not +obscured by overlaying windows, it would be visible. +

              See also setVisible() and z(). + +

              void TQCanvasItem::move ( double x, double y ) +

              +Moves the canvas item to the absolute position (x, y). + +

              Example: canvas/canvas.cpp. +

              void TQCanvasItem::moveBy ( double dx, double dy ) [virtual] +

              +Moves the canvas item relative to its current position by (dx, +dy). + +

              Example: canvas/canvas.cpp. +

              int TQCanvasItem::rtti () const [virtual] +

              +Returns 0 (TQCanvasItem::Rtti_Item). +

              Make your derived classes return their own values for rtti(), so +that you can distinguish between objects returned by +TQCanvas::at(). You should use values greater than 1000 to allow +for extensions to this class. +

              Overuse of this functionality can damage it's extensibility. For +example, once you have identified a base class of a TQCanvasItem +found by TQCanvas::at(), cast it to that type and call meaningful +methods rather than acting upon the object based on its rtti +value. +

              For example: +

              +        TQCanvasItem* item;
              +        // Find an item, e.g. with TQCanvasItem::collisions().
              +        ...
              +        if (item->rtti() == MySprite::RTTI ) {
              +            MySprite* s = (MySprite*)item;
              +            if (s->isDamagable()) s->loseHitPoints(1000);
              +            if (s->isHot()) myself->loseHitPoints(1000);
              +            ...
              +        }
              +    
              + + +

              Example: canvas/canvas.cpp. +

              Reimplemented in TQCanvasSprite, TQCanvasPolygonalItem, and TQCanvasText. +

              bool TQCanvasItem::selected () const +

              +This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. +

              +Use isSelected() instead. + +

              void TQCanvasItem::setActive ( bool yes ) [virtual] +

              +Sets the active flag of the item to yes. If this changes the +item's active state the item will be redrawn when +TQCanvas::update() is next called. +

              The TQCanvas, TQCanvasItem and the TQt-supplied TQCanvasItem +subclasses do not make use of this value. The setActive() function +is supplied because many applications need it, but it is up to you +how you use the isActive() value. + +

              void TQCanvasItem::setAnimated ( bool y ) [virtual] +

              +Sets the canvas item to be in motion if y is TRUE, or not if y is FALSE. The speed and direction of the motion is set with +setVelocity(), or with setXVelocity() and setYVelocity(). +

              See also advance() and TQCanvas::advance(). + +

              void TQCanvasItem::setCanvas ( TQCanvas * c ) [virtual] +

              +Sets the TQCanvas upon which the canvas item is to be drawn to c. +

              See also canvas(). + +

              void TQCanvasItem::setEnabled ( bool yes ) [virtual] +

              +Sets the enabled flag of the item to yes. If this changes the +item's enabled state the item will be redrawn when +TQCanvas::update() is next called. +

              The TQCanvas, TQCanvasItem and the TQt-supplied TQCanvasItem +subclasses do not make use of this value. The setEnabled() +function is supplied because many applications need it, but it is +up to you how you use the isEnabled() value. + +

              void TQCanvasItem::setSelected ( bool yes ) [virtual] +

              +Sets the selected flag of the item to yes. If this changes the +item's selected state the item will be redrawn when +TQCanvas::update() is next called. +

              The TQCanvas, TQCanvasItem and the TQt-supplied TQCanvasItem +subclasses do not make use of this value. The setSelected() +function is supplied because many applications need it, but it is +up to you how you use the isSelected() value. + +

              void TQCanvasItem::setVelocity ( double vx, double vy ) [virtual] +

              +Sets the canvas item to be in motion, moving by vx and vy +pixels in the horizontal and vertical directions respectively. +

              See also advance(), setXVelocity(), and setYVelocity(). + +

              void TQCanvasItem::setVisible ( bool yes ) [virtual] +

              +Makes the canvas item visible if yes is TRUE, or invisible if +yes is FALSE. The change takes effect when TQCanvas::update() is +next called. + +

              void TQCanvasItem::setX ( double x ) +

              + +

              Moves the canvas item so that its x-position is x. +

              See also x() and move(). + +

              Example: chart/chartform_canvas.cpp. +

              void TQCanvasItem::setXVelocity ( double vx ) +

              + +

              Sets the horizontal component of the canvas item's velocity to vx. +

              See also setYVelocity() and setVelocity(). + +

              void TQCanvasItem::setY ( double y ) +

              + +

              Moves the canvas item so that its y-position is y. +

              See also y() and move(). + +

              Example: chart/chartform_canvas.cpp. +

              void TQCanvasItem::setYVelocity ( double vy ) +

              + +

              Sets the vertical component of the canvas item's velocity to vy. +

              See also setXVelocity() and setVelocity(). + +

              void TQCanvasItem::setZ ( double z ) +

              + +

              Sets the z index of the canvas item to z. Higher-z items +obscure (are in front of) lower-z items. +

              See also z() and move(). + +

              Examples: canvas/canvas.cpp and chart/chartform_canvas.cpp. +

              void TQCanvasItem::show () +

              Shorthand for setVisible(TRUE). +

              Examples: canvas/canvas.cpp and chart/chartform_canvas.cpp. +

              void TQCanvasItem::update () [protected] +

              + +

              Call this function to repaint the canvas's changed chunks. + +

              bool TQCanvasItem::visible () const +

              +This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. +

              +Use isVisible() instead. + +

              double TQCanvasItem::x () const +

              + +

              Returns the horizontal position of the canvas item. Note that +subclasses often have an origin other than the top-left corner. + +

              Example: canvas/canvas.cpp. +

              double TQCanvasItem::xVelocity () const +

              +Returns the horizontal velocity component of the canvas item. + +

              double TQCanvasItem::y () const +

              + +

              Returns the vertical position of the canvas item. Note that +subclasses often have an origin other than the top-left corner. + +

              Example: canvas/canvas.cpp. +

              double TQCanvasItem::yVelocity () const +

              +Returns the vertical velocity component of the canvas item. + +

              double TQCanvasItem::z () const +

              + +

              Returns the z index of the canvas item, which is used for visual +order: higher-z items obscure (are in front of) lower-z items. + + +


              +This file is part of the TQt toolkit. +Copyright © 1995-2007 +Trolltech. All Rights Reserved.


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvasitemlist-members.html b/doc/html/tqcanvasitemlist-members.html new file mode 100644 index 00000000..d01f249b --- /dev/null +++ b/doc/html/tqcanvasitemlist-members.html @@ -0,0 +1,80 @@ + + + + + +TQCanvasItemList Member List + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              Complete Member List for TQCanvasItemList

              + +

              This is the complete list of member functions for +TQCanvasItemList, including inherited members. + +

              + +


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvasitemlist.html b/doc/html/tqcanvasitemlist.html new file mode 100644 index 00000000..4a94dce8 --- /dev/null +++ b/doc/html/tqcanvasitemlist.html @@ -0,0 +1,72 @@ + + + + + +TQCanvasItemList Class + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              TQCanvasItemList Class Reference
              [canvas module]

              + +

              The TQCanvasItemList class is a list of TQCanvasItems. +More... +

              #include <tqcanvas.h> +

              Inherits TQValueList<TQCanvasItem * >. +

              List of all member functions. +

              Public Members

              +
                +
              • TQCanvasItemList operator+ ( const TQCanvasItemList & l ) const
              • +
              +

              Detailed Description

              + + +The TQCanvasItemList class is a list of TQCanvasItems. + +

              + + +

              TQCanvasItemList is a TQValueList of pointers to TQCanvasItems. +This class is used by some methods in TQCanvas that need to return +a list of canvas items. +

              The TQValueList documentation describes how to use this list. +

              See also Graphics Classes and Image Processing Classes. + +


              Member Function Documentation

              +

              TQCanvasItemList TQCanvasItemList::operator+ ( const TQCanvasItemList & l ) const +

              +Returns the concatenation of this list and list l. + + +

              +This file is part of the TQt toolkit. +Copyright © 1995-2007 +Trolltech. All Rights Reserved.


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvasline-members.html b/doc/html/tqcanvasline-members.html new file mode 100644 index 00000000..1336fe6b --- /dev/null +++ b/doc/html/tqcanvasline-members.html @@ -0,0 +1,101 @@ + + + + + +TQCanvasLine Member List + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              Complete Member List for TQCanvasLine

              + +

              This is the complete list of member functions for +TQCanvasLine, including inherited members. + +

              + +


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvasline.html b/doc/html/tqcanvasline.html new file mode 100644 index 00000000..3629eb1e --- /dev/null +++ b/doc/html/tqcanvasline.html @@ -0,0 +1,109 @@ + + + + + +TQCanvasLine Class + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              TQCanvasLine Class Reference
              [canvas module]

              + +

              The TQCanvasLine class provides a line on a TQCanvas. +More... +

              #include <tqcanvas.h> +

              Inherits TQCanvasPolygonalItem. +

              List of all member functions. +

              Public Members

              + +

              Detailed Description

              + + +The TQCanvasLine class provides a line on a TQCanvas. + +

              + + +

              The line inherits functionality from TQCanvasPolygonalItem, for +example the setPen() function. The start and end points of the +line are set with setPoints(). +

              Like any other canvas item lines can be moved with +TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting +coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and +TQCanvasItem::setZ(). +

              See also Graphics Classes and Image Processing Classes. + +


              Member Function Documentation

              +

              TQCanvasLine::TQCanvasLine ( TQCanvas * canvas ) +

              +Constructs a line from (0,0) to (0,0) on canvas. +

              See also setPoints(). + +

              TQCanvasLine::~TQCanvasLine () +

              +Destroys the line. + +

              TQPoint TQCanvasLine::endPoint () const +

              + +

              Returns the end point of the line. +

              See also setPoints() and startPoint(). + +

              int TQCanvasLine::rtti () const [virtual] +

              +Returns 7 (TQCanvasItem::Rtti_Line). +

              See also TQCanvasItem::rtti(). + +

              Reimplemented from TQCanvasPolygonalItem. +

              void TQCanvasLine::setPoints ( int xa, int ya, int xb, int yb ) +

              +Sets the line's start point to (xa, ya) and its end point to +(xb, yb). + +

              Example: canvas/canvas.cpp. +

              TQPoint TQCanvasLine::startPoint () const +

              + +

              Returns the start point of the line. +

              See also setPoints() and endPoint(). + + +


              +This file is part of the TQt toolkit. +Copyright © 1995-2007 +Trolltech. All Rights Reserved.


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvaspixmap-members.html b/doc/html/tqcanvaspixmap-members.html new file mode 100644 index 00000000..7419d9a6 --- /dev/null +++ b/doc/html/tqcanvaspixmap-members.html @@ -0,0 +1,111 @@ + + + + + +TQCanvasPixmap Member List + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              Complete Member List for TQCanvasPixmap

              + +

              This is the complete list of member functions for +TQCanvasPixmap, including inherited members. + +

              + +


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvaspixmap.html b/doc/html/tqcanvaspixmap.html new file mode 100644 index 00000000..eec83185 --- /dev/null +++ b/doc/html/tqcanvaspixmap.html @@ -0,0 +1,128 @@ + + + + + +TQCanvasPixmap Class + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              TQCanvasPixmap Class Reference
              [canvas module]

              + +

              The TQCanvasPixmap class provides pixmaps for TQCanvasSprites. +More... +

              #include <tqcanvas.h> +

              Inherits TQPixmap. +

              List of all member functions. +

              Public Members

              + +

              Detailed Description

              + + +The TQCanvasPixmap class provides pixmaps for TQCanvasSprites. + +

              + + +

              If you want to show a single pixmap on a TQCanvas use a +TQCanvasSprite with just one pixmap. +

              When pixmaps are inserted into a TQCanvasPixmapArray they are held +as TQCanvasPixmaps. TQCanvasSprites are used to show pixmaps on +TQCanvases and hold their pixmaps in a TQCanvasPixmapArray. If +you retrieve a frame (pixmap) from a TQCanvasSprite it will be +returned as a TQCanvasPixmap. +

              The pixmap is a TQPixmap and can only be set in the constructor. +There are three different constructors, one taking a TQPixmap, one +a TQImage and one a file name that refers to a file in any +supported file format (see TQImageIO). +

              TQCanvasPixmap can have a hotspot which is defined in terms of an (x, +y) offset. When you create a TQCanvasPixmap from a PNG file or from +a TQImage that has a TQImage::offset(), the offset() is initialized +appropriately, otherwise the constructor leaves it at (0, 0). You +can set it later using setOffset(). When the TQCanvasPixmap is used +in a TQCanvasSprite, the offset position is the point at +TQCanvasItem::x() and TQCanvasItem::y(), not the top-left corner of +the pixmap. +

              Note that for TQCanvasPixmap objects created by a TQCanvasSprite, the +position of each TQCanvasPixmap object is set so that the hotspot +stays in the same position. +

              See also TQCanvasPixmapArray, TQCanvasItem, TQCanvasSprite, Graphics Classes, and Image Processing Classes. + +


              Member Function Documentation

              +

              TQCanvasPixmap::TQCanvasPixmap ( const TQString & datafilename ) +

              +Constructs a TQCanvasPixmap that uses the image stored in datafilename. + +

              TQCanvasPixmap::TQCanvasPixmap ( const TQImage & image ) +

              +Constructs a TQCanvasPixmap from the image image. + +

              TQCanvasPixmap::TQCanvasPixmap ( const TQPixmap & pm, const TQPoint & offset ) +

              +Constructs a TQCanvasPixmap from the pixmap pm using the offset +offset. + +

              TQCanvasPixmap::~TQCanvasPixmap () +

              +Destroys the pixmap. + +

              int TQCanvasPixmap::offsetX () const +

              + +

              Returns the x-offset of the pixmap's hotspot. +

              See also setOffset(). + +

              int TQCanvasPixmap::offsetY () const +

              + +

              Returns the y-offset of the pixmap's hotspot. +

              See also setOffset(). + +

              void TQCanvasPixmap::setOffset ( int x, int y ) +

              + +

              Sets the offset of the pixmap's hotspot to (x, y). +

              Warning: Do not call this function if any TQCanvasSprites are +currently showing this pixmap. + + +


              +This file is part of the TQt toolkit. +Copyright © 1995-2007 +Trolltech. All Rights Reserved.


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvaspixmaparray-members.html b/doc/html/tqcanvaspixmaparray-members.html new file mode 100644 index 00000000..97604c12 --- /dev/null +++ b/doc/html/tqcanvaspixmaparray-members.html @@ -0,0 +1,55 @@ + + + + + +TQCanvasPixmapArray Member List + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              Complete Member List for TQCanvasPixmapArray

              + +

              This is the complete list of member functions for +TQCanvasPixmapArray, including inherited members. + +

              + +


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvaspixmaparray.html b/doc/html/tqcanvaspixmaparray.html new file mode 100644 index 00000000..4af61946 --- /dev/null +++ b/doc/html/tqcanvaspixmaparray.html @@ -0,0 +1,192 @@ + + + + + +TQCanvasPixmapArray Class + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              TQCanvasPixmapArray Class Reference
              [canvas module]

              + +

              The TQCanvasPixmapArray class provides an array of TQCanvasPixmaps. +More... +

              #include <tqcanvas.h> +

              List of all member functions. +

              Public Members

              + +

              Detailed Description

              + + +The TQCanvasPixmapArray class provides an array of TQCanvasPixmaps. + +

              + + +

              This class is used by TQCanvasSprite to hold an array of pixmaps. +It is used to implement animated sprites, i.e. images that change +over time, with each pixmap in the array holding one frame. +

              Depending on the constructor you use you can load multiple pixmaps +into the array either from a directory (specifying a wildcard +pattern for the files), or from a list of TQPixmaps. You can also +read in a set of pixmaps after construction using readPixmaps(). +

              Individual pixmaps can be set with setImage() and retrieved with +image(). The number of pixmaps in the array is returned by +count(). +

              TQCanvasSprite uses an image's mask for collision detection. You +can change this by reading in a separate set of image masks using +readCollisionMasks(). +

              See also Graphics Classes and Image Processing Classes. + +


              Member Function Documentation

              +

              TQCanvasPixmapArray::TQCanvasPixmapArray () +

              +Constructs an invalid array (i.e. isValid() will return FALSE). +You must call readPixmaps() before being able to use this +TQCanvasPixmapArray. + +

              TQCanvasPixmapArray::TQCanvasPixmapArray ( const TQString & datafilenamepattern, int fc = 0 ) +

              +Constructs a TQCanvasPixmapArray from files. +

              The fc parameter sets the number of frames to be loaded for +this image. +

              If fc is not 0, datafilenamepattern should contain "%1", +e.g. "foo%1.png". The actual filenames are formed by replacing the +%1 with four-digit integers from 0 to (fc - 1), e.g. foo0000.png, +foo0001.png, foo0002.png, etc. +

              If fc is 0, datafilenamepattern is asssumed to be a +filename, and the image contained in this file will be loaded as +the first (and only) frame. +

              If datafilenamepattern does not exist, is not readable, isn't +an image, or some other error occurs, the array ends up empty and +isValid() returns FALSE. + +

              TQCanvasPixmapArray::TQCanvasPixmapArray ( TQPtrList<TQPixmap> list, TQPtrList<TQPoint> hotspots ) +

              +This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. +

              Use TQCanvasPixmapArray::TQCanvasPixmapArray( TQValueList, TQPointArray ) +instead. +

              Constructs a TQCanvasPixmapArray from the list of TQPixmaps list. The hotspots list has to be of the same size as list. + +

              TQCanvasPixmapArray::TQCanvasPixmapArray ( TQValueList<TQPixmap> list, TQPointArray hotspots = TQPointArray ( ) ) +

              +Constructs a TQCanvasPixmapArray from the list of TQPixmaps in the +list. Each pixmap will get a hotspot according to the hotspots array. If no hotspots are specified, each one is set to +be at position (0, 0). +

              If an error occurs, isValid() will return FALSE. + +

              TQCanvasPixmapArray::~TQCanvasPixmapArray () +

              +Destroys the pixmap array and all the pixmaps it contains. + +

              uint TQCanvasPixmapArray::count () const +

              + +

              Returns the number of pixmaps in the array. + +

              TQCanvasPixmap * TQCanvasPixmapArray::image ( int i ) const +

              + +

              Returns pixmap i in the array, if i is non-negative and less +than than count(), and returns an unspecified value otherwise. + +

              bool TQCanvasPixmapArray::isValid () const +

              +Returns TRUE if the pixmap array is valid; otherwise returns +FALSE. + +

              bool TQCanvasPixmapArray::operator! () +

              +This function is obsolete. It is provided to keep old source working. We strongly advise against using it in new code. +

              Use isValid() instead. +

              This returns FALSE if the array is valid, and TRUE if it is not. + +

              bool TQCanvasPixmapArray::readCollisionMasks ( const TQString & filename ) +

              +Reads new collision masks for the array. +

              By default, TQCanvasSprite uses the image mask of a sprite to +detect collisions. Use this function to set your own collision +image masks. +

              If count() is 1 filename must specify a real filename to read +the mask from. If count() is greater than 1, the filename must +contain a "%1" that will get replaced by the number of the mask to +be loaded, just like TQCanvasPixmapArray::readPixmaps(). +

              All collision masks must be 1-bit images or this function call +will fail. +

              If the file isn't readable, contains the wrong number of images, +or there is some other error, this function will return FALSE, and +the array will be flagged as invalid; otherwise this function +returns TRUE. +

              See also isValid(). + +

              bool TQCanvasPixmapArray::readPixmaps ( const TQString & filenamepattern, int fc = 0 ) +

              +Reads one or more pixmaps into the pixmap array. +

              If fc is not 0, filenamepattern should contain "%1", e.g. +"foo%1.png". The actual filenames are formed by replacing the %1 +with four-digit integers from 0 to (fc - 1), e.g. foo0000.png, +foo0001.png, foo0002.png, etc. +

              If fc is 0, filenamepattern is asssumed to be a filename, +and the image contained in this file will be loaded as the first +(and only) frame. +

              If filenamepattern does not exist, is not readable, isn't an +image, or some other error occurs, this function will return +FALSE, and isValid() will return FALSE; otherwise this function +will return TRUE. +

              See also isValid(). + +

              void TQCanvasPixmapArray::setImage ( int i, TQCanvasPixmap * p ) +

              +Replaces the pixmap at index i with pixmap p. +

              The array takes ownership of p and will delete p when the +array itself is deleted. +

              If i is beyond the end of the array the array is extended to at +least i+1 elements, with elements count() to i-1 being initialized +to 0. + + +


              +This file is part of the TQt toolkit. +Copyright © 1995-2007 +Trolltech. All Rights Reserved.


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvaspolygon-members.html b/doc/html/tqcanvaspolygon-members.html new file mode 100644 index 00000000..a57f78bf --- /dev/null +++ b/doc/html/tqcanvaspolygon-members.html @@ -0,0 +1,100 @@ + + + + + +TQCanvasPolygon Member List + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              Complete Member List for TQCanvasPolygon

              + +

              This is the complete list of member functions for +TQCanvasPolygon, including inherited members. + +

              + +


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvaspolygon.html b/doc/html/tqcanvaspolygon.html new file mode 100644 index 00000000..75befa86 --- /dev/null +++ b/doc/html/tqcanvaspolygon.html @@ -0,0 +1,126 @@ + + + + + +TQCanvasPolygon Class + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              TQCanvasPolygon Class Reference
              [canvas module]

              + +

              The TQCanvasPolygon class provides a polygon on a TQCanvas. +More... +

              #include <tqcanvas.h> +

              Inherits TQCanvasPolygonalItem. +

              Inherited by TQCanvasSpline. +

              List of all member functions. +

              Public Members

              + +

              Protected Members

              +
                +
              • virtual void drawShape ( TQPainter & p )
              • +
              +

              Detailed Description

              + + +The TQCanvasPolygon class provides a polygon on a TQCanvas. + +

              + + +

              Paints a polygon with a TQBrush. The polygon's points can be set in +the constructor or set or changed later using setPoints(). Use +points() to retrieve the points, or areaPoints() to retrieve the +points relative to the canvas's origin. +

              The polygon can be drawn on a painter with drawShape(). +

              Like any other canvas item polygons can be moved with +TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting +coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and +TQCanvasItem::setZ(). +

              Note: TQCanvasPolygon does not use the pen. +

              See also Graphics Classes and Image Processing Classes. + +


              Member Function Documentation

              +

              TQCanvasPolygon::TQCanvasPolygon ( TQCanvas * canvas ) +

              +Constructs a point-less polygon on the canvas canvas. You +should call setPoints() before using it further. + +

              TQCanvasPolygon::~TQCanvasPolygon () +

              +Destroys the polygon. + +

              TQPointArray TQCanvasPolygon::areaPoints () const [virtual] +

              +Returns the vertices of the polygon translated by the polygon's +current x(), y() position, i.e. relative to the canvas's origin. +

              See also setPoints() and points(). + +

              Reimplemented from TQCanvasPolygonalItem. +

              void TQCanvasPolygon::drawShape ( TQPainter & p ) [virtual protected] +

              +Draws the polygon using the painter p. +

              Note that TQCanvasPolygon does not support an outline (the pen is +always NoPen). + +

              Reimplemented from TQCanvasPolygonalItem. +

              TQPointArray TQCanvasPolygon::points () const +

              + +

              Returns the vertices of the polygon, not translated by the position. +

              See also setPoints() and areaPoints(). + +

              int TQCanvasPolygon::rtti () const [virtual] +

              +Returns 4 (TQCanvasItem::Rtti_Polygon). +

              See also TQCanvasItem::rtti(). + +

              Reimplemented from TQCanvasPolygonalItem. +

              Reimplemented in TQCanvasSpline. +

              void TQCanvasPolygon::setPoints ( TQPointArray pa ) +

              +Sets the points of the polygon to be pa. These points will have +their x and y coordinates automatically translated by x(), y() as +the polygon is moved. + + +

              +This file is part of the TQt toolkit. +Copyright © 1995-2007 +Trolltech. All Rights Reserved.


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvaspolygonalitem-members.html b/doc/html/tqcanvaspolygonalitem-members.html new file mode 100644 index 00000000..fbc1c594 --- /dev/null +++ b/doc/html/tqcanvaspolygonalitem-members.html @@ -0,0 +1,98 @@ + + + + + +TQCanvasPolygonalItem Member List + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              Complete Member List for TQCanvasPolygonalItem

              + +

              This is the complete list of member functions for +TQCanvasPolygonalItem, including inherited members. + +

              + +


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvaspolygonalitem.html b/doc/html/tqcanvaspolygonalitem.html new file mode 100644 index 00000000..2a877178 --- /dev/null +++ b/doc/html/tqcanvaspolygonalitem.html @@ -0,0 +1,235 @@ + + + + + +TQCanvasPolygonalItem Class + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              TQCanvasPolygonalItem Class Reference
              [canvas module]

              + +

              The TQCanvasPolygonalItem class provides a polygonal canvas item +on a TQCanvas. +More... +

              #include <tqcanvas.h> +

              Inherits TQCanvasItem. +

              Inherited by TQCanvasRectangle, TQCanvasPolygon, TQCanvasLine, and TQCanvasEllipse. +

              List of all member functions. +

              Public Members

              + +

              Protected Members

              + +

              Detailed Description

              + + +The TQCanvasPolygonalItem class provides a polygonal canvas item +on a TQCanvas. + +

              + + +

              The mostly rectangular classes, such as TQCanvasSprite and +TQCanvasText, use the object's bounding rectangle for movement, +repainting and collision calculations. For most other items, the +bounding rectangle can be far too large -- a diagonal line being +the worst case, and there are many other cases which are also bad. +TQCanvasPolygonalItem provides polygon-based bounding rectangle +handling, etc., which is much faster for non-rectangular items. +

              Derived classes should try to define as small an area as possible +to maximize efficiency, but the polygon must definitely be +contained completely within the polygonal area. Calculating the +exact requirements is usually difficult, but if you allow a small +overestimate it can be easy and quick, while still getting almost +all of TQCanvasPolygonalItem's speed. +

              Note that all subclasses must call hide() in their destructor +since hide() needs to be able to access areaPoints(). +

              Normally, TQCanvasPolygonalItem uses the odd-even algorithm for +determining whether an object intersects this object. You can +change this to the winding algorithm using setWinding(). +

              The bounding rectangle is available using boundingRect(). The +points bounding the polygonal item are retrieved with +areaPoints(). Use areaPointsAdvanced() to retrieve the bounding +points the polygonal item will have after +TQCanvasItem::advance(1) has been called. +

              If the shape of the polygonal item is about to change while the +item is visible, call invalidate() before updating with a +different result from areaPoints(). +

              By default, TQCanvasPolygonalItem objects have a black pen and no +brush (the default TQPen and TQBrush constructors). You can change +this with setPen() and setBrush(), but note that some +TQCanvasPolygonalItem subclasses only use the brush, ignoring the +pen setting. +

              The polygonal item can be drawn on a painter with draw(). +Subclasses must reimplement drawShape() to draw themselves. +

              Like any other canvas item polygonal items can be moved with +TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting coordinates +with TQCanvasItem::setX(), TQCanvasItem::setY() and TQCanvasItem::setZ(). +

              See also Graphics Classes and Image Processing Classes. + +


              Member Function Documentation

              +

              TQCanvasPolygonalItem::TQCanvasPolygonalItem ( TQCanvas * canvas ) +

              +Constructs a TQCanvasPolygonalItem on the canvas canvas. + +

              TQCanvasPolygonalItem::~TQCanvasPolygonalItem () [virtual] +

              +Note that all subclasses must call hide() in their destructor +since hide() needs to be able to access areaPoints(). + +

              TQPointArray TQCanvasPolygonalItem::areaPoints () const [pure virtual] +

              + +

              This function must be reimplemented by subclasses. It must +return the points bounding (i.e. outside and not touching) the +shape or drawing errors will occur. + +

              Reimplemented in TQCanvasPolygon. +

              TQPointArray TQCanvasPolygonalItem::areaPointsAdvanced () const [virtual] +

              +Returns the points the polygonal item will have after +TQCanvasItem::advance(1) is called, i.e. what the points are when +advanced by the current xVelocity() and yVelocity(). + +

              TQRect TQCanvasPolygonalItem::boundingRect () const [virtual] +

              +Returns the bounding rectangle of the polygonal item, based on +areaPoints(). + +

              Reimplemented from TQCanvasItem. +

              TQBrush TQCanvasPolygonalItem::brush () const +

              + +

              Returns the TQBrush used to fill the item, if filled. +

              See also setBrush(). + +

              void TQCanvasPolygonalItem::draw ( TQPainter & p ) [virtual protected] +

              +Reimplemented from TQCanvasItem, this draws the polygonal item by +setting the pen and brush for the item on the painter p and +calling drawShape(). + +

              Reimplemented from TQCanvasItem. +

              void TQCanvasPolygonalItem::drawShape ( TQPainter & p ) [pure virtual protected] +

              + +

              Subclasses must reimplement this function to draw their shape. The +pen and brush of p are already set to pen() and brush() prior +to calling this function. +

              Warning: When you reimplement this function, make sure that you +leave the painter in the same state as you found it. For example, +if you start by calling TQPainter::translate(50, 50), end your +code by calling TQPainter::translate(-50, -50). Be also aware that +the painter might already have some transformations set (i.e., +don't call TQPainter::resetXForm() when you're done). +

              See also draw(). + +

              Reimplemented in TQCanvasRectangle, TQCanvasPolygon, and TQCanvasEllipse. +

              void TQCanvasPolygonalItem::invalidate () [protected] +

              +Invalidates all information about the area covered by the canvas +item. The item will be updated automatically on the next call that +changes the item's status, for example, move() or update(). Call +this function if you are going to change the shape of the item (as +returned by areaPoints()) while the item is visible. + +

              bool TQCanvasPolygonalItem::isValid () const [protected] +

              + +

              Returns TRUE if the polygonal item's area information has not been +invalidated; otherwise returns FALSE. +

              See also invalidate(). + +

              TQPen TQCanvasPolygonalItem::pen () const +

              + +

              Returns the TQPen used to draw the outline of the item, if any. +

              See also setPen(). + +

              int TQCanvasPolygonalItem::rtti () const [virtual] +

              +Returns 2 (TQCanvasItem::Rtti_PolygonalItem). +

              See also TQCanvasItem::rtti(). + +

              Reimplemented from TQCanvasItem. +

              Reimplemented in TQCanvasRectangle, TQCanvasPolygon, TQCanvasLine, and TQCanvasEllipse. +

              void TQCanvasPolygonalItem::setBrush ( TQBrush b ) [virtual] +

              +Sets the TQBrush used when drawing the polygonal item to the brush b. +

              See also setPen(), brush(), and drawShape(). + +

              Examples: canvas/canvas.cpp and chart/chartform_canvas.cpp. +

              void TQCanvasPolygonalItem::setPen ( TQPen p ) [virtual] +

              +Sets the TQPen used when drawing the item to the pen p. +Note that many TQCanvasPolygonalItems do not use the pen value. +

              See also setBrush(), pen(), and drawShape(). + +

              Examples: canvas/canvas.cpp and chart/chartform_canvas.cpp. +

              void TQCanvasPolygonalItem::setWinding ( bool enable ) [protected] +

              +If enable is TRUE, the polygonal item will use the winding +algorithm to determine the "inside" of the polygon; otherwise the +odd-even algorithm will be used. +

              The default is to use the odd-even algorithm. +

              See also winding(). + +

              bool TQCanvasPolygonalItem::winding () const [protected] +

              +Returns TRUE if the polygonal item uses the winding algorithm to +determine the "inside" of the polygon. Returns FALSE if it uses +the odd-even algorithm. +

              The default is to use the odd-even algorithm. +

              See also setWinding(). + + +


              +This file is part of the TQt toolkit. +Copyright © 1995-2007 +Trolltech. All Rights Reserved.


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvasrectangle-members.html b/doc/html/tqcanvasrectangle-members.html new file mode 100644 index 00000000..a35d4b3e --- /dev/null +++ b/doc/html/tqcanvasrectangle-members.html @@ -0,0 +1,104 @@ + + + + + +TQCanvasRectangle Member List + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              Complete Member List for TQCanvasRectangle

              + +

              This is the complete list of member functions for +TQCanvasRectangle, including inherited members. + +

              + +


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvasrectangle.html b/doc/html/tqcanvasrectangle.html new file mode 100644 index 00000000..c2aaa94c --- /dev/null +++ b/doc/html/tqcanvasrectangle.html @@ -0,0 +1,147 @@ + + + + + +TQCanvasRectangle Class + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              TQCanvasRectangle Class Reference
              [canvas module]

              + +

              The TQCanvasRectangle class provides a rectangle on a TQCanvas. +More... +

              #include <tqcanvas.h> +

              Inherits TQCanvasPolygonalItem. +

              List of all member functions. +

              Public Members

              + +

              Protected Members

              +
                +
              • virtual void drawShape ( TQPainter & p )
              • +
              • virtual TQPointArray chunks () const
              • +
              +

              Detailed Description

              + + +The TQCanvasRectangle class provides a rectangle on a TQCanvas. + +

              + + +

              This item paints a single rectangle which may have any pen() and +brush(), but may not be tilted/rotated. For rotated rectangles, +use TQCanvasPolygon. +

              The rectangle's size and initial position can be set in the +constructor. The size can be set or changed later using setSize(). +Use height() and width() to retrieve the rectangle's dimensions. +

              The rectangle can be drawn on a painter with drawShape(). +

              Like any other canvas item rectangles can be moved with +TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting +coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and +TQCanvasItem::setZ(). +

              See also Graphics Classes and Image Processing Classes. + +


              Member Function Documentation

              +

              TQCanvasRectangle::TQCanvasRectangle ( TQCanvas * canvas ) +

              +Constructs a rectangle at position (0,0) with both width and +height set to 32 pixels on canvas. + +

              TQCanvasRectangle::TQCanvasRectangle ( const TQRect & r, TQCanvas * canvas ) +

              +Constructs a rectangle positioned and sized by r on canvas. + +

              TQCanvasRectangle::TQCanvasRectangle ( int x, int y, int width, int height, TQCanvas * canvas ) +

              +Constructs a rectangle at position (x, y) and size width +by height, on canvas. + +

              TQCanvasRectangle::~TQCanvasRectangle () +

              +Destroys the rectangle. + +

              TQPointArray TQCanvasRectangle::chunks () const [virtual protected] +

              +Simply calls TQCanvasItem::chunks(). + +

              void TQCanvasRectangle::drawShape ( TQPainter & p ) [virtual protected] +

              +Draws the rectangle on painter p. + +

              Example: canvas/canvas.cpp. +

              Reimplemented from TQCanvasPolygonalItem. +

              int TQCanvasRectangle::height () const +

              +Returns the height of the rectangle. + +

              TQRect TQCanvasRectangle::rect () const +

              + +

              Returns the integer-converted x(), y() position and size() of the +rectangle as a TQRect. + +

              int TQCanvasRectangle::rtti () const [virtual] +

              +Returns 5 (TQCanvasItem::Rtti_Rectangle). +

              See also TQCanvasItem::rtti(). + +

              Reimplemented from TQCanvasPolygonalItem. +

              void TQCanvasRectangle::setSize ( int width, int height ) +

              +Sets the width and height of the rectangle. + +

              TQSize TQCanvasRectangle::size () const +

              + +

              Returns the width() and height() of the rectangle. +

              See also rect() and setSize(). + +

              int TQCanvasRectangle::width () const +

              +Returns the width of the rectangle. + + +

              +This file is part of the TQt toolkit. +Copyright © 1995-2007 +Trolltech. All Rights Reserved.


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvasspline-members.html b/doc/html/tqcanvasspline-members.html new file mode 100644 index 00000000..c0cf717e --- /dev/null +++ b/doc/html/tqcanvasspline-members.html @@ -0,0 +1,103 @@ + + + + + +TQCanvasSpline Member List + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              Complete Member List for TQCanvasSpline

              + +

              This is the complete list of member functions for +TQCanvasSpline, including inherited members. + +

              + +


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvasspline.html b/doc/html/tqcanvasspline.html new file mode 100644 index 00000000..5396ace8 --- /dev/null +++ b/doc/html/tqcanvasspline.html @@ -0,0 +1,121 @@ + + + + + +TQCanvasSpline Class + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              TQCanvasSpline Class Reference
              [canvas module]

              + +

              The TQCanvasSpline class provides multi-bezier splines on a TQCanvas. +More... +

              #include <tqcanvas.h> +

              Inherits TQCanvasPolygon. +

              List of all member functions. +

              Public Members

              + +

              Detailed Description

              + + +The TQCanvasSpline class provides multi-bezier splines on a TQCanvas. + +

              + + +

              A TQCanvasSpline is a sequence of 4-point bezier curves joined +together to make a curved shape. +

              You set the control points of the spline with setControlPoints(). +

              If the bezier is closed(), then the first control point will be +re-used as the last control point. Therefore, a closed bezier must +have a multiple of 3 control points and an open bezier must have +one extra point. +

              The beziers are not necessarily joined "smoothly". To ensure this, +set control points appropriately (general reference texts about +beziers will explain this in detail). +

              Like any other canvas item splines can be moved with +TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting +coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and +TQCanvasItem::setZ(). +

              See also Graphics Classes and Image Processing Classes. + +


              Member Function Documentation

              +

              TQCanvasSpline::TQCanvasSpline ( TQCanvas * canvas ) +

              +Create a spline with no control points on the canvas canvas. +

              See also setControlPoints(). + +

              TQCanvasSpline::~TQCanvasSpline () +

              +Destroy the spline. + +

              bool TQCanvasSpline::closed () const +

              +Returns TRUE if the control points are a closed set; otherwise +returns FALSE. + +

              TQPointArray TQCanvasSpline::controlPoints () const +

              +Returns the current set of control points. +

              See also setControlPoints() and closed(). + +

              int TQCanvasSpline::rtti () const [virtual] +

              +Returns 8 (TQCanvasItem::Rtti_Spline). +

              See also TQCanvasItem::rtti(). + +

              Reimplemented from TQCanvasPolygon. +

              void TQCanvasSpline::setControlPoints ( TQPointArray ctrl, bool close = TRUE ) +

              +Set the spline control points to ctrl. +

              If close is TRUE, then the first point in ctrl will be +re-used as the last point, and the number of control points must +be a multiple of 3. If close is FALSE, one additional control +point is required, and the number of control points must be one of +(4, 7, 10, 13, ...). +

              If the number of control points doesn't meet the above conditions, +the number of points will be truncated to the largest number of +points that do meet the requirement. + +

              Example: canvas/canvas.cpp. + +


              +This file is part of the TQt toolkit. +Copyright © 1995-2007 +Trolltech. All Rights Reserved.


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvassprite-members.html b/doc/html/tqcanvassprite-members.html new file mode 100644 index 00000000..466f8b5c --- /dev/null +++ b/doc/html/tqcanvassprite-members.html @@ -0,0 +1,100 @@ + + + + + +TQCanvasSprite Member List + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              Complete Member List for TQCanvasSprite

              + +

              This is the complete list of member functions for +TQCanvasSprite, including inherited members. + +

              + +


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvassprite.html b/doc/html/tqcanvassprite.html new file mode 100644 index 00000000..036717f4 --- /dev/null +++ b/doc/html/tqcanvassprite.html @@ -0,0 +1,303 @@ + + + + + +TQCanvasSprite Class + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              TQCanvasSprite Class Reference
              [canvas module]

              + +

              The TQCanvasSprite class provides an animated canvas item on a TQCanvas. +More... +

              #include <tqcanvas.h> +

              Inherits TQCanvasItem. +

              List of all member functions. +

              Public Members

              + +

              Detailed Description

              + + +The TQCanvasSprite class provides an animated canvas item on a TQCanvas. + +

              + + +

              A canvas sprite is an object which can contain any number of images +(referred to as frames), only one of which is current, i.e. +displayed, at any one time. The images can be passed in the +constructor or set or changed later with setSequence(). If you +subclass TQCanvasSprite you can change the frame that is displayed +periodically, e.g. whenever TQCanvasItem::advance(1) is called to +create the effect of animation. +

              The current frame can be set with setFrame() or with move(). The +number of frames available is given by frameCount(). The bounding +rectangle of the current frame is returned by boundingRect(). +

              The current frame's image can be retrieved with image(); use +imageAdvanced() to retrieve the image for the frame that will be +shown after advance(1) is called. Use the image() overload passing +it an integer index to retrieve a particular image from the list of +frames. +

              Use width() and height() to retrieve the dimensions of the current +frame. +

              Use leftEdge() and rightEdge() to retrieve the current frame's +left-hand and right-hand x-coordinates respectively. Use +bottomEdge() and topEdge() to retrieve the current frame's bottom +and top y-coordinates respectively. These functions have an overload +which will accept an integer frame number to retrieve the +coordinates of a particular frame. +

              TQCanvasSprite draws very quickly, at the expense of memory. +

              The current frame's image can be drawn on a painter with draw(). +

              Like any other canvas item, canvas sprites can be moved with +move() which sets the x and y coordinates and the frame number, as +well as with TQCanvasItem::move() and TQCanvasItem::moveBy(), or by +setting coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() +and TQCanvasItem::setZ(). +

              See also Graphics Classes and Image Processing Classes. + +


              Member Type Documentation

              +

              TQCanvasSprite::FrameAnimationType

              + +

              This enum is used to identify the different types of frame +animation offered by TQCanvasSprite. +

                +
              • TQCanvasSprite::Cycle - at each advance the frame number will be incremented by +1 (modulo the frame count). +
              • TQCanvasSprite::Oscillate - at each advance the frame number will be +incremented by 1 up to the frame count then decremented to by 1 to +0, repeating this sequence forever. +
              +

              Member Function Documentation

              +

              TQCanvasSprite::TQCanvasSprite ( TQCanvasPixmapArray * a, TQCanvas * canvas ) +

              +Constructs a TQCanvasSprite which uses images from the +TQCanvasPixmapArray a. +

              The sprite in initially positioned at (0, 0) on canvas, using +frame 0. + +

              TQCanvasSprite::~TQCanvasSprite () [virtual] +

              +Destroys the sprite and removes it from the canvas. Does not +delete the images. + +

              void TQCanvasSprite::advance ( int phase ) [virtual] +

              +Extends the default TQCanvasItem implementation to provide the +functionality of setFrameAnimation(). +

              The phase is 0 or 1: see TQCanvasItem::advance() for details. +

              See also TQCanvasItem::advance() and setVelocity(). + +

              Example: canvas/canvas.cpp. +

              Reimplemented from TQCanvasItem. +

              int TQCanvasSprite::bottomEdge () const +

              +Returns the y-coordinate of the current bottom edge of the sprite. +(This may change as the sprite animates since different frames may +have different bottom edges.) +

              See also leftEdge(), rightEdge(), and topEdge(). + +

              int TQCanvasSprite::bottomEdge ( int ny ) const +

              +This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +

              Returns what the y-coordinate of the top edge of the sprite would +be if the sprite (actually its hotspot) were moved to y-position +ny. +

              See also leftEdge(), rightEdge(), and topEdge(). + +

              TQRect TQCanvasSprite::boundingRect () const [virtual] +

              +Returns the bounding rectangle for the image in the sprite's +current frame. This assumes that the images are tightly cropped +(i.e. do not have transparent pixels all along a side). + +

              Reimplemented from TQCanvasItem. +

              void TQCanvasSprite::draw ( TQPainter & painter ) [virtual] +

              +Draws the current frame's image at the sprite's current position +on painter painter. + +

              Reimplemented from TQCanvasItem. +

              int TQCanvasSprite::frame () const +

              + +

              Returns the index of the current animation frame in the +TQCanvasSprite's TQCanvasPixmapArray. +

              See also setFrame() and move(). + +

              int TQCanvasSprite::frameCount () const +

              + +

              Returns the number of frames in the TQCanvasSprite's +TQCanvasPixmapArray. + +

              int TQCanvasSprite::height () const +

              +The height of the sprite for the current frame's image. +

              See also frame(). + +

              TQCanvasPixmap * TQCanvasSprite::image () const +

              + +

              Returns the current frame's image. +

              See also frame() and setFrame(). + +

              TQCanvasPixmap * TQCanvasSprite::image ( int f ) const +

              + +This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +

              Returns the image for frame f. Does not do any bounds checking on f. + +

              TQCanvasPixmap * TQCanvasSprite::imageAdvanced () const [virtual] +

              +Returns the image the sprite will have after advance(1) is +called. By default this is the same as image(). + +

              int TQCanvasSprite::leftEdge () const +

              +Returns the x-coordinate of the current left edge of the sprite. +(This may change as the sprite animates since different frames may +have different left edges.) +

              See also rightEdge(), bottomEdge(), and topEdge(). + +

              int TQCanvasSprite::leftEdge ( int nx ) const +

              +This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +

              Returns what the x-coordinate of the left edge of the sprite would +be if the sprite (actually its hotspot) were moved to x-position +nx. +

              See also rightEdge(), bottomEdge(), and topEdge(). + +

              void TQCanvasSprite::move ( double nx, double ny, int nf ) [virtual] +

              + +

              Set the position of the sprite to nx, ny and the current +frame to nf. nf will be ignored if it is larger than +frameCount() or smaller than 0. + +

              int TQCanvasSprite::rightEdge () const +

              +Returns the x-coordinate of the current right edge of the sprite. +(This may change as the sprite animates since different frames may +have different right edges.) +

              See also leftEdge(), bottomEdge(), and topEdge(). + +

              int TQCanvasSprite::rightEdge ( int nx ) const +

              +This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +

              Returns what the x-coordinate of the right edge of the sprite +would be if the sprite (actually its hotspot) were moved to +x-position nx. +

              See also leftEdge(), bottomEdge(), and topEdge(). + +

              int TQCanvasSprite::rtti () const [virtual] +

              +Returns 1 (TQCanvasItem::Rtti_Sprite). +

              See also TQCanvasItem::rtti(). + +

              Example: canvas/canvas.cpp. +

              Reimplemented from TQCanvasItem. +

              void TQCanvasSprite::setFrame ( int f ) +

              +Sets the animation frame used for displaying the sprite to f, +an index into the TQCanvasSprite's TQCanvasPixmapArray. The call +will be ignored if f is larger than frameCount() or smaller +than 0. +

              See also frame() and move(). + +

              void TQCanvasSprite::setFrameAnimation ( FrameAnimationType type = Cycle, int step = 1, int state = 0 ) [virtual] +

              +Sets the animation characteristics for the sprite. +

              For type == Cycle, the frames will increase by step +at each advance, modulo the frameCount(). +

              For type == Oscillate, the frames will increase by step +at each advance, up to the frameCount(), then decrease by step +back to 0, repeating forever. +

              The state parameter is for internal use. + +

              void TQCanvasSprite::setSequence ( TQCanvasPixmapArray * a ) +

              +Set the array of images used for displaying the sprite to the +TQCanvasPixmapArray a. +

              If the current frame() is larger than the number of images in a, the current frame will be reset to 0. + +

              int TQCanvasSprite::topEdge () const +

              +Returns the y-coordinate of the top edge of the sprite. (This may +change as the sprite animates since different frames may have +different top edges.) +

              See also leftEdge(), rightEdge(), and bottomEdge(). + +

              int TQCanvasSprite::topEdge ( int ny ) const +

              +This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +

              Returns what the y-coordinate of the top edge of the sprite would +be if the sprite (actually its hotspot) were moved to y-position +ny. +

              See also leftEdge(), rightEdge(), and bottomEdge(). + +

              int TQCanvasSprite::width () const +

              +The width of the sprite for the current frame's image. +

              See also frame(). + + +


              +This file is part of the TQt toolkit. +Copyright © 1995-2007 +Trolltech. All Rights Reserved.


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvastext-members.html b/doc/html/tqcanvastext-members.html new file mode 100644 index 00000000..56c3e52d --- /dev/null +++ b/doc/html/tqcanvastext-members.html @@ -0,0 +1,95 @@ + + + + + +TQCanvasText Member List + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              Complete Member List for TQCanvasText

              + +

              This is the complete list of member functions for +TQCanvasText, including inherited members. + +

              + +


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvastext.html b/doc/html/tqcanvastext.html new file mode 100644 index 00000000..1750494a --- /dev/null +++ b/doc/html/tqcanvastext.html @@ -0,0 +1,169 @@ + + + + + +TQCanvasText Class + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              TQCanvasText Class Reference
              [canvas module]

              + +

              The TQCanvasText class provides a text object on a TQCanvas. +More... +

              #include <tqcanvas.h> +

              Inherits TQCanvasItem. +

              List of all member functions. +

              Public Members

              + +

              Protected Members

              +
                +
              • virtual void draw ( TQPainter & painter )
              • +
              +

              Detailed Description

              + + +The TQCanvasText class provides a text object on a TQCanvas. + +

              + + +

              A canvas text item has text with font, color and alignment +attributes. The text and font can be set in the constructor or set +or changed later with setText() and setFont(). The color is set +with setColor() and the alignment with setTextFlags(). The text +item's bounding rectangle is retrieved with boundingRect(). +

              The text can be drawn on a painter with draw(). +

              Like any other canvas item text items can be moved with +TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting +coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and +TQCanvasItem::setZ(). +

              See also Graphics Classes and Image Processing Classes. + +


              Member Function Documentation

              +

              TQCanvasText::TQCanvasText ( TQCanvas * canvas ) +

              +Constructs a TQCanvasText with the text "<text>", on canvas. + +

              TQCanvasText::TQCanvasText ( const TQString & t, TQCanvas * canvas ) +

              +Constructs a TQCanvasText with the text t, on canvas canvas. + +

              TQCanvasText::TQCanvasText ( const TQString & t, TQFont f, TQCanvas * canvas ) +

              +Constructs a TQCanvasText with the text t and font f, on the +canvas canvas. + +

              TQCanvasText::~TQCanvasText () [virtual] +

              +Destroys the canvas text item. + +

              TQRect TQCanvasText::boundingRect () const [virtual] +

              +Returns the bounding rectangle of the text. + +

              Reimplemented from TQCanvasItem. +

              TQColor TQCanvasText::color () const +

              +Returns the color of the text. +

              See also setColor(). + +

              void TQCanvasText::draw ( TQPainter & painter ) [virtual protected] +

              +Draws the text using the painter painter. + +

              Reimplemented from TQCanvasItem. +

              TQFont TQCanvasText::font () const +

              +Returns the font in which the text is drawn. +

              See also setFont(). + +

              int TQCanvasText::rtti () const [virtual] +

              +Returns 3 (TQCanvasItem::Rtti_Text). +

              See also TQCanvasItem::rtti(). + +

              Reimplemented from TQCanvasItem. +

              void TQCanvasText::setColor ( const TQColor & c ) +

              +Sets the color of the text to the color c. +

              See also color() and setFont(). + +

              Example: chart/chartform_canvas.cpp. +

              void TQCanvasText::setFont ( const TQFont & f ) +

              +Sets the font in which the text is drawn to font f. +

              See also font(). + +

              void TQCanvasText::setText ( const TQString & t ) +

              +Sets the text item's text to t. The text may contain newlines. +

              See also text(), setFont(), setColor(), and setTextFlags(). + +

              Example: canvas/canvas.cpp. +

              void TQCanvasText::setTextFlags ( int f ) +

              +Sets the alignment flags to f. These are a bitwise OR of the +flags available to TQPainter::drawText() -- see the +TQt::AlignmentFlags. +

              See also setFont() and setColor(). + +

              TQString TQCanvasText::text () const +

              +Returns the text item's text. +

              See also setText(). + +

              int TQCanvasText::textFlags () const +

              + +

              Returns the currently set alignment flags. +

              See also setTextFlags() and TQt::AlignmentFlags. + + +


              +This file is part of the TQt toolkit. +Copyright © 1995-2007 +Trolltech. All Rights Reserved.


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvasview-members.html b/doc/html/tqcanvasview-members.html new file mode 100644 index 00000000..38bf87dc --- /dev/null +++ b/doc/html/tqcanvasview-members.html @@ -0,0 +1,429 @@ + + + + + +TQCanvasView Member List + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              Complete Member List for TQCanvasView

              + +

              This is the complete list of member functions for +TQCanvasView, including inherited members. + +

              + +


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqcanvasview.html b/doc/html/tqcanvasview.html new file mode 100644 index 00000000..bbd572f2 --- /dev/null +++ b/doc/html/tqcanvasview.html @@ -0,0 +1,190 @@ + + + + + +TQCanvasView Class + + + + + + + +
              + +Home + | +All Classes + | +Main Classes + | +Annotated + | +Grouped Classes + | +Functions +

              TQCanvasView Class Reference
              [canvas module]

              + +

              The TQCanvasView class provides an on-screen view of a TQCanvas. +More... +

              #include <tqcanvas.h> +

              Inherits TQScrollView. +

              List of all member functions. +

              Public Members

              + +

              Protected Members

              +
                +
              • virtual void drawContents ( TQPainter * p, int cx, int cy, int cw, int ch )
              • +
              • virtual TQSize sizeHint () const
              • +
              +

              Detailed Description

              + + +The TQCanvasView class provides an on-screen view of a TQCanvas. + +

              + + +

              A TQCanvasView is widget which provides a view of a TQCanvas. +

              If you want users to be able to interact with a canvas view, +subclass TQCanvasView. You might then reimplement +TQScrollView::contentsMousePressEvent(). For example, assuming no +transformation matrix is set: +

              +    void MyCanvasView::contentsMousePressEvent( TQMouseEvent* e )
              +    {
              +        TQCanvasItemList l = canvas()->collisions(e->pos());
              +        for (TQCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) {
              +            if ( (*it)->rtti() == TQCanvasRectangle::RTTI )
              +                tqDebug("A TQCanvasRectangle lies somewhere at this point");
              +        }
              +    }
              +    
              + +

              The canvas view shows canvas canvas(); this can be changed using +setCanvas(). +

              A transformation matrix can be used to transform the view of the +canvas in various ways, for example, zooming in or out or rotating. +For example: +

              +    TQWMatrix wm;
              +    wm.scale( 2, 2 );   // Zooms in by 2 times
              +    wm.rotate( 90 );    // Rotates 90 degrees counter clockwise
              +                        // around the origin.
              +    wm.translate( 0, -canvas->height() );
              +                        // moves the canvas down so what was visible
              +                        // before is still visible.
              +    myCanvasView->setWorldMatrix( wm );
              +    
              + +

              Use setWorldMatrix() to set the canvas view's world matrix: you must +ensure that the world matrix is invertible. The current world matrix +is retrievable with worldMatrix(), and its inversion is retrievable +with inverseWorldMatrix(). +

              Example: +

              The following code finds the part of the canvas that is visible in +this view, i.e. the bounding rectangle of the view in canvas coordinates. +

              +    TQRect rc = TQRect( myCanvasView->contentsX(), myCanvasView->contentsY(),
              +                        myCanvasView->visibleWidth(), myCanvasView->visibleHeight() );
              +    TQRect canvasRect = myCanvasView->inverseWorldMatrix().mapRect(rc);
              +    
              + +

              See also TQWMatrix, TQPainter::setWorldMatrix(), Graphics Classes, and Image Processing Classes. + +

              +


              Member Function Documentation

              +

              TQCanvasView::TQCanvasView ( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 ) +

              +Constructs a TQCanvasView with parent parent, and name name, +using the widget flags f. The canvas view is not associated +with a canvas, so you must to call setCanvas() to view a +canvas. + +

              TQCanvasView::TQCanvasView ( TQCanvas * canvas, TQWidget * parent = 0, const char * name = 0, WFlags f = 0 ) +

              +This is an overloaded member function, provided for convenience. It behaves essentially like the above function. +

              Constructs a TQCanvasView which views canvas canvas, with parent +parent, and name name, using the widget flags f. + +

              TQCanvasView::~TQCanvasView () +

              +Destroys the canvas view. The associated canvas is not deleted. + +

              TQCanvas * TQCanvasView::canvas () const +

              + +

              Returns a pointer to the canvas which the TQCanvasView is currently +showing. + +

              void TQCanvasView::drawContents ( TQPainter * p, int cx, int cy, int cw, int ch ) [virtual protected] +

              +Repaints part of the TQCanvas that the canvas view is showing +starting at cx by cy, with a width of cw and a height of ch using the painter p. +

              Warning: When double buffering is enabled, drawContents() will +not respect the current settings of the painter when setting up +the painter for the double buffer (e.g., viewport() and +window()). Also, be aware that TQCanvas::update() bypasses +drawContents(), which means any reimplementation of +drawContents() is not called. +

              See also TQCanvas::setDoubleBuffering(). + +

              Reimplemented from TQScrollView. +

              const TQWMatrix & TQCanvasView::inverseWorldMatrix () const +

              +Returns a reference to the inverse of the canvas view's current +transformation matrix. +

              See also setWorldMatrix() and worldMatrix(). + +

              void TQCanvasView::setCanvas ( TQCanvas * canvas ) +

              +Sets the canvas that the TQCanvasView is showing to the canvas canvas. + +

              bool TQCanvasView::setWorldMatrix ( const TQWMatrix & wm ) +

              +Sets the transformation matrix of the TQCanvasView to wm. The +matrix must be invertible (i.e. if you create a world matrix that +zooms out by 2 times, then the inverse of this matrix is one that +will zoom in by 2 times). +

              When you use this, you should note that the performance of the +TQCanvasView will decrease considerably. +

              Returns FALSE if wm is not invertable; otherwise returns TRUE. +

              See also worldMatrix(), inverseWorldMatrix(), and TQWMatrix::isInvertible(). + +

              Example: canvas/canvas.cpp. +

              TQSize TQCanvasView::sizeHint () const [virtual protected] +

              +Suggests a size sufficient to view the entire canvas. + +

              const TQWMatrix & TQCanvasView::worldMatrix () const +

              +Returns a reference to the canvas view's current transformation matrix. +

              See also setWorldMatrix() and inverseWorldMatrix(). + +

              Example: canvas/canvas.cpp. + +


              +This file is part of the TQt toolkit. +Copyright © 1995-2007 +Trolltech. All Rights Reserved.


              + +
              Copyright © 2007 +TrolltechTrademarks +
              TQt 3.3.8
              +
              + diff --git a/doc/html/tqobject.html b/doc/html/tqobject.html index 27d5699b..a18303de 100644 --- a/doc/html/tqobject.html +++ b/doc/html/tqobject.html @@ -36,7 +36,7 @@ body { background: #ffffff; color: black; }

              All the functions in this class are reentrant when TQt is built with thread support.

              #include <tqobject.h>

              Inherits TQt. -

              Inherited by TQAccel, TQAccessibleObject, TQAction, TQApplication, TQAssistantClient, TQDataPump, TQAxObject, TQAxScript, TQAxScriptManager, TQWidget, TQCanvas, TQStyle, TQClipboard, TQCopChannel, TQDns, TQLayout, TQDragObject, TQEditorFactory, TQEventLoop, TQFileIconProvider, TQNetworkProtocol, TQWSKeyboardHandler, TQNetworkOperation, TQNPInstance, TQObjectCleanupHandler, TQProcess, TQServerSocket, TQSessionManager, TQSignal, TQSignalMapper, TQSocket, TQSocketNotifier, TQSound, TQSqlDatabase, TQSqlDriver, TQSqlForm, TQStyleSheet, TQTimer, TQToolTipGroup, TQTranslator, TQUrlOperator, and TQValidator. +

              Inherited by TQAccel, TQAccessibleObject, TQAction, TQApplication, TQAssistantClient, TQDataPump, TQAxObject, TQAxScript, TQAxScriptManager, TQWidget, TQCanvas, TQStyle, TQClipboard, TQCopChannel, TQDns, TQLayout, TQDragObject, TQEditorFactory, TQEventLoop, TQFileIconProvider, TQNetworkProtocol, TQWSKeyboardHandler, TQNetworkOperation, TQNPInstance, TQObjectCleanupHandler, TQProcess, TQServerSocket, TQSessionManager, TQSignal, TQSignalMapper, TQSocket, TQSocketNotifier, TQSound, TQSqlDatabase, TQSqlDriver, TQSqlForm, TQStyleSheet, TQTimer, TQToolTipGroup, TQTranslator, TQUrlOperator, and TQValidator.

              List of all member functions.

              Public Members

                diff --git a/doc/html/tutorial2-02.html b/doc/html/tutorial2-02.html index 933099c5..e01dee8c 100644 --- a/doc/html/tutorial2-02.html +++ b/doc/html/tutorial2-02.html @@ -44,10 +44,10 @@ form. The chart form has a menubar and toolbar which provide access to the program's functionality. The program provides two dialogs, one to set options, and the other to create and edit a data set. Both dialogs are launched from chart form menu options or toolbar buttons. -

                The chart form's main widget is a TQCanvasView which displays the -TQCanvas on which we draw the pie chart or bar graph. We subclass +

                The chart form's main widget is a TQCanvasView which displays the +TQCanvas on which we draw the pie chart or bar graph. We subclass TQCanvasView to obtain some specialised behaviour. Similarly we -subclass the TQCanvasText class (used to place text items on a canvas) +subclass the TQCanvasText class (used to place text items on a canvas) since we require slightly more than the standard class provides.

                The project file, chart.pro, is used to create the Makefile that is used to build the application. diff --git a/doc/html/tutorial2-05.html b/doc/html/tutorial2-05.html index df811b8c..98f29edd 100644 --- a/doc/html/tutorial2-05.html +++ b/doc/html/tutorial2-05.html @@ -98,7 +98,7 @@ conventional document-centric style. TQAction *optionsVerticalBarChartAction; TQString m_filename; TQStringList m_recentFiles; - TQCanvas *m_canvas; + TQCanvas *m_canvas; CanvasView *m_canvasView; bool m_changed; ElementVector m_elements; @@ -119,8 +119,8 @@ because we are also going to use this menu as the canvas view's context menu.

                -
                The TQCanvas class is used for drawing 2D vector graphics. The -TQCanvasView class is used to present a view of a canvas in an +The TQCanvas class is used for drawing 2D vector graphics. The +TQCanvasView class is used to present a view of a canvas in an application's GUI. All our drawing operations take place on the canvas; but events (e.g. mouse clicks) take place on the canvas view.
                @@ -269,15 +269,15 @@ updateChartType() slot.

                And now that we know the window size and position we can resize and move the chart form's window accordingly. -

                        m_canvas = new TQCanvas( this );
                -        m_canvas->resize( width(), height() );
                +

                        m_canvas = new TQCanvas( this );
                +        m_canvas->resize( width(), height() );
                         m_canvasView = new CanvasView( m_canvas, &m_elements, this );
                         setCentralWidget( m_canvasView );
                         m_canvasView->show();
                 
                -

                We create a new TQCanvas and set its size to that of the chart form +

                We create a new TQCanvas and set its size to that of the chart form window's client area. We also create a CanvasView (our own subclass -of TQCanvasView) to display the TQCanvas. We make the canvas view the +of TQCanvasView) to display the TQCanvas. We make the canvas view the chart form's main widget and show it.

                        if ( !filename.isEmpty() )
                             load( filename );
                diff --git a/doc/html/tutorial2-06.html b/doc/html/tutorial2-06.html
                index 4f1ff0bf..3d5977d7 100644
                --- a/doc/html/tutorial2-06.html
                +++ b/doc/html/tutorial2-06.html
                @@ -43,7 +43,7 @@ drawElements() function is called to redraw the canvas when necessary.
                 
                 
                    void ChartForm::drawElements()
                     {
                -        TQCanvasItemList list = m_canvas->allItems();
                +        TQCanvasItemList list = m_canvas->allItems();
                         for ( TQCanvasItemList::iterator it = list.begin(); it != list.end(); ++it )
                             delete *it;
                 
                @@ -135,15 +135,15 @@ it to NoPen so that no outlines are drawn.

                We iterate over every element in the element vector, skipping invalid elements. The extent of each bar (its length) is simply its scaled value. -

                                TQCanvasRectangle *rect = new TQCanvasRectangle(
                +

                                TQCanvasRectangle *rect = new TQCanvasRectangle(
                                                                 0, y, extent, proheight, m_canvas );
                -                rect->setBrush( TQBrush( m_elements[i].valueColor(),
                +                rect->setBrush( TQBrush( m_elements[i].valueColor(),
                                                         BrushStyle(m_elements[i].valuePattern()) ) );
                -                rect->setPen( pen );
                -                rect->setZ( 0 );
                -                rect->show();
                +                rect->setPen( pen );
                +                rect->setZ( 0 );
                +                rect->show();
                 
                -

                We create a new TQCanvasRectangle for each bar with an x position of 0 +

                We create a new TQCanvasRectangle for each bar with an x position of 0 (since this is a horizontal bar chart every bar begins at the left), a y value that starts at 0 and grows by the height of each bar as each one is drawn, the height of the bar and the canvas that the bar should @@ -176,11 +176,11 @@ containing the label text. (The valueLabel() function adds on the value or percentage to the textual label if the user has set the appropriate options.)

                                    CanvasText *text = new CanvasText( i, label, m_font, m_canvas );
                -                    text->setColor( m_elements[i].labelColor() );
                -                    text->setX( proX * width );
                -                    text->setY( proY * height );
                -                    text->setZ( 1 );
                -                    text->show();
                +                    text->setColor( m_elements[i].labelColor() );
                +                    text->setX( proX * width );
                +                    text->setY( proY * height );
                +                    text->setZ( 1 );
                +                    text->show();
                                     m_elements[i].setProX( HORIZONTAL_BAR, proX );
                                     m_elements[i].setProY( HORIZONTAL_BAR, proY );
                 
                @@ -201,22 +201,22 @@ proportional height ready to draw the next element. } }
                -

                Subclassing TQCanvasText +

                Subclassing TQCanvasText

                (Extracts from canvastext.h.)

                -

                    class CanvasText : public TQCanvasText
                +
                    class CanvasText : public TQCanvasText
                     {
                     public:
                         enum { CANVAS_TEXT = 1100 };
                 
                         CanvasText( int index, TQCanvas *canvas )
                -            : TQCanvasText( canvas ), m_index( index ) {}
                +            : TQCanvasText( canvas ), m_index( index ) {}
                         CanvasText( int index, const TQString& text, TQCanvas *canvas )
                -            : TQCanvasText( text, canvas ), m_index( index ) {}
                +            : TQCanvasText( text, canvas ), m_index( index ) {}
                         CanvasText( int index, const TQString& text, TQFont font, TQCanvas *canvas )
                -            : TQCanvasText( text, font, canvas ), m_index( index ) {}
                +            : TQCanvasText( text, font, canvas ), m_index( index ) {}
                 
                         int index() const { return m_index; }
                         void setIndex( int index ) { m_index = index; }
                @@ -228,21 +228,21 @@ proportional height ready to draw the next element.
                     };
                 

                Our CanvasText subclass is a very simple specialisation of -TQCanvasText. All we've done is added a single private member m_index which holds the element vector index of the element associated +TQCanvasText. All we've done is added a single private member m_index which holds the element vector index of the element associated with this text item, and provided a getter and setter for this value. -

                Subclassing TQCanvasView +

                Subclassing TQCanvasView

                (Extracts from canvasview.h.)

                -

                    class CanvasView : public TQCanvasView
                +
                    class CanvasView : public TQCanvasView
                     {
                         TQ_OBJECT
                     public:
                -        CanvasView( TQCanvas *canvas, ElementVector *elements,
                +        CanvasView( TQCanvas *canvas, ElementVector *elements,
                                     TQWidget* parent = 0, const char* name = "canvas view",
                                     WFlags f = 0 )
                -            : TQCanvasView( canvas, parent, name, f ), m_movingItem(0),
                +            : TQCanvasView( canvas, parent, name, f ), m_movingItem(0),
                               m_elements( elements ) {}
                 
                     protected:
                @@ -252,12 +252,12 @@ with this text item, and provided a getter and setter for this value.
                         void contentsContextMenuEvent( TQContextMenuEvent *e );
                 
                     private:
                -        TQCanvasItem *m_movingItem;
                +        TQCanvasItem *m_movingItem;
                         TQPoint m_pos;
                         ElementVector *m_elements;
                     };
                 
                -

                We need to subclass TQCanvasView so that we can handle: +

                We need to subclass TQCanvasView so that we can handle:

                1. Context menu requests.
                2. Form resizing. @@ -284,7 +284,7 @@ position.

                      void CanvasView::viewportResizeEvent( TQResizeEvent *e )
                       {
                  -        canvas()->resize( e->size().width(), e->size().height() );
                  +        canvas()->resize( e->size().width(), e->size().height() );
                           ((ChartForm*)parent())->drawElements();
                       }
                   
                  @@ -299,7 +299,7 @@ drawn correctly. drag and release at the new position.

                      void CanvasView::contentsMousePressEvent( TQMouseEvent *e )
                       {
                  -        TQCanvasItemList list = canvas()->collisions( e->pos() );
                  +        TQCanvasItemList list = canvas()->collisions( e->pos() );
                           for ( TQCanvasItemList::iterator it = list.begin(); it != list.end(); ++it )
                               if ( (*it)->rtti() == CanvasText::CANVAS_TEXT ) {
                                   m_movingItem = *it;
                  @@ -328,7 +328,7 @@ and record its position. Otherwise we set there to be no moving item.
                               (*m_elements)[i].setProX( chartType, item->x() / canvas()->width() );
                               (*m_elements)[i].setProY( chartType, item->y() / canvas()->height() );
                   
                  -            canvas()->update();
                  +            canvas()->update();
                           }
                       }
                   
                  @@ -342,16 +342,16 @@ element's proportional x and y positions for the current chart type to the current x and y positions proportional to the width and height respectively. We know which element to update because when we create each canvas text item we pass it the index position of the element it -corresponds to. We subclassed TQCanvasText so that we could set and get +corresponds to. We subclassed TQCanvasText so that we could set and get this index value. Finally we call update() to make the canvas redraw.

                  -
                  A TQCanvas has no visual representation. To see the contents of a -canvas you must create a TQCanvasView to present the canvas. Items only +A TQCanvas has no visual representation. To see the contents of a +canvas you must create a TQCanvasView to present the canvas. Items only appear in the canvas view if they have been show()n, and then, only if -TQCanvas::update() has been called. By default a TQCanvas's background +TQCanvas::update() has been called. By default a TQCanvas's background color is white, and by default shapes drawn on the canvas, e.g. -TQCanvasRectangle, TQCanvasEllipse, etc., have their fill color set to +TQCanvasRectangle, TQCanvasEllipse, etc., have their fill color set to white, so setting a non-white brush color is highly recommended!

                  diff --git a/doc/html/whatsthis b/doc/html/whatsthis index 71c8639e..2d5b5c04 100644 --- a/doc/html/whatsthis +++ b/doc/html/whatsthis @@ -1,4 +1,4 @@ -2D area that can contain QCanvasItem objects. | QCanvas +2D area that can contain TQCanvasItem objects. | TQCanvas 2D transformations of a coordinate system. | QWMatrix Abstract base class for accessing SQL databases. | TQSqlDriver Abstract base class for custom menu items in popup menus. | QCustomMenuItem @@ -14,7 +14,7 @@ Abstract base for custom TQWidget plugins. | QWidgetPlugin Abstract base for custom image format plugins. | QImageFormatPlugin Abstract base for fixed-size grids. | QGridView Abstract class that provides an API to initalize and access a COM object. | QAxBase -Abstract graphic object on a QCanvas. | QCanvasItem +Abstract graphic object on a TQCanvas. | TQCanvasItem Abstract interface for accessing data from SQL databases. | TQSqlResult Abstract item that a QLayout manipulates. | QLayoutItem Abstract user interface action that can appear both in menus and tool bars. | QAction @@ -34,10 +34,10 @@ Acts like a union for the most common TQt data types. | QVariant Allows the appearance of the Qt/Embedded Window Manager to be customized. | QWSDecoration Allows waiting/waking for conditions between threads. | QWaitCondition And its descendants manage the framebuffer and palette. | QScreen -Animated canvas item on a QCanvas. | QCanvasSprite +Animated canvas item on a TQCanvas. | TQCanvasSprite Application-global cache for pixmaps. | QPixmapCache Area with movable labelled icons. | QIconView -Array of QCanvasPixmaps. | QCanvasPixmapArray +Array of TQCanvasPixmaps. | TQCanvasPixmapArray Array of bits. | QBitArray Array of bytes. | QByteArray Array of points. | QPointArray @@ -120,7 +120,7 @@ Drag and drop object for transferring colors. | QColorDrag Drag and drop object for transferring images. | QImageDrag Drag and drop object for transferring plain and Unicode text. | QTextDrag Drag object for a list of URI references. | QUriDrag -Ellipse or ellipse segment on a QCanvas. | QCanvasEllipse +Ellipse or ellipse segment on a TQCanvas. | TQCanvasEllipse Encapsulates MIME-based data transfer. | QDragObject Encapsulates a database record, i.e. a set of database fields. | TQSqlRecord Encapsulates a drag item. | QIconDragItem @@ -219,13 +219,13 @@ Layout attribute describing horizontal and vertical resizing policy. | QSizePoli Layout item that represents a widget. | QWidgetItem Lays out widgets in a grid. | QGridLayout Lightweight Unicode character. | TQChar -Line on a QCanvas. | QCanvasLine +Line on a TQCanvas. | TQCanvasLine Lines up child widgets horizontally or vertically. | QBoxLayout Lines up widgets horizontally. | QHBoxLayout Lines up widgets vertically. | QVBoxLayout List box items that display text. | QListBoxText List box items with a pixmap and optional text. | QListBoxPixmap -List of QCanvasItems. | QCanvasItemList +List of TQCanvasItems. | TQCanvasItemList List of TQDomNode objects. | TQDomNodeList List of selectable, read-only items. | QListBox List of strings. | QStringList @@ -250,12 +250,12 @@ Motif look and feel. | QMotifStyle Mouse cursor with an arbitrary shape. | QCursor Mouse driver for Qt/Embedded. | QWSMouseHandler Movable panel containing widgets such as tool buttons. | QToolBar -Multi-bezier splines on a QCanvas. | QCanvasSpline +Multi-bezier splines on a TQCanvas. | TQCanvasSpline Namespace for TQt SQL identifiers that need to be global-like. | TQSql Namespace for miscellaneous identifiers in the TQt OpenGL module. | QGL Namespace for miscellaneous identifiers that need to be global-like. | Qt Off-screen, pixel-based paint device. | QPixmap -On-screen view of a QCanvas. | QCanvasView +On-screen view of a TQCanvas. | TQCanvasView One-line text editor. | QLineEdit Optional parameters for QStyle functions. | QStyleOption Organizes QButton widgets in a group. | QButtonGroup @@ -276,11 +276,11 @@ Parameters that describe a wheel event. | QWheelEvent Pattern matching using regular expressions. | QRegExp Per-thread data storage. | QThreadStorage Persistent platform-independent application settings. | QSettings -Pixmaps for QCanvasSprites. | QCanvasPixmap +Pixmaps for TQCanvasSprites. | TQCanvasPixmap Platform-independent low-level socket API. | QSocketDevice Platform-independent threads. | QThread -Polygon on a QCanvas. | QCanvasPolygon -Polygonal canvas item on a QCanvas. | QCanvasPolygonalItem +Polygon on a TQCanvas. | TQCanvasPolygon +Polygonal canvas item on a TQCanvas. | TQCanvasPolygonalItem Popup menu widget. | QPopupMenu Powerful single-page rich text editor. | QTextEdit TQObject that is a web browser plugin. | QNPInstance @@ -292,7 +292,7 @@ Quick-access button to commands or options, usually used inside a QToolBar. | QT Radio button with a text or pixmap label. | QRadioButton Range checking of floating-point numbers. | QDoubleValidator Read-only SQL forms. | TQDataView -Rectangle on a QCanvas. | QCanvasRectangle +Rectangle on a TQCanvas. | TQCanvasRectangle Represents a generic string in the DOM. | TQDomCharacterData Represents an XML CDATA section. | TQDomCDATASection Represents an XML comment. | TQDomComment @@ -356,7 +356,7 @@ Template class that provides arrays of simple types. | QMemArray Template class that provides guarded pointers to TQObjects. | QGuardedPtr Template class which ensures that implicitly shared and explicitly shared classes reference unique data. | QDeepCopy Template collection class that provides a vector (array). | QPtrVector -Text object on a QCanvas. | QCanvasText +Text object on a TQCanvas. | TQCanvasText Text or image display. | QLabel The QDialog API for Motif-based dialogs. | QMotifDialog The TQWidget API for Xt/Motif widgets. | QMotifWidget diff --git a/doc/man/man3/tqcanvas.3qt b/doc/man/man3/tqcanvas.3qt index dc43b992..4e745459 100644 --- a/doc/man/man3/tqcanvas.3qt +++ b/doc/man/man3/tqcanvas.3qt @@ -1,5 +1,5 @@ '\" t -.TH QCanvas 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- +.TH TQCanvas 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. @@ -7,25 +7,25 @@ .ad l .nh .SH NAME -QCanvas \- 2D area that can contain QCanvasItem objects +TQCanvas \- 2D area that can contain TQCanvasItem objects .SH SYNOPSIS -\fC#include \fR +\fC#include \fR .PP Inherits TQObject. .PP .SS "Public Members" .in +1c .ti -1c -.BI "\fBQCanvas\fR ( TQObject * parent = 0, const char * name = 0 )" +.BI "\fBTQCanvas\fR ( TQObject * parent = 0, const char * name = 0 )" .br .ti -1c -.BI "\fBQCanvas\fR ( int w, int h )" +.BI "\fBTQCanvas\fR ( int w, int h )" .br .ti -1c -.BI "\fBQCanvas\fR ( QPixmap p, int h, int v, int tilewidth, int tileheight )" +.BI "\fBTQCanvas\fR ( QPixmap p, int h, int v, int tilewidth, int tileheight )" .br .ti -1c -.BI "virtual \fB~QCanvas\fR ()" +.BI "virtual \fB~TQCanvas\fR ()" .br .ti -1c .BI "virtual void \fBsetTiles\fR ( QPixmap p, int h, int v, int tilewidth, int tileheight )" @@ -103,16 +103,16 @@ Inherits TQObject. .BI "virtual void \fBsetUnchanged\fR ( const QRect & area )" .br .ti -1c -.BI "QCanvasItemList \fBallItems\fR ()" +.BI "TQCanvasItemList \fBallItems\fR ()" .br .ti -1c -.BI "QCanvasItemList \fBcollisions\fR ( const QPoint & p ) const" +.BI "TQCanvasItemList \fBcollisions\fR ( const QPoint & p ) const" .br .ti -1c -.BI "QCanvasItemList \fBcollisions\fR ( const QRect & r ) const" +.BI "TQCanvasItemList \fBcollisions\fR ( const QRect & r ) const" .br .ti -1c -.BI "QCanvasItemList \fBcollisions\fR ( const QPointArray & chunklist, const QCanvasItem * item, bool exact ) const" +.BI "TQCanvasItemList \fBcollisions\fR ( const QPointArray & chunklist, const TQCanvasItem * item, bool exact ) const" .br .ti -1c .BI "void \fBdrawArea\fR ( const QRect & clip, QPainter * painter, bool dbuf = FALSE )" @@ -152,13 +152,13 @@ Inherits TQObject. .br .in -1c .SH DESCRIPTION -The QCanvas class provides a 2D area that can contain QCanvasItem objects. +The TQCanvas class provides a 2D area that can contain TQCanvasItem objects. .PP -The QCanvas class manages its 2D graphic area and all the canvas items the area contains. The canvas has no visual appearance of its own. Instead, it is displayed on screen using a QCanvasView. Multiple QCanvasView widgets may be associated with a canvas to provide multiple views of the same canvas. +The TQCanvas class manages its 2D graphic area and all the canvas items the area contains. The canvas has no visual appearance of its own. Instead, it is displayed on screen using a TQCanvasView. Multiple TQCanvasView widgets may be associated with a canvas to provide multiple views of the same canvas. .PP The canvas is optimized for large numbers of items, particularly where only a small percentage of the items change at any one time. If the entire display changes very frequently, you should consider using your own custom QScrollView subclass. .PP -Qt provides a rich set of canvas item classes, e.g. QCanvasEllipse, QCanvasLine, QCanvasPolygon, QCanvasPolygonalItem, QCanvasRectangle, QCanvasSpline, QCanvasSprite and QCanvasText. You can subclass to create your own canvas items; QCanvasPolygonalItem is the most common base class used for this purpose. +Qt provides a rich set of canvas item classes, e.g. TQCanvasEllipse, TQCanvasLine, TQCanvasPolygon, TQCanvasPolygonalItem, TQCanvasRectangle, TQCanvasSpline, TQCanvasSprite and TQCanvasText. You can subclass to create your own canvas items; TQCanvasPolygonalItem is the most common base class used for this purpose. .PP Items appear on the canvas after their show() function has been called (or setVisible(TRUE)), and \fIafter\fR update() has been called. The canvas only shows items that are visible, and then only if update() is called. (By default the canvas is white and so are canvas items, so if nothing appears try changing colors.) .PP @@ -172,13 +172,13 @@ Canvas items are usually much faster to manipulate and redraw than child widgets It's easy to detect overlapping items (collision detection). .IP .TP -The canvas can be larger than a widget. A million-by-million canvas is perfectly possible. At such a size a widget might be very inefficient, and some window systems might not support it at all, whereas QCanvas scales well. Even with a billion pixels and a million items, finding a particular canvas item, detecting collisions, etc., is still fast (though the memory consumption may be prohibitive at such extremes). +The canvas can be larger than a widget. A million-by-million canvas is perfectly possible. At such a size a widget might be very inefficient, and some window systems might not support it at all, whereas TQCanvas scales well. Even with a billion pixels and a million items, finding a particular canvas item, detecting collisions, etc., is still fast (though the memory consumption may be prohibitive at such extremes). .IP .TP -Two or more QCanvasView objects can view the same canvas. +Two or more TQCanvasView objects can view the same canvas. .IP .TP -An arbitrary transformation matrix can be set on each QCanvasView which makes it easy to zoom, rotate or shear the viewed canvas. +An arbitrary transformation matrix can be set on each TQCanvasView which makes it easy to zoom, rotate or shear the viewed canvas. .IP .TP Widgets provide a lot more functionality, such as input (QKeyEvent, QMouseEvent etc.) and layout management (QGridLayout etc.). @@ -188,19 +188,19 @@ A canvas consists of a background, a number of canvas items organized by x, y an .PP The background is white by default, but can be set to a different color using setBackgroundColor(), or to a repeated pixmap using setBackgroundPixmap() or to a mosaic of smaller pixmaps using setTiles(). Individual tiles can be set with setTile(). There are corresponding get functions, e.g. backgroundColor() and backgroundPixmap(). .PP -Note that QCanvas does not inherit from TQWidget, even though it has some functions which provide the same functionality as those in TQWidget. One of these is setBackgroundPixmap(); some others are resize(), size(), width() and height(). QCanvasView is the widget used to display a canvas on the screen. +Note that TQCanvas does not inherit from TQWidget, even though it has some functions which provide the same functionality as those in TQWidget. One of these is setBackgroundPixmap(); some others are resize(), size(), width() and height(). TQCanvasView is the widget used to display a canvas on the screen. .PP -Canvas items are added to a canvas by constructing them and passing the canvas to the canvas item's constructor. An item can be moved to a different canvas using QCanvasItem::setCanvas(). +Canvas items are added to a canvas by constructing them and passing the canvas to the canvas item's constructor. An item can be moved to a different canvas using TQCanvasItem::setCanvas(). .PP -Canvas items are movable (and in the case of QCanvasSprites, animated) objects that inherit QCanvasItem. Each canvas item has a position on the canvas (x, y coordinates) and a height (z coordinate), all of which are held as floating-point numbers. Moving canvas items also have x and y velocities. It's possible for a canvas item to be outside the canvas (for example QCanvasItem::x() is greater than width()). When a canvas item is off the canvas, onCanvas() returns FALSE and the canvas disregards the item. (Canvas items off the canvas do not slow down any of the common operations on the canvas.) +Canvas items are movable (and in the case of TQCanvasSprites, animated) objects that inherit TQCanvasItem. Each canvas item has a position on the canvas (x, y coordinates) and a height (z coordinate), all of which are held as floating-point numbers. Moving canvas items also have x and y velocities. It's possible for a canvas item to be outside the canvas (for example TQCanvasItem::x() is greater than width()). When a canvas item is off the canvas, onCanvas() returns FALSE and the canvas disregards the item. (Canvas items off the canvas do not slow down any of the common operations on the canvas.) .PP -Canvas items can be moved with QCanvasItem::move(). The advance() function moves all QCanvasItem::animated() canvas items and setAdvancePeriod() makes QCanvas move them automatically on a periodic basis. In the context of the QCanvas classes, to `animate' a canvas item is to set it in motion, i.e. using QCanvasItem::setVelocity(). Animation of a canvas item itself, i.e. items which change over time, is enabled by calling QCanvasSprite::setFrameAnimation(), or more generally by subclassing and reimplementing QCanvasItem::advance(). To detect collisions use one of the QCanvasItem::collisions() functions. +Canvas items can be moved with TQCanvasItem::move(). The advance() function moves all TQCanvasItem::animated() canvas items and setAdvancePeriod() makes TQCanvas move them automatically on a periodic basis. In the context of the TQCanvas classes, to `animate' a canvas item is to set it in motion, i.e. using TQCanvasItem::setVelocity(). Animation of a canvas item itself, i.e. items which change over time, is enabled by calling TQCanvasSprite::setFrameAnimation(), or more generally by subclassing and reimplementing TQCanvasItem::advance(). To detect collisions use one of the TQCanvasItem::collisions() functions. .PP -The changed parts of the canvas are redrawn (if they are visible in a canvas view) whenever update() is called. You can either call update() manually after having changed the contents of the canvas, or force periodic updates using setUpdatePeriod(). If you have moving objects on the canvas, you must call advance() every time the objects should move one step further. Periodic calls to advance() can be forced using setAdvancePeriod(). The advance() function will call QCanvasItem::advance() on every item that is animated and trigger an update of the affected areas afterwards. (A canvas item that is `animated' is simply a canvas item that is in motion.) +The changed parts of the canvas are redrawn (if they are visible in a canvas view) whenever update() is called. You can either call update() manually after having changed the contents of the canvas, or force periodic updates using setUpdatePeriod(). If you have moving objects on the canvas, you must call advance() every time the objects should move one step further. Periodic calls to advance() can be forced using setAdvancePeriod(). The advance() function will call TQCanvasItem::advance() on every item that is animated and trigger an update of the affected areas afterwards. (A canvas item that is `animated' is simply a canvas item that is in motion.) .PP -QCanvas organizes its canvas items into \fIchunks\fR; these are areas on the canvas that are used to speed up most operations. Many operations start by eliminating most chunks (i.e. those which haven't changed) and then process only the canvas items that are in the few interesting (i.e. changed) chunks. A valid chunk, validChunk(), is one which is on the canvas. +TQCanvas organizes its canvas items into \fIchunks\fR; these are areas on the canvas that are used to speed up most operations. Many operations start by eliminating most chunks (i.e. those which haven't changed) and then process only the canvas items that are in the few interesting (i.e. changed) chunks. A valid chunk, validChunk(), is one which is on the canvas. .PP -The chunk size is a key factor to QCanvas's speed: if there are too many chunks, the speed benefit of grouping canvas items into chunks is reduced. If the chunks are too large, it takes too long to process each one. The QCanvas constructor tries to pick a suitable size, but you can call retune() to change it at any time. The chunkSize() function returns the current chunk size. The canvas items always make sure they're in the right chunks; all you need to make sure of is that the canvas uses the right chunk size. A good rule of thumb is that the size should be a bit smaller than the average canvas item size. If you have moving objects, the chunk size should be a bit smaller than the average size of the moving items. +The chunk size is a key factor to TQCanvas's speed: if there are too many chunks, the speed benefit of grouping canvas items into chunks is reduced. If the chunks are too large, it takes too long to process each one. The TQCanvas constructor tries to pick a suitable size, but you can call retune() to change it at any time. The chunkSize() function returns the current chunk size. The canvas items always make sure they're in the right chunks; all you need to make sure of is that the canvas uses the right chunk size. A good rule of thumb is that the size should be a bit smaller than the average canvas item size. If you have moving objects, the chunk size should be a bit smaller than the average size of the moving items. .PP The foreground is normally nothing, but if you reimplement drawForeground(), you can draw things in front of all the canvas items. .PP @@ -210,18 +210,18 @@ An area can be copied (painted) to a QPainter with drawArea(). .PP If the canvas is resized it emits the resized() signal. .PP -The examples/canvas application and the 2D graphics page of the examples/demo application demonstrate many of QCanvas's facilities. +The examples/canvas application and the 2D graphics page of the examples/demo application demonstrate many of TQCanvas's facilities. .PP -See also QCanvasView, QCanvasItem, Abstract Widget Classes, Graphics Classes, and Image Processing Classes. +See also TQCanvasView, TQCanvasItem, Abstract Widget Classes, Graphics Classes, and Image Processing Classes. .SH MEMBER FUNCTION DOCUMENTATION -.SH "QCanvas::QCanvas ( TQObject * parent = 0, const char * name = 0 )" -Create a QCanvas with no size. \fIparent\fR and \fIname\fR are passed to the TQObject superclass. +.SH "TQCanvas::TQCanvas ( TQObject * parent = 0, const char * name = 0 )" +Create a TQCanvas with no size. \fIparent\fR and \fIname\fR are passed to the TQObject superclass. .PP \fBWarning:\fR You \fImust\fR call resize() at some time after creation to be able to use the canvas. -.SH "QCanvas::QCanvas ( int w, int h )" -Constructs a QCanvas that is \fIw\fR pixels wide and \fIh\fR pixels high. -.SH "QCanvas::QCanvas ( QPixmap p, int h, int v, int tilewidth, int tileheight )" -Constructs a QCanvas which will be composed of \fIh\fR tiles horizontally and \fIv\fR tiles vertically. Each tile will be an image \fItilewidth\fR by \fItileheight\fR pixels taken from pixmap \fIp\fR. +.SH "TQCanvas::TQCanvas ( int w, int h )" +Constructs a TQCanvas that is \fIw\fR pixels wide and \fIh\fR pixels high. +.SH "TQCanvas::TQCanvas ( QPixmap p, int h, int v, int tilewidth, int tileheight )" +Constructs a TQCanvas which will be composed of \fIh\fR tiles horizontally and \fIv\fR tiles vertically. Each tile will be an image \fItilewidth\fR by \fItileheight\fR pixels taken from pixmap \fIp\fR. .PP The pixmap \fIp\fR is a list of tiles, arranged left to right, (and in the case of pixmaps that have multiple rows of tiles, top to bottom), with tile 0 in the top-left corner, tile 1 next to the right, and so on, e.g. .PP @@ -232,48 +232,48 @@ l - l. 0 1 2 3 4 5 6 .fi .PP -The QCanvas is initially sized to show exactly the given number of tiles horizontally and vertically. If it is resized to be larger, the entire matrix of tiles will be repeated as often as necessary to cover the area. If it is smaller, tiles to the right and bottom will not be visible. +The TQCanvas is initially sized to show exactly the given number of tiles horizontally and vertically. If it is resized to be larger, the entire matrix of tiles will be repeated as often as necessary to cover the area. If it is smaller, tiles to the right and bottom will not be visible. .PP See also setTiles(). -.SH "QCanvas::~QCanvas ()\fC [virtual]\fR" +.SH "TQCanvas::~TQCanvas ()\fC [virtual]\fR" Destroys the canvas and all the canvas's canvas items. -.SH "void QCanvas::advance ()\fC [virtual slot]\fR" -Moves all QCanvasItem::animated() canvas items on the canvas and refreshes all changes to all views of the canvas. (An `animated' item is an item that is in motion; see setVelocity().) +.SH "void TQCanvas::advance ()\fC [virtual slot]\fR" +Moves all TQCanvasItem::animated() canvas items on the canvas and refreshes all changes to all views of the canvas. (An `animated' item is an item that is in motion; see setVelocity().) .PP -The advance takes place in two phases. In phase 0, the QCanvasItem::advance() function of each QCanvasItem::animated() canvas item is called with paramater 0. Then all these canvas items are called again, with parameter 1. In phase 0, the canvas items should not change position, merely examine other items on the canvas for which special processing is required, such as collisions between items. In phase 1, all canvas items should change positions, ignoring any other items on the canvas. This two-phase approach allows for considerations of "fairness", although no QCanvasItem subclasses supplied with TQt do anything interesting in phase 0. +The advance takes place in two phases. In phase 0, the TQCanvasItem::advance() function of each TQCanvasItem::animated() canvas item is called with paramater 0. Then all these canvas items are called again, with parameter 1. In phase 0, the canvas items should not change position, merely examine other items on the canvas for which special processing is required, such as collisions between items. In phase 1, all canvas items should change positions, ignoring any other items on the canvas. This two-phase approach allows for considerations of "fairness", although no TQCanvasItem subclasses supplied with TQt do anything interesting in phase 0. .PP The canvas can be configured to call this function periodically with setAdvancePeriod(). .PP See also update(). -.SH "QCanvasItemList QCanvas::allItems ()" +.SH "TQCanvasItemList TQCanvas::allItems ()" Returns a list of all the items in the canvas. -.SH "TQColor QCanvas::backgroundColor () const" +.SH "TQColor TQCanvas::backgroundColor () const" Returns the color set by setBackgroundColor(). By default, this is white. .PP -This function is not a reimplementation of TQWidget::backgroundColor() (QCanvas is not a subclass of TQWidget), but all QCanvasViews that are viewing the canvas will set their backgrounds to this color. +This function is not a reimplementation of TQWidget::backgroundColor() (TQCanvas is not a subclass of TQWidget), but all TQCanvasViews that are viewing the canvas will set their backgrounds to this color. .PP See also setBackgroundColor() and backgroundPixmap(). -.SH "QPixmap QCanvas::backgroundPixmap () const" +.SH "QPixmap TQCanvas::backgroundPixmap () const" Returns the pixmap set by setBackgroundPixmap(). By default, this is a null pixmap. .PP See also setBackgroundPixmap() and backgroundColor(). -.SH "int QCanvas::chunkSize () const" +.SH "int TQCanvas::chunkSize () const" Returns the chunk size of the canvas. .PP See also retune(). -.SH "QCanvasItemList QCanvas::collisions ( const QPoint & p ) const" +.SH "TQCanvasItemList TQCanvas::collisions ( const QPoint & p ) const" Returns a list of canvas items that collide with the point \fIp\fR. The list is ordered by z coordinates, from highest z coordinate (front-most item) to lowest z coordinate (rear-most item). -.SH "QCanvasItemList QCanvas::collisions ( const QRect & r ) const" +.SH "TQCanvasItemList TQCanvas::collisions ( const QRect & r ) const" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Returns a list of items which collide with the rectangle \fIr\fR. The list is ordered by z coordinates, from highest z coordinate (front-most item) to lowest z coordinate (rear-most item). -.SH "QCanvasItemList QCanvas::collisions ( const QPointArray & chunklist, const QCanvasItem * item, bool exact ) const" +.SH "TQCanvasItemList TQCanvas::collisions ( const QPointArray & chunklist, const TQCanvasItem * item, bool exact ) const" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Returns a list of canvas items which intersect with the chunks listed in \fIchunklist\fR, excluding \fIitem\fR. If \fIexact\fR is TRUE, only those which actually collide with \fIitem\fR are returned; otherwise canvas items are included just for being in the chunks. .PP -This is a utility function mainly used to implement the simpler QCanvasItem::collisions() function. -.SH "void QCanvas::drawArea ( const QRect & clip, QPainter * painter, bool dbuf = FALSE )" +This is a utility function mainly used to implement the simpler TQCanvasItem::collisions() function. +.SH "void TQCanvas::drawArea ( const QRect & clip, QPainter * painter, bool dbuf = FALSE )" Paints all canvas items that are in the area \fIclip\fR to \fIpainter\fR, using double-buffering if \fIdbuf\fR is TRUE. .PP e.g. to print the canvas to a printer: @@ -293,42 +293,42 @@ e.g. to print the canvas to a printer: .fi .PP Example: canvas/canvas.cpp. -.SH "void QCanvas::drawBackground ( QPainter & painter, const QRect & clip )\fC [virtual protected]\fR" +.SH "void TQCanvas::drawBackground ( QPainter & painter, const QRect & clip )\fC [virtual protected]\fR" This virtual function is called for all updates of the canvas. It renders any background graphics using the painter \fIpainter\fR, in the area \fIclip\fR. If the canvas has a background pixmap or a tiled background, that graphic is used, otherwise the canvas is cleared using the background color. .PP If the graphics for an area change, you must explicitly call setChanged(const QRect&) for the result to be visible when update() is next called. .PP See also setBackgroundColor(), setBackgroundPixmap(), and setTiles(). -.SH "void QCanvas::drawForeground ( QPainter & painter, const QRect & clip )\fC [virtual protected]\fR" +.SH "void TQCanvas::drawForeground ( QPainter & painter, const QRect & clip )\fC [virtual protected]\fR" This virtual function is called for all updates of the canvas. It renders any foreground graphics using the painter \fIpainter\fR, in the area \fIclip\fR. .PP If the graphics for an area change, you must explicitly call setChanged(const QRect&) for the result to be visible when update() is next called. .PP The default is to draw nothing. -.SH "int QCanvas::height () const" +.SH "int TQCanvas::height () const" Returns the height of the canvas, in pixels. .PP Example: canvas/canvas.cpp. -.SH "bool QCanvas::onCanvas ( int x, int y ) const" +.SH "bool TQCanvas::onCanvas ( int x, int y ) const" Returns TRUE if the pixel position (\fIx\fR, \fIy\fR) is on the canvas; otherwise returns FALSE. .PP See also validChunk(). -.SH "bool QCanvas::onCanvas ( const QPoint & p ) const" +.SH "bool TQCanvas::onCanvas ( const QPoint & p ) const" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Returns TRUE if the pixel position \fIp\fR is on the canvas; otherwise returns FALSE. .PP See also validChunk(). -.SH "QRect QCanvas::rect () const" +.SH "QRect TQCanvas::rect () const" Returns a rectangle the size of the canvas. -.SH "void QCanvas::resize ( int w, int h )\fC [virtual]\fR" +.SH "void TQCanvas::resize ( int w, int h )\fC [virtual]\fR" Changes the size of the canvas to have a width of \fIw\fR and a height of \fIh\fR. This is a slow operation. .PP Examples: .)l canvas/canvas.cpp and chart/chartform.cpp. -.SH "void QCanvas::resized ()\fC [signal]\fR" -This signal is emitted whenever the canvas is resized. Each QCanvasView connects to this signal to keep the scrollview's size correct. -.SH "void QCanvas::retune ( int chunksze, int mxclusters = 100 )\fC [virtual]\fR" +.SH "void TQCanvas::resized ()\fC [signal]\fR" +This signal is emitted whenever the canvas is resized. Each TQCanvasView connects to this signal to keep the scrollview's size correct. +.SH "void TQCanvas::retune ( int chunksze, int mxclusters = 100 )\fC [virtual]\fR" Change the efficiency tuning parameters to \fImxclusters\fR clusters, each of size \fIchunksze\fR. This is a slow operation if there are many objects on the canvas. .PP The canvas is divided into chunks which are rectangular areas \fIchunksze\fR wide by \fIchunksze\fR high. Use a chunk size which is about the average size of the canvas items. If you choose a chunk size which is too small it will increase the amount of calculation required when drawing since each change will affect many chunks. If you choose a chunk size which is too large the amount of drawing required will increase because for each change, a lot of drawing will be required since there will be many (unchanged) canvas items which are in the same chunk as the changed canvas items. @@ -336,31 +336,31 @@ The canvas is divided into chunks which are rectangular areas \fIchunksze\fR wid Internally, a canvas uses a low-resolution "chunk matrix" to keep track of all the items in the canvas. A 64x64 chunk matrix is the default for a 1024x1024 pixel canvas, where each chunk collects canvas items in a 16x16 pixel square. This default is also affected by setTiles(). You can tune this default using this function. For example if you have a very large canvas and want to trade off speed for memory then you might set the chunk size to 32 or 64. .PP The \fImxclusters\fR argument is the number of rectangular groups of chunks that will be separately drawn. If the canvas has a large number of small, dispersed items, this should be about that number. Our testing suggests that a large number of clusters is almost always best. -.SH "void QCanvas::setAdvancePeriod ( int ms )\fC [virtual]\fR" +.SH "void TQCanvas::setAdvancePeriod ( int ms )\fC [virtual]\fR" Sets the canvas to call advance() every \fIms\fR milliseconds. Any previous setting by setAdvancePeriod() or setUpdatePeriod() is overridden. .PP If \fIms\fR is less than 0 advancing will be stopped. .PP Example: canvas/main.cpp. -.SH "void QCanvas::setAllChanged ()\fC [virtual]\fR" +.SH "void TQCanvas::setAllChanged ()\fC [virtual]\fR" Marks the whole canvas as changed. All views of the canvas will be entirely redrawn when update() is called next. -.SH "void QCanvas::setBackgroundColor ( const TQColor & c )\fC [virtual]\fR" +.SH "void TQCanvas::setBackgroundColor ( const TQColor & c )\fC [virtual]\fR" Sets the solid background to be the color \fIc\fR. .PP See also backgroundColor(), setBackgroundPixmap(), and setTiles(). -.SH "void QCanvas::setBackgroundPixmap ( const QPixmap & p )\fC [virtual]\fR" +.SH "void TQCanvas::setBackgroundPixmap ( const QPixmap & p )\fC [virtual]\fR" Sets the solid background to be the pixmap \fIp\fR repeated as necessary to cover the entire canvas. .PP See also backgroundPixmap(), setBackgroundColor(), and setTiles(). -.SH "void QCanvas::setChanged ( const QRect & area )\fC [virtual]\fR" +.SH "void TQCanvas::setChanged ( const QRect & area )\fC [virtual]\fR" Marks \fIarea\fR as changed. This \fIarea\fR will be redrawn in all views that are showing it when update() is called next. -.SH "void QCanvas::setDoubleBuffering ( bool y )\fC [virtual]\fR" +.SH "void TQCanvas::setDoubleBuffering ( bool y )\fC [virtual]\fR" If \fIy\fR is TRUE (the default) double-buffering is switched on; otherwise double-buffering is switched off. .PP Turning off double-buffering causes the redrawn areas to flicker a little and also gives a (usually small) performance improvement. .PP Example: canvas/canvas.cpp. -.SH "void QCanvas::setTile ( int x, int y, int tilenum )\fC [virtual]\fR" +.SH "void TQCanvas::setTile ( int x, int y, int tilenum )\fC [virtual]\fR" Sets the tile at (\fIx\fR, \fIy\fR) to use tile number \fItilenum\fR, which is an index into the tile pixmaps. The canvas will update appropriately when update() is next called. .PP The images are taken from the pixmap set by setTiles() and are arranged left to right, (and in the case of pixmaps that have multiple rows of tiles, top to bottom), with tile 0 in the top-left corner, tile 1 next to the right, and so on, e.g. @@ -373,8 +373,8 @@ l - l. 0 1 2 3 4 5 6 .PP See also tile() and setTiles(). -.SH "void QCanvas::setTiles ( QPixmap p, int h, int v, int tilewidth, int tileheight )\fC [virtual]\fR" -Sets the QCanvas to be composed of \fIh\fR tiles horizontally and \fIv\fR tiles vertically. Each tile will be an image \fItilewidth\fR by \fItileheight\fR pixels from pixmap \fIp\fR. +.SH "void TQCanvas::setTiles ( QPixmap p, int h, int v, int tilewidth, int tileheight )\fC [virtual]\fR" +Sets the TQCanvas to be composed of \fIh\fR tiles horizontally and \fIv\fR tiles vertically. Each tile will be an image \fItilewidth\fR by \fItileheight\fR pixels from pixmap \fIp\fR. .PP The pixmap \fIp\fR is a list of tiles, arranged left to right, (and in the case of pixmaps that have multiple rows of tiles, top to bottom), with tile 0 in the top-left corner, tile 1 next to the right, and so on, e.g. .PP @@ -390,49 +390,49 @@ If the canvas is larger than the matrix of tiles, the entire matrix is repeated The width and height of \fIp\fR must be a multiple of \fItilewidth\fR and \fItileheight\fR. If they are not the function will do nothing. .PP If you want to unset any tiling set, then just pass in a null pixmap and 0 for \fIh\fR, \fIv\fR, \fItilewidth\fR, and \fItileheight\fR. -.SH "void QCanvas::setUnchanged ( const QRect & area )\fC [virtual]\fR" +.SH "void TQCanvas::setUnchanged ( const QRect & area )\fC [virtual]\fR" Marks \fIarea\fR as \fIunchanged\fR. The area will \fInot\fR be redrawn in the views for the next update(), unless it is marked or changed again before the next call to update(). -.SH "void QCanvas::setUpdatePeriod ( int ms )\fC [virtual]\fR" +.SH "void TQCanvas::setUpdatePeriod ( int ms )\fC [virtual]\fR" Sets the canvas to call update() every \fIms\fR milliseconds. Any previous setting by setAdvancePeriod() or setUpdatePeriod() is overridden. .PP If \fIms\fR is less than 0 automatic updating will be stopped. -.SH "QSize QCanvas::size () const" +.SH "QSize TQCanvas::size () const" Returns the size of the canvas, in pixels. -.SH "int QCanvas::tile ( int x, int y ) const" +.SH "int TQCanvas::tile ( int x, int y ) const" Returns the tile at position (\fIx\fR, \fIy\fR). Initially, all tiles are 0. .PP The parameters must be within range, i.e. 0 < \fIx\fR < tilesHorizontally() and 0 < \fIy\fR < tilesVertically(). .PP See also setTile(). -.SH "int QCanvas::tileHeight () const" +.SH "int TQCanvas::tileHeight () const" Returns the height of each tile. -.SH "int QCanvas::tileWidth () const" +.SH "int TQCanvas::tileWidth () const" Returns the width of each tile. -.SH "int QCanvas::tilesHorizontally () const" +.SH "int TQCanvas::tilesHorizontally () const" Returns the number of tiles horizontally. -.SH "int QCanvas::tilesVertically () const" +.SH "int TQCanvas::tilesVertically () const" Returns the number of tiles vertically. -.SH "void QCanvas::update ()\fC [virtual slot]\fR" +.SH "void TQCanvas::update ()\fC [virtual slot]\fR" Repaints changed areas in all views of the canvas. .PP See also advance(). -.SH "bool QCanvas::validChunk ( int x, int y ) const" +.SH "bool TQCanvas::validChunk ( int x, int y ) const" Returns TRUE if the chunk position (\fIx\fR, \fIy\fR) is on the canvas; otherwise returns FALSE. .PP See also onCanvas(). -.SH "bool QCanvas::validChunk ( const QPoint & p ) const" +.SH "bool TQCanvas::validChunk ( const QPoint & p ) const" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Returns TRUE if the chunk position \fIp\fR is on the canvas; otherwise returns FALSE. .PP See also onCanvas(). -.SH "int QCanvas::width () const" +.SH "int TQCanvas::width () const" Returns the width of the canvas, in pixels. .PP Example: canvas/canvas.cpp. .SH "SEE ALSO" -.BR http://doc.trolltech.com/ntqcanvas.html +.BR http://doc.trolltech.com/tqcanvas.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the diff --git a/doc/man/man3/tqcanvasellipse.3qt b/doc/man/man3/tqcanvasellipse.3qt index 8359f1a0..cd74f8aa 100644 --- a/doc/man/man3/tqcanvasellipse.3qt +++ b/doc/man/man3/tqcanvasellipse.3qt @@ -1,5 +1,5 @@ '\" t -.TH QCanvasEllipse 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- +.TH TQCanvasEllipse 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. @@ -7,25 +7,25 @@ .ad l .nh .SH NAME -QCanvasEllipse \- Ellipse or ellipse segment on a QCanvas +TQCanvasEllipse \- Ellipse or ellipse segment on a TQCanvas .SH SYNOPSIS -\fC#include \fR +\fC#include \fR .PP -Inherits QCanvasPolygonalItem. +Inherits TQCanvasPolygonalItem. .PP .SS "Public Members" .in +1c .ti -1c -.BI "\fBQCanvasEllipse\fR ( QCanvas * canvas )" +.BI "\fBTQCanvasEllipse\fR ( TQCanvas * canvas )" .br .ti -1c -.BI "\fBQCanvasEllipse\fR ( int width, int height, QCanvas * canvas )" +.BI "\fBTQCanvasEllipse\fR ( int width, int height, TQCanvas * canvas )" .br .ti -1c -.BI "\fBQCanvasEllipse\fR ( int width, int height, int startangle, int angle, QCanvas * canvas )" +.BI "\fBTQCanvasEllipse\fR ( int width, int height, int startangle, int angle, TQCanvas * canvas )" .br .ti -1c -.BI "\fB~QCanvasEllipse\fR ()" +.BI "\fB~TQCanvasEllipse\fR ()" .br .ti -1c .BI "int \fBwidth\fR () const" @@ -56,7 +56,7 @@ Inherits QCanvasPolygonalItem. .br .in -1c .SH DESCRIPTION -The QCanvasEllipse class provides an ellipse or ellipse segment on a QCanvas. +The TQCanvasEllipse class provides an ellipse or ellipse segment on a TQCanvas. .PP A canvas item that paints an ellipse or ellipse segment with a QBrush. The ellipse's height, width, start angle and angle length can be set at construction time. The size can be changed at runtime with setSize(), and the angles can be changed (if you're displaying an ellipse segment rather than a whole ellipse) with setAngles(). .PP @@ -74,53 +74,53 @@ The ellipse can be drawn on a painter with drawShape(). .PP Like any other canvas item ellipses can be moved with move() and moveBy(), or by setting coordinates with setX(), setY() and setZ(). .PP -Note: QCanvasEllipse does not use the pen. +Note: TQCanvasEllipse does not use the pen. .PP See also Graphics Classes and Image Processing Classes. .SH MEMBER FUNCTION DOCUMENTATION -.SH "QCanvasEllipse::QCanvasEllipse ( QCanvas * canvas )" +.SH "TQCanvasEllipse::TQCanvasEllipse ( TQCanvas * canvas )" Constructs a 32x32 ellipse, centered at (0, 0) on \fIcanvas\fR. -.SH "QCanvasEllipse::QCanvasEllipse ( int width, int height, QCanvas * canvas )" +.SH "TQCanvasEllipse::TQCanvasEllipse ( int width, int height, TQCanvas * canvas )" Constructs a \fIwidth\fR by \fIheight\fR pixel ellipse, centered at (0, 0) on \fIcanvas\fR. -.SH "QCanvasEllipse::QCanvasEllipse ( int width, int height, int startangle, int angle, QCanvas * canvas )" +.SH "TQCanvasEllipse::TQCanvasEllipse ( int width, int height, int startangle, int angle, TQCanvas * canvas )" Constructs a \fIwidth\fR by \fIheight\fR pixel ellipse, centered at (0, 0) on \fIcanvas\fR. Only a segment of the ellipse is drawn, starting at angle \fIstartangle\fR, and extending for angle \fIangle\fR (the angle length). .PP Note that angles are specified in 1/16ths of a degree. -.SH "QCanvasEllipse::~QCanvasEllipse ()" +.SH "TQCanvasEllipse::~TQCanvasEllipse ()" Destroys the ellipse. -.SH "int QCanvasEllipse::angleLength () const" +.SH "int TQCanvasEllipse::angleLength () const" Returns the length angle (the extent of the ellipse segment) in 16ths of a degree. Initially this will be 360 * 16 (a complete ellipse). .PP See also setAngles() and angleStart(). -.SH "int QCanvasEllipse::angleStart () const" +.SH "int TQCanvasEllipse::angleStart () const" Returns the start angle in 16ths of a degree. Initially this will be 0. .PP See also setAngles() and angleLength(). -.SH "void QCanvasEllipse::drawShape ( QPainter & p )\fC [virtual protected]\fR" +.SH "void TQCanvasEllipse::drawShape ( QPainter & p )\fC [virtual protected]\fR" Draws the ellipse, centered at x(), y() using the painter \fIp\fR. .PP -Note that QCanvasEllipse does not support an outline (the pen is always NoPen). +Note that TQCanvasEllipse does not support an outline (the pen is always NoPen). .PP -Reimplemented from QCanvasPolygonalItem. -.SH "int QCanvasEllipse::height () const" +Reimplemented from TQCanvasPolygonalItem. +.SH "int TQCanvasEllipse::height () const" Returns the height of the ellipse. -.SH "int QCanvasEllipse::rtti () const\fC [virtual]\fR" -Returns 6 (QCanvasItem::Rtti_Ellipse). +.SH "int TQCanvasEllipse::rtti () const\fC [virtual]\fR" +Returns 6 (TQCanvasItem::Rtti_Ellipse). .PP -See also QCanvasItem::rtti(). +See also TQCanvasItem::rtti(). .PP -Reimplemented from QCanvasPolygonalItem. -.SH "void QCanvasEllipse::setAngles ( int start, int length )" +Reimplemented from TQCanvasPolygonalItem. +.SH "void TQCanvasEllipse::setAngles ( int start, int length )" Sets the angles for the ellipse. The start angle is \fIstart\fR and the extent of the segment is \fIlength\fR (the angle length) from the \fIstart\fR. The angles are specified in 16ths of a degree. By default the ellipse will start at 0 and have an angle length of 360 * 16 (a complete ellipse). .PP See also angleStart() and angleLength(). -.SH "void QCanvasEllipse::setSize ( int width, int height )" +.SH "void TQCanvasEllipse::setSize ( int width, int height )" Sets the \fIwidth\fR and \fIheight\fR of the ellipse. -.SH "int QCanvasEllipse::width () const" +.SH "int TQCanvasEllipse::width () const" Returns the width of the ellipse. .SH "SEE ALSO" -.BR http://doc.trolltech.com/qcanvasellipse.html +.BR http://doc.trolltech.com/tqcanvasellipse.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the diff --git a/doc/man/man3/tqcanvasitem.3qt b/doc/man/man3/tqcanvasitem.3qt index 0a6db191..75406891 100644 --- a/doc/man/man3/tqcanvasitem.3qt +++ b/doc/man/man3/tqcanvasitem.3qt @@ -1,5 +1,5 @@ '\" t -.TH QCanvasItem 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- +.TH TQCanvasItem 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. @@ -7,21 +7,21 @@ .ad l .nh .SH NAME -QCanvasItem \- Abstract graphic object on a QCanvas +TQCanvasItem \- Abstract graphic object on a TQCanvas .SH SYNOPSIS -\fC#include \fR +\fC#include \fR .PP Inherits Qt. .PP -Inherited by QCanvasSprite, QCanvasPolygonalItem, and QCanvasText. +Inherited by TQCanvasSprite, TQCanvasPolygonalItem, and TQCanvasText. .PP .SS "Public Members" .in +1c .ti -1c -.BI "\fBQCanvasItem\fR ( QCanvas * canvas )" +.BI "\fBTQCanvasItem\fR ( TQCanvas * canvas )" .br .ti -1c -.BI "virtual \fB~QCanvasItem\fR ()" +.BI "virtual \fB~TQCanvasItem\fR ()" .br .ti -1c .BI "double \fBx\fR () const" @@ -72,13 +72,13 @@ Inherited by QCanvasSprite, QCanvasPolygonalItem, and QCanvasText. .BI "virtual void \fBadvance\fR ( int phase )" .br .ti -1c -.BI "virtual bool \fBcollidesWith\fR ( const QCanvasItem * other ) const = 0" +.BI "virtual bool \fBcollidesWith\fR ( const TQCanvasItem * other ) const = 0" .br .ti -1c -.BI "QCanvasItemList \fBcollisions\fR ( bool exact ) const" +.BI "TQCanvasItemList \fBcollisions\fR ( bool exact ) const" .br .ti -1c -.BI "virtual void \fBsetCanvas\fR ( QCanvas * c )" +.BI "virtual void \fBsetCanvas\fR ( TQCanvas * c )" .br .ti -1c .BI "virtual void \fBdraw\fR ( QPainter & painter ) = 0" @@ -138,7 +138,7 @@ Inherited by QCanvasSprite, QCanvasPolygonalItem, and QCanvasText. .BI "virtual QRect \fBboundingRectAdvanced\fR () const" .br .ti -1c -.BI "QCanvas * \fBcanvas\fR () const" +.BI "TQCanvas * \fBcanvas\fR () const" .br .in -1c .SS "Protected Members" @@ -148,95 +148,95 @@ Inherited by QCanvasSprite, QCanvasPolygonalItem, and QCanvasText. .br .in -1c .SH DESCRIPTION -The QCanvasItem class provides an abstract graphic object on a QCanvas. +The TQCanvasItem class provides an abstract graphic object on a TQCanvas. .PP -A variety of QCanvasItem subclasses provide immediately usable behaviour. This class is a pure abstract superclass providing the behaviour that is shared among all the concrete canvas item classes. QCanvasItem is not intended for direct subclassing. It is much easier to subclass one of its subclasses, e.g. QCanvasPolygonalItem (the commonest base class), QCanvasRectangle, QCanvasSprite, QCanvasEllipse or QCanvasText. +A variety of TQCanvasItem subclasses provide immediately usable behaviour. This class is a pure abstract superclass providing the behaviour that is shared among all the concrete canvas item classes. TQCanvasItem is not intended for direct subclassing. It is much easier to subclass one of its subclasses, e.g. TQCanvasPolygonalItem (the commonest base class), TQCanvasRectangle, TQCanvasSprite, TQCanvasEllipse or TQCanvasText. .PP Canvas items are added to a canvas by constructing them and passing the canvas to the canvas item's constructor. An item can be moved to a different canvas using setCanvas(). .PP Items appear on the canvas after their show() function has been called (or setVisible(TRUE)), and \fIafter\fR update() has been called. The canvas only shows items that are visible, and then only if update() is called. If you created the canvas without passing a width and height to the constructor you'll also need to call resize(). Since the canvas background defaults to white and canvas items default to white, you may need to change colors to see your items. .PP -A QCanvasItem object can be moved in the x(), y() and z() dimensions using functions such as move(), moveBy(), setX(), setY() and setZ(). A canvas item can be set in motion, `animated', using setAnimated() and given a velocity in the x and y directions with setXVelocity() and setYVelocity() -- the same effect can be achieved by calling setVelocity(). Use the collidesWith() function to see if the canvas item will collide on the \fInext\fR advance(1) and use collisions() to see what collisions have occurred. +A TQCanvasItem object can be moved in the x(), y() and z() dimensions using functions such as move(), moveBy(), setX(), setY() and setZ(). A canvas item can be set in motion, `animated', using setAnimated() and given a velocity in the x and y directions with setXVelocity() and setYVelocity() -- the same effect can be achieved by calling setVelocity(). Use the collidesWith() function to see if the canvas item will collide on the \fInext\fR advance(1) and use collisions() to see what collisions have occurred. .PP -Use QCanvasSprite or your own subclass of QCanvasSprite to create canvas items which are animated, i.e. which change over time. +Use TQCanvasSprite or your own subclass of TQCanvasSprite to create canvas items which are animated, i.e. which change over time. .PP The size of a canvas item is given by boundingRect(). Use boundingRectAdvanced() to see what the size of the canvas item will be \fIafter\fR the next advance(1) call. .PP -The rtti() function is used for identifying subclasses of QCanvasItem. The canvas() function returns a pointer to the canvas which contains the canvas item. +The rtti() function is used for identifying subclasses of TQCanvasItem. The canvas() function returns a pointer to the canvas which contains the canvas item. .PP -QCanvasItem provides the show() and isVisible() functions like those in TQWidget. +TQCanvasItem provides the show() and isVisible() functions like those in TQWidget. .PP -QCanvasItem also provides the setEnabled(), setActive() and setSelected() functions; these functions set the relevant boolean and cause a repaint but the boolean values they set are not used in QCanvasItem itself. You can make use of these booleans in your subclasses. +TQCanvasItem also provides the setEnabled(), setActive() and setSelected() functions; these functions set the relevant boolean and cause a repaint but the boolean values they set are not used in TQCanvasItem itself. You can make use of these booleans in your subclasses. .PP By default, canvas items have no velocity, no size, and are not in motion. The subclasses provided in TQt do not change these defaults except where noted. .PP See also Graphics Classes and Image Processing Classes. .SS "Member Type Documentation" -.SH "QCanvasItem::RttiValues" +.SH "TQCanvasItem::RttiValues" This enum is used to name the different types of canvas item. .TP -\fCQCanvasItem::Rtti_Item\fR - Canvas item abstract base class +\fCTQCanvasItem::Rtti_Item\fR - Canvas item abstract base class .TP -\fCQCanvasItem::Rtti_Ellipse\fR +\fCTQCanvasItem::Rtti_Ellipse\fR .TP -\fCQCanvasItem::Rtti_Line\fR +\fCTQCanvasItem::Rtti_Line\fR .TP -\fCQCanvasItem::Rtti_Polygon\fR +\fCTQCanvasItem::Rtti_Polygon\fR .TP -\fCQCanvasItem::Rtti_PolygonalItem\fR +\fCTQCanvasItem::Rtti_PolygonalItem\fR .TP -\fCQCanvasItem::Rtti_Rectangle\fR +\fCTQCanvasItem::Rtti_Rectangle\fR .TP -\fCQCanvasItem::Rtti_Spline\fR +\fCTQCanvasItem::Rtti_Spline\fR .TP -\fCQCanvasItem::Rtti_Sprite\fR +\fCTQCanvasItem::Rtti_Sprite\fR .TP -\fCQCanvasItem::Rtti_Text\fR +\fCTQCanvasItem::Rtti_Text\fR .PP .SH MEMBER FUNCTION DOCUMENTATION -.SH "QCanvasItem::QCanvasItem ( QCanvas * canvas )" -Constructs a QCanvasItem on canvas \fIcanvas\fR. +.SH "TQCanvasItem::TQCanvasItem ( TQCanvas * canvas )" +Constructs a TQCanvasItem on canvas \fIcanvas\fR. .PP See also setCanvas(). -.SH "QCanvasItem::~QCanvasItem ()\fC [virtual]\fR" -Destroys the QCanvasItem and removes it from its canvas. -.SH "bool QCanvasItem::active () const" +.SH "TQCanvasItem::~TQCanvasItem ()\fC [virtual]\fR" +Destroys the TQCanvasItem and removes it from its canvas. +.SH "bool TQCanvasItem::active () const" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP Use isActive() instead. -.SH "void QCanvasItem::advance ( int phase )\fC [virtual]\fR" +.SH "void TQCanvasItem::advance ( int phase )\fC [virtual]\fR" The default implementation moves the canvas item, if it is animated(), by the preset velocity if \fIphase\fR is 1, and does nothing if \fIphase\fR is 0. .PP Note that if you reimplement this function, the reimplementation must not change the canvas in any way, for example it must not add or remove items. .PP -See also QCanvas::advance() and setVelocity(). +See also TQCanvas::advance() and setVelocity(). .PP Example: canvas/canvas.cpp. .PP -Reimplemented in QCanvasSprite. -.SH "bool QCanvasItem::animated () const" +Reimplemented in TQCanvasSprite. +.SH "bool TQCanvasItem::animated () const" Returns TRUE if the canvas item is in motion; otherwise returns FALSE. .PP See also setVelocity() and setAnimated(). -.SH "QRect QCanvasItem::boundingRect () const\fC [pure virtual]\fR" +.SH "QRect TQCanvasItem::boundingRect () const\fC [pure virtual]\fR" Returns the bounding rectangle in pixels that the canvas item covers. .PP See also boundingRectAdvanced(). .PP -Reimplemented in QCanvasSprite, QCanvasPolygonalItem, and QCanvasText. -.SH "QRect QCanvasItem::boundingRectAdvanced () const\fC [virtual]\fR" +Reimplemented in TQCanvasSprite, TQCanvasPolygonalItem, and TQCanvasText. +.SH "QRect TQCanvasItem::boundingRectAdvanced () const\fC [virtual]\fR" Returns the bounding rectangle of pixels that the canvas item \fIwill\fR cover after advance(1) is called. .PP See also boundingRect(). -.SH "QCanvas * QCanvasItem::canvas () const" +.SH "TQCanvas * TQCanvasItem::canvas () const" Returns the canvas containing the canvas item. -.SH "bool QCanvasItem::collidesWith ( const QCanvasItem * other ) const\fC [pure virtual]\fR" +.SH "bool TQCanvasItem::collidesWith ( const TQCanvasItem * other ) const\fC [pure virtual]\fR" Returns TRUE if the canvas item will collide with the \fIother\fR item \fIafter\fR they have moved by their current velocities; otherwise returns FALSE. .PP See also collisions(). .PP Example: canvas/canvas.cpp. -.SH "QCanvasItemList QCanvasItem::collisions ( bool exact ) const" +.SH "TQCanvasItemList TQCanvasItem::collisions ( bool exact ) const" Returns the list of canvas items that this canvas item has collided with. .PP A collision is generally defined as occurring when the pixels of one item draw on the pixels of another item, but not all subclasses are so precise. Also, since pixel-wise collision detection can be slow, this function works in either exact or inexact mode, according to the \fIexact\fR parameter. @@ -245,57 +245,57 @@ If \fIexact\fR is TRUE, the canvas items returned have been accurately tested fo .PP If \fIexact\fR is FALSE, the canvas items returned are \fInear\fR the canvas item. You can test the canvas items returned using collidesWith() if any are interesting collision candidates. By using this approach, you can ignore some canvas items for which collisions are not relevant. .PP -The returned list is a list of QCanvasItems, but often you will need to cast the items to their subclass types. The safe way to do this is to use rtti() before casting. This provides some of the functionality of the standard C++ dynamic cast operation even on compilers where dynamic casts are not available. +The returned list is a list of TQCanvasItems, but often you will need to cast the items to their subclass types. The safe way to do this is to use rtti() before casting. This provides some of the functionality of the standard C++ dynamic cast operation even on compilers where dynamic casts are not available. .PP Note that a canvas item may be `on' a canvas, e.g. it was created with the canvas as parameter, even though its coordinates place it beyond the edge of the canvas's area. Collision detection only works for canvas items which are wholly or partly within the canvas's area. .PP Note that if items have a velocity (see setVelocity()), then collision testing is done based on where the item \fIwill\fR be when it moves, not its current location. For example, a "ball" item doesn't need to actually embed into a "wall" item before a collision is detected. For items without velocity, plain intersection is used. -.SH "void QCanvasItem::draw ( QPainter & painter )\fC [pure virtual]\fR" +.SH "void TQCanvasItem::draw ( QPainter & painter )\fC [pure virtual]\fR" This abstract virtual function draws the canvas item using \fIpainter\fR. .PP \fBWarning:\fR When you reimplement this function, make sure that you leave the painter in the same state as you found it. For example, if you start by calling QPainter::translate(50, 50), end your code by calling QPainter::translate(-50, -50). Be also aware that the painter might already have some transformations set (i.e., don't call QPainter::resetXForm() when you're done). .PP -Reimplemented in QCanvasSprite, QCanvasPolygonalItem, and QCanvasText. -.SH "bool QCanvasItem::enabled () const" +Reimplemented in TQCanvasSprite, TQCanvasPolygonalItem, and TQCanvasText. +.SH "bool TQCanvasItem::enabled () const" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP Use isEnabled() instead. -.SH "void QCanvasItem::hide ()" +.SH "void TQCanvasItem::hide ()" Shorthand for setVisible(FALSE). -.SH "bool QCanvasItem::isActive () const" -Returns TRUE if the QCanvasItem is active; otherwise returns FALSE. -.SH "bool QCanvasItem::isEnabled () const" -Returns TRUE if the QCanvasItem is enabled; otherwise returns FALSE. -.SH "bool QCanvasItem::isSelected () const" +.SH "bool TQCanvasItem::isActive () const" +Returns TRUE if the TQCanvasItem is active; otherwise returns FALSE. +.SH "bool TQCanvasItem::isEnabled () const" +Returns TRUE if the TQCanvasItem is enabled; otherwise returns FALSE. +.SH "bool TQCanvasItem::isSelected () const" Returns TRUE if the canvas item is selected; otherwise returns FALSE. -.SH "bool QCanvasItem::isVisible () const" +.SH "bool TQCanvasItem::isVisible () const" Returns TRUE if the canvas item is visible; otherwise returns FALSE. .PP Note that in this context TRUE does \fInot\fR mean that the canvas item is currently in a view, merely that if a view is showing the area where the canvas item is positioned, and the item is not obscured by items with higher z values, and the view is not obscured by overlaying windows, it would be visible. .PP See also setVisible() and z(). -.SH "void QCanvasItem::move ( double x, double y )" +.SH "void TQCanvasItem::move ( double x, double y )" Moves the canvas item to the absolute position (\fIx\fR, \fIy\fR). .PP Example: canvas/canvas.cpp. -.SH "void QCanvasItem::moveBy ( double dx, double dy )\fC [virtual]\fR" +.SH "void TQCanvasItem::moveBy ( double dx, double dy )\fC [virtual]\fR" Moves the canvas item relative to its current position by (\fIdx\fR, \fIdy\fR). .PP Example: canvas/canvas.cpp. -.SH "int QCanvasItem::rtti () const\fC [virtual]\fR" -Returns 0 (QCanvasItem::Rtti_Item). +.SH "int TQCanvasItem::rtti () const\fC [virtual]\fR" +Returns 0 (TQCanvasItem::Rtti_Item). .PP -Make your derived classes return their own values for rtti(), so that you can distinguish between objects returned by QCanvas::at(). You should use values greater than 1000 to allow for extensions to this class. +Make your derived classes return their own values for rtti(), so that you can distinguish between objects returned by TQCanvas::at(). You should use values greater than 1000 to allow for extensions to this class. .PP -Overuse of this functionality can damage it's extensibility. For example, once you have identified a base class of a QCanvasItem found by QCanvas::at(), cast it to that type and call meaningful methods rather than acting upon the object based on its rtti value. +Overuse of this functionality can damage it's extensibility. For example, once you have identified a base class of a TQCanvasItem found by TQCanvas::at(), cast it to that type and call meaningful methods rather than acting upon the object based on its rtti value. .PP For example: .PP .nf .br - QCanvasItem* item; + TQCanvasItem* item; .br - // Find an item, e.g. with QCanvasItem::collisions(). + // Find an item, e.g. with TQCanvasItem::collisions(). .br ... .br @@ -315,93 +315,93 @@ For example: .PP Example: canvas/canvas.cpp. .PP -Reimplemented in QCanvasSprite, QCanvasPolygonalItem, and QCanvasText. -.SH "bool QCanvasItem::selected () const" +Reimplemented in TQCanvasSprite, TQCanvasPolygonalItem, and TQCanvasText. +.SH "bool TQCanvasItem::selected () const" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP Use isSelected() instead. -.SH "void QCanvasItem::setActive ( bool yes )\fC [virtual]\fR" -Sets the active flag of the item to \fIyes\fR. If this changes the item's active state the item will be redrawn when QCanvas::update() is next called. +.SH "void TQCanvasItem::setActive ( bool yes )\fC [virtual]\fR" +Sets the active flag of the item to \fIyes\fR. If this changes the item's active state the item will be redrawn when TQCanvas::update() is next called. .PP -The QCanvas, QCanvasItem and the Qt-supplied QCanvasItem subclasses do not make use of this value. The setActive() function is supplied because many applications need it, but it is up to you how you use the isActive() value. -.SH "void QCanvasItem::setAnimated ( bool y )\fC [virtual]\fR" +The TQCanvas, TQCanvasItem and the Qt-supplied TQCanvasItem subclasses do not make use of this value. The setActive() function is supplied because many applications need it, but it is up to you how you use the isActive() value. +.SH "void TQCanvasItem::setAnimated ( bool y )\fC [virtual]\fR" Sets the canvas item to be in motion if \fIy\fR is TRUE, or not if \fIy\fR is FALSE. The speed and direction of the motion is set with setVelocity(), or with setXVelocity() and setYVelocity(). .PP -See also advance() and QCanvas::advance(). -.SH "void QCanvasItem::setCanvas ( QCanvas * c )\fC [virtual]\fR" -Sets the QCanvas upon which the canvas item is to be drawn to \fIc\fR. +See also advance() and TQCanvas::advance(). +.SH "void TQCanvasItem::setCanvas ( TQCanvas * c )\fC [virtual]\fR" +Sets the TQCanvas upon which the canvas item is to be drawn to \fIc\fR. .PP See also canvas(). -.SH "void QCanvasItem::setEnabled ( bool yes )\fC [virtual]\fR" -Sets the enabled flag of the item to \fIyes\fR. If this changes the item's enabled state the item will be redrawn when QCanvas::update() is next called. +.SH "void TQCanvasItem::setEnabled ( bool yes )\fC [virtual]\fR" +Sets the enabled flag of the item to \fIyes\fR. If this changes the item's enabled state the item will be redrawn when TQCanvas::update() is next called. .PP -The QCanvas, QCanvasItem and the Qt-supplied QCanvasItem subclasses do not make use of this value. The setEnabled() function is supplied because many applications need it, but it is up to you how you use the isEnabled() value. -.SH "void QCanvasItem::setSelected ( bool yes )\fC [virtual]\fR" -Sets the selected flag of the item to \fIyes\fR. If this changes the item's selected state the item will be redrawn when QCanvas::update() is next called. +The TQCanvas, TQCanvasItem and the Qt-supplied TQCanvasItem subclasses do not make use of this value. The setEnabled() function is supplied because many applications need it, but it is up to you how you use the isEnabled() value. +.SH "void TQCanvasItem::setSelected ( bool yes )\fC [virtual]\fR" +Sets the selected flag of the item to \fIyes\fR. If this changes the item's selected state the item will be redrawn when TQCanvas::update() is next called. .PP -The QCanvas, QCanvasItem and the Qt-supplied QCanvasItem subclasses do not make use of this value. The setSelected() function is supplied because many applications need it, but it is up to you how you use the isSelected() value. -.SH "void QCanvasItem::setVelocity ( double vx, double vy )\fC [virtual]\fR" +The TQCanvas, TQCanvasItem and the Qt-supplied TQCanvasItem subclasses do not make use of this value. The setSelected() function is supplied because many applications need it, but it is up to you how you use the isSelected() value. +.SH "void TQCanvasItem::setVelocity ( double vx, double vy )\fC [virtual]\fR" Sets the canvas item to be in motion, moving by \fIvx\fR and \fIvy\fR pixels in the horizontal and vertical directions respectively. .PP See also advance(), setXVelocity(), and setYVelocity(). -.SH "void QCanvasItem::setVisible ( bool yes )\fC [virtual]\fR" -Makes the canvas item visible if \fIyes\fR is TRUE, or invisible if \fIyes\fR is FALSE. The change takes effect when QCanvas::update() is next called. -.SH "void QCanvasItem::setX ( double x )" +.SH "void TQCanvasItem::setVisible ( bool yes )\fC [virtual]\fR" +Makes the canvas item visible if \fIyes\fR is TRUE, or invisible if \fIyes\fR is FALSE. The change takes effect when TQCanvas::update() is next called. +.SH "void TQCanvasItem::setX ( double x )" Moves the canvas item so that its x-position is \fIx\fR. .PP See also x() and move(). .PP Example: chart/chartform_canvas.cpp. -.SH "void QCanvasItem::setXVelocity ( double vx )" +.SH "void TQCanvasItem::setXVelocity ( double vx )" Sets the horizontal component of the canvas item's velocity to \fIvx\fR. .PP See also setYVelocity() and setVelocity(). -.SH "void QCanvasItem::setY ( double y )" +.SH "void TQCanvasItem::setY ( double y )" Moves the canvas item so that its y-position is \fIy\fR. .PP See also y() and move(). .PP Example: chart/chartform_canvas.cpp. -.SH "void QCanvasItem::setYVelocity ( double vy )" +.SH "void TQCanvasItem::setYVelocity ( double vy )" Sets the vertical component of the canvas item's velocity to \fIvy\fR. .PP See also setXVelocity() and setVelocity(). -.SH "void QCanvasItem::setZ ( double z )" +.SH "void TQCanvasItem::setZ ( double z )" Sets the z index of the canvas item to \fIz\fR. Higher-z items obscure (are in front of) lower-z items. .PP See also z() and move(). .PP Examples: .)l canvas/canvas.cpp and chart/chartform_canvas.cpp. -.SH "void QCanvasItem::show ()" +.SH "void TQCanvasItem::show ()" Shorthand for setVisible(TRUE). .PP Examples: .)l canvas/canvas.cpp and chart/chartform_canvas.cpp. -.SH "void QCanvasItem::update ()\fC [protected]\fR" +.SH "void TQCanvasItem::update ()\fC [protected]\fR" Call this function to repaint the canvas's changed chunks. -.SH "bool QCanvasItem::visible () const" +.SH "bool TQCanvasItem::visible () const" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP Use isVisible() instead. -.SH "double QCanvasItem::x () const" +.SH "double TQCanvasItem::x () const" Returns the horizontal position of the canvas item. Note that subclasses often have an origin other than the top-left corner. .PP Example: canvas/canvas.cpp. -.SH "double QCanvasItem::xVelocity () const" +.SH "double TQCanvasItem::xVelocity () const" Returns the horizontal velocity component of the canvas item. -.SH "double QCanvasItem::y () const" +.SH "double TQCanvasItem::y () const" Returns the vertical position of the canvas item. Note that subclasses often have an origin other than the top-left corner. .PP Example: canvas/canvas.cpp. -.SH "double QCanvasItem::yVelocity () const" +.SH "double TQCanvasItem::yVelocity () const" Returns the vertical velocity component of the canvas item. -.SH "double QCanvasItem::z () const" +.SH "double TQCanvasItem::z () const" Returns the z index of the canvas item, which is used for visual order: higher-z items obscure (are in front of) lower-z items. .SH "SEE ALSO" -.BR http://doc.trolltech.com/qcanvasitem.html +.BR http://doc.trolltech.com/tqcanvasitem.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the diff --git a/doc/man/man3/tqcanvasitemlist.3qt b/doc/man/man3/tqcanvasitemlist.3qt index fe692c12..258d9fd2 100644 --- a/doc/man/man3/tqcanvasitemlist.3qt +++ b/doc/man/man3/tqcanvasitemlist.3qt @@ -1,5 +1,5 @@ '\" t -.TH QCanvasItemList 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- +.TH TQCanvasItemList 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. @@ -7,32 +7,32 @@ .ad l .nh .SH NAME -QCanvasItemList \- List of QCanvasItems +TQCanvasItemList \- List of TQCanvasItems .SH SYNOPSIS -\fC#include \fR +\fC#include \fR .PP -Inherits QValueList. +Inherits QValueList. .PP .SS "Public Members" .in +1c .ti -1c -.BI "QCanvasItemList \fBoperator+\fR ( const QCanvasItemList & l ) const" +.BI "TQCanvasItemList \fBoperator+\fR ( const TQCanvasItemList & l ) const" .br .in -1c .SH DESCRIPTION -The QCanvasItemList class is a list of QCanvasItems. +The TQCanvasItemList class is a list of TQCanvasItems. .PP -QCanvasItemList is a QValueList of pointers to QCanvasItems. This class is used by some methods in QCanvas that need to return a list of canvas items. +TQCanvasItemList is a QValueList of pointers to TQCanvasItems. This class is used by some methods in TQCanvas that need to return a list of canvas items. .PP The QValueList documentation describes how to use this list. .PP See also Graphics Classes and Image Processing Classes. .SH MEMBER FUNCTION DOCUMENTATION -.SH "QCanvasItemList QCanvasItemList::operator+ ( const QCanvasItemList & l ) const" +.SH "TQCanvasItemList TQCanvasItemList::operator+ ( const TQCanvasItemList & l ) const" Returns the concatenation of this list and list \fIl\fR. .SH "SEE ALSO" -.BR http://doc.trolltech.com/qcanvasitemlist.html +.BR http://doc.trolltech.com/tqcanvasitemlist.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the diff --git a/doc/man/man3/tqcanvasline.3qt b/doc/man/man3/tqcanvasline.3qt index b23e7956..c360a76d 100644 --- a/doc/man/man3/tqcanvasline.3qt +++ b/doc/man/man3/tqcanvasline.3qt @@ -1,5 +1,5 @@ '\" t -.TH QCanvasLine 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- +.TH TQCanvasLine 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. @@ -7,19 +7,19 @@ .ad l .nh .SH NAME -QCanvasLine \- Line on a QCanvas +TQCanvasLine \- Line on a TQCanvas .SH SYNOPSIS -\fC#include \fR +\fC#include \fR .PP -Inherits QCanvasPolygonalItem. +Inherits TQCanvasPolygonalItem. .PP .SS "Public Members" .in +1c .ti -1c -.BI "\fBQCanvasLine\fR ( QCanvas * canvas )" +.BI "\fBTQCanvasLine\fR ( TQCanvas * canvas )" .br .ti -1c -.BI "\fB~QCanvasLine\fR ()" +.BI "\fB~TQCanvasLine\fR ()" .br .ti -1c .BI "void \fBsetPoints\fR ( int xa, int ya, int xb, int yb )" @@ -35,41 +35,41 @@ Inherits QCanvasPolygonalItem. .br .in -1c .SH DESCRIPTION -The QCanvasLine class provides a line on a QCanvas. +The TQCanvasLine class provides a line on a TQCanvas. .PP -The line inherits functionality from QCanvasPolygonalItem, for example the setPen() function. The start and end points of the line are set with setPoints(). +The line inherits functionality from TQCanvasPolygonalItem, for example the setPen() function. The start and end points of the line are set with setPoints(). .PP -Like any other canvas item lines can be moved with QCanvasItem::move() and QCanvasItem::moveBy(), or by setting coordinates with QCanvasItem::setX(), QCanvasItem::setY() and QCanvasItem::setZ(). +Like any other canvas item lines can be moved with TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and TQCanvasItem::setZ(). .PP See also Graphics Classes and Image Processing Classes. .SH MEMBER FUNCTION DOCUMENTATION -.SH "QCanvasLine::QCanvasLine ( QCanvas * canvas )" +.SH "TQCanvasLine::TQCanvasLine ( TQCanvas * canvas )" Constructs a line from (0,0) to (0,0) on \fIcanvas\fR. .PP See also setPoints(). -.SH "QCanvasLine::~QCanvasLine ()" +.SH "TQCanvasLine::~TQCanvasLine ()" Destroys the line. -.SH "QPoint QCanvasLine::endPoint () const" +.SH "QPoint TQCanvasLine::endPoint () const" Returns the end point of the line. .PP See also setPoints() and startPoint(). -.SH "int QCanvasLine::rtti () const\fC [virtual]\fR" -Returns 7 (QCanvasItem::Rtti_Line). +.SH "int TQCanvasLine::rtti () const\fC [virtual]\fR" +Returns 7 (TQCanvasItem::Rtti_Line). .PP -See also QCanvasItem::rtti(). +See also TQCanvasItem::rtti(). .PP -Reimplemented from QCanvasPolygonalItem. -.SH "void QCanvasLine::setPoints ( int xa, int ya, int xb, int yb )" +Reimplemented from TQCanvasPolygonalItem. +.SH "void TQCanvasLine::setPoints ( int xa, int ya, int xb, int yb )" Sets the line's start point to (\fIxa\fR, \fIya\fR) and its end point to (\fIxb\fR, \fIyb\fR). .PP Example: canvas/canvas.cpp. -.SH "QPoint QCanvasLine::startPoint () const" +.SH "QPoint TQCanvasLine::startPoint () const" Returns the start point of the line. .PP See also setPoints() and endPoint(). .SH "SEE ALSO" -.BR http://doc.trolltech.com/qcanvasline.html +.BR http://doc.trolltech.com/tqcanvasline.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the diff --git a/doc/man/man3/tqcanvaspixmap.3qt b/doc/man/man3/tqcanvaspixmap.3qt index 3dfacaec..89245ffb 100644 --- a/doc/man/man3/tqcanvaspixmap.3qt +++ b/doc/man/man3/tqcanvaspixmap.3qt @@ -1,5 +1,5 @@ '\" t -.TH QCanvasPixmap 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- +.TH TQCanvasPixmap 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. @@ -7,25 +7,25 @@ .ad l .nh .SH NAME -QCanvasPixmap \- Pixmaps for QCanvasSprites +TQCanvasPixmap \- Pixmaps for TQCanvasSprites .SH SYNOPSIS -\fC#include \fR +\fC#include \fR .PP Inherits QPixmap. .PP .SS "Public Members" .in +1c .ti -1c -.BI "\fBQCanvasPixmap\fR ( const TQString & datafilename )" +.BI "\fBTQCanvasPixmap\fR ( const TQString & datafilename )" .br .ti -1c -.BI "\fBQCanvasPixmap\fR ( const TQImage & image )" +.BI "\fBTQCanvasPixmap\fR ( const TQImage & image )" .br .ti -1c -.BI "\fBQCanvasPixmap\fR ( const QPixmap & pm, const QPoint & offset )" +.BI "\fBTQCanvasPixmap\fR ( const QPixmap & pm, const QPoint & offset )" .br .ti -1c -.BI "\fB~QCanvasPixmap\fR ()" +.BI "\fB~TQCanvasPixmap\fR ()" .br .ti -1c .BI "int \fBoffsetX\fR () const" @@ -38,44 +38,44 @@ Inherits QPixmap. .br .in -1c .SH DESCRIPTION -The QCanvasPixmap class provides pixmaps for QCanvasSprites. +The TQCanvasPixmap class provides pixmaps for TQCanvasSprites. .PP -If you want to show a single pixmap on a QCanvas use a QCanvasSprite with just one pixmap. +If you want to show a single pixmap on a TQCanvas use a TQCanvasSprite with just one pixmap. .PP -When pixmaps are inserted into a QCanvasPixmapArray they are held as QCanvasPixmaps. QCanvasSprites are used to show pixmaps on QCanvases and hold their pixmaps in a QCanvasPixmapArray. If you retrieve a frame (pixmap) from a QCanvasSprite it will be returned as a QCanvasPixmap. +When pixmaps are inserted into a TQCanvasPixmapArray they are held as TQCanvasPixmaps. TQCanvasSprites are used to show pixmaps on TQCanvases and hold their pixmaps in a TQCanvasPixmapArray. If you retrieve a frame (pixmap) from a TQCanvasSprite it will be returned as a TQCanvasPixmap. .PP The pixmap is a QPixmap and can only be set in the constructor. There are three different constructors, one taking a QPixmap, one a TQImage and one a file name that refers to a file in any supported file format (see QImageIO). .PP -QCanvasPixmap can have a hotspot which is defined in terms of an (x, y) offset. When you create a QCanvasPixmap from a PNG file or from a TQImage that has a TQImage::offset(), the offset() is initialized appropriately, otherwise the constructor leaves it at (0, 0). You can set it later using setOffset(). When the QCanvasPixmap is used in a QCanvasSprite, the offset position is the point at QCanvasItem::x() and QCanvasItem::y(), not the top-left corner of the pixmap. +TQCanvasPixmap can have a hotspot which is defined in terms of an (x, y) offset. When you create a TQCanvasPixmap from a PNG file or from a TQImage that has a TQImage::offset(), the offset() is initialized appropriately, otherwise the constructor leaves it at (0, 0). You can set it later using setOffset(). When the TQCanvasPixmap is used in a TQCanvasSprite, the offset position is the point at TQCanvasItem::x() and TQCanvasItem::y(), not the top-left corner of the pixmap. .PP -Note that for QCanvasPixmap objects created by a QCanvasSprite, the position of each QCanvasPixmap object is set so that the hotspot stays in the same position. +Note that for TQCanvasPixmap objects created by a TQCanvasSprite, the position of each TQCanvasPixmap object is set so that the hotspot stays in the same position. .PP -See also QCanvasPixmapArray, QCanvasItem, QCanvasSprite, Graphics Classes, and Image Processing Classes. +See also TQCanvasPixmapArray, TQCanvasItem, TQCanvasSprite, Graphics Classes, and Image Processing Classes. .SH MEMBER FUNCTION DOCUMENTATION -.SH "QCanvasPixmap::QCanvasPixmap ( const TQString & datafilename )" -Constructs a QCanvasPixmap that uses the image stored in \fIdatafilename\fR. -.SH "QCanvasPixmap::QCanvasPixmap ( const TQImage & image )" -Constructs a QCanvasPixmap from the image \fIimage\fR. -.SH "QCanvasPixmap::QCanvasPixmap ( const QPixmap & pm, const QPoint & offset )" -Constructs a QCanvasPixmap from the pixmap \fIpm\fR using the offset \fIoffset\fR. -.SH "QCanvasPixmap::~QCanvasPixmap ()" +.SH "TQCanvasPixmap::TQCanvasPixmap ( const TQString & datafilename )" +Constructs a TQCanvasPixmap that uses the image stored in \fIdatafilename\fR. +.SH "TQCanvasPixmap::TQCanvasPixmap ( const TQImage & image )" +Constructs a TQCanvasPixmap from the image \fIimage\fR. +.SH "TQCanvasPixmap::TQCanvasPixmap ( const QPixmap & pm, const QPoint & offset )" +Constructs a TQCanvasPixmap from the pixmap \fIpm\fR using the offset \fIoffset\fR. +.SH "TQCanvasPixmap::~TQCanvasPixmap ()" Destroys the pixmap. -.SH "int QCanvasPixmap::offsetX () const" +.SH "int TQCanvasPixmap::offsetX () const" Returns the x-offset of the pixmap's hotspot. .PP See also setOffset(). -.SH "int QCanvasPixmap::offsetY () const" +.SH "int TQCanvasPixmap::offsetY () const" Returns the y-offset of the pixmap's hotspot. .PP See also setOffset(). -.SH "void QCanvasPixmap::setOffset ( int x, int y )" +.SH "void TQCanvasPixmap::setOffset ( int x, int y )" Sets the offset of the pixmap's hotspot to (\fIx\fR, \fIy\fR). .PP -\fBWarning:\fR Do not call this function if any QCanvasSprites are +\fBWarning:\fR Do not call this function if any TQCanvasSprites are currently showing this pixmap. .SH "SEE ALSO" -.BR http://doc.trolltech.com/qcanvaspixmap.html +.BR http://doc.trolltech.com/tqcanvaspixmap.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the diff --git a/doc/man/man3/tqcanvaspixmaparray.3qt b/doc/man/man3/tqcanvaspixmaparray.3qt index e296265b..296c66c7 100644 --- a/doc/man/man3/tqcanvaspixmaparray.3qt +++ b/doc/man/man3/tqcanvaspixmaparray.3qt @@ -1,5 +1,5 @@ '\" t -.TH QCanvasPixmapArray 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- +.TH TQCanvasPixmapArray 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. @@ -7,26 +7,26 @@ .ad l .nh .SH NAME -QCanvasPixmapArray \- Array of QCanvasPixmaps +TQCanvasPixmapArray \- Array of TQCanvasPixmaps .SH SYNOPSIS -\fC#include \fR +\fC#include \fR .PP .SS "Public Members" .in +1c .ti -1c -.BI "\fBQCanvasPixmapArray\fR ()" +.BI "\fBTQCanvasPixmapArray\fR ()" .br .ti -1c -.BI "\fBQCanvasPixmapArray\fR ( const TQString & datafilenamepattern, int fc = 0 )" +.BI "\fBTQCanvasPixmapArray\fR ( const TQString & datafilenamepattern, int fc = 0 )" .br .ti -1c -.BI "QCanvasPixmapArray ( QPtrList list, QPtrList hotspots ) \fI(obsolete)\fR" +.BI "TQCanvasPixmapArray ( QPtrList list, QPtrList hotspots ) \fI(obsolete)\fR" .br .ti -1c -.BI "\fBQCanvasPixmapArray\fR ( QValueList list, QPointArray hotspots = QPointArray ( ) )" +.BI "\fBTQCanvasPixmapArray\fR ( QValueList list, QPointArray hotspots = QPointArray ( ) )" .br .ti -1c -.BI "\fB~QCanvasPixmapArray\fR ()" +.BI "\fB~TQCanvasPixmapArray\fR ()" .br .ti -1c .BI "bool \fBreadPixmaps\fR ( const TQString & filenamepattern, int fc = 0 )" @@ -41,32 +41,32 @@ QCanvasPixmapArray \- Array of QCanvasPixmaps .BI "bool \fBisValid\fR () const" .br .ti -1c -.BI "QCanvasPixmap * \fBimage\fR ( int i ) const" +.BI "TQCanvasPixmap * \fBimage\fR ( int i ) const" .br .ti -1c -.BI "void \fBsetImage\fR ( int i, QCanvasPixmap * p )" +.BI "void \fBsetImage\fR ( int i, TQCanvasPixmap * p )" .br .ti -1c .BI "uint \fBcount\fR () const" .br .in -1c .SH DESCRIPTION -The QCanvasPixmapArray class provides an array of QCanvasPixmaps. +The TQCanvasPixmapArray class provides an array of TQCanvasPixmaps. .PP -This class is used by QCanvasSprite to hold an array of pixmaps. It is used to implement animated sprites, i.e. images that change over time, with each pixmap in the array holding one frame. +This class is used by TQCanvasSprite to hold an array of pixmaps. It is used to implement animated sprites, i.e. images that change over time, with each pixmap in the array holding one frame. .PP Depending on the constructor you use you can load multiple pixmaps into the array either from a directory (specifying a wildcard pattern for the files), or from a list of QPixmaps. You can also read in a set of pixmaps after construction using readPixmaps(). .PP Individual pixmaps can be set with setImage() and retrieved with image(). The number of pixmaps in the array is returned by count(). .PP -QCanvasSprite uses an image's mask for collision detection. You can change this by reading in a separate set of image masks using readCollisionMasks(). +TQCanvasSprite uses an image's mask for collision detection. You can change this by reading in a separate set of image masks using readCollisionMasks(). .PP See also Graphics Classes and Image Processing Classes. .SH MEMBER FUNCTION DOCUMENTATION -.SH "QCanvasPixmapArray::QCanvasPixmapArray ()" -Constructs an invalid array (i.e. isValid() will return FALSE). You must call readPixmaps() before being able to use this QCanvasPixmapArray. -.SH "QCanvasPixmapArray::QCanvasPixmapArray ( const TQString & datafilenamepattern, int fc = 0 )" -Constructs a QCanvasPixmapArray from files. +.SH "TQCanvasPixmapArray::TQCanvasPixmapArray ()" +Constructs an invalid array (i.e. isValid() will return FALSE). You must call readPixmaps() before being able to use this TQCanvasPixmapArray. +.SH "TQCanvasPixmapArray::TQCanvasPixmapArray ( const TQString & datafilenamepattern, int fc = 0 )" +Constructs a TQCanvasPixmapArray from files. .PP The \fIfc\fR parameter sets the number of frames to be loaded for this image. .PP @@ -75,43 +75,43 @@ If \fIfc\fR is not 0, \fIdatafilenamepattern\fR should contain "%1", e.g. "foo%1 If \fIfc\fR is 0, \fIdatafilenamepattern\fR is asssumed to be a filename, and the image contained in this file will be loaded as the first (and only) frame. .PP If \fIdatafilenamepattern\fR does not exist, is not readable, isn't an image, or some other error occurs, the array ends up empty and isValid() returns FALSE. -.SH "QCanvasPixmapArray::QCanvasPixmapArray ( QPtrList list, QPtrList hotspots )" +.SH "TQCanvasPixmapArray::TQCanvasPixmapArray ( QPtrList list, QPtrList hotspots )" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP -Use QCanvasPixmapArray::QCanvasPixmapArray( QValueList, QPointArray ) instead. +Use TQCanvasPixmapArray::TQCanvasPixmapArray( QValueList, QPointArray ) instead. .PP -Constructs a QCanvasPixmapArray from the list of QPixmaps \fIlist\fR. The \fIhotspots\fR list has to be of the same size as \fIlist\fR. -.SH "QCanvasPixmapArray::QCanvasPixmapArray ( QValueList list, QPointArray hotspots = QPointArray ( ) )" -Constructs a QCanvasPixmapArray from the list of QPixmaps in the \fIlist\fR. Each pixmap will get a hotspot according to the \fIhotspots\fR array. If no hotspots are specified, each one is set to be at position (0, 0). +Constructs a TQCanvasPixmapArray from the list of QPixmaps \fIlist\fR. The \fIhotspots\fR list has to be of the same size as \fIlist\fR. +.SH "TQCanvasPixmapArray::TQCanvasPixmapArray ( QValueList list, QPointArray hotspots = QPointArray ( ) )" +Constructs a TQCanvasPixmapArray from the list of QPixmaps in the \fIlist\fR. Each pixmap will get a hotspot according to the \fIhotspots\fR array. If no hotspots are specified, each one is set to be at position (0, 0). .PP If an error occurs, isValid() will return FALSE. -.SH "QCanvasPixmapArray::~QCanvasPixmapArray ()" +.SH "TQCanvasPixmapArray::~TQCanvasPixmapArray ()" Destroys the pixmap array and all the pixmaps it contains. -.SH "uint QCanvasPixmapArray::count () const" +.SH "uint TQCanvasPixmapArray::count () const" Returns the number of pixmaps in the array. -.SH "QCanvasPixmap * QCanvasPixmapArray::image ( int i ) const" +.SH "TQCanvasPixmap * TQCanvasPixmapArray::image ( int i ) const" Returns pixmap \fIi\fR in the array, if \fIi\fR is non-negative and less than than count(), and returns an unspecified value otherwise. -.SH "bool QCanvasPixmapArray::isValid () const" +.SH "bool TQCanvasPixmapArray::isValid () const" Returns TRUE if the pixmap array is valid; otherwise returns FALSE. -.SH "bool QCanvasPixmapArray::operator! ()" +.SH "bool TQCanvasPixmapArray::operator! ()" \fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code. .PP Use isValid() instead. .PP This returns FALSE if the array is valid, and TRUE if it is not. -.SH "bool QCanvasPixmapArray::readCollisionMasks ( const TQString & filename )" +.SH "bool TQCanvasPixmapArray::readCollisionMasks ( const TQString & filename )" Reads new collision masks for the array. .PP -By default, QCanvasSprite uses the image mask of a sprite to detect collisions. Use this function to set your own collision image masks. +By default, TQCanvasSprite uses the image mask of a sprite to detect collisions. Use this function to set your own collision image masks. .PP -If count() is 1 \fIfilename\fR must specify a real filename to read the mask from. If count() is greater than 1, the \fIfilename\fR must contain a "%1" that will get replaced by the number of the mask to be loaded, just like QCanvasPixmapArray::readPixmaps(). +If count() is 1 \fIfilename\fR must specify a real filename to read the mask from. If count() is greater than 1, the \fIfilename\fR must contain a "%1" that will get replaced by the number of the mask to be loaded, just like TQCanvasPixmapArray::readPixmaps(). .PP All collision masks must be 1-bit images or this function call will fail. .PP If the file isn't readable, contains the wrong number of images, or there is some other error, this function will return FALSE, and the array will be flagged as invalid; otherwise this function returns TRUE. .PP See also isValid(). -.SH "bool QCanvasPixmapArray::readPixmaps ( const TQString & filenamepattern, int fc = 0 )" +.SH "bool TQCanvasPixmapArray::readPixmaps ( const TQString & filenamepattern, int fc = 0 )" Reads one or more pixmaps into the pixmap array. .PP If \fIfc\fR is not 0, \fIfilenamepattern\fR should contain "%1", e.g." foo%1.png". The actual filenames are formed by replacing the %1 with four-digit integers from 0 to (fc - 1), e.g. foo0000.png, foo0001.png, foo0002.png, etc. @@ -121,7 +121,7 @@ If \fIfc\fR is 0, \fIfilenamepattern\fR is asssumed to be a filename, and the im If \fIfilenamepattern\fR does not exist, is not readable, isn't an image, or some other error occurs, this function will return FALSE, and isValid() will return FALSE; otherwise this function will return TRUE. .PP See also isValid(). -.SH "void QCanvasPixmapArray::setImage ( int i, QCanvasPixmap * p )" +.SH "void TQCanvasPixmapArray::setImage ( int i, TQCanvasPixmap * p )" Replaces the pixmap at index \fIi\fR with pixmap \fIp\fR. .PP The array takes ownership of \fIp\fR and will delete \fIp\fR when the array itself is deleted. @@ -131,7 +131,7 @@ least i+1 elements, with elements count() to i-1 being initialized to 0. .SH "SEE ALSO" -.BR http://doc.trolltech.com/qcanvaspixmaparray.html +.BR http://doc.trolltech.com/tqcanvaspixmaparray.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the diff --git a/doc/man/man3/tqcanvaspolygon.3qt b/doc/man/man3/tqcanvaspolygon.3qt index 1b1bbae4..e97dbf2b 100644 --- a/doc/man/man3/tqcanvaspolygon.3qt +++ b/doc/man/man3/tqcanvaspolygon.3qt @@ -1,5 +1,5 @@ '\" t -.TH QCanvasPolygon 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- +.TH TQCanvasPolygon 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. @@ -7,21 +7,21 @@ .ad l .nh .SH NAME -QCanvasPolygon \- Polygon on a QCanvas +TQCanvasPolygon \- Polygon on a TQCanvas .SH SYNOPSIS -\fC#include \fR +\fC#include \fR .PP -Inherits QCanvasPolygonalItem. +Inherits TQCanvasPolygonalItem. .PP -Inherited by QCanvasSpline. +Inherited by TQCanvasSpline. .PP .SS "Public Members" .in +1c .ti -1c -.BI "\fBQCanvasPolygon\fR ( QCanvas * canvas )" +.BI "\fBTQCanvasPolygon\fR ( TQCanvas * canvas )" .br .ti -1c -.BI "\fB~QCanvasPolygon\fR ()" +.BI "\fB~TQCanvasPolygon\fR ()" .br .ti -1c .BI "void \fBsetPoints\fR ( QPointArray pa )" @@ -43,53 +43,53 @@ Inherited by QCanvasSpline. .br .in -1c .SH DESCRIPTION -The QCanvasPolygon class provides a polygon on a QCanvas. +The TQCanvasPolygon class provides a polygon on a TQCanvas. .PP Paints a polygon with a QBrush. The polygon's points can be set in the constructor or set or changed later using setPoints(). Use points() to retrieve the points, or areaPoints() to retrieve the points relative to the canvas's origin. .PP The polygon can be drawn on a painter with drawShape(). .PP -Like any other canvas item polygons can be moved with QCanvasItem::move() and QCanvasItem::moveBy(), or by setting coordinates with QCanvasItem::setX(), QCanvasItem::setY() and QCanvasItem::setZ(). +Like any other canvas item polygons can be moved with TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and TQCanvasItem::setZ(). .PP -Note: QCanvasPolygon does not use the pen. +Note: TQCanvasPolygon does not use the pen. .PP See also Graphics Classes and Image Processing Classes. .SH MEMBER FUNCTION DOCUMENTATION -.SH "QCanvasPolygon::QCanvasPolygon ( QCanvas * canvas )" +.SH "TQCanvasPolygon::TQCanvasPolygon ( TQCanvas * canvas )" Constructs a point-less polygon on the canvas \fIcanvas\fR. You should call setPoints() before using it further. -.SH "QCanvasPolygon::~QCanvasPolygon ()" +.SH "TQCanvasPolygon::~TQCanvasPolygon ()" Destroys the polygon. -.SH "QPointArray QCanvasPolygon::areaPoints () const\fC [virtual]\fR" +.SH "QPointArray TQCanvasPolygon::areaPoints () const\fC [virtual]\fR" Returns the vertices of the polygon translated by the polygon's current x(), y() position, i.e. relative to the canvas's origin. .PP See also setPoints() and points(). .PP -Reimplemented from QCanvasPolygonalItem. -.SH "void QCanvasPolygon::drawShape ( QPainter & p )\fC [virtual protected]\fR" +Reimplemented from TQCanvasPolygonalItem. +.SH "void TQCanvasPolygon::drawShape ( QPainter & p )\fC [virtual protected]\fR" Draws the polygon using the painter \fIp\fR. .PP -Note that QCanvasPolygon does not support an outline (the pen is always NoPen). +Note that TQCanvasPolygon does not support an outline (the pen is always NoPen). .PP -Reimplemented from QCanvasPolygonalItem. -.SH "QPointArray QCanvasPolygon::points () const" +Reimplemented from TQCanvasPolygonalItem. +.SH "QPointArray TQCanvasPolygon::points () const" Returns the vertices of the polygon, not translated by the position. .PP See also setPoints() and areaPoints(). -.SH "int QCanvasPolygon::rtti () const\fC [virtual]\fR" -Returns 4 (QCanvasItem::Rtti_Polygon). +.SH "int TQCanvasPolygon::rtti () const\fC [virtual]\fR" +Returns 4 (TQCanvasItem::Rtti_Polygon). .PP -See also QCanvasItem::rtti(). +See also TQCanvasItem::rtti(). .PP -Reimplemented from QCanvasPolygonalItem. +Reimplemented from TQCanvasPolygonalItem. .PP -Reimplemented in QCanvasSpline. -.SH "void QCanvasPolygon::setPoints ( QPointArray pa )" +Reimplemented in TQCanvasSpline. +.SH "void TQCanvasPolygon::setPoints ( QPointArray pa )" Sets the points of the polygon to be \fIpa\fR. These points will have their x and y coordinates automatically translated by x(), y() as the polygon is moved. .SH "SEE ALSO" -.BR http://doc.trolltech.com/qcanvaspolygon.html +.BR http://doc.trolltech.com/tqcanvaspolygon.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the diff --git a/doc/man/man3/tqcanvaspolygonalitem.3qt b/doc/man/man3/tqcanvaspolygonalitem.3qt index b32e35e3..0bd708a0 100644 --- a/doc/man/man3/tqcanvaspolygonalitem.3qt +++ b/doc/man/man3/tqcanvaspolygonalitem.3qt @@ -1,5 +1,5 @@ '\" t -.TH QCanvasPolygonalItem 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- +.TH TQCanvasPolygonalItem 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. @@ -7,21 +7,21 @@ .ad l .nh .SH NAME -QCanvasPolygonalItem \- Polygonal canvas item on a QCanvas +TQCanvasPolygonalItem \- Polygonal canvas item on a TQCanvas .SH SYNOPSIS -\fC#include \fR +\fC#include \fR .PP -Inherits QCanvasItem. +Inherits TQCanvasItem. .PP -Inherited by QCanvasRectangle, QCanvasPolygon, QCanvasLine, and QCanvasEllipse. +Inherited by TQCanvasRectangle, TQCanvasPolygon, TQCanvasLine, and TQCanvasEllipse. .PP .SS "Public Members" .in +1c .ti -1c -.BI "\fBQCanvasPolygonalItem\fR ( QCanvas * canvas )" +.BI "\fBTQCanvasPolygonalItem\fR ( TQCanvas * canvas )" .br .ti -1c -.BI "virtual \fB~QCanvasPolygonalItem\fR ()" +.BI "virtual \fB~TQCanvasPolygonalItem\fR ()" .br .ti -1c .BI "virtual void \fBsetPen\fR ( QPen p )" @@ -70,97 +70,97 @@ Inherited by QCanvasRectangle, QCanvasPolygon, QCanvasLine, and QCanvasEllipse. .br .in -1c .SH DESCRIPTION -The QCanvasPolygonalItem class provides a polygonal canvas item on a QCanvas. +The TQCanvasPolygonalItem class provides a polygonal canvas item on a TQCanvas. .PP -The mostly rectangular classes, such as QCanvasSprite and QCanvasText, use the object's bounding rectangle for movement, repainting and collision calculations. For most other items, the bounding rectangle can be far too large -- a diagonal line being the worst case, and there are many other cases which are also bad. QCanvasPolygonalItem provides polygon-based bounding rectangle handling, etc., which is much faster for non-rectangular items. +The mostly rectangular classes, such as TQCanvasSprite and TQCanvasText, use the object's bounding rectangle for movement, repainting and collision calculations. For most other items, the bounding rectangle can be far too large -- a diagonal line being the worst case, and there are many other cases which are also bad. TQCanvasPolygonalItem provides polygon-based bounding rectangle handling, etc., which is much faster for non-rectangular items. .PP -Derived classes should try to define as small an area as possible to maximize efficiency, but the polygon must \fIdefinitely\fR be contained completely within the polygonal area. Calculating the exact requirements is usually difficult, but if you allow a small overestimate it can be easy and quick, while still getting almost all of QCanvasPolygonalItem's speed. +Derived classes should try to define as small an area as possible to maximize efficiency, but the polygon must \fIdefinitely\fR be contained completely within the polygonal area. Calculating the exact requirements is usually difficult, but if you allow a small overestimate it can be easy and quick, while still getting almost all of TQCanvasPolygonalItem's speed. .PP Note that all subclasses \fImust\fR call hide() in their destructor since hide() needs to be able to access areaPoints(). .PP -Normally, QCanvasPolygonalItem uses the odd-even algorithm for determining whether an object intersects this object. You can change this to the winding algorithm using setWinding(). +Normally, TQCanvasPolygonalItem uses the odd-even algorithm for determining whether an object intersects this object. You can change this to the winding algorithm using setWinding(). .PP -The bounding rectangle is available using boundingRect(). The points bounding the polygonal item are retrieved with areaPoints(). Use areaPointsAdvanced() to retrieve the bounding points the polygonal item \fIwill\fR have after QCanvasItem::advance(1) has been called. +The bounding rectangle is available using boundingRect(). The points bounding the polygonal item are retrieved with areaPoints(). Use areaPointsAdvanced() to retrieve the bounding points the polygonal item \fIwill\fR have after TQCanvasItem::advance(1) has been called. .PP If the shape of the polygonal item is about to change while the item is visible, call invalidate() before updating with a different result from areaPoints(). .PP -By default, QCanvasPolygonalItem objects have a black pen and no brush (the default QPen and QBrush constructors). You can change this with setPen() and setBrush(), but note that some QCanvasPolygonalItem subclasses only use the brush, ignoring the pen setting. +By default, TQCanvasPolygonalItem objects have a black pen and no brush (the default QPen and QBrush constructors). You can change this with setPen() and setBrush(), but note that some TQCanvasPolygonalItem subclasses only use the brush, ignoring the pen setting. .PP The polygonal item can be drawn on a painter with draw(). Subclasses must reimplement drawShape() to draw themselves. .PP -Like any other canvas item polygonal items can be moved with QCanvasItem::move() and QCanvasItem::moveBy(), or by setting coordinates with QCanvasItem::setX(), QCanvasItem::setY() and QCanvasItem::setZ(). +Like any other canvas item polygonal items can be moved with TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and TQCanvasItem::setZ(). .PP See also Graphics Classes and Image Processing Classes. .SH MEMBER FUNCTION DOCUMENTATION -.SH "QCanvasPolygonalItem::QCanvasPolygonalItem ( QCanvas * canvas )" -Constructs a QCanvasPolygonalItem on the canvas \fIcanvas\fR. -.SH "QCanvasPolygonalItem::~QCanvasPolygonalItem ()\fC [virtual]\fR" +.SH "TQCanvasPolygonalItem::TQCanvasPolygonalItem ( TQCanvas * canvas )" +Constructs a TQCanvasPolygonalItem on the canvas \fIcanvas\fR. +.SH "TQCanvasPolygonalItem::~TQCanvasPolygonalItem ()\fC [virtual]\fR" Note that all subclasses \fImust\fR call hide() in their destructor since hide() needs to be able to access areaPoints(). -.SH "QPointArray QCanvasPolygonalItem::areaPoints () const\fC [pure virtual]\fR" +.SH "QPointArray TQCanvasPolygonalItem::areaPoints () const\fC [pure virtual]\fR" This function must be reimplemented by subclasses. It \fImust\fR return the points bounding (i.e. outside and not touching) the shape or drawing errors will occur. .PP -Reimplemented in QCanvasPolygon. -.SH "QPointArray QCanvasPolygonalItem::areaPointsAdvanced () const\fC [virtual]\fR" -Returns the points the polygonal item \fIwill\fR have after QCanvasItem::advance(1) is called, i.e. what the points are when advanced by the current xVelocity() and yVelocity(). -.SH "QRect QCanvasPolygonalItem::boundingRect () const\fC [virtual]\fR" +Reimplemented in TQCanvasPolygon. +.SH "QPointArray TQCanvasPolygonalItem::areaPointsAdvanced () const\fC [virtual]\fR" +Returns the points the polygonal item \fIwill\fR have after TQCanvasItem::advance(1) is called, i.e. what the points are when advanced by the current xVelocity() and yVelocity(). +.SH "QRect TQCanvasPolygonalItem::boundingRect () const\fC [virtual]\fR" Returns the bounding rectangle of the polygonal item, based on areaPoints(). .PP -Reimplemented from QCanvasItem. -.SH "QBrush QCanvasPolygonalItem::brush () const" +Reimplemented from TQCanvasItem. +.SH "QBrush TQCanvasPolygonalItem::brush () const" Returns the QBrush used to fill the item, if filled. .PP See also setBrush(). -.SH "void QCanvasPolygonalItem::draw ( QPainter & p )\fC [virtual protected]\fR" -Reimplemented from QCanvasItem, this draws the polygonal item by setting the pen and brush for the item on the painter \fIp\fR and calling drawShape(). +.SH "void TQCanvasPolygonalItem::draw ( QPainter & p )\fC [virtual protected]\fR" +Reimplemented from TQCanvasItem, this draws the polygonal item by setting the pen and brush for the item on the painter \fIp\fR and calling drawShape(). .PP -Reimplemented from QCanvasItem. -.SH "void QCanvasPolygonalItem::drawShape ( QPainter & p )\fC [pure virtual protected]\fR" +Reimplemented from TQCanvasItem. +.SH "void TQCanvasPolygonalItem::drawShape ( QPainter & p )\fC [pure virtual protected]\fR" Subclasses must reimplement this function to draw their shape. The pen and brush of \fIp\fR are already set to pen() and brush() prior to calling this function. .PP \fBWarning:\fR When you reimplement this function, make sure that you leave the painter in the same state as you found it. For example, if you start by calling QPainter::translate(50, 50), end your code by calling QPainter::translate(-50, -50). Be also aware that the painter might already have some transformations set (i.e., don't call QPainter::resetXForm() when you're done). .PP See also draw(). .PP -Reimplemented in QCanvasRectangle, QCanvasPolygon, and QCanvasEllipse. -.SH "void QCanvasPolygonalItem::invalidate ()\fC [protected]\fR" +Reimplemented in TQCanvasRectangle, TQCanvasPolygon, and TQCanvasEllipse. +.SH "void TQCanvasPolygonalItem::invalidate ()\fC [protected]\fR" Invalidates all information about the area covered by the canvas item. The item will be updated automatically on the next call that changes the item's status, for example, move() or update(). Call this function if you are going to change the shape of the item (as returned by areaPoints()) while the item is visible. -.SH "bool QCanvasPolygonalItem::isValid () const\fC [protected]\fR" +.SH "bool TQCanvasPolygonalItem::isValid () const\fC [protected]\fR" Returns TRUE if the polygonal item's area information has not been invalidated; otherwise returns FALSE. .PP See also invalidate(). -.SH "QPen QCanvasPolygonalItem::pen () const" +.SH "QPen TQCanvasPolygonalItem::pen () const" Returns the QPen used to draw the outline of the item, if any. .PP See also setPen(). -.SH "int QCanvasPolygonalItem::rtti () const\fC [virtual]\fR" -Returns 2 (QCanvasItem::Rtti_PolygonalItem). +.SH "int TQCanvasPolygonalItem::rtti () const\fC [virtual]\fR" +Returns 2 (TQCanvasItem::Rtti_PolygonalItem). .PP -See also QCanvasItem::rtti(). +See also TQCanvasItem::rtti(). .PP -Reimplemented from QCanvasItem. +Reimplemented from TQCanvasItem. .PP -Reimplemented in QCanvasRectangle, QCanvasPolygon, QCanvasLine, and QCanvasEllipse. -.SH "void QCanvasPolygonalItem::setBrush ( QBrush b )\fC [virtual]\fR" +Reimplemented in TQCanvasRectangle, TQCanvasPolygon, TQCanvasLine, and TQCanvasEllipse. +.SH "void TQCanvasPolygonalItem::setBrush ( QBrush b )\fC [virtual]\fR" Sets the QBrush used when drawing the polygonal item to the brush \fIb\fR. .PP See also setPen(), brush(), and drawShape(). .PP Examples: .)l canvas/canvas.cpp and chart/chartform_canvas.cpp. -.SH "void QCanvasPolygonalItem::setPen ( QPen p )\fC [virtual]\fR" -Sets the QPen used when drawing the item to the pen \fIp\fR. Note that many QCanvasPolygonalItems do not use the pen value. +.SH "void TQCanvasPolygonalItem::setPen ( QPen p )\fC [virtual]\fR" +Sets the QPen used when drawing the item to the pen \fIp\fR. Note that many TQCanvasPolygonalItems do not use the pen value. .PP See also setBrush(), pen(), and drawShape(). .PP Examples: .)l canvas/canvas.cpp and chart/chartform_canvas.cpp. -.SH "void QCanvasPolygonalItem::setWinding ( bool enable )\fC [protected]\fR" +.SH "void TQCanvasPolygonalItem::setWinding ( bool enable )\fC [protected]\fR" If \fIenable\fR is TRUE, the polygonal item will use the winding algorithm to determine the "inside" of the polygon; otherwise the odd-even algorithm will be used. .PP The default is to use the odd-even algorithm. .PP See also winding(). -.SH "bool QCanvasPolygonalItem::winding () const\fC [protected]\fR" +.SH "bool TQCanvasPolygonalItem::winding () const\fC [protected]\fR" Returns TRUE if the polygonal item uses the winding algorithm to determine the "inside" of the polygon. Returns FALSE if it uses the odd-even algorithm. .PP The default is to use the odd-even algorithm. @@ -168,7 +168,7 @@ The default is to use the odd-even algorithm. See also setWinding(). .SH "SEE ALSO" -.BR http://doc.trolltech.com/qcanvaspolygonalitem.html +.BR http://doc.trolltech.com/tqcanvaspolygonalitem.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the diff --git a/doc/man/man3/tqcanvasrectangle.3qt b/doc/man/man3/tqcanvasrectangle.3qt index 9a6211b5..a2132592 100644 --- a/doc/man/man3/tqcanvasrectangle.3qt +++ b/doc/man/man3/tqcanvasrectangle.3qt @@ -1,5 +1,5 @@ '\" t -.TH QCanvasRectangle 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- +.TH TQCanvasRectangle 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. @@ -7,25 +7,25 @@ .ad l .nh .SH NAME -QCanvasRectangle \- Rectangle on a QCanvas +TQCanvasRectangle \- Rectangle on a TQCanvas .SH SYNOPSIS -\fC#include \fR +\fC#include \fR .PP -Inherits QCanvasPolygonalItem. +Inherits TQCanvasPolygonalItem. .PP .SS "Public Members" .in +1c .ti -1c -.BI "\fBQCanvasRectangle\fR ( QCanvas * canvas )" +.BI "\fBTQCanvasRectangle\fR ( TQCanvas * canvas )" .br .ti -1c -.BI "\fBQCanvasRectangle\fR ( const QRect & r, QCanvas * canvas )" +.BI "\fBTQCanvasRectangle\fR ( const QRect & r, TQCanvas * canvas )" .br .ti -1c -.BI "\fBQCanvasRectangle\fR ( int x, int y, int width, int height, QCanvas * canvas )" +.BI "\fBTQCanvasRectangle\fR ( int x, int y, int width, int height, TQCanvas * canvas )" .br .ti -1c -.BI "\fB~QCanvasRectangle\fR ()" +.BI "\fB~TQCanvasRectangle\fR ()" .br .ti -1c .BI "int \fBwidth\fR () const" @@ -56,55 +56,55 @@ Inherits QCanvasPolygonalItem. .br .in -1c .SH DESCRIPTION -The QCanvasRectangle class provides a rectangle on a QCanvas. +The TQCanvasRectangle class provides a rectangle on a TQCanvas. .PP -This item paints a single rectangle which may have any pen() and brush(), but may not be tilted/rotated. For rotated rectangles, use QCanvasPolygon. +This item paints a single rectangle which may have any pen() and brush(), but may not be tilted/rotated. For rotated rectangles, use TQCanvasPolygon. .PP The rectangle's size and initial position can be set in the constructor. The size can be set or changed later using setSize(). Use height() and width() to retrieve the rectangle's dimensions. .PP The rectangle can be drawn on a painter with drawShape(). .PP -Like any other canvas item rectangles can be moved with QCanvasItem::move() and QCanvasItem::moveBy(), or by setting coordinates with QCanvasItem::setX(), QCanvasItem::setY() and QCanvasItem::setZ(). +Like any other canvas item rectangles can be moved with TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and TQCanvasItem::setZ(). .PP See also Graphics Classes and Image Processing Classes. .SH MEMBER FUNCTION DOCUMENTATION -.SH "QCanvasRectangle::QCanvasRectangle ( QCanvas * canvas )" +.SH "TQCanvasRectangle::TQCanvasRectangle ( TQCanvas * canvas )" Constructs a rectangle at position (0,0) with both width and height set to 32 pixels on \fIcanvas\fR. -.SH "QCanvasRectangle::QCanvasRectangle ( const QRect & r, QCanvas * canvas )" +.SH "TQCanvasRectangle::TQCanvasRectangle ( const QRect & r, TQCanvas * canvas )" Constructs a rectangle positioned and sized by \fIr\fR on \fIcanvas\fR. -.SH "QCanvasRectangle::QCanvasRectangle ( int x, int y, int width, int height, QCanvas * canvas )" +.SH "TQCanvasRectangle::TQCanvasRectangle ( int x, int y, int width, int height, TQCanvas * canvas )" Constructs a rectangle at position (\fIx\fR, \fIy\fR) and size \fIwidth\fR by \fIheight\fR, on \fIcanvas\fR. -.SH "QCanvasRectangle::~QCanvasRectangle ()" +.SH "TQCanvasRectangle::~TQCanvasRectangle ()" Destroys the rectangle. -.SH "QPointArray QCanvasRectangle::chunks () const\fC [virtual protected]\fR" -Simply calls QCanvasItem::chunks(). -.SH "void QCanvasRectangle::drawShape ( QPainter & p )\fC [virtual protected]\fR" +.SH "QPointArray TQCanvasRectangle::chunks () const\fC [virtual protected]\fR" +Simply calls TQCanvasItem::chunks(). +.SH "void TQCanvasRectangle::drawShape ( QPainter & p )\fC [virtual protected]\fR" Draws the rectangle on painter \fIp\fR. .PP Example: canvas/canvas.cpp. .PP -Reimplemented from QCanvasPolygonalItem. -.SH "int QCanvasRectangle::height () const" +Reimplemented from TQCanvasPolygonalItem. +.SH "int TQCanvasRectangle::height () const" Returns the height of the rectangle. -.SH "QRect QCanvasRectangle::rect () const" +.SH "QRect TQCanvasRectangle::rect () const" Returns the integer-converted x(), y() position and size() of the rectangle as a QRect. -.SH "int QCanvasRectangle::rtti () const\fC [virtual]\fR" -Returns 5 (QCanvasItem::Rtti_Rectangle). +.SH "int TQCanvasRectangle::rtti () const\fC [virtual]\fR" +Returns 5 (TQCanvasItem::Rtti_Rectangle). .PP -See also QCanvasItem::rtti(). +See also TQCanvasItem::rtti(). .PP -Reimplemented from QCanvasPolygonalItem. -.SH "void QCanvasRectangle::setSize ( int width, int height )" +Reimplemented from TQCanvasPolygonalItem. +.SH "void TQCanvasRectangle::setSize ( int width, int height )" Sets the \fIwidth\fR and \fIheight\fR of the rectangle. -.SH "QSize QCanvasRectangle::size () const" +.SH "QSize TQCanvasRectangle::size () const" Returns the width() and height() of the rectangle. .PP See also rect() and setSize(). -.SH "int QCanvasRectangle::width () const" +.SH "int TQCanvasRectangle::width () const" Returns the width of the rectangle. .SH "SEE ALSO" -.BR http://doc.trolltech.com/qcanvasrectangle.html +.BR http://doc.trolltech.com/tqcanvasrectangle.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the diff --git a/doc/man/man3/tqcanvasspline.3qt b/doc/man/man3/tqcanvasspline.3qt index 1f00c4b3..8424e675 100644 --- a/doc/man/man3/tqcanvasspline.3qt +++ b/doc/man/man3/tqcanvasspline.3qt @@ -1,5 +1,5 @@ '\" t -.TH QCanvasSpline 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- +.TH TQCanvasSpline 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. @@ -7,19 +7,19 @@ .ad l .nh .SH NAME -QCanvasSpline \- Multi-bezier splines on a QCanvas +TQCanvasSpline \- Multi-bezier splines on a TQCanvas .SH SYNOPSIS -\fC#include \fR +\fC#include \fR .PP -Inherits QCanvasPolygon. +Inherits TQCanvasPolygon. .PP .SS "Public Members" .in +1c .ti -1c -.BI "\fBQCanvasSpline\fR ( QCanvas * canvas )" +.BI "\fBTQCanvasSpline\fR ( TQCanvas * canvas )" .br .ti -1c -.BI "\fB~QCanvasSpline\fR ()" +.BI "\fB~TQCanvasSpline\fR ()" .br .ti -1c .BI "void \fBsetControlPoints\fR ( QPointArray ctrl, bool close = TRUE )" @@ -35,9 +35,9 @@ Inherits QCanvasPolygon. .br .in -1c .SH DESCRIPTION -The QCanvasSpline class provides multi-bezier splines on a QCanvas. +The TQCanvasSpline class provides multi-bezier splines on a TQCanvas. .PP -A QCanvasSpline is a sequence of 4-point bezier curves joined together to make a curved shape. +A TQCanvasSpline is a sequence of 4-point bezier curves joined together to make a curved shape. .PP You set the control points of the spline with setControlPoints(). .PP @@ -45,29 +45,29 @@ If the bezier is closed(), then the first control point will be re-used as the l .PP The beziers are not necessarily joined "smoothly". To ensure this, set control points appropriately (general reference texts about beziers will explain this in detail). .PP -Like any other canvas item splines can be moved with QCanvasItem::move() and QCanvasItem::moveBy(), or by setting coordinates with QCanvasItem::setX(), QCanvasItem::setY() and QCanvasItem::setZ(). +Like any other canvas item splines can be moved with TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and TQCanvasItem::setZ(). .PP See also Graphics Classes and Image Processing Classes. .SH MEMBER FUNCTION DOCUMENTATION -.SH "QCanvasSpline::QCanvasSpline ( QCanvas * canvas )" +.SH "TQCanvasSpline::TQCanvasSpline ( TQCanvas * canvas )" Create a spline with no control points on the canvas \fIcanvas\fR. .PP See also setControlPoints(). -.SH "QCanvasSpline::~QCanvasSpline ()" +.SH "TQCanvasSpline::~TQCanvasSpline ()" Destroy the spline. -.SH "bool QCanvasSpline::closed () const" +.SH "bool TQCanvasSpline::closed () const" Returns TRUE if the control points are a closed set; otherwise returns FALSE. -.SH "QPointArray QCanvasSpline::controlPoints () const" +.SH "QPointArray TQCanvasSpline::controlPoints () const" Returns the current set of control points. .PP See also setControlPoints() and closed(). -.SH "int QCanvasSpline::rtti () const\fC [virtual]\fR" -Returns 8 (QCanvasItem::Rtti_Spline). +.SH "int TQCanvasSpline::rtti () const\fC [virtual]\fR" +Returns 8 (TQCanvasItem::Rtti_Spline). .PP -See also QCanvasItem::rtti(). +See also TQCanvasItem::rtti(). .PP -Reimplemented from QCanvasPolygon. -.SH "void QCanvasSpline::setControlPoints ( QPointArray ctrl, bool close = TRUE )" +Reimplemented from TQCanvasPolygon. +.SH "void TQCanvasSpline::setControlPoints ( QPointArray ctrl, bool close = TRUE )" Set the spline control points to \fIctrl\fR. .PP If \fIclose\fR is TRUE, then the first point in \fIctrl\fR will be re-used as the last point, and the number of control points must be a multiple of 3. If \fIclose\fR is FALSE, one additional control point is required, and the number of control points must be one of (4, 7, 10, 13, ...). @@ -77,7 +77,7 @@ If the number of control points doesn't meet the above conditions, the number of Example: canvas/canvas.cpp. .SH "SEE ALSO" -.BR http://doc.trolltech.com/qcanvasspline.html +.BR http://doc.trolltech.com/tqcanvasspline.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the diff --git a/doc/man/man3/tqcanvassprite.3qt b/doc/man/man3/tqcanvassprite.3qt index 8a3e194b..adcc403b 100644 --- a/doc/man/man3/tqcanvassprite.3qt +++ b/doc/man/man3/tqcanvassprite.3qt @@ -1,5 +1,5 @@ '\" t -.TH QCanvasSprite 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- +.TH TQCanvasSprite 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. @@ -7,22 +7,22 @@ .ad l .nh .SH NAME -QCanvasSprite \- Animated canvas item on a QCanvas +TQCanvasSprite \- Animated canvas item on a TQCanvas .SH SYNOPSIS -\fC#include \fR +\fC#include \fR .PP -Inherits QCanvasItem. +Inherits TQCanvasItem. .PP .SS "Public Members" .in +1c .ti -1c -.BI "\fBQCanvasSprite\fR ( QCanvasPixmapArray * a, QCanvas * canvas )" +.BI "\fBTQCanvasSprite\fR ( TQCanvasPixmapArray * a, TQCanvas * canvas )" .br .ti -1c -.BI "void \fBsetSequence\fR ( QCanvasPixmapArray * a )" +.BI "void \fBsetSequence\fR ( TQCanvasPixmapArray * a )" .br .ti -1c -.BI "virtual \fB~QCanvasSprite\fR ()" +.BI "virtual \fB~TQCanvasSprite\fR ()" .br .ti -1c .BI "virtual void \fBmove\fR ( double nx, double ny, int nf )" @@ -79,13 +79,13 @@ Inherits QCanvasItem. .BI "int \fBbottomEdge\fR ( int ny ) const" .br .ti -1c -.BI "QCanvasPixmap * \fBimage\fR () const" +.BI "TQCanvasPixmap * \fBimage\fR () const" .br .ti -1c -.BI "virtual QCanvasPixmap * \fBimageAdvanced\fR () const" +.BI "virtual TQCanvasPixmap * \fBimageAdvanced\fR () const" .br .ti -1c -.BI "QCanvasPixmap * \fBimage\fR ( int f ) const" +.BI "TQCanvasPixmap * \fBimage\fR ( int f ) const" .br .ti -1c .BI "virtual void \fBadvance\fR ( int phase )" @@ -95,9 +95,9 @@ Inherits QCanvasItem. .br .in -1c .SH DESCRIPTION -The QCanvasSprite class provides an animated canvas item on a QCanvas. +The TQCanvasSprite class provides an animated canvas item on a TQCanvas. .PP -A canvas sprite is an object which can contain any number of images (referred to as frames), only one of which is current, i.e. displayed, at any one time. The images can be passed in the constructor or set or changed later with setSequence(). If you subclass QCanvasSprite you can change the frame that is displayed periodically, e.g. whenever QCanvasItem::advance(1) is called to create the effect of animation. +A canvas sprite is an object which can contain any number of images (referred to as frames), only one of which is current, i.e. displayed, at any one time. The images can be passed in the constructor or set or changed later with setSequence(). If you subclass TQCanvasSprite you can change the frame that is displayed periodically, e.g. whenever TQCanvasItem::advance(1) is called to create the effect of animation. .PP The current frame can be set with setFrame() or with move(). The number of frames available is given by frameCount(). The bounding rectangle of the current frame is returned by boundingRect(). .PP @@ -107,110 +107,110 @@ Use width() and height() to retrieve the dimensions of the current frame. .PP Use leftEdge() and rightEdge() to retrieve the current frame's left-hand and right-hand x-coordinates respectively. Use bottomEdge() and topEdge() to retrieve the current frame's bottom and top y-coordinates respectively. These functions have an overload which will accept an integer frame number to retrieve the coordinates of a particular frame. .PP -QCanvasSprite draws very quickly, at the expense of memory. +TQCanvasSprite draws very quickly, at the expense of memory. .PP The current frame's image can be drawn on a painter with draw(). .PP -Like any other canvas item, canvas sprites can be moved with move() which sets the x and y coordinates and the frame number, as well as with QCanvasItem::move() and QCanvasItem::moveBy(), or by setting coordinates with QCanvasItem::setX(), QCanvasItem::setY() and QCanvasItem::setZ(). +Like any other canvas item, canvas sprites can be moved with move() which sets the x and y coordinates and the frame number, as well as with TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and TQCanvasItem::setZ(). .PP See also Graphics Classes and Image Processing Classes. .SS "Member Type Documentation" -.SH "QCanvasSprite::FrameAnimationType" -This enum is used to identify the different types of frame animation offered by QCanvasSprite. +.SH "TQCanvasSprite::FrameAnimationType" +This enum is used to identify the different types of frame animation offered by TQCanvasSprite. .TP -\fCQCanvasSprite::Cycle\fR - at each advance the frame number will be incremented by 1 (modulo the frame count). +\fCTQCanvasSprite::Cycle\fR - at each advance the frame number will be incremented by 1 (modulo the frame count). .TP -\fCQCanvasSprite::Oscillate\fR - at each advance the frame number will be incremented by 1 up to the frame count then decremented to by 1 to 0, repeating this sequence forever. +\fCTQCanvasSprite::Oscillate\fR - at each advance the frame number will be incremented by 1 up to the frame count then decremented to by 1 to 0, repeating this sequence forever. .SH MEMBER FUNCTION DOCUMENTATION -.SH "QCanvasSprite::QCanvasSprite ( QCanvasPixmapArray * a, QCanvas * canvas )" -Constructs a QCanvasSprite which uses images from the QCanvasPixmapArray \fIa\fR. +.SH "TQCanvasSprite::TQCanvasSprite ( TQCanvasPixmapArray * a, TQCanvas * canvas )" +Constructs a TQCanvasSprite which uses images from the TQCanvasPixmapArray \fIa\fR. .PP The sprite in initially positioned at (0, 0) on \fIcanvas\fR, using frame 0. -.SH "QCanvasSprite::~QCanvasSprite ()\fC [virtual]\fR" +.SH "TQCanvasSprite::~TQCanvasSprite ()\fC [virtual]\fR" Destroys the sprite and removes it from the canvas. Does \fInot\fR delete the images. -.SH "void QCanvasSprite::advance ( int phase )\fC [virtual]\fR" -Extends the default QCanvasItem implementation to provide the functionality of setFrameAnimation(). +.SH "void TQCanvasSprite::advance ( int phase )\fC [virtual]\fR" +Extends the default TQCanvasItem implementation to provide the functionality of setFrameAnimation(). .PP -The \fIphase\fR is 0 or 1: see QCanvasItem::advance() for details. +The \fIphase\fR is 0 or 1: see TQCanvasItem::advance() for details. .PP -See also QCanvasItem::advance() and setVelocity(). +See also TQCanvasItem::advance() and setVelocity(). .PP Example: canvas/canvas.cpp. .PP -Reimplemented from QCanvasItem. -.SH "int QCanvasSprite::bottomEdge () const" +Reimplemented from TQCanvasItem. +.SH "int TQCanvasSprite::bottomEdge () const" Returns the y-coordinate of the current bottom edge of the sprite. (This may change as the sprite animates since different frames may have different bottom edges.) .PP See also leftEdge(), rightEdge(), and topEdge(). -.SH "int QCanvasSprite::bottomEdge ( int ny ) const" +.SH "int TQCanvasSprite::bottomEdge ( int ny ) const" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Returns what the y-coordinate of the top edge of the sprite would be if the sprite (actually its hotspot) were moved to y-position \fIny\fR. .PP See also leftEdge(), rightEdge(), and topEdge(). -.SH "QRect QCanvasSprite::boundingRect () const\fC [virtual]\fR" +.SH "QRect TQCanvasSprite::boundingRect () const\fC [virtual]\fR" Returns the bounding rectangle for the image in the sprite's current frame. This assumes that the images are tightly cropped (i.e. do not have transparent pixels all along a side). .PP -Reimplemented from QCanvasItem. -.SH "void QCanvasSprite::draw ( QPainter & painter )\fC [virtual]\fR" +Reimplemented from TQCanvasItem. +.SH "void TQCanvasSprite::draw ( QPainter & painter )\fC [virtual]\fR" Draws the current frame's image at the sprite's current position on painter \fIpainter\fR. .PP -Reimplemented from QCanvasItem. -.SH "int QCanvasSprite::frame () const" -Returns the index of the current animation frame in the QCanvasSprite's QCanvasPixmapArray. +Reimplemented from TQCanvasItem. +.SH "int TQCanvasSprite::frame () const" +Returns the index of the current animation frame in the TQCanvasSprite's TQCanvasPixmapArray. .PP See also setFrame() and move(). -.SH "int QCanvasSprite::frameCount () const" -Returns the number of frames in the QCanvasSprite's QCanvasPixmapArray. -.SH "int QCanvasSprite::height () const" +.SH "int TQCanvasSprite::frameCount () const" +Returns the number of frames in the TQCanvasSprite's TQCanvasPixmapArray. +.SH "int TQCanvasSprite::height () const" The height of the sprite for the current frame's image. .PP See also frame(). -.SH "QCanvasPixmap * QCanvasSprite::image () const" +.SH "TQCanvasPixmap * TQCanvasSprite::image () const" Returns the current frame's image. .PP See also frame() and setFrame(). -.SH "QCanvasPixmap * QCanvasSprite::image ( int f ) const" +.SH "TQCanvasPixmap * TQCanvasSprite::image ( int f ) const" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Returns the image for frame \fIf\fR. Does not do any bounds checking on \fIf\fR. -.SH "QCanvasPixmap * QCanvasSprite::imageAdvanced () const\fC [virtual]\fR" +.SH "TQCanvasPixmap * TQCanvasSprite::imageAdvanced () const\fC [virtual]\fR" Returns the image the sprite \fIwill\fR have after advance(1) is called. By default this is the same as image(). -.SH "int QCanvasSprite::leftEdge () const" +.SH "int TQCanvasSprite::leftEdge () const" Returns the x-coordinate of the current left edge of the sprite. (This may change as the sprite animates since different frames may have different left edges.) .PP See also rightEdge(), bottomEdge(), and topEdge(). -.SH "int QCanvasSprite::leftEdge ( int nx ) const" +.SH "int TQCanvasSprite::leftEdge ( int nx ) const" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Returns what the x-coordinate of the left edge of the sprite would be if the sprite (actually its hotspot) were moved to x-position \fInx\fR. .PP See also rightEdge(), bottomEdge(), and topEdge(). -.SH "void QCanvasSprite::move ( double nx, double ny, int nf )\fC [virtual]\fR" +.SH "void TQCanvasSprite::move ( double nx, double ny, int nf )\fC [virtual]\fR" Set the position of the sprite to \fInx\fR, \fIny\fR and the current frame to \fInf\fR. \fInf\fR will be ignored if it is larger than frameCount() or smaller than 0. -.SH "int QCanvasSprite::rightEdge () const" +.SH "int TQCanvasSprite::rightEdge () const" Returns the x-coordinate of the current right edge of the sprite. (This may change as the sprite animates since different frames may have different right edges.) .PP See also leftEdge(), bottomEdge(), and topEdge(). -.SH "int QCanvasSprite::rightEdge ( int nx ) const" +.SH "int TQCanvasSprite::rightEdge ( int nx ) const" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Returns what the x-coordinate of the right edge of the sprite would be if the sprite (actually its hotspot) were moved to x-position \fInx\fR. .PP See also leftEdge(), bottomEdge(), and topEdge(). -.SH "int QCanvasSprite::rtti () const\fC [virtual]\fR" -Returns 1 (QCanvasItem::Rtti_Sprite). +.SH "int TQCanvasSprite::rtti () const\fC [virtual]\fR" +Returns 1 (TQCanvasItem::Rtti_Sprite). .PP -See also QCanvasItem::rtti(). +See also TQCanvasItem::rtti(). .PP Example: canvas/canvas.cpp. .PP -Reimplemented from QCanvasItem. -.SH "void QCanvasSprite::setFrame ( int f )" -Sets the animation frame used for displaying the sprite to \fIf\fR, an index into the QCanvasSprite's QCanvasPixmapArray. The call will be ignored if \fIf\fR is larger than frameCount() or smaller than 0. +Reimplemented from TQCanvasItem. +.SH "void TQCanvasSprite::setFrame ( int f )" +Sets the animation frame used for displaying the sprite to \fIf\fR, an index into the TQCanvasSprite's TQCanvasPixmapArray. The call will be ignored if \fIf\fR is larger than frameCount() or smaller than 0. .PP See also frame() and move(). -.SH "void QCanvasSprite::setFrameAnimation ( FrameAnimationType type = Cycle, int step = 1, int state = 0 )\fC [virtual]\fR" +.SH "void TQCanvasSprite::setFrameAnimation ( FrameAnimationType type = Cycle, int step = 1, int state = 0 )\fC [virtual]\fR" Sets the animation characteristics for the sprite. .PP For \fItype\fR == Cycle, the frames will increase by \fIstep\fR at each advance, modulo the frameCount(). @@ -218,27 +218,27 @@ For \fItype\fR == Cycle, the frames will increase by \fIstep\fR at each advance, For \fItype\fR == Oscillate, the frames will increase by \fIstep\fR at each advance, up to the frameCount(), then decrease by \fIstep\fR back to 0, repeating forever. .PP The \fIstate\fR parameter is for internal use. -.SH "void QCanvasSprite::setSequence ( QCanvasPixmapArray * a )" -Set the array of images used for displaying the sprite to the QCanvasPixmapArray \fIa\fR. +.SH "void TQCanvasSprite::setSequence ( TQCanvasPixmapArray * a )" +Set the array of images used for displaying the sprite to the TQCanvasPixmapArray \fIa\fR. .PP If the current frame() is larger than the number of images in \fIa\fR, the current frame will be reset to 0. -.SH "int QCanvasSprite::topEdge () const" +.SH "int TQCanvasSprite::topEdge () const" Returns the y-coordinate of the top edge of the sprite. (This may change as the sprite animates since different frames may have different top edges.) .PP See also leftEdge(), rightEdge(), and bottomEdge(). -.SH "int QCanvasSprite::topEdge ( int ny ) const" +.SH "int TQCanvasSprite::topEdge ( int ny ) const" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP Returns what the y-coordinate of the top edge of the sprite would be if the sprite (actually its hotspot) were moved to y-position \fIny\fR. .PP See also leftEdge(), rightEdge(), and bottomEdge(). -.SH "int QCanvasSprite::width () const" +.SH "int TQCanvasSprite::width () const" The width of the sprite for the current frame's image. .PP See also frame(). .SH "SEE ALSO" -.BR http://doc.trolltech.com/qcanvassprite.html +.BR http://doc.trolltech.com/tqcanvassprite.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the diff --git a/doc/man/man3/tqcanvastext.3qt b/doc/man/man3/tqcanvastext.3qt index 65ab8e04..0aab507b 100644 --- a/doc/man/man3/tqcanvastext.3qt +++ b/doc/man/man3/tqcanvastext.3qt @@ -1,5 +1,5 @@ '\" t -.TH QCanvasText 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- +.TH TQCanvasText 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. @@ -7,25 +7,25 @@ .ad l .nh .SH NAME -QCanvasText \- Text object on a QCanvas +TQCanvasText \- Text object on a TQCanvas .SH SYNOPSIS -\fC#include \fR +\fC#include \fR .PP -Inherits QCanvasItem. +Inherits TQCanvasItem. .PP .SS "Public Members" .in +1c .ti -1c -.BI "\fBQCanvasText\fR ( QCanvas * canvas )" +.BI "\fBTQCanvasText\fR ( TQCanvas * canvas )" .br .ti -1c -.BI "\fBQCanvasText\fR ( const TQString & t, QCanvas * canvas )" +.BI "\fBTQCanvasText\fR ( const TQString & t, TQCanvas * canvas )" .br .ti -1c -.BI "\fBQCanvasText\fR ( const TQString & t, QFont f, QCanvas * canvas )" +.BI "\fBTQCanvasText\fR ( const TQString & t, QFont f, TQCanvas * canvas )" .br .ti -1c -.BI "virtual \fB~QCanvasText\fR ()" +.BI "virtual \fB~TQCanvasText\fR ()" .br .ti -1c .BI "void \fBsetText\fR ( const TQString & t )" @@ -65,77 +65,77 @@ Inherits QCanvasItem. .br .in -1c .SH DESCRIPTION -The QCanvasText class provides a text object on a QCanvas. +The TQCanvasText class provides a text object on a TQCanvas. .PP A canvas text item has text with font, color and alignment attributes. The text and font can be set in the constructor or set or changed later with setText() and setFont(). The color is set with setColor() and the alignment with setTextFlags(). The text item's bounding rectangle is retrieved with boundingRect(). .PP The text can be drawn on a painter with draw(). .PP -Like any other canvas item text items can be moved with QCanvasItem::move() and QCanvasItem::moveBy(), or by setting coordinates with QCanvasItem::setX(), QCanvasItem::setY() and QCanvasItem::setZ(). +Like any other canvas item text items can be moved with TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and TQCanvasItem::setZ(). .PP See also Graphics Classes and Image Processing Classes. .SH MEMBER FUNCTION DOCUMENTATION -.SH "QCanvasText::QCanvasText ( QCanvas * canvas )" -Constructs a QCanvasText with the text "", on \fIcanvas\fR. -.SH "QCanvasText::QCanvasText ( const TQString & t, QCanvas * canvas )" -Constructs a QCanvasText with the text \fIt\fR, on canvas \fIcanvas\fR. -.SH "QCanvasText::QCanvasText ( const TQString & t, QFont f, QCanvas * canvas )" -Constructs a QCanvasText with the text \fIt\fR and font \fIf\fR, on the canvas \fIcanvas\fR. -.SH "QCanvasText::~QCanvasText ()\fC [virtual]\fR" +.SH "TQCanvasText::TQCanvasText ( TQCanvas * canvas )" +Constructs a TQCanvasText with the text "", on \fIcanvas\fR. +.SH "TQCanvasText::TQCanvasText ( const TQString & t, TQCanvas * canvas )" +Constructs a TQCanvasText with the text \fIt\fR, on canvas \fIcanvas\fR. +.SH "TQCanvasText::TQCanvasText ( const TQString & t, QFont f, TQCanvas * canvas )" +Constructs a TQCanvasText with the text \fIt\fR and font \fIf\fR, on the canvas \fIcanvas\fR. +.SH "TQCanvasText::~TQCanvasText ()\fC [virtual]\fR" Destroys the canvas text item. -.SH "QRect QCanvasText::boundingRect () const\fC [virtual]\fR" +.SH "QRect TQCanvasText::boundingRect () const\fC [virtual]\fR" Returns the bounding rectangle of the text. .PP -Reimplemented from QCanvasItem. -.SH "TQColor QCanvasText::color () const" +Reimplemented from TQCanvasItem. +.SH "TQColor TQCanvasText::color () const" Returns the color of the text. .PP See also setColor(). -.SH "void QCanvasText::draw ( QPainter & painter )\fC [virtual protected]\fR" +.SH "void TQCanvasText::draw ( QPainter & painter )\fC [virtual protected]\fR" Draws the text using the painter \fIpainter\fR. .PP -Reimplemented from QCanvasItem. -.SH "QFont QCanvasText::font () const" +Reimplemented from TQCanvasItem. +.SH "QFont TQCanvasText::font () const" Returns the font in which the text is drawn. .PP See also setFont(). -.SH "int QCanvasText::rtti () const\fC [virtual]\fR" -Returns 3 (QCanvasItem::Rtti_Text). +.SH "int TQCanvasText::rtti () const\fC [virtual]\fR" +Returns 3 (TQCanvasItem::Rtti_Text). .PP -See also QCanvasItem::rtti(). +See also TQCanvasItem::rtti(). .PP -Reimplemented from QCanvasItem. -.SH "void QCanvasText::setColor ( const TQColor & c )" +Reimplemented from TQCanvasItem. +.SH "void TQCanvasText::setColor ( const TQColor & c )" Sets the color of the text to the color \fIc\fR. .PP See also color() and setFont(). .PP Example: chart/chartform_canvas.cpp. -.SH "void QCanvasText::setFont ( const QFont & f )" +.SH "void TQCanvasText::setFont ( const QFont & f )" Sets the font in which the text is drawn to font \fIf\fR. .PP See also font(). -.SH "void QCanvasText::setText ( const TQString & t )" +.SH "void TQCanvasText::setText ( const TQString & t )" Sets the text item's text to \fIt\fR. The text may contain newlines. .PP See also text(), setFont(), setColor(), and setTextFlags(). .PP Example: canvas/canvas.cpp. -.SH "void QCanvasText::setTextFlags ( int f )" +.SH "void TQCanvasText::setTextFlags ( int f )" Sets the alignment flags to \fIf\fR. These are a bitwise OR of the flags available to QPainter::drawText() -- see the TQt::AlignmentFlags. .PP See also setFont() and setColor(). -.SH "TQString QCanvasText::text () const" +.SH "TQString TQCanvasText::text () const" Returns the text item's text. .PP See also setText(). -.SH "int QCanvasText::textFlags () const" +.SH "int TQCanvasText::textFlags () const" Returns the currently set alignment flags. .PP See also setTextFlags() and TQt::AlignmentFlags. .SH "SEE ALSO" -.BR http://doc.trolltech.com/qcanvastext.html +.BR http://doc.trolltech.com/tqcanvastext.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the diff --git a/doc/man/man3/tqcanvasview.3qt b/doc/man/man3/tqcanvasview.3qt index f5ed502e..7988ab89 100644 --- a/doc/man/man3/tqcanvasview.3qt +++ b/doc/man/man3/tqcanvasview.3qt @@ -1,5 +1,5 @@ '\" t -.TH QCanvasView 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- +.TH TQCanvasView 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*- .\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the .\" license file included in the distribution for a complete license .\" statement. @@ -7,28 +7,28 @@ .ad l .nh .SH NAME -QCanvasView \- On-screen view of a QCanvas +TQCanvasView \- On-screen view of a TQCanvas .SH SYNOPSIS -\fC#include \fR +\fC#include \fR .PP Inherits QScrollView. .PP .SS "Public Members" .in +1c .ti -1c -.BI "\fBQCanvasView\fR ( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 )" +.BI "\fBTQCanvasView\fR ( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 )" .br .ti -1c -.BI "\fBQCanvasView\fR ( QCanvas * canvas, TQWidget * parent = 0, const char * name = 0, WFlags f = 0 )" +.BI "\fBTQCanvasView\fR ( TQCanvas * canvas, TQWidget * parent = 0, const char * name = 0, WFlags f = 0 )" .br .ti -1c -.BI "\fB~QCanvasView\fR ()" +.BI "\fB~TQCanvasView\fR ()" .br .ti -1c -.BI "QCanvas * \fBcanvas\fR () const" +.BI "TQCanvas * \fBcanvas\fR () const" .br .ti -1c -.BI "void \fBsetCanvas\fR ( QCanvas * canvas )" +.BI "void \fBsetCanvas\fR ( TQCanvas * canvas )" .br .ti -1c .BI "const QWMatrix & \fBworldMatrix\fR () const" @@ -50,11 +50,11 @@ Inherits QScrollView. .br .in -1c .SH DESCRIPTION -The QCanvasView class provides an on-screen view of a QCanvas. +The TQCanvasView class provides an on-screen view of a TQCanvas. .PP -A QCanvasView is widget which provides a view of a QCanvas. +A TQCanvasView is widget which provides a view of a TQCanvas. .PP -If you want users to be able to interact with a canvas view, subclass QCanvasView. You might then reimplement QScrollView::contentsMousePressEvent(). For example, assuming no transformation matrix is set: +If you want users to be able to interact with a canvas view, subclass TQCanvasView. You might then reimplement QScrollView::contentsMousePressEvent(). For example, assuming no transformation matrix is set: .PP .nf .br @@ -62,13 +62,13 @@ If you want users to be able to interact with a canvas view, subclass QCanvasVie .br { .br - QCanvasItemList l = canvas()->collisions(e->pos()); + TQCanvasItemList l = canvas()->collisions(e->pos()); .br - for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { + for (TQCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { .br - if ( (*it)->rtti() == QCanvasRectangle::RTTI ) + if ( (*it)->rtti() == TQCanvasRectangle::RTTI ) .br - tqDebug("A QCanvasRectangle lies somewhere at this point"); + tqDebug("A TQCanvasRectangle lies somewhere at this point"); .br } .br @@ -119,43 +119,43 @@ The following code finds the part of the canvas that is visible in this view, i. See also QWMatrix, QPainter::setWorldMatrix(), Graphics Classes, and Image Processing Classes. .PP .SH MEMBER FUNCTION DOCUMENTATION -.SH "QCanvasView::QCanvasView ( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 )" -Constructs a QCanvasView with parent \fIparent\fR, and name \fIname\fR, using the widget flags \fIf\fR. The canvas view is not associated with a canvas, so you must to call setCanvas() to view a canvas. -.SH "QCanvasView::QCanvasView ( QCanvas * canvas, TQWidget * parent = 0, const char * name = 0, WFlags f = 0 )" +.SH "TQCanvasView::TQCanvasView ( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 )" +Constructs a TQCanvasView with parent \fIparent\fR, and name \fIname\fR, using the widget flags \fIf\fR. The canvas view is not associated with a canvas, so you must to call setCanvas() to view a canvas. +.SH "TQCanvasView::TQCanvasView ( TQCanvas * canvas, TQWidget * parent = 0, const char * name = 0, WFlags f = 0 )" This is an overloaded member function, provided for convenience. It behaves essentially like the above function. .PP -Constructs a QCanvasView which views canvas \fIcanvas\fR, with parent \fIparent\fR, and name \fIname\fR, using the widget flags \fIf\fR. -.SH "QCanvasView::~QCanvasView ()" +Constructs a TQCanvasView which views canvas \fIcanvas\fR, with parent \fIparent\fR, and name \fIname\fR, using the widget flags \fIf\fR. +.SH "TQCanvasView::~TQCanvasView ()" Destroys the canvas view. The associated canvas is \fInot\fR deleted. -.SH "QCanvas * QCanvasView::canvas () const" -Returns a pointer to the canvas which the QCanvasView is currently showing. -.SH "void QCanvasView::drawContents ( QPainter * p, int cx, int cy, int cw, int ch )\fC [virtual protected]\fR" -Repaints part of the QCanvas that the canvas view is showing starting at \fIcx\fR by \fIcy\fR, with a width of \fIcw\fR and a height of \fIch\fR using the painter \fIp\fR. +.SH "TQCanvas * TQCanvasView::canvas () const" +Returns a pointer to the canvas which the TQCanvasView is currently showing. +.SH "void TQCanvasView::drawContents ( QPainter * p, int cx, int cy, int cw, int ch )\fC [virtual protected]\fR" +Repaints part of the TQCanvas that the canvas view is showing starting at \fIcx\fR by \fIcy\fR, with a width of \fIcw\fR and a height of \fIch\fR using the painter \fIp\fR. .PP -\fBWarning:\fR When double buffering is enabled, drawContents() will not respect the current settings of the painter when setting up the painter for the double buffer (e.g., viewport() and window()). Also, be aware that QCanvas::update() bypasses drawContents(), which means any reimplementation of drawContents() is not called. +\fBWarning:\fR When double buffering is enabled, drawContents() will not respect the current settings of the painter when setting up the painter for the double buffer (e.g., viewport() and window()). Also, be aware that TQCanvas::update() bypasses drawContents(), which means any reimplementation of drawContents() is not called. .PP -See also QCanvas::setDoubleBuffering(). +See also TQCanvas::setDoubleBuffering(). .PP Reimplemented from QScrollView. -.SH "const QWMatrix & QCanvasView::inverseWorldMatrix () const" +.SH "const QWMatrix & TQCanvasView::inverseWorldMatrix () const" Returns a reference to the inverse of the canvas view's current transformation matrix. .PP See also setWorldMatrix() and worldMatrix(). -.SH "void QCanvasView::setCanvas ( QCanvas * canvas )" -Sets the canvas that the QCanvasView is showing to the canvas \fIcanvas\fR. -.SH "bool QCanvasView::setWorldMatrix ( const QWMatrix & wm )" -Sets the transformation matrix of the QCanvasView to \fIwm\fR. The matrix must be invertible (i.e. if you create a world matrix that zooms out by 2 times, then the inverse of this matrix is one that will zoom in by 2 times). +.SH "void TQCanvasView::setCanvas ( TQCanvas * canvas )" +Sets the canvas that the TQCanvasView is showing to the canvas \fIcanvas\fR. +.SH "bool TQCanvasView::setWorldMatrix ( const QWMatrix & wm )" +Sets the transformation matrix of the TQCanvasView to \fIwm\fR. The matrix must be invertible (i.e. if you create a world matrix that zooms out by 2 times, then the inverse of this matrix is one that will zoom in by 2 times). .PP -When you use this, you should note that the performance of the QCanvasView will decrease considerably. +When you use this, you should note that the performance of the TQCanvasView will decrease considerably. .PP Returns FALSE if \fIwm\fR is not invertable; otherwise returns TRUE. .PP See also worldMatrix(), inverseWorldMatrix(), and QWMatrix::isInvertible(). .PP Example: canvas/canvas.cpp. -.SH "QSize QCanvasView::sizeHint () const\fC [virtual protected]\fR" +.SH "QSize TQCanvasView::sizeHint () const\fC [virtual protected]\fR" Suggests a size sufficient to view the entire canvas. -.SH "const QWMatrix & QCanvasView::worldMatrix () const" +.SH "const QWMatrix & TQCanvasView::worldMatrix () const" Returns a reference to the canvas view's current transformation matrix. .PP See also setWorldMatrix() and inverseWorldMatrix(). @@ -163,7 +163,7 @@ See also setWorldMatrix() and inverseWorldMatrix(). Example: canvas/canvas.cpp. .SH "SEE ALSO" -.BR http://doc.trolltech.com/qcanvasview.html +.BR http://doc.trolltech.com/tqcanvasview.html .BR http://www.trolltech.com/faq/tech.html .SH COPYRIGHT Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the diff --git a/doc/man/man3/tqgridview.3qt b/doc/man/man3/tqgridview.3qt index c52cfd52..c3fb2268 100644 --- a/doc/man/man3/tqgridview.3qt +++ b/doc/man/man3/tqgridview.3qt @@ -110,7 +110,7 @@ If you need to monitor changes to the grid's dimensions (i.e. when numRows or nu .PP Note: the row and column indices are always given in the order, row (vertical offset) then column (horizontal offset). This order is the opposite of all pixel operations, which are given in the order x (horizontal offset), y (vertical offset). .PP -QGridView is a very simple abstract class based on QScrollView. It is designed to simplify the task of drawing many cells of the same size in a potentially scrollable canvas. If you need rows and columns with different sizes, use a QTable instead. If you need a simple list of items, use a QListBox. If you need to present hierachical data use a QListView, and if you need random objects at random positions, consider using either a QIconView or a QCanvas. +QGridView is a very simple abstract class based on QScrollView. It is designed to simplify the task of drawing many cells of the same size in a potentially scrollable canvas. If you need rows and columns with different sizes, use a QTable instead. If you need a simple list of items, use a QListBox. If you need to present hierachical data use a QListView, and if you need random objects at random positions, consider using either a QIconView or a TQCanvas. .PP See also Abstract Widget Classes. .SH MEMBER FUNCTION DOCUMENTATION diff --git a/doc/man/man3/tqobject.3qt b/doc/man/man3/tqobject.3qt index 6f651cc2..08a22236 100644 --- a/doc/man/man3/tqobject.3qt +++ b/doc/man/man3/tqobject.3qt @@ -15,7 +15,7 @@ All the functions in this class are reentrant when TQt is built with thread supp .PP Inherits Qt. .PP -Inherited by QAccel, QAccessibleObject, QAction, QApplication, QAssistantClient, QDataPump, QAxObject, QAxScript, QAxScriptManager, TQWidget, QCanvas, QStyle, QClipboard, QCopChannel, QDns, QLayout, QDragObject, TQEditorFactory, QEventLoop, QFileIconProvider, QNetworkProtocol, QWSKeyboardHandler, QNetworkOperation, QNPInstance, TQObjectCleanupHandler, QProcess, QServerSocket, QSessionManager, QSignal, QSignalMapper, QSocket, QSocketNotifier, QSound, TQSqlDatabase, TQSqlDriver, TQSqlForm, QStyleSheet, QTimer, QToolTipGroup, QTranslator, QUrlOperator, and QValidator. +Inherited by QAccel, QAccessibleObject, QAction, QApplication, QAssistantClient, QDataPump, QAxObject, QAxScript, QAxScriptManager, TQWidget, TQCanvas, QStyle, QClipboard, QCopChannel, QDns, QLayout, QDragObject, TQEditorFactory, QEventLoop, QFileIconProvider, QNetworkProtocol, QWSKeyboardHandler, QNetworkOperation, QNPInstance, TQObjectCleanupHandler, QProcess, QServerSocket, QSessionManager, QSignal, QSignalMapper, QSocket, QSocketNotifier, QSound, TQSqlDatabase, TQSqlDriver, TQSqlForm, QStyleSheet, QTimer, QToolTipGroup, QTranslator, QUrlOperator, and QValidator. .PP .SS "Public Members" .in +1c diff --git a/doc/man/man3/tqpixmap.3qt b/doc/man/man3/tqpixmap.3qt index 9fbe5233..98ae130f 100644 --- a/doc/man/man3/tqpixmap.3qt +++ b/doc/man/man3/tqpixmap.3qt @@ -13,7 +13,7 @@ QPixmap \- Off-screen, pixel-based paint device .PP Inherits QPaintDevice and Qt. .PP -Inherited by QBitmap and QCanvasPixmap. +Inherited by QBitmap and TQCanvasPixmap. .PP .SS "Public Members" .in +1c diff --git a/doc/man/man3/tqscrollview.3qt b/doc/man/man3/tqscrollview.3qt index e271ad2b..fc77918a 100644 --- a/doc/man/man3/tqscrollview.3qt +++ b/doc/man/man3/tqscrollview.3qt @@ -13,7 +13,7 @@ QScrollView \- Scrolling area with on-demand scroll bars .PP Inherits QFrame. .PP -Inherited by QCanvasView, QTable, QGridView, QIconView, QListBox, QListView, and QTextEdit. +Inherited by TQCanvasView, QTable, QGridView, QIconView, QListBox, QListView, and QTextEdit. .PP .SS "Public Members" .in +1c @@ -635,7 +635,7 @@ The clip rectangle and translation of the painter \fIp\fR is already set appropr .PP Example: qdir/qdir.cpp. .PP -Reimplemented in QCanvasView and QTable. +Reimplemented in TQCanvasView and QTable. .SH "void QScrollView::drawContentsOffset ( QPainter * p, int offsetx, int offsety, int clipx, int clipy, int clipw, int cliph )\fC [virtual protected]\fR" For backward-compatibility only. It is easier to use drawContents(QPainter*,int,int,int,int). .PP diff --git a/doc/man/man3/tqt.3qt b/doc/man/man3/tqt.3qt index 0233670f..60086430 100644 --- a/doc/man/man3/tqt.3qt +++ b/doc/man/man3/tqt.3qt @@ -11,7 +11,7 @@ Qt \- Namespace for miscellaneous identifiers that need to be global-like .SH SYNOPSIS \fC#include \fR .PP -Inherited by TQObject, QPixmap, QBrush, QCanvasItem, QCursor, QPainter, QEvent, QIconViewItem, QKeySequence, QListViewItem, QCustomMenuItem, QPen, QStyleSheetItem, QSyntaxHighlighter, QTab, QTableItem, QThread, QToolTip, and QWhatsThis. +Inherited by TQObject, QPixmap, QBrush, TQCanvasItem, QCursor, QPainter, QEvent, QIconViewItem, QKeySequence, QListViewItem, QCustomMenuItem, QPen, QStyleSheetItem, QSyntaxHighlighter, QTab, QTableItem, QThread, QToolTip, and QWhatsThis. .PP .SS "Public Members" .in +1c diff --git a/doc/man/man3/tqvaluelist.3qt b/doc/man/man3/tqvaluelist.3qt index 414bb6f9..a24de76f 100644 --- a/doc/man/man3/tqvaluelist.3qt +++ b/doc/man/man3/tqvaluelist.3qt @@ -13,7 +13,7 @@ All the functions in this class are reentrant when TQt is built with thread supp .PP \fC#include \fR .PP -Inherited by QCanvasItemList, QStringList, and QValueStack. +Inherited by TQCanvasItemList, QStringList, and QValueStack. .PP .SS "Public Members" .in +1c diff --git a/doc/man/man3/tqwidget.3qt b/doc/man/man3/tqwidget.3qt index 456e7428..dbba2636 100644 --- a/doc/man/man3/tqwidget.3qt +++ b/doc/man/man3/tqwidget.3qt @@ -1802,7 +1802,7 @@ This event handler can be reimplemented in a subclass to receive paint events. .PP A paint event is a request to repaint all or part of the widget. It can happen as a result of repaint() or update(), or because the widget was obscured and has now been uncovered, or for many other reasons. .PP -Many widgets can simply repaint their entire surface when asked to, but some slow widgets need to optimize by painting only the requested region: QPaintEvent::region(). This speed optimization does not change the result, as painting is clipped to that region during event processing. QListView and QCanvas do this, for example. +Many widgets can simply repaint their entire surface when asked to, but some slow widgets need to optimize by painting only the requested region: QPaintEvent::region(). This speed optimization does not change the result, as painting is clipped to that region during event processing. QListView and TQCanvas do this, for example. .PP Qt also tries to speed up painting by merging multiple paint events into one. When update() is called several times or the window system sends several paint events, TQt merges these events into one event with a larger region (see QRegion::unite()). repaint() does not permit this optimization, so we suggest using update() when possible. .PP diff --git a/doc/porting3.doc b/doc/porting3.doc index ccb2e165..a3841743 100644 --- a/doc/porting3.doc +++ b/doc/porting3.doc @@ -254,12 +254,12 @@ new code. \i QAccel::keyToString( QKeySequence k ) \i QAccel::stringToKey( const TQString \& s ) \i QActionGroup::insert( QAction *a ) -\i QCanvasItem::active() const -\i QCanvasItem::enabled() const -\i QCanvasItem::selected() const -\i QCanvasItem::visible() const -\i QCanvasPixmapArray::QCanvasPixmapArray( QPtrList\ list, QPtrList\ hotspots ) -\i QCanvasPixmapArray::operator!() +\i TQCanvasItem::active() const +\i TQCanvasItem::enabled() const +\i TQCanvasItem::selected() const +\i TQCanvasItem::visible() const +\i TQCanvasPixmapArray::TQCanvasPixmapArray( QPtrList\ list, QPtrList\ hotspots ) +\i TQCanvasPixmapArray::operator!() \i QColorGroup::QColorGroup( const TQColor \& foreground, const TQColor \& background, const TQColor \& light, const TQColor \& dark, const TQColor \& mid, const TQColor \& text, const TQColor \& base ) \i QComboBox::autoResize() const \i QComboBox::setAutoResize( bool ) diff --git a/doc/tutorial2.doc b/doc/tutorial2.doc index efe2b1d8..75225b0d 100644 --- a/doc/tutorial2.doc +++ b/doc/tutorial2.doc @@ -90,10 +90,10 @@ the program's functionality. The program provides two dialogs, one to set options, and the other to create and edit a data set. Both dialogs are launched from chart form menu options or toolbar buttons. -The chart form's main widget is a QCanvasView which displays the -QCanvas on which we draw the pie chart or bar graph. We subclass -QCanvasView to obtain some specialised behaviour. Similarly we -subclass the QCanvasText class (used to place text items on a canvas) +The chart form's main widget is a TQCanvasView which displays the +TQCanvas on which we draw the pie chart or bar graph. We subclass +TQCanvasView to obtain some specialised behaviour. Similarly we +subclass the TQCanvasText class (used to place text items on a canvas) since we require slightly more than the standard class provides. The project file, \c chart.pro, is used to create the Makefile that is @@ -378,8 +378,8 @@ context menu. \table \row -\i The QCanvas class is used for drawing 2D vector graphics. The -QCanvasView class is used to present a view of a canvas in an +\i The TQCanvas class is used for drawing 2D vector graphics. The +TQCanvasView class is used to present a view of a canvas in an application's GUI. All our drawing operations take place on the canvas; but events (e.g. mouse clicks) take place on the canvas view. \endtable @@ -524,12 +524,12 @@ updateChartType() slot. And now that we know the window size and position we can resize and move the chart form's window accordingly. -\skipto new QCanvas +\skipto new TQCanvas \printuntil show -We create a new QCanvas and set its size to that of the chart form +We create a new TQCanvas and set its size to that of the chart form window's client area. We also create a \c CanvasView (our own subclass -of QCanvasView) to display the QCanvas. We make the canvas view the +of TQCanvasView) to display the TQCanvas. We make the canvas view the chart form's main widget and show it. \skipto isEmpty @@ -808,7 +808,7 @@ value. \printuntil show -We create a new QCanvasRectangle for each bar with an x position of 0 +We create a new TQCanvasRectangle for each bar with an x position of 0 (since this is a horizontal bar chart every bar begins at the left), a y value that starts at 0 and grows by the height of each bar as each one is drawn, the height of the bar and the canvas that the bar should @@ -856,30 +856,30 @@ proportional height ready to draw the next element. \printline \printline -\section1 Subclassing QCanvasText +\section1 Subclassing TQCanvasText (Extracts from \c canvastext.h.) \quotefile chart/canvastext.h -\skipto public QCanvasText +\skipto public TQCanvasText \printuntil private \printuntil }; Our CanvasText subclass is a very simple specialisation of -QCanvasText. All we've done is added a single private member \c +TQCanvasText. All we've done is added a single private member \c m_index which holds the element vector index of the element associated with this text item, and provided a getter and setter for this value. -\section1 Subclassing QCanvasView +\section1 Subclassing TQCanvasView (Extracts from \c canvasview.h.) \quotefile chart/canvasview.h -\skipto public QCanvasView +\skipto public TQCanvasView \printuntil private \printuntil }; -We need to subclass QCanvasView so that we can handle: +We need to subclass TQCanvasView so that we can handle: \list 1 \i Context menu requests. \i Form resizing. @@ -944,17 +944,17 @@ element's proportional x and y positions for the current chart type to the current x and y positions proportional to the width and height respectively. We know which element to update because when we create each canvas text item we pass it the index position of the element it -corresponds to. We subclassed QCanvasText so that we could set and get +corresponds to. We subclassed TQCanvasText so that we could set and get this index value. Finally we call update() to make the canvas redraw. \table \row -\i A QCanvas has no visual representation. To see the contents of a -canvas you must create a QCanvasView to present the canvas. Items only +\i A TQCanvas has no visual representation. To see the contents of a +canvas you must create a TQCanvasView to present the canvas. Items only appear in the canvas view if they have been show()n, and then, only if -QCanvas::update() has been called. By default a QCanvas's background +TQCanvas::update() has been called. By default a TQCanvas's background color is white, and by default shapes drawn on the canvas, e.g. -QCanvasRectangle, QCanvasEllipse, etc., have their fill color set to +TQCanvasRectangle, TQCanvasEllipse, etc., have their fill color set to white, so setting a non-white brush color is highly recommended! \endtable diff --git a/examples/README b/examples/README index 1bd72aba..6c6d0cab 100644 --- a/examples/README +++ b/examples/README @@ -38,10 +38,10 @@ buttongroups QPopupMenu to a button. canvas - This examples demonstrates many of QCanvasView's facilities, but - by no means all of them. It uses QCanvasItem, QCanvasLine, - QCanvasRectangle, QCanvasEllipse, QCanvasSprite, and of course - QCanvas. + This examples demonstrates many of TQCanvasView's facilities, but + by no means all of them. It uses TQCanvasItem, TQCanvasLine, + TQCanvasRectangle, TQCanvasEllipse, TQCanvasSprite, and of course + TQCanvas. chart An application for maintaining simple numeric data and visualising @@ -307,7 +307,7 @@ scribble An implementation of the well known scribble program. You can draw with different pen colors and widths and save the result as a pixmap in various formats. It shows how to do drawing using a - TQWidget subclass (rather than a QCanvas for example). It also + TQWidget subclass (rather than a TQCanvas for example). It also shows how to add a QSpinBox to a QToolBar and how to implement a button that pops up a menu (using QPushButton and QPopupMenu), and also how to use the QColorDialog. diff --git a/examples/canvas/canvas.doc b/examples/canvas/canvas.doc index f6d77ad6..787ea6f9 100644 --- a/examples/canvas/canvas.doc +++ b/examples/canvas/canvas.doc @@ -3,8 +3,8 @@ \ingroup examples \title Canvas Example - This example shows a QCanvas and some \l{QCanvasItem}s in action. - You can do a lot more with QCanvas than we show here, but the + This example shows a TQCanvas and some \l{TQCanvasItem}s in action. + You can do a lot more with TQCanvas than we show here, but the example provides a taste of what can be done.


                  diff --git a/examples/canvas/canvas.h b/examples/canvas/canvas.h index 20e1cc95..60ff9da2 100644 --- a/examples/canvas/canvas.h +++ b/examples/canvas/canvas.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include class BouncyLogo : public TQCanvasSprite { void initPos(); diff --git a/examples/chart/canvastext.h b/examples/chart/canvastext.h index 6b61fa46..fa288c2b 100644 --- a/examples/chart/canvastext.h +++ b/examples/chart/canvastext.h @@ -1,7 +1,7 @@ #ifndef CANVASTEXT_H #define CANVASTEXT_H -#include +#include class TQFont; diff --git a/examples/chart/canvasview.h b/examples/chart/canvasview.h index a066c1b1..0bb17627 100644 --- a/examples/chart/canvasview.h +++ b/examples/chart/canvasview.h @@ -4,7 +4,7 @@ #include "element.h" #include "canvastext.h" -#include +#include class TQPoint; diff --git a/examples/chart/chart.doc b/examples/chart/chart.doc index c6c99f26..ff4f7c86 100644 --- a/examples/chart/chart.doc +++ b/examples/chart/chart.doc @@ -6,7 +6,7 @@ \title A Complete Canvas Application This is a complete example program with a main window, menus and - toolbars. The main widget is a QCanvas, and this example + toolbars. The main widget is a TQCanvas, and this example demonstrates basic canvas usage. \omit This example is the subject of \link tutorial2.html Tutorial diff --git a/examples/chart/chartform_canvas.cpp b/examples/chart/chartform_canvas.cpp index 72b65f5c..8d789292 100644 --- a/examples/chart/chartform_canvas.cpp +++ b/examples/chart/chartform_canvas.cpp @@ -2,7 +2,7 @@ #include "chartform.h" #include -#include +#include #include // sin, cos diff --git a/examples/chart/images/chart-forms.sk b/examples/chart/images/chart-forms.sk index d9087b48..89d6ff9f 100644 --- a/examples/chart/images/chart-forms.sk +++ b/examples/chart/images/chart-forms.sk @@ -84,7 +84,7 @@ le() lw(1) Fn('Helvetica-Narrow-Bold') Fs(18) -txt('QCanvas',(580.906,-614.774)) +txt('TQCanvas',(580.906,-614.774)) G_() lw(1.41732) la2(([(-4.0, 3.0), (2.0, 0.0), (-4.0, -3.0), (-4.0, 3.0)], 1)) diff --git a/examples/demo/graph.cpp b/examples/demo/graph.cpp index 257609f1..a4a3dc48 100644 --- a/examples/demo/graph.cpp +++ b/examples/demo/graph.cpp @@ -1,5 +1,5 @@ #include "graph.h" -#include +#include #include #include #include diff --git a/examples/demo/qasteroids/sprites.h b/examples/demo/qasteroids/sprites.h index dbf83441..1f39e74a 100644 --- a/examples/demo/qasteroids/sprites.h +++ b/examples/demo/qasteroids/sprites.h @@ -7,7 +7,7 @@ #ifndef __SPRITES_H__ #define __SPRITES_H__ -#include +#include #define ID_ROCK_LARGE 1024 #define ID_ROCK_MEDIUM 1025 diff --git a/examples/demo/qasteroids/view.h b/examples/demo/qasteroids/view.h index 35b360ab..34ee3d53 100644 --- a/examples/demo/qasteroids/view.h +++ b/examples/demo/qasteroids/view.h @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include "sprites.h" #define MAX_POWER_LEVEL 1000 diff --git a/examples/demo/translations/demo_ar.ts b/examples/demo/translations/demo_ar.ts index 6a749aa5..b63b22da 100644 --- a/examples/demo/translations/demo_ar.ts +++ b/examples/demo/translations/demo_ar.ts @@ -733,15 +733,15 @@ KAsteroidsView - QCanvas demo - عرض QCanvas + TQCanvas demo + عرض TQCanvas - This game has been implemented using the QCanvas class. -The QCanvas class is not part of the Professional Edition. Please + This game has been implemented using the TQCanvas class. +The TQCanvas class is not part of the Professional Edition. Please contact Trolltech if you want to upgrade to the Enterprise Edition. - تمّ إنجاز هذه اللّعبة باستعمال فصيلة QCanvas. -فصيلة QCanvas ليست جزء من التّحريرة الاحترافية. تفضّل + تمّ إنجاز هذه اللّعبة باستعمال فصيلة TQCanvas. +فصيلة TQCanvas ليست جزء من التّحريرة الاحترافية. تفضّل بالإتّصال بترولتك إن أردت التّرفيع إلى تحريرة الشّركات. diff --git a/examples/demo/translations/demo_de.ts b/examples/demo/translations/demo_de.ts index 3f78437b..3c7b2ca5 100644 --- a/examples/demo/translations/demo_de.ts +++ b/examples/demo/translations/demo_de.ts @@ -535,14 +535,14 @@ Windows 95/98/NT/2000, Linux, Solaris, HP-UX. und viele andere Unix-Derivate mit KAsteroidsView - QCanvas demo - QCanvas Demonstration + TQCanvas demo + TQCanvas Demonstration - This game has been implemented using the QCanvas class. -The QCanvas class is not part of the Professional Edition. Please + This game has been implemented using the TQCanvas class. +The TQCanvas class is not part of the Professional Edition. Please contact Trolltech if you want to upgrade to the Enterprise Edition. - Dieses Spiel wurde mit der QCanvas Klasse implementiert. Diese ist kein Teil der Professional Edition. Bitte kontaktieren Sie Trolltech wenn sie auf the Enterprise Edition upgraden möchten. + Dieses Spiel wurde mit der TQCanvas Klasse implementiert. Diese ist kein Teil der Professional Edition. Bitte kontaktieren Sie Trolltech wenn sie auf the Enterprise Edition upgraden möchten. diff --git a/examples/demo/translations/demo_fr.ts b/examples/demo/translations/demo_fr.ts index 9a9bd219..8e59cae1 100644 --- a/examples/demo/translations/demo_fr.ts +++ b/examples/demo/translations/demo_fr.ts @@ -534,12 +534,12 @@ KAsteroidsView - QCanvas demo + TQCanvas demo - This game has been implemented using the QCanvas class. -The QCanvas class is not part of the Professional Edition. Please + This game has been implemented using the TQCanvas class. +The TQCanvas class is not part of the Professional Edition. Please contact Trolltech if you want to upgrade to the Enterprise Edition. diff --git a/examples/demo/translations/demo_he.ts b/examples/demo/translations/demo_he.ts index 48439b45..35247dab 100644 --- a/examples/demo/translations/demo_he.ts +++ b/examples/demo/translations/demo_he.ts @@ -532,15 +532,15 @@ KAsteroidsView - QCanvas demo - הדגמה של QCanvas + TQCanvas demo + הדגמה של TQCanvas - This game has been implemented using the QCanvas class. -The QCanvas class is not part of the Professional Edition. Please + This game has been implemented using the TQCanvas class. +The TQCanvas class is not part of the Professional Edition. Please contact Trolltech if you want to upgrade to the Enterprise Edition. - משחק זה יושם באמצעות המחלקה QCanvas. -המחלקה QCanvas אינה חלק מהמהדורה המקצועית. אנא + משחק זה יושם באמצעות המחלקה TQCanvas. +המחלקה TQCanvas אינה חלק מהמהדורה המקצועית. אנא צור קשר עם Trolltech אם ברצונך לשדרג למהדורה העסקית. diff --git a/include/ntqcanvas.h b/include/ntqcanvas.h deleted file mode 120000 index 276850e8..00000000 --- a/include/ntqcanvas.h +++ /dev/null @@ -1 +0,0 @@ -../src/canvas/ntqcanvas.h \ No newline at end of file diff --git a/include/tqcanvas.h b/include/tqcanvas.h new file mode 120000 index 00000000..35e71a54 --- /dev/null +++ b/include/tqcanvas.h @@ -0,0 +1 @@ +../src/canvas/tqcanvas.h \ No newline at end of file diff --git a/src/canvas/ntqcanvas.h b/src/canvas/ntqcanvas.h deleted file mode 100644 index 9bf3d729..00000000 --- a/src/canvas/ntqcanvas.h +++ /dev/null @@ -1,816 +0,0 @@ -/********************************************************************** -** -** Definition of TQCanvas classes -** -** Created : 991211 -** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the canvas module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial licenses may use this file in accordance with the TQt -** Commercial License Agreement provided with the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#ifndef TQCANVAS_H -#define TQCANVAS_H - -#ifndef QT_H -#include "ntqscrollview.h" -#include "ntqpixmap.h" -#include "ntqptrlist.h" -#include "ntqbrush.h" -#include "ntqpen.h" -#include "ntqvaluelist.h" -#include "ntqpointarray.h" -#endif // QT_H - -#if !defined( TQT_MODULE_CANVAS ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_CANVAS ) -#define TQM_EXPORT_CANVAS -#define TQM_TEMPLATE_EXTERN_CANVAS -#else -#define TQM_EXPORT_CANVAS TQ_EXPORT -#define TQM_TEMPLATE_EXTERN_CANVAS Q_TEMPLATE_EXTERN -#endif - -#ifndef TQT_NO_CANVAS - - -class TQCanvasSprite; -class TQCanvasPolygonalItem; -class TQCanvasRectangle; -class TQCanvasPolygon; -class TQCanvasEllipse; -class TQCanvasText; -class TQCanvasLine; -class TQCanvasChunk; -class TQCanvas; -class TQCanvasItem; -class TQCanvasView; -class TQCanvasPixmap; - -#if defined(Q_TEMPLATEDLL) && ( !defined(Q_CC_BOR) || !defined(QT_MAKEDLL) || defined(Q_EXPORT_TEMPLATES) ) -// MOC_SKIP_BEGIN -TQM_TEMPLATE_EXTERN_CANVAS template class TQM_EXPORT_CANVAS TQValueListIterator< TQCanvasItem* >; -TQM_TEMPLATE_EXTERN_CANVAS template class TQM_EXPORT_CANVAS TQValueList< TQCanvasItem* >; -// MOC_SKIP_END -#endif - -class TQM_EXPORT_CANVAS TQCanvasItemList : public TQValueList { -public: - void sort(); - void drawUnique( TQPainter& painter ); - TQCanvasItemList operator+(const TQCanvasItemList &l) const; -}; - - -class TQCanvasItemExtra; - -class TQM_EXPORT_CANVAS TQCanvasItem : public TQt -{ -public: - TQCanvasItem(TQCanvas* canvas); - virtual ~TQCanvasItem(); - - double x() const - { return myx; } - double y() const - { return myy; } - double z() const - { return myz; } // (depth) - - virtual void moveBy(double dx, double dy); - void move(double x, double y); - void setX(double a) { move(a,y()); } - void setY(double a) { move(x(),a); } - void setZ(double a) { myz=a; changeChunks(); } - - bool animated() const; - virtual void setAnimated(bool y); - virtual void setVelocity( double vx, double vy); - void setXVelocity( double vx ) { setVelocity(vx,yVelocity()); } - void setYVelocity( double vy ) { setVelocity(xVelocity(),vy); } - double xVelocity() const; - double yVelocity() const; - virtual void advance(int stage); - - virtual bool collidesWith( const TQCanvasItem* ) const=0; - - TQCanvasItemList collisions(bool exact /* NO DEFAULT */ ) const; - - virtual void setCanvas(TQCanvas*); - - virtual void draw(TQPainter&)=0; - - void show(); - void hide(); - - virtual void setVisible(bool yes); - bool isVisible() const - { return (bool)vis; } - virtual void setSelected(bool yes); - bool isSelected() const - { return (bool)sel; } - virtual void setEnabled(bool yes); - bool isEnabled() const - { return (bool)ena; } - virtual void setActive(bool yes); - bool isActive() const - { return (bool)act; } -#ifndef TQT_NO_COMPAT - bool visible() const - { return (bool)vis; } - bool selected() const - { return (bool)sel; } - bool enabled() const - { return (bool)ena; } - bool active() const - { return (bool)act; } -#endif - - enum RttiValues { - Rtti_Item = 0, - Rtti_Sprite = 1, - Rtti_PolygonalItem = 2, - Rtti_Text = 3, - Rtti_Polygon = 4, - Rtti_Rectangle = 5, - Rtti_Ellipse = 6, - Rtti_Line = 7, - Rtti_Spline = 8 - }; - - virtual int rtti() const; - static int RTTI; - - virtual TQRect boundingRect() const=0; - virtual TQRect boundingRectAdvanced() const; - - TQCanvas* canvas() const - { return cnv; } - -protected: - void update() { changeChunks(); } - -private: - // For friendly subclasses... - - friend class TQCanvasPolygonalItem; - friend class TQCanvasSprite; - friend class TQCanvasRectangle; - friend class TQCanvasPolygon; - friend class TQCanvasEllipse; - friend class TQCanvasText; - friend class TQCanvasLine; - - virtual TQPointArray chunks() const; - virtual void addToChunks(); - virtual void removeFromChunks(); - virtual void changeChunks(); - virtual bool collidesWith( const TQCanvasSprite*, - const TQCanvasPolygonalItem*, - const TQCanvasRectangle*, - const TQCanvasEllipse*, - const TQCanvasText* ) const = 0; - // End of friend stuff - - TQCanvas* cnv; - static TQCanvas* current_canvas; - double myx,myy,myz; - TQCanvasItemExtra *ext; - TQCanvasItemExtra& extra(); - uint ani:1; - uint vis:1; - uint val:1; - uint sel:1; - uint ena:1; - uint act:1; -}; - - -class TQCanvasData; - -class TQM_EXPORT_CANVAS TQCanvas : public TQObject -{ - TQ_OBJECT -public: - TQCanvas( TQObject* parent = 0, const char* name = 0 ); - TQCanvas(int w, int h); - TQCanvas( TQPixmap p, int h, int v, int tilewidth, int tileheight ); - - virtual ~TQCanvas(); - - virtual void setTiles( TQPixmap tiles, int h, int v, - int tilewidth, int tileheight ); - virtual void setBackgroundPixmap( const TQPixmap& p ); - TQPixmap backgroundPixmap() const; - - virtual void setBackgroundColor( const TQColor& c ); - TQColor backgroundColor() const; - - virtual void setTile( int x, int y, int tilenum ); - int tile( int x, int y ) const - { return grid[x+y*htiles]; } - - int tilesHorizontally() const - { return htiles; } - int tilesVertically() const - { return vtiles; } - - int tileWidth() const - { return tilew; } - int tileHeight() const - { return tileh; } - - virtual void resize(int width, int height); - int width() const - { return awidth; } - int height() const - { return aheight; } - TQSize size() const - { return TQSize(awidth,aheight); } - TQRect rect() const - { return TQRect( 0, 0, awidth, aheight ); } - bool onCanvas( int x, int y ) const - { return x>=0 && y>=0 && x=0 && y>=0 && x, TQPtrList hotspots); - - TQCanvasPixmapArray(TQValueList, TQPointArray hotspots = TQPointArray() ); - ~TQCanvasPixmapArray(); - -#ifndef TQT_NO_IMAGEIO - bool readPixmaps(const TQString& datafilenamepattern, int framecount=0); - bool readCollisionMasks(const TQString& filenamepattern); -#endif - - // deprecated - bool operator!(); // Failure check. - bool isValid() const; - - TQCanvasPixmap* image(int i) const - { return img ? img[i] : 0; } - void setImage(int i, TQCanvasPixmap* p); - uint count() const - { return (uint)framecount; } - -private: -#if defined(TQ_DISABLE_COPY) - TQCanvasPixmapArray( const TQCanvasPixmapArray & ); - TQCanvasPixmapArray &operator=( const TQCanvasPixmapArray & ); -#endif -#ifndef TQT_NO_IMAGEIO - bool readPixmaps(const TQString& datafilenamepattern, int framecount, bool maskonly); -#endif - - void reset(); - int framecount; - TQCanvasPixmap** img; -}; - - -class TQM_EXPORT_CANVAS TQCanvasSprite : public TQCanvasItem -{ -public: - TQCanvasSprite(TQCanvasPixmapArray* array, TQCanvas* canvas); - - void setSequence(TQCanvasPixmapArray* seq); - - virtual ~TQCanvasSprite(); - - void move(double x, double y); - virtual void move(double x, double y, int frame); - void setFrame(int); - enum FrameAnimationType { Cycle, Oscillate }; - virtual void setFrameAnimation(FrameAnimationType=Cycle, int step=1, int state=0); - int frame() const - { return frm; } - int frameCount() const - { return images->count(); } - - int rtti() const; - static int RTTI; - - bool collidesWith( const TQCanvasItem* ) const; - - TQRect boundingRect() const; - - // is there a reason for these to be protected? Lars -//protected: - - int width() const; - int height() const; - - int leftEdge() const; - int topEdge() const; - int rightEdge() const; - int bottomEdge() const; - - int leftEdge(int nx) const; - int topEdge(int ny) const; - int rightEdge(int nx) const; - int bottomEdge(int ny) const; - TQCanvasPixmap* image() const - { return images->image(frm); } - virtual TQCanvasPixmap* imageAdvanced() const; - TQCanvasPixmap* image(int f) const - { return images->image(f); } - virtual void advance(int stage); - -public: - void draw(TQPainter& painter); - -private: -#if defined(TQ_DISABLE_COPY) - TQCanvasSprite( const TQCanvasSprite & ); - TQCanvasSprite &operator=( const TQCanvasSprite & ); -#endif - void addToChunks(); - void removeFromChunks(); - void changeChunks(); - - int frm; - ushort anim_val; - uint anim_state:2; - uint anim_type:14; - bool collidesWith( const TQCanvasSprite*, - const TQCanvasPolygonalItem*, - const TQCanvasRectangle*, - const TQCanvasEllipse*, - const TQCanvasText* ) const; - - friend bool qt_testCollision( const TQCanvasSprite* s1, - const TQCanvasSprite* s2 ); - - TQCanvasPixmapArray* images; -}; - -class TQPolygonalProcessor; - -class TQM_EXPORT_CANVAS TQCanvasPolygonalItem : public TQCanvasItem -{ -public: - TQCanvasPolygonalItem(TQCanvas* canvas); - virtual ~TQCanvasPolygonalItem(); - - bool collidesWith( const TQCanvasItem* ) const; - - virtual void setPen(TQPen p); - virtual void setBrush(TQBrush b); - - TQPen pen() const - { return pn; } - TQBrush brush() const - { return br; } - - virtual TQPointArray areaPoints() const=0; - virtual TQPointArray areaPointsAdvanced() const; - TQRect boundingRect() const; - - int rtti() const; - static int RTTI; - -protected: - void draw(TQPainter &); - virtual void drawShape(TQPainter &) = 0; - - bool winding() const; - void setWinding(bool); - - void invalidate(); - bool isValid() const - { return (bool)val; } - -private: - void scanPolygon( const TQPointArray& pa, int winding, - TQPolygonalProcessor& process ) const; - TQPointArray chunks() const; - - bool collidesWith( const TQCanvasSprite*, - const TQCanvasPolygonalItem*, - const TQCanvasRectangle*, - const TQCanvasEllipse*, - const TQCanvasText* ) const; - - TQBrush br; - TQPen pn; - uint wind:1; -}; - - -class TQM_EXPORT_CANVAS TQCanvasRectangle : public TQCanvasPolygonalItem -{ -public: - TQCanvasRectangle(TQCanvas* canvas); - TQCanvasRectangle(const TQRect&, TQCanvas* canvas); - TQCanvasRectangle(int x, int y, int width, int height, TQCanvas* canvas); - - ~TQCanvasRectangle(); - - int width() const; - int height() const; - void setSize(int w, int h); - TQSize size() const - { return TQSize(w,h); } - TQPointArray areaPoints() const; - TQRect rect() const - { return TQRect(int(x()),int(y()),w,h); } - - bool collidesWith( const TQCanvasItem* ) const; - - int rtti() const; - static int RTTI; - -protected: - void drawShape(TQPainter &); - TQPointArray chunks() const; - -private: - bool collidesWith( const TQCanvasSprite*, - const TQCanvasPolygonalItem*, - const TQCanvasRectangle*, - const TQCanvasEllipse*, - const TQCanvasText* ) const; - - int w, h; -}; - - -class TQM_EXPORT_CANVAS TQCanvasPolygon : public TQCanvasPolygonalItem -{ -public: - TQCanvasPolygon(TQCanvas* canvas); - ~TQCanvasPolygon(); - void setPoints(TQPointArray); - TQPointArray points() const; - void moveBy(double dx, double dy); - - TQPointArray areaPoints() const; - - int rtti() const; - static int RTTI; - -protected: - void drawShape(TQPainter &); - TQPointArray poly; -}; - - -class TQM_EXPORT_CANVAS TQCanvasSpline : public TQCanvasPolygon -{ -public: - TQCanvasSpline(TQCanvas* canvas); - ~TQCanvasSpline(); - - void setControlPoints(TQPointArray, bool closed=TRUE); - TQPointArray controlPoints() const; - bool closed() const; - - int rtti() const; - static int RTTI; - -private: - void recalcPoly(); - TQPointArray bez; - bool cl; -}; - - -class TQM_EXPORT_CANVAS TQCanvasLine : public TQCanvasPolygonalItem -{ -public: - TQCanvasLine(TQCanvas* canvas); - ~TQCanvasLine(); - void setPoints(int x1, int y1, int x2, int y2); - - TQPoint startPoint() const - { return TQPoint(x1,y1); } - TQPoint endPoint() const - { return TQPoint(x2,y2); } - - int rtti() const; - static int RTTI; - - void setPen(TQPen p); - void moveBy(double dx, double dy); - -protected: - void drawShape(TQPainter &); - TQPointArray areaPoints() const; - -private: - int x1,y1,x2,y2; -}; - - -class TQM_EXPORT_CANVAS TQCanvasEllipse : public TQCanvasPolygonalItem -{ - -public: - TQCanvasEllipse( TQCanvas* canvas ); - TQCanvasEllipse( int width, int height, TQCanvas* canvas ); - TQCanvasEllipse( int width, int height, int startangle, int angle, - TQCanvas* canvas ); - - ~TQCanvasEllipse(); - - int width() const; - int height() const; - void setSize(int w, int h); - void setAngles(int start, int length); - int angleStart() const - { return a1; } - int angleLength() const - { return a2; } - TQPointArray areaPoints() const; - - bool collidesWith( const TQCanvasItem* ) const; - - int rtti() const; - static int RTTI; - -protected: - void drawShape(TQPainter &); - -private: - bool collidesWith( const TQCanvasSprite*, - const TQCanvasPolygonalItem*, - const TQCanvasRectangle*, - const TQCanvasEllipse*, - const TQCanvasText* ) const; - int w, h; - int a1, a2; -}; - - -class TQCanvasTextExtra; - -class TQM_EXPORT_CANVAS TQCanvasText : public TQCanvasItem -{ -public: - TQCanvasText(TQCanvas* canvas); - TQCanvasText(const TQString&, TQCanvas* canvas); - TQCanvasText(const TQString&, TQFont, TQCanvas* canvas); - - virtual ~TQCanvasText(); - - void setText( const TQString& ); - void setFont( const TQFont& ); - void setColor( const TQColor& ); - TQString text() const; - TQFont font() const; - TQColor color() const; - - void moveBy(double dx, double dy); - - int textFlags() const - { return flags; } - void setTextFlags(int); - - TQRect boundingRect() const; - - bool collidesWith( const TQCanvasItem* ) const; - - int rtti() const; - static int RTTI; - -protected: - virtual void draw(TQPainter&); - -private: -#if defined(TQ_DISABLE_COPY) - TQCanvasText( const TQCanvasText & ); - TQCanvasText &operator=( const TQCanvasText & ); -#endif - void addToChunks(); - void removeFromChunks(); - void changeChunks(); - - void setRect(); - TQRect brect; - TQString txt; - int flags; - TQFont fnt; - TQColor col; - TQCanvasTextExtra* extra; - - bool collidesWith( const TQCanvasSprite*, - const TQCanvasPolygonalItem*, - const TQCanvasRectangle*, - const TQCanvasEllipse*, - const TQCanvasText* ) const; -}; - -#define Q_DEFINED_QCANVAS -#include "ntqwinexport.h" -#endif // TQT_NO_CANVAS - -#endif // TQCANVAS_H diff --git a/src/canvas/qcanvas.cpp b/src/canvas/qcanvas.cpp deleted file mode 100644 index 11f8a53a..00000000 --- a/src/canvas/qcanvas.cpp +++ /dev/null @@ -1,5415 +0,0 @@ -/********************************************************************** -** -** Implementation of TQCanvas and associated classes -** -** Created : 991211 -** -** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. -** -** This file is part of the canvas module of the TQt GUI Toolkit. -** -** This file may be used under the terms of the GNU General -** Public License versions 2.0 or 3.0 as published by the Free -** Software Foundation and appearing in the files LICENSE.GPL2 -** and LICENSE.GPL3 included in the packaging of this file. -** Alternatively you may (at your option) use any later version -** of the GNU General Public License if such license has been -** publicly approved by Trolltech ASA (or its successors, if any) -** and the KDE Free TQt Foundation. -** -** Please review the following information to ensure GNU General -** Public Licensing requirements will be met: -** http://trolltech.com/products/qt/licenses/licensing/opensource/. -** If you are unsure which license is appropriate for your use, please -** review the following information: -** http://trolltech.com/products/qt/licenses/licensing/licensingoverview -** or contact the sales department at sales@trolltech.com. -** -** This file may be used under the terms of the Q Public License as -** defined by Trolltech ASA and appearing in the file LICENSE.TQPL -** included in the packaging of this file. Licensees holding valid TQt -** Commercial licenses may use this file in accordance with the TQt -** Commercial License Agreement provided with the Software. -** -** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, -** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted -** herein. -** -**********************************************************************/ - -#include "ntqcanvas.h" -#ifndef TQT_NO_CANVAS -#include "ntqapplication.h" -#include "ntqbitmap.h" -#include "ntqimage.h" -#include "ntqptrdict.h" -#include "ntqpainter.h" -#include "ntqpolygonscanner.h" -#include "ntqtimer.h" -#include "ntqtl.h" - -#include - -class TQCanvasData { -public: - TQCanvasData() : - itemDict(1013), animDict(503) - { - } - - TQPtrList viewList; - TQPtrDict itemDict; - TQPtrDict animDict; -}; - -class TQCanvasViewData { -public: - TQCanvasViewData() : repaint_from_moving( FALSE ) {} -#ifndef TQT_NO_TRANSFORMATIONS - TQWMatrix xform; - TQWMatrix ixform; -#endif - bool repaint_from_moving; -}; - -// clusterizer - -class TQCanvasClusterizer { -public: - TQCanvasClusterizer(int maxclusters); - ~TQCanvasClusterizer(); - - void add(int x, int y); // 1x1 rectangle (point) - void add(int x, int y, int w, int h); - void add(const TQRect& rect); - - void clear(); - int clusters() { return count; } - const TQRect& operator[](int i); - -private: - TQRect* cluster; - int count; - const int maxcl; -}; - -static -void include(TQRect& r, const TQRect& rect) -{ - if (rect.left()r.right()) { - r.setRight(rect.right()); - } - if (rect.top()r.bottom()) { - r.setBottom(rect.bottom()); - } -} - -/* -A TQCanvasClusterizer groups rectangles (TQRects) into non-overlapping rectangles -by a merging heuristic. -*/ -TQCanvasClusterizer::TQCanvasClusterizer(int maxclusters) : - cluster(new TQRect[maxclusters]), - count(0), - maxcl(maxclusters) -{ } - -TQCanvasClusterizer::~TQCanvasClusterizer() -{ - delete [] cluster; -} - -void TQCanvasClusterizer::clear() -{ - count=0; -} - -void TQCanvasClusterizer::add(int x, int y) -{ - add(TQRect(x,y,1,1)); -} - -void TQCanvasClusterizer::add(int x, int y, int w, int h) -{ - add(TQRect(x,y,w,h)); -} - -void TQCanvasClusterizer::add(const TQRect& rect) -{ - TQRect biggerrect(rect.x()-1,rect.y()-1,rect.width()+2,rect.height()+2); - - //assert(rect.width()>0 && rect.height()>0); - - int cursor; - - for (cursor=0; cursor=0) { - include(cluster[cheapest],rect); - return; - } - - if (count < maxcl) { - cluster[count++]=rect; - return; - } - - // Do cheapest of: - // add to closest cluster - // do cheapest cluster merge, add to new cluster - - lowestcost=9999999; - cheapest=-1; - cursor=0; - while( cursor=0) { - include(cluster[cheapestmerge1],cluster[cheapestmerge2]); - cluster[cheapestmerge2]=cluster[count--]; - } else { - // if (!cheapest) debugRectangles(rect); - include(cluster[cheapest],rect); - } - - // NB: clusters do not intersect (or intersection will - // overwrite). This is a result of the above algorithm, - // given the assumption that (x,y) are ordered topleft - // to bottomright. - - // ### - // - // add explicit x/y ordering to that comment, move it to the top - // and rephrase it as pre-/post-conditions. -} - -const TQRect& TQCanvasClusterizer::operator[](int i) -{ - return cluster[i]; -} - -// end of clusterizer - - - -class TQM_EXPORT_CANVAS TQCanvasItemPtr { -public: - TQCanvasItemPtr() : ptr(0) { } - TQCanvasItemPtr( TQCanvasItem* p ) : ptr(p) { } - - bool operator<=(const TQCanvasItemPtr& that) const - { - // Order same-z objects by identity. - if (that.ptr->z()==ptr->z()) - return that.ptr <= ptr; - return that.ptr->z() <= ptr->z(); - } - bool operator<(const TQCanvasItemPtr& that) const - { - // Order same-z objects by identity. - if (that.ptr->z()==ptr->z()) - return that.ptr < ptr; - return that.ptr->z() < ptr->z(); - } - bool operator>(const TQCanvasItemPtr& that) const - { - // Order same-z objects by identity. - if (that.ptr->z()==ptr->z()) - return that.ptr > ptr; - return that.ptr->z() > ptr->z(); - } - bool operator==(const TQCanvasItemPtr& that) const - { - return that.ptr == ptr; - } - operator TQCanvasItem*() const { return ptr; } - -private: - TQCanvasItem* ptr; -}; - - -/*! - \class TQCanvasItemList - \brief The TQCanvasItemList class is a list of TQCanvasItems. -\if defined(commercial) - It is part of the TQt Enterprise Edition. -\endif - - \module canvas - \ingroup graphics - \ingroup images - - TQCanvasItemList is a TQValueList of pointers to \l{TQCanvasItem}s. - This class is used by some methods in TQCanvas that need to return - a list of canvas items. - - The \l TQValueList documentation describes how to use this list. -*/ - -/*! - \internal -*/ -void TQCanvasItemList::sort() -{ - qHeapSort(*((TQValueList*)this)); -} - -/*! - \internal -*/ -void TQCanvasItemList::drawUnique( TQPainter& painter ) -{ - TQCanvasItem* prev=0; - for (Iterator it=fromLast(); it!=end(); --it) { - TQCanvasItem *g=*it; - if (g!=prev) { - g->draw(painter); - prev=g; - } - } -} - -/*! - Returns the concatenation of this list and list \a l. -*/ -TQCanvasItemList TQCanvasItemList::operator+(const TQCanvasItemList &l) const -{ - TQCanvasItemList l2(*this); - for(const_iterator it = l.begin(); it != l.end(); ++it) - l2.append(*it); - return l2; -} - -class TQCanvasChunk { -public: - TQCanvasChunk() : changed(TRUE) { } - // Other code assumes lists are not deleted. Assignment is also - // done on ChunkRecs. So don't add that sort of thing here. - - void sort() - { - list.sort(); - } - - const TQCanvasItemList* listPtr() const - { - return &list; - } - - void add(TQCanvasItem* item) - { - list.prepend(item); - changed = TRUE; - } - - void remove(TQCanvasItem* item) - { - list.remove(item); - changed = TRUE; - } - - void change() - { - changed = TRUE; - } - - bool hasChanged() const - { - return changed; - } - - bool takeChange() - { - bool y = changed; - changed = FALSE; - return y; - } - -private: - TQCanvasItemList list; - bool changed; -}; - - -static int gcd(int a, int b) -{ - int r; - while ( (r = a%b) ) { - a=b; - b=r; - } - return b; -} - -static int scm(int a, int b) -{ - int g = gcd(a,b); - return a/g*b; -} - - - -/*! - \class TQCanvas ntqcanvas.h - \brief The TQCanvas class provides a 2D area that can contain TQCanvasItem objects. -\if defined(commercial) - It is part of the TQt Enterprise Edition. -\endif - - \ingroup abstractwidgets - \ingroup graphics - \ingroup images - \mainclass - \module canvas - - The TQCanvas class manages its 2D graphic area and all the canvas - items the area contains. The canvas has no visual appearance of - its own. Instead, it is displayed on screen using a TQCanvasView. - Multiple TQCanvasView widgets may be associated with a canvas to - provide multiple views of the same canvas. - - The canvas is optimized for large numbers of items, particularly - where only a small percentage of the items change at any - one time. If the entire display changes very frequently, you should - consider using your own custom TQScrollView subclass. - - TQt provides a rich - set of canvas item classes, e.g. TQCanvasEllipse, TQCanvasLine, - TQCanvasPolygon, TQCanvasPolygonalItem, TQCanvasRectangle, TQCanvasSpline, - TQCanvasSprite and TQCanvasText. You can subclass to create your own - canvas items; TQCanvasPolygonalItem is the most common base class used - for this purpose. - - Items appear on the canvas after their \link TQCanvasItem::show() - show()\endlink function has been called (or \link - TQCanvasItem::setVisible() setVisible(TRUE)\endlink), and \e after - update() has been called. The canvas only shows items that are - \link TQCanvasItem::setVisible() visible\endlink, and then only if - \l update() is called. (By default the canvas is white and so are - canvas items, so if nothing appears try changing colors.) - - If you created the canvas without passing a width and height to - the constructor you must also call resize(). - - Although a canvas may appear to be similar to a widget with child - widgets, there are several notable differences: - - \list - \i Canvas items are usually much faster to manipulate and redraw than - child widgets, with the speed advantage becoming especially great when - there are \e many canvas items and non-rectangular items. In most - situations canvas items are also a lot more memory efficient than child - widgets. - - \i It's easy to detect overlapping items (collision detection). - - \i The canvas can be larger than a widget. A million-by-million canvas - is perfectly possible. At such a size a widget might be very - inefficient, and some window systems might not support it at all, - whereas TQCanvas scales well. Even with a billion pixels and a million - items, finding a particular canvas item, detecting collisions, etc., - is still fast (though the memory consumption may be prohibitive - at such extremes). - - \i Two or more TQCanvasView objects can view the same canvas. - - \i An arbitrary transformation matrix can be set on each TQCanvasView - which makes it easy to zoom, rotate or shear the viewed canvas. - - \i Widgets provide a lot more functionality, such as input (TQKeyEvent, - TQMouseEvent etc.) and layout management (TQGridLayout etc.). - - \endlist - - A canvas consists of a background, a number of canvas items organized by - x, y and z coordinates, and a foreground. A canvas item's z coordinate - can be treated as a layer number -- canvas items with a higher z - coordinate appear in front of canvas items with a lower z coordinate. - - The background is white by default, but can be set to a different color - using setBackgroundColor(), or to a repeated pixmap using - setBackgroundPixmap() or to a mosaic of smaller pixmaps using - setTiles(). Individual tiles can be set with setTile(). There - are corresponding get functions, e.g. backgroundColor() and - backgroundPixmap(). - - Note that TQCanvas does not inherit from TQWidget, even though it has some - functions which provide the same functionality as those in TQWidget. One - of these is setBackgroundPixmap(); some others are resize(), size(), - width() and height(). \l TQCanvasView is the widget used to display a - canvas on the screen. - - Canvas items are added to a canvas by constructing them and passing the - canvas to the canvas item's constructor. An item can be moved to a - different canvas using TQCanvasItem::setCanvas(). - - Canvas items are movable (and in the case of TQCanvasSprites, animated) - objects that inherit TQCanvasItem. Each canvas item has a position on the - canvas (x, y coordinates) and a height (z coordinate), all of which are - held as floating-point numbers. Moving canvas items also have x and y - velocities. It's possible for a canvas item to be outside the canvas - (for example TQCanvasItem::x() is greater than width()). When a canvas - item is off the canvas, onCanvas() returns FALSE and the canvas - disregards the item. (Canvas items off the canvas do not slow down any - of the common operations on the canvas.) - - Canvas items can be moved with TQCanvasItem::move(). The advance() - function moves all TQCanvasItem::animated() canvas items and - setAdvancePeriod() makes TQCanvas move them automatically on a periodic - basis. In the context of the TQCanvas classes, to `animate' a canvas item - is to set it in motion, i.e. using TQCanvasItem::setVelocity(). Animation - of a canvas item itself, i.e. items which change over time, is enabled - by calling TQCanvasSprite::setFrameAnimation(), or more generally by - subclassing and reimplementing TQCanvasItem::advance(). To detect collisions - use one of the TQCanvasItem::collisions() functions. - - The changed parts of the canvas are redrawn (if they are visible in a - canvas view) whenever update() is called. You can either call update() - manually after having changed the contents of the canvas, or force - periodic updates using setUpdatePeriod(). If you have moving objects on - the canvas, you must call advance() every time the objects should - move one step further. Periodic calls to advance() can be forced using - setAdvancePeriod(). The advance() function will call - TQCanvasItem::advance() on every item that is \link - TQCanvasItem::animated() animated\endlink and trigger an update of the - affected areas afterwards. (A canvas item that is `animated' is simply - a canvas item that is in motion.) - - TQCanvas organizes its canvas items into \e chunks; these are areas on - the canvas that are used to speed up most operations. Many operations - start by eliminating most chunks (i.e. those which haven't changed) - and then process only the canvas items that are in the few interesting - (i.e. changed) chunks. A valid chunk, validChunk(), is one which is on - the canvas. - - The chunk size is a key factor to TQCanvas's speed: if there are too many - chunks, the speed benefit of grouping canvas items into chunks is - reduced. If the chunks are too large, it takes too long to process each - one. The TQCanvas constructor tries to pick a suitable size, but you - can call retune() to change it at any time. The chunkSize() function - returns the current chunk size. The canvas items always make sure - they're in the right chunks; all you need to make sure of is that - the canvas uses the right chunk size. A good rule of thumb is that - the size should be a bit smaller than the average canvas item - size. If you have moving objects, the chunk size should be a bit - smaller than the average size of the moving items. - - The foreground is normally nothing, but if you reimplement - drawForeground(), you can draw things in front of all the canvas - items. - - Areas can be set as changed with setChanged() and set unchanged with - setUnchanged(). The entire canvas can be set as changed with - setAllChanged(). A list of all the items on the canvas is returned by - allItems(). - - An area can be copied (painted) to a TQPainter with drawArea(). - - If the canvas is resized it emits the resized() signal. - - The examples/canvas application and the 2D graphics page of the - examples/demo application demonstrate many of TQCanvas's facilities. - - \sa TQCanvasView TQCanvasItem -*/ -void TQCanvas::init(int w, int h, int chunksze, int mxclusters) -{ - d = new TQCanvasData; - awidth=w; - aheight=h; - chunksize=chunksze; - maxclusters=mxclusters; - chwidth=(w+chunksize-1)/chunksize; - chheight=(h+chunksize-1)/chunksize; - chunks=new TQCanvasChunk[chwidth*chheight]; - update_timer = 0; - bgcolor = white; - grid = 0; - htiles = 0; - vtiles = 0; - dblbuf = TRUE; - debug_redraw_areas = FALSE; -} - -/*! - Create a TQCanvas with no size. \a parent and \a name are passed to - the TQObject superclass. - - \warning You \e must call resize() at some time after creation to - be able to use the canvas. -*/ -TQCanvas::TQCanvas( TQObject* parent, const char* name ) - : TQObject( parent, name ) -{ - init(0,0); -} - -/*! - Constructs a TQCanvas that is \a w pixels wide and \a h pixels high. -*/ -TQCanvas::TQCanvas(int w, int h) -{ - init(w,h); -} - -/*! - Constructs a TQCanvas which will be composed of \a h tiles - horizontally and \a v tiles vertically. Each tile will be an image - \a tilewidth by \a tileheight pixels taken from pixmap \a p. - - The pixmap \a p is a list of tiles, arranged left to right, (and - in the case of pixmaps that have multiple rows of tiles, top to - bottom), with tile 0 in the top-left corner, tile 1 next to the - right, and so on, e.g. - - \table - \row \i 0 \i 1 \i 2 \i 3 - \row \i 4 \i 5 \i 6 \i 7 - \endtable - - The TQCanvas is initially sized to show exactly the given number of - tiles horizontally and vertically. If it is resized to be larger, - the entire matrix of tiles will be repeated as often as necessary - to cover the area. If it is smaller, tiles to the right and bottom - will not be visible. - - \sa setTiles() -*/ -TQCanvas::TQCanvas( TQPixmap p, - int h, int v, int tilewidth, int tileheight ) -{ - init(h*tilewidth, v*tileheight, scm(tilewidth,tileheight) ); - setTiles( p, h, v, tilewidth, tileheight ); -} - -void qt_unview(TQCanvas* c) -{ - for (TQCanvasView* view=c->d->viewList.first(); view != 0; view=c->d->viewList.next()) { - view->viewing = 0; - } -} - -/*! - Destroys the canvas and all the canvas's canvas items. -*/ -TQCanvas::~TQCanvas() -{ - qt_unview(this); - TQCanvasItemList all = allItems(); - for (TQCanvasItemList::Iterator it=all.begin(); it!=all.end(); ++it) - delete *it; - delete [] chunks; - delete [] grid; - delete d; -} - -/*! -\internal -Returns the chunk at a chunk position \a i, \a j. -*/ -TQCanvasChunk& TQCanvas::chunk(int i, int j) const -{ - return chunks[i+chwidth*j]; -} - -/*! -\internal -Returns the chunk at a pixel position \a x, \a y. -*/ -TQCanvasChunk& TQCanvas::chunkContaining(int x, int y) const -{ - return chunk(x/chunksize,y/chunksize); -} - -/*! - Returns a list of all the items in the canvas. -*/ -TQCanvasItemList TQCanvas::allItems() -{ - TQCanvasItemList list; - for (TQPtrDictIterator it=d->itemDict; it.currentKey(); ++it) { - list.prepend((TQCanvasItem*)it.currentKey()); - } - return list; -} - - -/*! - Changes the size of the canvas to have a width of \a w and a - height of \a h. This is a slow operation. -*/ -void TQCanvas::resize(int w, int h) -{ - if (awidth==w && aheight==h) - return; - - TQCanvasItem* item; - TQPtrList hidden; - for (TQPtrDictIterator it=d->itemDict; it.currentKey(); ++it) { - if (((TQCanvasItem*)it.currentKey())->isVisible()) { - ((TQCanvasItem*)it.currentKey())->hide(); - hidden.append(((TQCanvasItem*)it.currentKey())); - } - } - - int nchwidth=(w+chunksize-1)/chunksize; - int nchheight=(h+chunksize-1)/chunksize; - - TQCanvasChunk* newchunks = new TQCanvasChunk[nchwidth*nchheight]; - - // Commit the new values. - // - awidth=w; - aheight=h; - chwidth=nchwidth; - chheight=nchheight; - delete [] chunks; - chunks=newchunks; - - for (item=hidden.first(); item != 0; item=hidden.next()) { - item->show(); - } - - setAllChanged(); - - emit resized(); -} - -/*! - \fn void TQCanvas::resized() - - This signal is emitted whenever the canvas is resized. Each - TQCanvasView connects to this signal to keep the scrollview's size - correct. -*/ - -/*! - Change the efficiency tuning parameters to \a mxclusters clusters, - each of size \a chunksze. This is a slow operation if there are - many objects on the canvas. - - The canvas is divided into chunks which are rectangular areas \a - chunksze wide by \a chunksze high. Use a chunk size which is about - the average size of the canvas items. If you choose a chunk size - which is too small it will increase the amount of calculation - required when drawing since each change will affect many chunks. - If you choose a chunk size which is too large the amount of - drawing required will increase because for each change, a lot of - drawing will be required since there will be many (unchanged) - canvas items which are in the same chunk as the changed canvas - items. - - Internally, a canvas uses a low-resolution "chunk matrix" to keep - track of all the items in the canvas. A 64x64 chunk matrix is the - default for a 1024x1024 pixel canvas, where each chunk collects - canvas items in a 16x16 pixel square. This default is also - affected by setTiles(). You can tune this default using this - function. For example if you have a very large canvas and want to - trade off speed for memory then you might set the chunk size to 32 - or 64. - - The \a mxclusters argument is the number of rectangular groups of - chunks that will be separately drawn. If the canvas has a large - number of small, dispersed items, this should be about that - number. Our testing suggests that a large number of clusters is - almost always best. - -*/ -void TQCanvas::retune(int chunksze, int mxclusters) -{ - maxclusters=mxclusters; - - if ( chunksize!=chunksze ) { - TQPtrList hidden; - for (TQPtrDictIterator it=d->itemDict; it.currentKey(); ++it) { - if (((TQCanvasItem*)it.currentKey())->isVisible()) { - ((TQCanvasItem*)it.currentKey())->hide(); - hidden.append(((TQCanvasItem*)it.currentKey())); - } - } - - chunksize=chunksze; - - int nchwidth=(awidth+chunksize-1)/chunksize; - int nchheight=(aheight+chunksize-1)/chunksize; - - TQCanvasChunk* newchunks = new TQCanvasChunk[nchwidth*nchheight]; - - // Commit the new values. - // - chwidth=nchwidth; - chheight=nchheight; - delete [] chunks; - chunks=newchunks; - - for (TQCanvasItem* item=hidden.first(); item != 0; item=hidden.next()) { - item->show(); - } - } -} - -/*! - \fn int TQCanvas::width() const - - Returns the width of the canvas, in pixels. -*/ - -/*! - \fn int TQCanvas::height() const - - Returns the height of the canvas, in pixels. -*/ - -/*! - \fn TQSize TQCanvas::size() const - - Returns the size of the canvas, in pixels. -*/ - -/*! - \fn TQRect TQCanvas::rect() const - - Returns a rectangle the size of the canvas. -*/ - - -/*! - \fn bool TQCanvas::onCanvas( int x, int y ) const - - Returns TRUE if the pixel position (\a x, \a y) is on the canvas; - otherwise returns FALSE. - - \sa validChunk() -*/ - -/*! - \fn bool TQCanvas::onCanvas( const TQPoint& p ) const - \overload - - Returns TRUE if the pixel position \a p is on the canvas; - otherwise returns FALSE. - - \sa validChunk() -*/ - -/*! - \fn bool TQCanvas::validChunk( int x, int y ) const - - Returns TRUE if the chunk position (\a x, \a y) is on the canvas; - otherwise returns FALSE. - - \sa onCanvas() -*/ - -/*! - \fn bool TQCanvas::validChunk( const TQPoint& p ) const - \overload - - Returns TRUE if the chunk position \a p is on the canvas; otherwise - returns FALSE. - - \sa onCanvas() -*/ - -/*! - \fn int TQCanvas::chunkSize() const - - Returns the chunk size of the canvas. - - \sa retune() -*/ - -/*! -\fn bool TQCanvas::sameChunk(int x1, int y1, int x2, int y2) const -\internal -Tells if the points ( \a x1, \a y1 ) and ( \a x2, \a y2 ) are within the same chunk. -*/ - -/*! -\internal -This method adds an the item \a item to the list of TQCanvasItem objects -in the TQCanvas. The TQCanvasItem class calls this. -*/ -void TQCanvas::addItem(TQCanvasItem* item) -{ - d->itemDict.insert((void*)item,(void*)1); -} - -/*! -\internal -This method adds the item \a item to the list of TQCanvasItem objects -to be moved. The TQCanvasItem class calls this. -*/ -void TQCanvas::addAnimation(TQCanvasItem* item) -{ - d->animDict.insert((void*)item,(void*)1); -} - -/*! -\internal -This method adds the item \a item to the list of TQCanvasItem objects -which are no longer to be moved. The TQCanvasItem class calls this. -*/ -void TQCanvas::removeAnimation(TQCanvasItem* item) -{ - d->animDict.remove((void*)item); -} - -/*! -\internal -This method removes the item \a item from the list of TQCanvasItem objects -in this TQCanvas. The TQCanvasItem class calls this. -*/ -void TQCanvas::removeItem(TQCanvasItem* item) -{ - d->itemDict.remove((void*)item); -} - -/*! -\internal -This method adds the view \a view to the list of TQCanvasView objects -viewing this TQCanvas. The TQCanvasView class calls this. -*/ -void TQCanvas::addView(TQCanvasView* view) -{ - d->viewList.append(view); - if ( htiles>1 || vtiles>1 || pm.isNull() ) - view->viewport()->setBackgroundColor(backgroundColor()); -} - -/*! -\internal -This method removes the view \a view from the list of TQCanvasView objects -viewing this TQCanvas. The TQCanvasView class calls this. -*/ -void TQCanvas::removeView(TQCanvasView* view) -{ - d->viewList.removeRef(view); -} - -/*! - Sets the canvas to call advance() every \a ms milliseconds. Any - previous setting by setAdvancePeriod() or setUpdatePeriod() is - overridden. - - If \a ms is less than 0 advancing will be stopped. -*/ -void TQCanvas::setAdvancePeriod(int ms) -{ - if ( ms<0 ) { - if ( update_timer ) - update_timer->stop(); - } else { - if ( update_timer ) - delete update_timer; - update_timer = new TQTimer(this); - connect(update_timer,TQ_SIGNAL(timeout()),this,TQ_SLOT(advance())); - update_timer->start(ms); - } -} - -/*! - Sets the canvas to call update() every \a ms milliseconds. Any - previous setting by setAdvancePeriod() or setUpdatePeriod() is - overridden. - - If \a ms is less than 0 automatic updating will be stopped. -*/ -void TQCanvas::setUpdatePeriod(int ms) -{ - if ( ms<0 ) { - if ( update_timer ) - update_timer->stop(); - } else { - if ( update_timer ) - delete update_timer; - update_timer = new TQTimer(this); - connect(update_timer,TQ_SIGNAL(timeout()),this,TQ_SLOT(update())); - update_timer->start(ms); - } -} - -/*! - Moves all TQCanvasItem::animated() canvas items on the canvas and - refreshes all changes to all views of the canvas. (An `animated' - item is an item that is in motion; see setVelocity().) - - The advance takes place in two phases. In phase 0, the - TQCanvasItem::advance() function of each TQCanvasItem::animated() - canvas item is called with paramater 0. Then all these canvas - items are called again, with parameter 1. In phase 0, the canvas - items should not change position, merely examine other items on - the canvas for which special processing is required, such as - collisions between items. In phase 1, all canvas items should - change positions, ignoring any other items on the canvas. This - two-phase approach allows for considerations of "fairness", - although no TQCanvasItem subclasses supplied with TQt do anything - interesting in phase 0. - - The canvas can be configured to call this function periodically - with setAdvancePeriod(). - - \sa update() -*/ -void TQCanvas::advance() -{ - TQPtrDictIterator it=d->animDict; - while ( it.current() ) { - TQCanvasItem* i = (TQCanvasItem*)(void*)it.currentKey(); - ++it; - if ( i ) - i->advance(0); - } - // we expect the dict contains the exact same items as in the - // first pass. - it.toFirst(); - while ( it.current() ) { - TQCanvasItem* i = (TQCanvasItem*)(void*)it.currentKey(); - ++it; - if ( i ) - i->advance(1); - } - update(); -} - -// Don't call this unless you know what you're doing. -// p is in the content's co-ordinate example. -/*! - \internal -*/ -void TQCanvas::drawViewArea( TQCanvasView* view, TQPainter* p, const TQRect& vr, bool dbuf ) -{ - TQPoint tl = view->contentsToViewport(TQPoint(0,0)); - -#ifndef TQT_NO_TRANSFORMATIONS - TQWMatrix wm = view->worldMatrix(); - TQWMatrix iwm = wm.invert(); - // ivr = covers all chunks in vr - TQRect ivr = iwm.map(vr); - ivr.addCoords(-1, -1, 1, 1); - TQWMatrix twm; - twm.translate(tl.x(),tl.y()); -#else - TQRect ivr = vr; -#endif - - TQRect all(0,0,width(),height()); - - if ( !all.contains(ivr) ) { - // Need to clip with edge of canvas. - -#ifndef TQT_NO_TRANSFORMATIONS - // For translation-only transformation, it is safe to include the right - // and bottom edges, but otherwise, these must be excluded since they - // are not precisely defined (different bresenham paths). - TQPointArray a; - if ( wm.m12()==0.0 && wm.m21()==0.0 && wm.m11() == 1.0 && wm.m22() == 1.0 ) - a = TQPointArray( TQRect(all.x(),all.y(),all.width()+1,all.height()+1) ); - else - a = TQPointArray( all ); - - a = (wm*twm).map(a); -#else - TQPointArray a( TQRect(all.x(),all.y(),all.width()+1,all.height()+1) ); -#endif - if ( view->viewport()->backgroundMode() == NoBackground ) { - TQRect cvr = vr; cvr.moveBy(tl.x(),tl.y()); - p->setClipRegion(TQRegion(cvr)-TQRegion(a)); - p->fillRect(vr,view->viewport()->palette() - .brush(TQPalette::Active,TQColorGroup::Background)); - } - p->setClipRegion(a); - } - - if ( dbuf ) { - offscr = TQPixmap(vr.size().expandedTo(TQSize(1, 1))); -#ifdef TQ_WS_X11 - offscr.x11SetScreen(p->device()->x11Screen()); -#endif - TQPainter dbp(&offscr); -#ifndef TQT_NO_TRANSFORMATIONS - twm.translate(-vr.x(),-vr.y()); - twm.translate(-tl.x(),-tl.y()); - dbp.setWorldMatrix( wm*twm, TRUE ); -#else - dbp.translate(-vr.x()-tl.x(),-vr.y()-tl.y()); -#endif - dbp.setClipRect(0,0,vr.width(), vr.height()); - drawCanvasArea(ivr,&dbp,FALSE); - dbp.end(); - p->drawPixmap(vr.x(), vr.y(), offscr, 0, 0, vr.width(), vr.height()); - } else { - TQRect r = vr; r.moveBy(tl.x(),tl.y()); // move to untransformed co-ords - if ( !all.contains(ivr) ) { - TQRegion inside = p->clipRegion() & r; - //TQRegion outside = p->clipRegion() - r; - //p->setClipRegion(outside); - //p->fillRect(outside.boundingRect(),red); - p->setClipRegion(inside); - } else { - p->setClipRect(r); - } -#ifndef TQT_NO_TRANSFORMATIONS - p->setWorldMatrix( wm*twm ); -#else -#endif - p->setBrushOrigin(tl.x(), tl.y()); - drawCanvasArea(ivr,p,FALSE); - } -} - -/*! - Repaints changed areas in all views of the canvas. - - \sa advance() -*/ -void TQCanvas::update() -{ - TQCanvasClusterizer clusterizer(d->viewList.count()); -#ifndef TQT_NO_TRANSFORMATIONS - TQPtrList doneareas; - doneareas.setAutoDelete(TRUE); -#endif - - TQPtrListIterator it(d->viewList); - TQCanvasView* view; - while( (view=it.current()) != 0 ) { - ++it; -#ifndef TQT_NO_TRANSFORMATIONS - TQWMatrix wm = view->worldMatrix(); -#endif - TQRect area(view->contentsX(),view->contentsY(), - view->visibleWidth(),view->visibleHeight()); - if (area.width()>0 && area.height()>0) { -#ifndef TQT_NO_TRANSFORMATIONS - if ( !wm.isIdentity() ) { - // r = Visible area of the canvas where there are changes - TQRect r = changeBounds(view->inverseWorldMatrix().map(area)); - if ( !r.isEmpty() ) { - TQPainter p(view->viewport()); - // Translate to the coordinate system of drawViewArea(). - TQPoint tl = view->contentsToViewport(TQPoint(0,0)); - p.translate(tl.x(),tl.y()); - drawViewArea( view, &p, wm.map(r), dblbuf ); - doneareas.append(new TQRect(r)); - } - } else -#endif - { - clusterizer.add(area); - } - } - } - - for (int i=0; ichwidth) - mx=chwidth; - if (my>chheight) - my=chheight; - - int x=thearea.x()/chunksize; - while( xchwidth) - mx=chwidth; - if (my>chheight) - my=chheight; - - int x=thearea.x()/chunksize; - while( x chwidth) - mx=chwidth; - if (my > chheight) - my=chheight; - - TQRect result; - - int x=area.x()/chunksize; - while( x chwidth) - mx=chwidth; - if (my > chheight) - my=chheight; - - int x=area.x()/chunksize; - while( xviewList.first() && !p) return; // Nothing to do. - - int lx=area.x()/chunksize; - int ly=area.y()/chunksize; - int mx=area.right()/chunksize; - int my=area.bottom()/chunksize; - if (mx>=chwidth) - mx=chwidth-1; - if (my>=chheight) - my=chheight-1; - - TQCanvasItemList allvisible; - - // Stores the region within area that need to be drawn. It is relative - // to area.topLeft() (so as to keep within bounds of 16-bit XRegions) - TQRegion rgn; - - for (int x=lx; x<=mx; x++) { - for (int y=ly; y<=my; y++) { - // Only reset change if all views updating, and - // wholy within area. (conservative: ignore entire boundary) - // - // Disable this to help debugging. - // - if (!p) { - if ( chunk(x,y).takeChange() ) { - // ### should at least make bands - rgn |= TQRegion(x*chunksize-area.x(),y*chunksize-area.y(), - chunksize,chunksize); - allvisible += *chunk(x,y).listPtr(); - } - } else { - allvisible += *chunk(x,y).listPtr(); - } - } - } - allvisible.sort(); - - if ( double_buffer ) { - offscr = TQPixmap(area.size().expandedTo(TQSize(1, 1))); -#ifdef TQ_WS_X11 - if (p) - offscr.x11SetScreen(p->device()->x11Screen()); -#endif - } - - if ( double_buffer && !offscr.isNull() ) { - TQPainter painter; - painter.begin(&offscr); - painter.translate(-area.x(),-area.y()); - painter.setBrushOrigin(-area.x(),-area.y()); - if ( p ) { - painter.setClipRect(TQRect(0,0,area.width(),area.height())); - } else { - painter.setClipRegion(rgn); - } - drawBackground(painter,area); - allvisible.drawUnique(painter); - drawForeground(painter,area); - painter.end(); - if ( p ) { - p->drawPixmap( area.x(), area.y(), offscr, - 0, 0, area.width(), area.height() ); - return; - } - } else if ( p ) { - drawBackground(*p,area); - allvisible.drawUnique(*p); - drawForeground(*p,area); - return; - } - - TQPoint trtr; // keeps track of total translation of rgn - - trtr -= area.topLeft(); - - for (TQCanvasView* view=d->viewList.first(); view; view=d->viewList.next()) { -#ifndef TQT_NO_TRANSFORMATIONS - if ( !view->worldMatrix().isIdentity() ) - continue; // Cannot paint those here (see callers). -#endif - TQPainter painter(view->viewport()); - TQPoint tr = view->contentsToViewport(area.topLeft()); - TQPoint nrtr = view->contentsToViewport(TQPoint(0,0)); // new translation - TQPoint rtr = nrtr - trtr; // extra translation of rgn - trtr += rtr; // add to total - if (double_buffer) { - rgn.translate(rtr.x(),rtr.y()); - painter.setClipRegion(rgn); - painter.drawPixmap(tr,offscr, TQRect(TQPoint(0,0),area.size())); - } else { - painter.translate(nrtr.x(),nrtr.y()); - rgn.translate(rtr.x(),rtr.y()); - painter.setClipRegion(rgn); - drawBackground(painter,area); - allvisible.drawUnique(painter); - drawForeground(painter,area); - painter.translate(-nrtr.x(),-nrtr.y()); - } - } -} - -/*! -\internal -This method to informs the TQCanvas that a given chunk is -`dirty' and needs to be redrawn in the next Update. - -(\a x,\a y) is a chunk location. - -The sprite classes call this. Any new derived class of TQCanvasItem -must do so too. SetChangedChunkContaining can be used instead. -*/ -void TQCanvas::setChangedChunk(int x, int y) -{ - if (validChunk(x,y)) { - TQCanvasChunk& ch=chunk(x,y); - ch.change(); - } -} - -/*! -\internal -This method to informs the TQCanvas that the chunk containing a given -pixel is `dirty' and needs to be redrawn in the next Update. - -(\a x,\a y) is a pixel location. - -The item classes call this. Any new derived class of TQCanvasItem must -do so too. SetChangedChunk can be used instead. -*/ -void TQCanvas::setChangedChunkContaining(int x, int y) -{ - if (x>=0 && x=0 && y=0 && x=0 && y=0 && x=0 && yviewList.first(); - while ( view != 0 ) { - /* XXX this doesn't look right. Shouldn't this - be more like setBackgroundPixmap? : Ian */ - view->viewport()->setEraseColor( bgcolor ); - view=d->viewList.next(); - } - setAllChanged(); - } -} - -/*! - Returns the pixmap set by setBackgroundPixmap(). By default, - this is a null pixmap. - - \sa setBackgroundPixmap(), backgroundColor() -*/ -TQPixmap TQCanvas::backgroundPixmap() const -{ - return pm; -} - -/*! - Sets the solid background to be the pixmap \a p repeated as - necessary to cover the entire canvas. - - \sa backgroundPixmap(), setBackgroundColor(), setTiles() -*/ -void TQCanvas::setBackgroundPixmap( const TQPixmap& p ) -{ - setTiles(p, 1, 1, p.width(), p.height()); - TQCanvasView* view = d->viewList.first(); - while ( view != 0 ) { - view->updateContents(); - view = d->viewList.next(); - } -} - -/*! - This virtual function is called for all updates of the canvas. It - renders any background graphics using the painter \a painter, in - the area \a clip. If the canvas has a background pixmap or a tiled - background, that graphic is used, otherwise the canvas is cleared - using the background color. - - If the graphics for an area change, you must explicitly call - setChanged(const TQRect&) for the result to be visible when - update() is next called. - - \sa setBackgroundColor(), setBackgroundPixmap(), setTiles() -*/ -void TQCanvas::drawBackground(TQPainter& painter, const TQRect& clip) -{ - if ( pm.isNull() ) { - painter.fillRect(clip,bgcolor); - } else if ( !grid ) { - for (int x=clip.x()/pm.width(); - x<(clip.x()+clip.width()+pm.width()-1)/pm.width(); x++) - { - for (int y=clip.y()/pm.height(); - y<(clip.y()+clip.height()+pm.height()-1)/pm.height(); y++) - { - painter.drawPixmap(x*pm.width(), y*pm.height(),pm); - } - } - } else { - const int x1 = clip.left()/tilew; - int x2 = clip.right()/tilew; - const int y1 = clip.top()/tileh; - int y2 = clip.bottom()/tileh; - - const int roww = pm.width()/tilew; - - for (int j=y1; j<=y2; j++) { - int jj = j%tilesVertically(); - for (int i=x1; i<=x2; i++) { - int t = tile(i%tilesHorizontally(), jj); - int tx = t % roww; - int ty = t / roww; - painter.drawPixmap( i*tilew, j*tileh, pm, - tx*tilew, ty*tileh, tilew, tileh ); - } - } - } -} - -/*! - This virtual function is called for all updates of the canvas. It - renders any foreground graphics using the painter \a painter, in - the area \a clip. - - If the graphics for an area change, you must explicitly call - setChanged(const TQRect&) for the result to be visible when - update() is next called. - - The default is to draw nothing. -*/ -void TQCanvas::drawForeground(TQPainter& painter, const TQRect& clip) -{ - if ( debug_redraw_areas ) { - painter.setPen(red); - painter.setBrush(NoBrush); - painter.drawRect(clip); - } -} - -/*! - If \a y is TRUE (the default) double-buffering is switched on; - otherwise double-buffering is switched off. - - Turning off double-buffering causes the redrawn areas to flicker a - little and also gives a (usually small) performance improvement. -*/ -void TQCanvas::setDoubleBuffering(bool y) -{ - dblbuf = y; -} - - -/*! - Sets the TQCanvas to be composed of \a h tiles horizontally and \a - v tiles vertically. Each tile will be an image \a tilewidth by \a - tileheight pixels from pixmap \a p. - - The pixmap \a p is a list of tiles, arranged left to right, (and - in the case of pixmaps that have multiple rows of tiles, top to - bottom), with tile 0 in the top-left corner, tile 1 next to the - right, and so on, e.g. - - \table - \row \i 0 \i 1 \i 2 \i 3 - \row \i 4 \i 5 \i 6 \i 7 - \endtable - - If the canvas is larger than the matrix of tiles, the entire - matrix is repeated as necessary to cover the whole canvas. If it - is smaller, tiles to the right and bottom are not visible. - - The width and height of \a p must be a multiple of \a tilewidth - and \a tileheight. If they are not the function will do nothing. - - If you want to unset any tiling set, then just pass in a null - pixmap and 0 for \a h, \a v, \a tilewidth, and - \a tileheight. -*/ -void TQCanvas::setTiles( TQPixmap p, - int h, int v, int tilewidth, int tileheight ) -{ - if ( !p.isNull() && (!tilewidth || !tileheight || - p.width() % tilewidth != 0 || p.height() % tileheight != 0 ) ) - return; - - htiles = h; - vtiles = v; - delete[] grid; - pm = p; - if ( h && v && !p.isNull() ) { - grid = new ushort[h*v]; - memset( grid, 0, h*v*sizeof(ushort) ); - tilew = tilewidth; - tileh = tileheight; - } else { - grid = 0; - } - if ( h + v > 10 ) { - int s = scm(tilewidth,tileheight); - retune( s < 128 ? s : TQMAX(tilewidth,tileheight) ); - } - setAllChanged(); -} - -/*! - \fn int TQCanvas::tile( int x, int y ) const - - Returns the tile at position (\a x, \a y). Initially, all tiles - are 0. - - The parameters must be within range, i.e. - 0 \< \a x \< tilesHorizontally() and - 0 \< \a y \< tilesVertically(). - - \sa setTile() -*/ - -/*! - \fn int TQCanvas::tilesHorizontally() const - - Returns the number of tiles horizontally. -*/ - -/*! - \fn int TQCanvas::tilesVertically() const - - Returns the number of tiles vertically. -*/ - -/*! - \fn int TQCanvas::tileWidth() const - - Returns the width of each tile. -*/ - -/*! - \fn int TQCanvas::tileHeight() const - - Returns the height of each tile. -*/ - - -/*! - Sets the tile at (\a x, \a y) to use tile number \a tilenum, which - is an index into the tile pixmaps. The canvas will update - appropriately when update() is next called. - - The images are taken from the pixmap set by setTiles() and are - arranged left to right, (and in the case of pixmaps that have - multiple rows of tiles, top to bottom), with tile 0 in the - top-left corner, tile 1 next to the right, and so on, e.g. - - \table - \row \i 0 \i 1 \i 2 \i 3 - \row \i 4 \i 5 \i 6 \i 7 - \endtable - - \sa tile() setTiles() -*/ -void TQCanvas::setTile( int x, int y, int tilenum ) -{ - ushort& t = grid[x+y*htiles]; - if ( t != tilenum ) { - t = tilenum; - if ( tilew == tileh && tilew == chunksize ) - setChangedChunk( x, y ); // common case - else - setChanged( TQRect(x*tilew,y*tileh,tilew,tileh) ); - } -} - - -// lesser-used data in canvas item, plus room for extension. -// Be careful adding to this - check all usages. -class TQCanvasItemExtra { - TQCanvasItemExtra() : vx(0.0), vy(0.0) { } - double vx,vy; - friend class TQCanvasItem; -}; - - -/*! - \class TQCanvasItem ntqcanvas.h - \brief The TQCanvasItem class provides an abstract graphic object on a TQCanvas. -\if defined(commercial) - It is part of the TQt Enterprise Edition. -\endif - - \module canvas - \ingroup graphics - \ingroup images - - A variety of TQCanvasItem subclasses provide immediately usable - behaviour. This class is a pure abstract superclass providing the - behaviour that is shared among all the concrete canvas item classes. - TQCanvasItem is not intended for direct subclassing. It is much easier - to subclass one of its subclasses, e.g. TQCanvasPolygonalItem (the - commonest base class), TQCanvasRectangle, TQCanvasSprite, TQCanvasEllipse - or TQCanvasText. - - Canvas items are added to a canvas by constructing them and passing the - canvas to the canvas item's constructor. An item can be moved to a - different canvas using setCanvas(). - - Items appear on the canvas after their \link show() show()\endlink - function has been called (or \link setVisible() - setVisible(TRUE)\endlink), and \e after update() has been called. The - canvas only shows items that are \link setVisible() visible\endlink, - and then only if \l update() is called. If you created the canvas - without passing a width and height to the constructor you'll also need - to call \link TQCanvas::resize() resize()\endlink. Since the canvas - background defaults to white and canvas items default to white, - you may need to change colors to see your items. - - A TQCanvasItem object can be moved in the x(), y() and z() dimensions - using functions such as move(), moveBy(), setX(), setY() and setZ(). A - canvas item can be set in motion, `animated', using setAnimated() and - given a velocity in the x and y directions with setXVelocity() and - setYVelocity() -- the same effect can be achieved by calling - setVelocity(). Use the collidesWith() function to see if the canvas item - will collide on the \e next advance(1) and use collisions() to see what - collisions have occurred. - - Use TQCanvasSprite or your own subclass of TQCanvasSprite to create canvas - items which are animated, i.e. which change over time. - - The size of a canvas item is given by boundingRect(). Use - boundingRectAdvanced() to see what the size of the canvas item will be - \e after the next advance(1) call. - - The rtti() function is used for identifying subclasses of TQCanvasItem. - The canvas() function returns a pointer to the canvas which contains the - canvas item. - - TQCanvasItem provides the show() and isVisible() functions like those in - TQWidget. - - TQCanvasItem also provides the setEnabled(), setActive() and - setSelected() functions; these functions set the relevant boolean and - cause a repaint but the boolean values they set are not used in - TQCanvasItem itself. You can make use of these booleans in your subclasses. - - By default, canvas items have no velocity, no size, and are not in - motion. The subclasses provided in TQt do not change these defaults - except where noted. - -*/ - -/*! - \enum TQCanvasItem::RttiValues - - This enum is used to name the different types of canvas item. - - \value Rtti_Item Canvas item abstract base class - \value Rtti_Ellipse - \value Rtti_Line - \value Rtti_Polygon - \value Rtti_PolygonalItem - \value Rtti_Rectangle - \value Rtti_Spline - \value Rtti_Sprite - \value Rtti_Text - -*/ - -/*! - \fn void TQCanvasItem::update() - - Call this function to repaint the canvas's changed chunks. -*/ - -/*! - Constructs a TQCanvasItem on canvas \a canvas. - - \sa setCanvas() -*/ -TQCanvasItem::TQCanvasItem(TQCanvas* canvas) : - cnv(canvas), - myx(0),myy(0),myz(0) -{ - ani=0; - vis=0; - val=0; - sel=0; - ena=0; - act=0; - - ext = 0; - if (cnv) cnv->addItem(this); -} - -/*! - Destroys the TQCanvasItem and removes it from its canvas. -*/ -TQCanvasItem::~TQCanvasItem() -{ - if (cnv) { - cnv->removeItem(this); - cnv->removeAnimation(this); - } - delete ext; -} - -TQCanvasItemExtra& TQCanvasItem::extra() -{ - if ( !ext ) - ext = new TQCanvasItemExtra; - return *ext; -} - -/*! - \fn double TQCanvasItem::x() const - - Returns the horizontal position of the canvas item. Note that - subclasses often have an origin other than the top-left corner. -*/ - -/*! - \fn double TQCanvasItem::y() const - - Returns the vertical position of the canvas item. Note that - subclasses often have an origin other than the top-left corner. -*/ - -/*! - \fn double TQCanvasItem::z() const - - Returns the z index of the canvas item, which is used for visual - order: higher-z items obscure (are in front of) lower-z items. -*/ - -/*! - \fn void TQCanvasItem::setX(double x) - - Moves the canvas item so that its x-position is \a x. - - \sa x(), move() -*/ - -/*! - \fn void TQCanvasItem::setY(double y) - - Moves the canvas item so that its y-position is \a y. - - \sa y(), move() -*/ - -/*! - \fn void TQCanvasItem::setZ(double z) - - Sets the z index of the canvas item to \a z. Higher-z items - obscure (are in front of) lower-z items. - - \sa z(), move() -*/ - - -/*! - Moves the canvas item relative to its current position by (\a dx, - \a dy). -*/ -void TQCanvasItem::moveBy( double dx, double dy ) -{ - if ( dx || dy ) { - removeFromChunks(); - myx += dx; - myy += dy; - addToChunks(); - } -} - - -/*! - Moves the canvas item to the absolute position (\a x, \a y). -*/ -void TQCanvasItem::move( double x, double y ) -{ - moveBy( x-myx, y-myy ); -} - - -/*! - Returns TRUE if the canvas item is in motion; otherwise returns - FALSE. - - \sa setVelocity(), setAnimated() -*/ -bool TQCanvasItem::animated() const -{ - return (bool)ani; -} - -/*! - Sets the canvas item to be in motion if \a y is TRUE, or not if \a - y is FALSE. The speed and direction of the motion is set with - setVelocity(), or with setXVelocity() and setYVelocity(). - - \sa advance(), TQCanvas::advance() -*/ -void TQCanvasItem::setAnimated(bool y) -{ - if ( y != (bool)ani ) { - ani = (uint)y; - if ( y ) { - cnv->addAnimation(this); - } else { - cnv->removeAnimation(this); - } - } -} - -/*! - \fn void TQCanvasItem::setXVelocity( double vx ) - - Sets the horizontal component of the canvas item's velocity to \a vx. - - \sa setYVelocity() setVelocity() -*/ - -/*! - \fn void TQCanvasItem::setYVelocity( double vy ) - - Sets the vertical component of the canvas item's velocity to \a vy. - - \sa setXVelocity() setVelocity() -*/ - -/*! - Sets the canvas item to be in motion, moving by \a vx and \a vy - pixels in the horizontal and vertical directions respectively. - - \sa advance() setXVelocity() setYVelocity() -*/ -void TQCanvasItem::setVelocity( double vx, double vy) -{ - if ( ext || vx!=0.0 || vy!=0.0 ) { - if ( !ani ) - setAnimated(TRUE); - extra().vx = vx; - extra().vy = vy; - } -} - -/*! - Returns the horizontal velocity component of the canvas item. -*/ -double TQCanvasItem::xVelocity() const -{ - return ext ? ext->vx : 0; -} - -/*! - Returns the vertical velocity component of the canvas item. -*/ -double TQCanvasItem::yVelocity() const -{ - return ext ? ext->vy : 0; -} - -/*! - The default implementation moves the canvas item, if it is - animated(), by the preset velocity if \a phase is 1, and does - nothing if \a phase is 0. - - Note that if you reimplement this function, the reimplementation - must not change the canvas in any way, for example it must not add - or remove items. - - \sa TQCanvas::advance() setVelocity() -*/ -void TQCanvasItem::advance(int phase) -{ - if ( ext && phase==1 ) - moveBy(ext->vx,ext->vy); -} - -/*! - \fn void TQCanvasItem::draw(TQPainter& painter) - - This abstract virtual function draws the canvas item using \a painter. - - \warning When you reimplement this function, make sure that you - leave the painter in the same state as you found it. For example, - if you start by calling TQPainter::translate(50, 50), end your - code by calling TQPainter::translate(-50, -50). Be also aware that - the painter might already have some transformations set (i.e., - don't call TQPainter::resetXForm() when you're done). -*/ - -/*! - Sets the TQCanvas upon which the canvas item is to be drawn to \a c. - - \sa canvas() -*/ -void TQCanvasItem::setCanvas(TQCanvas* c) -{ - bool v=isVisible(); - setVisible(FALSE); - if (cnv) { - if (ext) - cnv->removeAnimation(this); - cnv->removeItem(this); - } - cnv=c; - if (cnv) { - cnv->addItem(this); - if ( ext ) - cnv->addAnimation(this); - } - setVisible(v); -} - -/*! - \fn TQCanvas* TQCanvasItem::canvas() const - - Returns the canvas containing the canvas item. -*/ - -/*! Shorthand for setVisible(TRUE). */ -void TQCanvasItem::show() -{ - setVisible(TRUE); -} - -/*! Shorthand for setVisible(FALSE). */ -void TQCanvasItem::hide() -{ - setVisible(FALSE); -} - -/*! - Makes the canvas item visible if \a yes is TRUE, or invisible if - \a yes is FALSE. The change takes effect when TQCanvas::update() is - next called. -*/ -void TQCanvasItem::setVisible(bool yes) -{ - if ((bool)vis!=yes) { - if (yes) { - vis=(uint)yes; - addToChunks(); - } else { - removeFromChunks(); - vis=(uint)yes; - } - } -} -/*! - \obsolete - \fn bool TQCanvasItem::visible() const - Use isVisible() instead. -*/ - -/*! - \fn bool TQCanvasItem::isVisible() const - - Returns TRUE if the canvas item is visible; otherwise returns - FALSE. - - Note that in this context TRUE does \e not mean that the canvas - item is currently in a view, merely that if a view is showing the - area where the canvas item is positioned, and the item is not - obscured by items with higher z values, and the view is not - obscured by overlaying windows, it would be visible. - - \sa setVisible(), z() -*/ - -/*! - \obsolete - \fn bool TQCanvasItem::selected() const - Use isSelected() instead. -*/ - -/*! - \fn bool TQCanvasItem::isSelected() const - - Returns TRUE if the canvas item is selected; otherwise returns FALSE. -*/ - -/*! - Sets the selected flag of the item to \a yes. If this changes the - item's selected state the item will be redrawn when - TQCanvas::update() is next called. - - The TQCanvas, TQCanvasItem and the TQt-supplied TQCanvasItem - subclasses do not make use of this value. The setSelected() - function is supplied because many applications need it, but it is - up to you how you use the isSelected() value. -*/ -void TQCanvasItem::setSelected(bool yes) -{ - if ((bool)sel!=yes) { - sel=(uint)yes; - changeChunks(); - } -} - -/*! - \obsolete - \fn bool TQCanvasItem::enabled() const - Use isEnabled() instead. -*/ - -/*! - \fn bool TQCanvasItem::isEnabled() const - - Returns TRUE if the TQCanvasItem is enabled; otherwise returns FALSE. -*/ - -/*! - Sets the enabled flag of the item to \a yes. If this changes the - item's enabled state the item will be redrawn when - TQCanvas::update() is next called. - - The TQCanvas, TQCanvasItem and the TQt-supplied TQCanvasItem - subclasses do not make use of this value. The setEnabled() - function is supplied because many applications need it, but it is - up to you how you use the isEnabled() value. -*/ -void TQCanvasItem::setEnabled(bool yes) -{ - if (ena!=(uint)yes) { - ena=(uint)yes; - changeChunks(); - } -} - -/*! - \obsolete - \fn bool TQCanvasItem::active() const - Use isActive() instead. -*/ - -/*! - \fn bool TQCanvasItem::isActive() const - - Returns TRUE if the TQCanvasItem is active; otherwise returns FALSE. -*/ - -/*! - Sets the active flag of the item to \a yes. If this changes the - item's active state the item will be redrawn when - TQCanvas::update() is next called. - - The TQCanvas, TQCanvasItem and the TQt-supplied TQCanvasItem - subclasses do not make use of this value. The setActive() function - is supplied because many applications need it, but it is up to you - how you use the isActive() value. -*/ -void TQCanvasItem::setActive(bool yes) -{ - if (act!=(uint)yes) { - act=(uint)yes; - changeChunks(); - } -} - -bool qt_testCollision(const TQCanvasSprite* s1, const TQCanvasSprite* s2) -{ - const TQImage* s2image = s2->imageAdvanced()->collision_mask; - TQRect s2area = s2->boundingRectAdvanced(); - - TQRect cyourarea(s2area.x(),s2area.y(), - s2area.width(),s2area.height()); - - TQImage* s1image=s1->imageAdvanced()->collision_mask; - - TQRect s1area = s1->boundingRectAdvanced(); - - TQRect ourarea = s1area.intersect(cyourarea); - - if ( ourarea.isEmpty() ) - return FALSE; - - int x2=ourarea.x()-cyourarea.x(); - int y2=ourarea.y()-cyourarea.y(); - int x1=ourarea.x()-s1area.x(); - int y1=ourarea.y()-s1area.y(); - int w=ourarea.width(); - int h=ourarea.height(); - - if ( !s2image ) { - if ( !s1image ) - return w>0 && h>0; - // swap everything around - int t; - t=x1; x1=x2; x2=t; - t=y1; x1=y2; y2=t; - s2image = s1image; - s1image = 0; - } - - // s2image != 0 - - // A non-linear search may be more efficient. - // Perhaps spiralling out from the center, or a simpler - // vertical expansion from the centreline. - - // We assume that sprite masks don't have - // different bit orders. - // - // Q_ASSERT(s1image->bitOrder()==s2image->bitOrder()); - - if (s1image) { - if (s1image->bitOrder() == TQImage::LittleEndian) { - for (int j=0; jscanLine(y1+j); - uchar* yl = s2image->scanLine(y2+j); - for (int i=0; i> 3)) & (1 << ((x2+i) & 7)) - && *(ml + ((x1+i) >> 3)) & (1 << ((x1+i) & 7))) - { - return TRUE; - } - } - } - } else { - for (int j=0; jscanLine(y1+j); - uchar* yl = s2image->scanLine(y2+j); - for (int i=0; i> 3)) & (1 << (7-((x2+i) & 7))) - && *(ml + ((x1+i) >> 3)) & (1 << (7-((x1+i) & 7)))) - { - return TRUE; - } - } - } - } - } else { - if (s2image->bitOrder() == TQImage::LittleEndian) { - for (int j=0; jscanLine(y2+j); - for (int i=0; i> 3)) & (1 << ((x2+i) & 7))) - { - return TRUE; - } - } - } - } else { - for (int j=0; jscanLine(y2+j); - for (int i=0; i> 3)) & (1 << (7-((x2+i) & 7)))) - { - return TRUE; - } - } - } - } - } - - return FALSE; -} - -static bool collision_double_dispatch( const TQCanvasSprite* s1, - const TQCanvasPolygonalItem* p1, - const TQCanvasRectangle* r1, - const TQCanvasEllipse* e1, - const TQCanvasText* t1, - const TQCanvasSprite* s2, - const TQCanvasPolygonalItem* p2, - const TQCanvasRectangle* r2, - const TQCanvasEllipse* e2, - const TQCanvasText* t2 ) -{ - const TQCanvasItem* i1 = s1 ? - (const TQCanvasItem*)s1 : p1 ? - (const TQCanvasItem*)p1 : r1 ? - (const TQCanvasItem*)r1 : e1 ? - (const TQCanvasItem*)e1 : (const TQCanvasItem*)t1; - const TQCanvasItem* i2 = s2 ? - (const TQCanvasItem*)s2 : p2 ? - (const TQCanvasItem*)p2 : r2 ? - (const TQCanvasItem*)r2 : e2 ? - (const TQCanvasItem*)e2 : (const TQCanvasItem*)t2; - - if ( s1 && s2 ) { - // a - return qt_testCollision(s1,s2); - } else if ( (r1 || t1 || s1) && (r2 || t2 || s2) ) { - // b - TQRect rc1 = i1->boundingRectAdvanced(); - TQRect rc2 = i2->boundingRectAdvanced(); - return rc1.intersects(rc2); - } else if ( e1 && e2 - && e1->angleLength()>=360*16 && e2->angleLength()>=360*16 - && e1->width()==e1->height() - && e2->width()==e2->height() ) { - // c - double xd = (e1->x()+e1->xVelocity())-(e2->x()+e1->xVelocity()); - double yd = (e1->y()+e1->yVelocity())-(e2->y()+e1->yVelocity()); - double rd = (e1->width()+e2->width())/2; - return xd*xd+yd*yd <= rd*rd; - } else if ( p1 && (p2 || s2 || t2) ) { - // d - TQPointArray pa1 = p1->areaPointsAdvanced(); - TQPointArray pa2 = p2 ? p2->areaPointsAdvanced() - : TQPointArray(i2->boundingRectAdvanced()); - bool col= !(TQRegion(pa1) & TQRegion(pa2,TRUE)).isEmpty(); - - return col; - } else { - return collision_double_dispatch(s2,p2,r2,e2,t2, - s1,p1,r1,e1,t1); - } -} - -/*! - \fn bool TQCanvasItem::collidesWith( const TQCanvasItem* other ) const - - Returns TRUE if the canvas item will collide with the \a other - item \e after they have moved by their current velocities; - otherwise returns FALSE. - - \sa collisions() -*/ - - -/*! - \class TQCanvasSprite ntqcanvas.h - \brief The TQCanvasSprite class provides an animated canvas item on a TQCanvas. -\if defined(commercial) - It is part of the TQt Enterprise Edition. -\endif - - \module canvas - \ingroup graphics - \ingroup images - - A canvas sprite is an object which can contain any number of images - (referred to as frames), only one of which is current, i.e. - displayed, at any one time. The images can be passed in the - constructor or set or changed later with setSequence(). If you - subclass TQCanvasSprite you can change the frame that is displayed - periodically, e.g. whenever TQCanvasItem::advance(1) is called to - create the effect of animation. - - The current frame can be set with setFrame() or with move(). The - number of frames available is given by frameCount(). The bounding - rectangle of the current frame is returned by boundingRect(). - - The current frame's image can be retrieved with image(); use - imageAdvanced() to retrieve the image for the frame that will be - shown after advance(1) is called. Use the image() overload passing - it an integer index to retrieve a particular image from the list of - frames. - - Use width() and height() to retrieve the dimensions of the current - frame. - - Use leftEdge() and rightEdge() to retrieve the current frame's - left-hand and right-hand x-coordinates respectively. Use - bottomEdge() and topEdge() to retrieve the current frame's bottom - and top y-coordinates respectively. These functions have an overload - which will accept an integer frame number to retrieve the - coordinates of a particular frame. - - TQCanvasSprite draws very quickly, at the expense of memory. - - The current frame's image can be drawn on a painter with draw(). - - Like any other canvas item, canvas sprites can be moved with - move() which sets the x and y coordinates and the frame number, as - well as with TQCanvasItem::move() and TQCanvasItem::moveBy(), or by - setting coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() - and TQCanvasItem::setZ(). - -*/ - - -/*! - \reimp -*/ -bool TQCanvasSprite::collidesWith( const TQCanvasItem* i ) const -{ - return i->collidesWith(this,0,0,0,0); -} - -/*! - Returns TRUE if the canvas item collides with any of the given - items; otherwise returns FALSE. The parameters, \a s, \a p, \a r, - \a e and \a t, are all the same object, this is just a type - resolution trick. -*/ -bool TQCanvasSprite::collidesWith( const TQCanvasSprite* s, - const TQCanvasPolygonalItem* p, - const TQCanvasRectangle* r, - const TQCanvasEllipse* e, - const TQCanvasText* t ) const -{ - return collision_double_dispatch(s,p,r,e,t,this,0,0,0,0); -} - -/*! - \reimp -*/ -bool TQCanvasPolygonalItem::collidesWith( const TQCanvasItem* i ) const -{ - return i->collidesWith(0,this,0,0,0); -} - -bool TQCanvasPolygonalItem::collidesWith( const TQCanvasSprite* s, - const TQCanvasPolygonalItem* p, - const TQCanvasRectangle* r, - const TQCanvasEllipse* e, - const TQCanvasText* t ) const -{ - return collision_double_dispatch(s,p,r,e,t,0,this,0,0,0); -} - -/*! - \reimp -*/ -bool TQCanvasRectangle::collidesWith( const TQCanvasItem* i ) const -{ - return i->collidesWith(0,this,this,0,0); -} - -bool TQCanvasRectangle::collidesWith( const TQCanvasSprite* s, - const TQCanvasPolygonalItem* p, - const TQCanvasRectangle* r, - const TQCanvasEllipse* e, - const TQCanvasText* t ) const -{ - return collision_double_dispatch(s,p,r,e,t,0,this,this,0,0); -} - - -/*! - \reimp -*/ -bool TQCanvasEllipse::collidesWith( const TQCanvasItem* i ) const -{ - return i->collidesWith(0,this,0,this,0); -} - -bool TQCanvasEllipse::collidesWith( const TQCanvasSprite* s, - const TQCanvasPolygonalItem* p, - const TQCanvasRectangle* r, - const TQCanvasEllipse* e, - const TQCanvasText* t ) const -{ - return collision_double_dispatch(s,p,r,e,t,0,this,0,this,0); -} - -/*! - \reimp -*/ -bool TQCanvasText::collidesWith( const TQCanvasItem* i ) const -{ - return i->collidesWith(0,0,0,0,this); -} - -bool TQCanvasText::collidesWith( const TQCanvasSprite* s, - const TQCanvasPolygonalItem* p, - const TQCanvasRectangle* r, - const TQCanvasEllipse* e, - const TQCanvasText* t ) const -{ - return collision_double_dispatch(s,p,r,e,t,0,0,0,0,this); -} - -/*! - Returns the list of canvas items that this canvas item has - collided with. - - A collision is generally defined as occurring when the pixels of - one item draw on the pixels of another item, but not all - subclasses are so precise. Also, since pixel-wise collision - detection can be slow, this function works in either exact or - inexact mode, according to the \a exact parameter. - - If \a exact is TRUE, the canvas items returned have been - accurately tested for collision with the canvas item. - - If \a exact is FALSE, the canvas items returned are \e near the - canvas item. You can test the canvas items returned using - collidesWith() if any are interesting collision candidates. By - using this approach, you can ignore some canvas items for which - collisions are not relevant. - - The returned list is a list of TQCanvasItems, but often you will - need to cast the items to their subclass types. The safe way to do - this is to use rtti() before casting. This provides some of the - functionality of the standard C++ dynamic cast operation even on - compilers where dynamic casts are not available. - - Note that a canvas item may be `on' a canvas, e.g. it was created - with the canvas as parameter, even though its coordinates place it - beyond the edge of the canvas's area. Collision detection only - works for canvas items which are wholly or partly within the - canvas's area. - - Note that if items have a velocity (see \l setVelocity()), then - collision testing is done based on where the item \e will be when - it moves, not its current location. For example, a "ball" item - doesn't need to actually embed into a "wall" item before a - collision is detected. For items without velocity, plain - intersection is used. -*/ -TQCanvasItemList TQCanvasItem::collisions(bool exact) const -{ - return canvas()->collisions(chunks(),this,exact); -} - -/*! - Returns a list of canvas items that collide with the point \a p. - The list is ordered by z coordinates, from highest z coordinate - (front-most item) to lowest z coordinate (rear-most item). -*/ -TQCanvasItemList TQCanvas::collisions(const TQPoint& p) const -{ - return collisions(TQRect(p,TQSize(1,1))); -} - -/*! - \overload - - Returns a list of items which collide with the rectangle \a r. The - list is ordered by z coordinates, from highest z coordinate - (front-most item) to lowest z coordinate (rear-most item). -*/ -TQCanvasItemList TQCanvas::collisions(const TQRect& r) const -{ - TQCanvasRectangle i(r,(TQCanvas*)this); - i.setPen(NoPen); - i.show(); // doesn't actually show, since we destroy it - TQCanvasItemList l = i.collisions(TRUE); - l.sort(); - return l; -} - -/*! - \overload - - Returns a list of canvas items which intersect with the chunks - listed in \a chunklist, excluding \a item. If \a exact is TRUE, - only those which actually \link TQCanvasItem::collidesWith() - collide with\endlink \a item are returned; otherwise canvas items - are included just for being in the chunks. - - This is a utility function mainly used to implement the simpler - TQCanvasItem::collisions() function. -*/ -TQCanvasItemList TQCanvas::collisions(const TQPointArray& chunklist, - const TQCanvasItem* item, bool exact) const -{ - TQPtrDict seen; - TQCanvasItemList result; - for (int i=0; i<(int)chunklist.count(); i++) { - int x = chunklist[i].x(); - int y = chunklist[i].y(); - if ( validChunk(x,y) ) { - const TQCanvasItemList* l = chunk(x,y).listPtr(); - for (TQCanvasItemList::ConstIterator it=l->begin(); it!=l->end(); ++it) { - TQCanvasItem *g=*it; - if ( g != item ) { - if ( !seen.find(g) ) { - seen.replace(g,(void*)1); - if ( !exact || item->collidesWith(g) ) - result.append(g); - } - } - } - } - } - return result; -} - -/*! - \internal - Adds the item to all the chunks it covers. -*/ -void TQCanvasItem::addToChunks() -{ - if (isVisible() && canvas()) { - TQPointArray pa = chunks(); - for (int i=0; i<(int)pa.count(); i++) - canvas()->addItemToChunk(this,pa[i].x(),pa[i].y()); - val=(uint)TRUE; - } -} - -/*! - \internal - Removes the item from all the chunks it covers. -*/ -void TQCanvasItem::removeFromChunks() -{ - if (isVisible() && canvas()) { - TQPointArray pa = chunks(); - for (int i=0; i<(int)pa.count(); i++) - canvas()->removeItemFromChunk(this,pa[i].x(),pa[i].y()); - } -} - -/*! - \internal - Sets all the chunks covered by the item to be refreshed with TQCanvas::update() - is next called. -*/ -void TQCanvasItem::changeChunks() -{ - if (isVisible() && canvas()) { - if (!val) - addToChunks(); - TQPointArray pa = chunks(); - for (int i=0; i<(int)pa.count(); i++) - canvas()->setChangedChunk(pa[i].x(),pa[i].y()); - } -} - -/*! - \fn TQRect TQCanvasItem::boundingRect() const - - Returns the bounding rectangle in pixels that the canvas item covers. - - \sa boundingRectAdvanced() -*/ - -/*! - Returns the bounding rectangle of pixels that the canvas item \e - will cover after advance(1) is called. - - \sa boundingRect() -*/ -TQRect TQCanvasItem::boundingRectAdvanced() const -{ - int dx = int(x()+xVelocity())-int(x()); - int dy = int(y()+yVelocity())-int(y()); - TQRect r = boundingRect(); - r.moveBy(dx,dy); - return r; -} - -/*! - \class TQCanvasPixmap ntqcanvas.h - \brief The TQCanvasPixmap class provides pixmaps for TQCanvasSprites. -\if defined(commercial) - It is part of the TQt Enterprise Edition. -\endif - - \module canvas - \ingroup graphics - \ingroup images - - If you want to show a single pixmap on a TQCanvas use a - TQCanvasSprite with just one pixmap. - - When pixmaps are inserted into a TQCanvasPixmapArray they are held - as TQCanvasPixmaps. \l{TQCanvasSprite}s are used to show pixmaps on - \l{TQCanvas}es and hold their pixmaps in a TQCanvasPixmapArray. If - you retrieve a frame (pixmap) from a TQCanvasSprite it will be - returned as a TQCanvasPixmap. - - The pixmap is a TQPixmap and can only be set in the constructor. - There are three different constructors, one taking a TQPixmap, one - a TQImage and one a file name that refers to a file in any - supported file format (see TQImageIO). - - TQCanvasPixmap can have a hotspot which is defined in terms of an (x, - y) offset. When you create a TQCanvasPixmap from a PNG file or from - a TQImage that has a TQImage::offset(), the offset() is initialized - appropriately, otherwise the constructor leaves it at (0, 0). You - can set it later using setOffset(). When the TQCanvasPixmap is used - in a TQCanvasSprite, the offset position is the point at - TQCanvasItem::x() and TQCanvasItem::y(), not the top-left corner of - the pixmap. - - Note that for TQCanvasPixmap objects created by a TQCanvasSprite, the - position of each TQCanvasPixmap object is set so that the hotspot - stays in the same position. - - \sa TQCanvasPixmapArray TQCanvasItem TQCanvasSprite -*/ - -#ifndef TQT_NO_IMAGEIO - -/*! - Constructs a TQCanvasPixmap that uses the image stored in \a - datafilename. -*/ -TQCanvasPixmap::TQCanvasPixmap(const TQString& datafilename) -{ - TQImage image(datafilename); - init(image); -} - -#endif - -/*! - Constructs a TQCanvasPixmap from the image \a image. -*/ -TQCanvasPixmap::TQCanvasPixmap(const TQImage& image) -{ - init(image); -} -/*! - Constructs a TQCanvasPixmap from the pixmap \a pm using the offset - \a offset. -*/ -TQCanvasPixmap::TQCanvasPixmap(const TQPixmap& pm, const TQPoint& offset) -{ - init(pm,offset.x(),offset.y()); -} - -void TQCanvasPixmap::init(const TQImage& image) -{ - convertFromImage(image); - hotx = image.offset().x(); - hoty = image.offset().y(); -#ifndef TQT_NO_IMAGE_DITHER_TO_1 - if( image.hasAlphaBuffer() ) { - TQImage i = image.createAlphaMask(); - collision_mask = new TQImage(i); - } else -#endif - collision_mask = 0; -} - -void TQCanvasPixmap::init(const TQPixmap& pixmap, int hx, int hy) -{ - (TQPixmap&)*this = pixmap; - hotx = hx; - hoty = hy; - if( pixmap.mask() ) { - TQImage i = mask()->convertToImage(); - collision_mask = new TQImage(i); - } else - collision_mask = 0; -} - -/*! - Destroys the pixmap. -*/ -TQCanvasPixmap::~TQCanvasPixmap() -{ - delete collision_mask; -} - -/*! - \fn int TQCanvasPixmap::offsetX() const - - Returns the x-offset of the pixmap's hotspot. - - \sa setOffset() -*/ - -/*! - \fn int TQCanvasPixmap::offsetY() const - - Returns the y-offset of the pixmap's hotspot. - - \sa setOffset() -*/ - -/*! - \fn void TQCanvasPixmap::setOffset(int x, int y) - - Sets the offset of the pixmap's hotspot to (\a x, \a y). - - \warning Do not call this function if any TQCanvasSprites are - currently showing this pixmap. -*/ - -/*! - \class TQCanvasPixmapArray ntqcanvas.h - \brief The TQCanvasPixmapArray class provides an array of TQCanvasPixmaps. -\if defined(commercial) - It is part of the TQt Enterprise Edition. -\endif - - \module canvas - \ingroup graphics - \ingroup images - - - This class is used by TQCanvasSprite to hold an array of pixmaps. - It is used to implement animated sprites, i.e. images that change - over time, with each pixmap in the array holding one frame. - - Depending on the constructor you use you can load multiple pixmaps - into the array either from a directory (specifying a wildcard - pattern for the files), or from a list of TQPixmaps. You can also - read in a set of pixmaps after construction using readPixmaps(). - - Individual pixmaps can be set with setImage() and retrieved with - image(). The number of pixmaps in the array is returned by - count(). - - TQCanvasSprite uses an image's mask for collision detection. You - can change this by reading in a separate set of image masks using - readCollisionMasks(). - -*/ - -/*! - Constructs an invalid array (i.e. isValid() will return FALSE). - You must call readPixmaps() before being able to use this - TQCanvasPixmapArray. -*/ -TQCanvasPixmapArray::TQCanvasPixmapArray() -: framecount( 0 ), img( 0 ) -{ -} - -#ifndef TQT_NO_IMAGEIO -/*! - Constructs a TQCanvasPixmapArray from files. - - The \a fc parameter sets the number of frames to be loaded for - this image. - - If \a fc is not 0, \a datafilenamepattern should contain "%1", - e.g. "foo%1.png". The actual filenames are formed by replacing the - %1 with four-digit integers from 0 to (fc - 1), e.g. foo0000.png, - foo0001.png, foo0002.png, etc. - - If \a fc is 0, \a datafilenamepattern is asssumed to be a - filename, and the image contained in this file will be loaded as - the first (and only) frame. - - If \a datafilenamepattern does not exist, is not readable, isn't - an image, or some other error occurs, the array ends up empty and - isValid() returns FALSE. -*/ - -TQCanvasPixmapArray::TQCanvasPixmapArray( const TQString& datafilenamepattern, - int fc ) -: framecount( 0 ), img( 0 ) -{ - readPixmaps(datafilenamepattern,fc); -} -#endif - -/*! - \obsolete - Use TQCanvasPixmapArray::TQCanvasPixmapArray( TQValueList, TQPointArray ) - instead. - - Constructs a TQCanvasPixmapArray from the list of TQPixmaps \a - list. The \a hotspots list has to be of the same size as \a list. -*/ -TQCanvasPixmapArray::TQCanvasPixmapArray(TQPtrList list, TQPtrList hotspots) : - framecount(list.count()), - img(new TQCanvasPixmap*[list.count()]) -{ - if (list.count() != hotspots.count()) { - tqWarning("TQCanvasPixmapArray: lists have different lengths"); - reset(); - img = 0; - } else { - list.first(); - hotspots.first(); - for (int i=0; i list, TQPointArray hotspots) : - framecount((int)list.size()), - img(new TQCanvasPixmap*[list.size()]) -{ - bool have_hotspots = ( hotspots.size() != 0 ); - if (have_hotspots && list.count() != hotspots.count()) { - tqWarning("TQCanvasPixmapArray: lists have different lengths"); - reset(); - img = 0; - } else { - TQValueList::iterator it; - it = list.begin(); - for (int i=0; i 1; - if ( !arg ) - framecount=1; - for (int i=0; icollision_mask) - img[i]->collision_mask = new TQImage(); - img[i]->collision_mask->load( - arg ? datafilenamepattern.arg(r) : datafilenamepattern); - ok = ok - && !img[i]->collision_mask->isNull() - && img[i]->collision_mask->depth()==1; - } else { - img[i]=new TQCanvasPixmap( - arg ? datafilenamepattern.arg(r) : datafilenamepattern); - ok = ok && !img[i]->isNull(); - } - } - if ( !ok ) { - reset(); - } - return ok; -} -#endif - -/*! - \obsolete - - Use isValid() instead. - - This returns FALSE if the array is valid, and TRUE if it is not. -*/ -bool TQCanvasPixmapArray::operator!() -{ - return img==0; -} - -/*! - Returns TRUE if the pixmap array is valid; otherwise returns - FALSE. -*/ -bool TQCanvasPixmapArray::isValid() const -{ - return (img != 0); -} - -/*! - \fn TQCanvasPixmap* TQCanvasPixmapArray::image(int i) const - - Returns pixmap \a i in the array, if \a i is non-negative and less - than than count(), and returns an unspecified value otherwise. -*/ - -// ### wouldn't it be better to put empty TQCanvasPixmaps in there instead of -// initializing the additional elements in the array to 0? Lars -/*! - Replaces the pixmap at index \a i with pixmap \a p. - - The array takes ownership of \a p and will delete \a p when the - array itself is deleted. - - If \a i is beyond the end of the array the array is extended to at - least i+1 elements, with elements count() to i-1 being initialized - to 0. -*/ -void TQCanvasPixmapArray::setImage(int i, TQCanvasPixmap* p) -{ - if ( i >= framecount ) { - TQCanvasPixmap** newimg = new TQCanvasPixmap*[i+1]; - memcpy(newimg, img, sizeof( TQCanvasPixmap * )*framecount); - memset(newimg + framecount, 0, sizeof( TQCanvasPixmap * )*( i+1 - framecount ) ); - framecount = i+1; - delete [] img; - img = newimg; - } - delete img[i]; img[i]=p; -} - -/*! - \fn uint TQCanvasPixmapArray::count() const - - Returns the number of pixmaps in the array. -*/ - -/*! - Returns the x-coordinate of the current left edge of the sprite. - (This may change as the sprite animates since different frames may - have different left edges.) - - \sa rightEdge() bottomEdge() topEdge() -*/ -int TQCanvasSprite::leftEdge() const -{ - return int(x()) - image()->hotx; -} - -/*! - \overload - - Returns what the x-coordinate of the left edge of the sprite would - be if the sprite (actually its hotspot) were moved to x-position - \a nx. - - \sa rightEdge() bottomEdge() topEdge() -*/ -int TQCanvasSprite::leftEdge(int nx) const -{ - return nx - image()->hotx; -} - -/*! - Returns the y-coordinate of the top edge of the sprite. (This may - change as the sprite animates since different frames may have - different top edges.) - - \sa leftEdge() rightEdge() bottomEdge() -*/ -int TQCanvasSprite::topEdge() const -{ - return int(y()) - image()->hoty; -} - -/*! - \overload - - Returns what the y-coordinate of the top edge of the sprite would - be if the sprite (actually its hotspot) were moved to y-position - \a ny. - - \sa leftEdge() rightEdge() bottomEdge() -*/ -int TQCanvasSprite::topEdge(int ny) const -{ - return ny - image()->hoty; -} - -/*! - Returns the x-coordinate of the current right edge of the sprite. - (This may change as the sprite animates since different frames may - have different right edges.) - - \sa leftEdge() bottomEdge() topEdge() -*/ -int TQCanvasSprite::rightEdge() const -{ - return leftEdge() + image()->width()-1; -} - -/*! - \overload - - Returns what the x-coordinate of the right edge of the sprite - would be if the sprite (actually its hotspot) were moved to - x-position \a nx. - - \sa leftEdge() bottomEdge() topEdge() -*/ -int TQCanvasSprite::rightEdge(int nx) const -{ - return leftEdge(nx) + image()->width()-1; -} - -/*! - Returns the y-coordinate of the current bottom edge of the sprite. - (This may change as the sprite animates since different frames may - have different bottom edges.) - - \sa leftEdge() rightEdge() topEdge() -*/ -int TQCanvasSprite::bottomEdge() const -{ - return topEdge() + image()->height()-1; -} - -/*! - \overload - - Returns what the y-coordinate of the top edge of the sprite would - be if the sprite (actually its hotspot) were moved to y-position - \a ny. - - \sa leftEdge() rightEdge() topEdge() -*/ -int TQCanvasSprite::bottomEdge(int ny) const -{ - return topEdge(ny) + image()->height()-1; -} - -/*! - \fn TQCanvasPixmap* TQCanvasSprite::image() const - - Returns the current frame's image. - - \sa frame(), setFrame() -*/ - -/*! - \fn TQCanvasPixmap* TQCanvasSprite::image(int f) const - \overload - - Returns the image for frame \a f. Does not do any bounds checking on \a f. -*/ - -/*! - Returns the image the sprite \e will have after advance(1) is - called. By default this is the same as image(). -*/ -TQCanvasPixmap* TQCanvasSprite::imageAdvanced() const -{ - return image(); -} - -/*! - Returns the bounding rectangle for the image in the sprite's - current frame. This assumes that the images are tightly cropped - (i.e. do not have transparent pixels all along a side). -*/ -TQRect TQCanvasSprite::boundingRect() const -{ - return TQRect(leftEdge(), topEdge(), width(), height()); -} - - -/*! - \internal - Returns the chunks covered by the item. -*/ -TQPointArray TQCanvasItem::chunks() const -{ - TQPointArray r; - int n=0; - TQRect br = boundingRect(); - if (isVisible() && canvas()) { - int chunksize=canvas()->chunkSize(); - br &= TQRect(0,0,canvas()->width(),canvas()->height()); - if ( br.isValid() ) { - r.resize((br.width()/chunksize+2)*(br.height()/chunksize+2)); - for (int j=br.top()/chunksize; j<=br.bottom()/chunksize; j++) { - for (int i=br.left()/chunksize; i<=br.right()/chunksize; i++) { - r[n++] = TQPoint(i,j); - } - } - } - } - r.resize(n); - return r; -} - - -/*! - \internal - Add the sprite to the chunks in its TQCanvas which it overlaps. -*/ -void TQCanvasSprite::addToChunks() -{ - if (isVisible() && canvas()) { - int chunksize=canvas()->chunkSize(); - for (int j=topEdge()/chunksize; j<=bottomEdge()/chunksize; j++) { - for (int i=leftEdge()/chunksize; i<=rightEdge()/chunksize; i++) { - canvas()->addItemToChunk(this,i,j); - } - } - } -} - -/*! - \internal - Remove the sprite from the chunks in its TQCanvas which it overlaps. - - \sa addToChunks() -*/ -void TQCanvasSprite::removeFromChunks() -{ - if (isVisible() && canvas()) { - int chunksize=canvas()->chunkSize(); - for (int j=topEdge()/chunksize; j<=bottomEdge()/chunksize; j++) { - for (int i=leftEdge()/chunksize; i<=rightEdge()/chunksize; i++) { - canvas()->removeItemFromChunk(this,i,j); - } - } - } -} - -/*! - The width of the sprite for the current frame's image. - - \sa frame() -*/ -//### mark: Why don't we have width(int) and height(int) to be -//consistent with leftEdge() and leftEdge(int)? -int TQCanvasSprite::width() const -{ - return image()->width(); -} - -/*! - The height of the sprite for the current frame's image. - - \sa frame() -*/ -int TQCanvasSprite::height() const -{ - return image()->height(); -} - - -/*! - Draws the current frame's image at the sprite's current position - on painter \a painter. -*/ -void TQCanvasSprite::draw(TQPainter& painter) -{ - painter.drawPixmap(leftEdge(),topEdge(),*image()); -} - -/*! - \class TQCanvasView ntqcanvas.h - \brief The TQCanvasView class provides an on-screen view of a TQCanvas. -\if defined(commercial) - It is part of the TQt Enterprise Edition. -\endif - - \module canvas - \ingroup graphics - \ingroup images - - A TQCanvasView is widget which provides a view of a TQCanvas. - - If you want users to be able to interact with a canvas view, - subclass TQCanvasView. You might then reimplement - TQScrollView::contentsMousePressEvent(). For example, assuming no - transformation matrix is set: - - \code - void MyCanvasView::contentsMousePressEvent( TQMouseEvent* e ) - { - TQCanvasItemList l = canvas()->collisions(e->pos()); - for (TQCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { - if ( (*it)->rtti() == TQCanvasRectangle::RTTI ) - tqDebug("A TQCanvasRectangle lies somewhere at this point"); - } - } - \endcode - - The canvas view shows canvas canvas(); this can be changed using - setCanvas(). - - A transformation matrix can be used to transform the view of the - canvas in various ways, for example, zooming in or out or rotating. - For example: - - \code - TQWMatrix wm; - wm.scale( 2, 2 ); // Zooms in by 2 times - wm.rotate( 90 ); // Rotates 90 degrees counter clockwise - // around the origin. - wm.translate( 0, -canvas->height() ); - // moves the canvas down so what was visible - // before is still visible. - myCanvasView->setWorldMatrix( wm ); - \endcode - - Use setWorldMatrix() to set the canvas view's world matrix: you must - ensure that the world matrix is invertible. The current world matrix - is retrievable with worldMatrix(), and its inversion is retrievable - with inverseWorldMatrix(). - - Example: - - The following code finds the part of the canvas that is visible in - this view, i.e. the bounding rectangle of the view in canvas coordinates. - - \code - TQRect rc = TQRect( myCanvasView->contentsX(), myCanvasView->contentsY(), - myCanvasView->visibleWidth(), myCanvasView->visibleHeight() ); - TQRect canvasRect = myCanvasView->inverseWorldMatrix().mapRect(rc); - \endcode - - \sa TQWMatrix TQPainter::setWorldMatrix() - -*/ - -/*! - Constructs a TQCanvasView with parent \a parent, and name \a name, - using the widget flags \a f. The canvas view is not associated - with a canvas, so you must to call setCanvas() to view a - canvas. -*/ -TQCanvasView::TQCanvasView(TQWidget* parent, const char* name, WFlags f) : - TQScrollView(parent,name,f|WResizeNoErase|WStaticContents) -{ - d = new TQCanvasViewData; - viewing = 0; - setCanvas(0); - connect(this,TQ_SIGNAL(contentsMoving(int,int)),this,TQ_SLOT(cMoving(int,int))); -} - -/*! - \overload - - Constructs a TQCanvasView which views canvas \a canvas, with parent - \a parent, and name \a name, using the widget flags \a f. -*/ -TQCanvasView::TQCanvasView(TQCanvas* canvas, TQWidget* parent, const char* name, WFlags f) : - TQScrollView(parent,name,f|WResizeNoErase|WStaticContents) -{ - d = new TQCanvasViewData; - viewing = 0; - setCanvas(canvas); - - connect(this,TQ_SIGNAL(contentsMoving(int,int)),this,TQ_SLOT(cMoving(int,int))); -} - -/*! - Destroys the canvas view. The associated canvas is \e not deleted. -*/ -TQCanvasView::~TQCanvasView() -{ - delete d; - d = 0; - setCanvas(0); -} - -/*! - \fn TQCanvas* TQCanvasView::canvas() const - - Returns a pointer to the canvas which the TQCanvasView is currently - showing. -*/ - - -/*! - Sets the canvas that the TQCanvasView is showing to the canvas \a - canvas. -*/ -void TQCanvasView::setCanvas(TQCanvas* canvas) -{ - if (viewing) { - disconnect(viewing); - viewing->removeView(this); - } - viewing=canvas; - if (viewing) { - connect(viewing,TQ_SIGNAL(resized()), this, TQ_SLOT(updateContentsSize())); - viewing->addView(this); - } - if ( d ) // called by d'tor - updateContentsSize(); -} - -#ifndef TQT_NO_TRANSFORMATIONS -/*! - Returns a reference to the canvas view's current transformation matrix. - - \sa setWorldMatrix() inverseWorldMatrix() -*/ -const TQWMatrix &TQCanvasView::worldMatrix() const -{ - return d->xform; -} - -/*! - Returns a reference to the inverse of the canvas view's current - transformation matrix. - - \sa setWorldMatrix() worldMatrix() -*/ -const TQWMatrix &TQCanvasView::inverseWorldMatrix() const -{ - return d->ixform; -} - -/*! - Sets the transformation matrix of the TQCanvasView to \a wm. The - matrix must be invertible (i.e. if you create a world matrix that - zooms out by 2 times, then the inverse of this matrix is one that - will zoom in by 2 times). - - When you use this, you should note that the performance of the - TQCanvasView will decrease considerably. - - Returns FALSE if \a wm is not invertable; otherwise returns TRUE. - - \sa worldMatrix() inverseWorldMatrix() TQWMatrix::isInvertible() -*/ -bool TQCanvasView::setWorldMatrix( const TQWMatrix & wm ) -{ - bool ok = wm.isInvertible(); - if ( ok ) { - d->xform = wm; - d->ixform = wm.invert(); - updateContentsSize(); - viewport()->update(); - } - return ok; -} -#endif - -void TQCanvasView::updateContentsSize() -{ - if ( viewing ) { - TQRect br; -#ifndef TQT_NO_TRANSFORMATIONS - br = d->xform.map(TQRect(0,0,viewing->width(),viewing->height())); -#else - br = TQRect(0,0,viewing->width(),viewing->height()); -#endif - - if ( br.width() < contentsWidth() ) { - TQRect r(contentsToViewport(TQPoint(br.width(),0)), - TQSize(contentsWidth()-br.width(),contentsHeight())); - viewport()->erase(r); - } - if ( br.height() < contentsHeight() ) { - TQRect r(contentsToViewport(TQPoint(0,br.height())), - TQSize(contentsWidth(),contentsHeight()-br.height())); - viewport()->erase(r); - } - - resizeContents(br.width(),br.height()); - } else { - viewport()->erase(); - resizeContents(1,1); - } -} - -void TQCanvasView::cMoving(int x, int y) -{ - // A little kludge to smooth up repaints when scrolling - int dx = x - contentsX(); - int dy = y - contentsY(); - d->repaint_from_moving = TQABS(dx) < width()/8 && TQABS(dy) < height()/8; -} - -/*! - Repaints part of the TQCanvas that the canvas view is showing - starting at \a cx by \a cy, with a width of \a cw and a height of \a - ch using the painter \a p. - - \warning When double buffering is enabled, drawContents() will - not respect the current settings of the painter when setting up - the painter for the double buffer (e.g., viewport() and - window()). Also, be aware that TQCanvas::update() bypasses - drawContents(), which means any reimplementation of - drawContents() is not called. - - \sa TQCanvas::setDoubleBuffering() -*/ -void TQCanvasView::drawContents(TQPainter *p, int cx, int cy, int cw, int ch) -{ - TQRect r(cx,cy,cw,ch); - if (viewing) { - //viewing->drawViewArea(this,p,r,TRUE); - viewing->drawViewArea(this,p,r,!d->repaint_from_moving); - d->repaint_from_moving = FALSE; - } else { - p->eraseRect(r); - } -} - -/*! - \reimp - \internal - - (Implemented to get rid of a compiler warning.) -*/ -void TQCanvasView::drawContents( TQPainter * ) -{ -} - -/*! - Suggests a size sufficient to view the entire canvas. -*/ -TQSize TQCanvasView::sizeHint() const -{ - if ( !canvas() ) - return TQScrollView::sizeHint(); - // should maybe take transformations into account - return ( canvas()->size() + 2 * TQSize(frameWidth(), frameWidth()) ) - .boundedTo( 3 * TQApplication::desktop()->size() / 4 ); -} - -// ### TQt 4.0 customer request: operate on doubles rather than int. -// ### I know, almost impossible due to the use of TQRegion etc. -/*! - \class TQCanvasPolygonalItem ntqcanvas.h - \brief The TQCanvasPolygonalItem class provides a polygonal canvas item - on a TQCanvas. -\if defined(commercial) - It is part of the TQt Enterprise Edition. -\endif - - \module canvas - \ingroup graphics - \ingroup images - - The mostly rectangular classes, such as TQCanvasSprite and - TQCanvasText, use the object's bounding rectangle for movement, - repainting and collision calculations. For most other items, the - bounding rectangle can be far too large -- a diagonal line being - the worst case, and there are many other cases which are also bad. - TQCanvasPolygonalItem provides polygon-based bounding rectangle - handling, etc., which is much faster for non-rectangular items. - - Derived classes should try to define as small an area as possible - to maximize efficiency, but the polygon must \e definitely be - contained completely within the polygonal area. Calculating the - exact requirements is usually difficult, but if you allow a small - overestimate it can be easy and quick, while still getting almost - all of TQCanvasPolygonalItem's speed. - - Note that all subclasses \e must call hide() in their destructor - since hide() needs to be able to access areaPoints(). - - Normally, TQCanvasPolygonalItem uses the odd-even algorithm for - determining whether an object intersects this object. You can - change this to the winding algorithm using setWinding(). - - The bounding rectangle is available using boundingRect(). The - points bounding the polygonal item are retrieved with - areaPoints(). Use areaPointsAdvanced() to retrieve the bounding - points the polygonal item \e will have after - TQCanvasItem::advance(1) has been called. - - If the shape of the polygonal item is about to change while the - item is visible, call invalidate() before updating with a - different result from \l areaPoints(). - - By default, TQCanvasPolygonalItem objects have a black pen and no - brush (the default TQPen and TQBrush constructors). You can change - this with setPen() and setBrush(), but note that some - TQCanvasPolygonalItem subclasses only use the brush, ignoring the - pen setting. - - The polygonal item can be drawn on a painter with draw(). - Subclasses must reimplement drawShape() to draw themselves. - - Like any other canvas item polygonal items can be moved with - TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting coordinates - with TQCanvasItem::setX(), TQCanvasItem::setY() and TQCanvasItem::setZ(). - -*/ - - -/* - Since most polygonal items don't have a pen, the default is - NoPen and a black brush. -*/ -static const TQPen& defaultPolygonPen() -{ - static TQPen* dp=0; - if ( !dp ) - dp = new TQPen; - return *dp; -} - -static const TQBrush& defaultPolygonBrush() -{ - static TQBrush* db=0; - if ( !db ) - db = new TQBrush; - return *db; -} - -/*! - Constructs a TQCanvasPolygonalItem on the canvas \a canvas. -*/ -TQCanvasPolygonalItem::TQCanvasPolygonalItem(TQCanvas* canvas) : - TQCanvasItem(canvas), - br(defaultPolygonBrush()), - pn(defaultPolygonPen()) -{ - wind=0; -} - -/*! - Note that all subclasses \e must call hide() in their destructor - since hide() needs to be able to access areaPoints(). -*/ -TQCanvasPolygonalItem::~TQCanvasPolygonalItem() -{ -} - -/*! - Returns TRUE if the polygonal item uses the winding algorithm to - determine the "inside" of the polygon. Returns FALSE if it uses - the odd-even algorithm. - - The default is to use the odd-even algorithm. - - \sa setWinding() -*/ -bool TQCanvasPolygonalItem::winding() const -{ - return wind; -} - -/*! - If \a enable is TRUE, the polygonal item will use the winding - algorithm to determine the "inside" of the polygon; otherwise the - odd-even algorithm will be used. - - The default is to use the odd-even algorithm. - - \sa winding() -*/ -void TQCanvasPolygonalItem::setWinding(bool enable) -{ - wind = enable; -} - -/*! - Invalidates all information about the area covered by the canvas - item. The item will be updated automatically on the next call that - changes the item's status, for example, move() or update(). Call - this function if you are going to change the shape of the item (as - returned by areaPoints()) while the item is visible. -*/ -void TQCanvasPolygonalItem::invalidate() -{ - val = (uint)FALSE; - removeFromChunks(); -} - -/*! - \fn TQCanvasPolygonalItem::isValid() const - - Returns TRUE if the polygonal item's area information has not been - invalidated; otherwise returns FALSE. - - \sa invalidate() -*/ - -/*! - Returns the points the polygonal item \e will have after - TQCanvasItem::advance(1) is called, i.e. what the points are when - advanced by the current xVelocity() and yVelocity(). -*/ -TQPointArray TQCanvasPolygonalItem::areaPointsAdvanced() const -{ - int dx = int(x()+xVelocity())-int(x()); - int dy = int(y()+yVelocity())-int(y()); - TQPointArray r = areaPoints(); - r.detach(); // Explicit sharing is stupid. - if ( dx || dy ) - r.translate(dx,dy); - return r; -} - -//#define TQCANVAS_POLYGONS_DEBUG -#ifdef TQCANVAS_POLYGONS_DEBUG -static TQWidget* dbg_wid=0; -static TQPainter* dbg_ptr=0; -#endif - -class TQPolygonalProcessor { -public: - TQPolygonalProcessor(TQCanvas* c, const TQPointArray& pa) : - canvas(c) - { - TQRect pixelbounds = pa.boundingRect(); - int cs = canvas->chunkSize(); - TQRect canvasbounds = pixelbounds.intersect(canvas->rect()); - bounds.setLeft(canvasbounds.left()/cs); - bounds.setRight(canvasbounds.right()/cs); - bounds.setTop(canvasbounds.top()/cs); - bounds.setBottom(canvasbounds.bottom()/cs); - bitmap = TQImage(bounds.width() + 1, bounds.height(), 1, 2, TQImage::LittleEndian); - pnt = 0; - bitmap.fill(0); -#ifdef TQCANVAS_POLYGONS_DEBUG - dbg_start(); -#endif - } - - inline void add(int x, int y) - { - if ( pnt >= (int)result.size() ) { - result.resize(pnt*2+10); - } - result[pnt++] = TQPoint(x+bounds.x(),y+bounds.y()); -#ifdef TQCANVAS_POLYGONS_DEBUG - if ( dbg_ptr ) { - int cs = canvas->chunkSize(); - TQRect r(x*cs+bounds.x()*cs,y*cs+bounds.y()*cs,cs-1,cs-1); - dbg_ptr->setPen(TQt::blue); - dbg_ptr->drawRect(r); - } -#endif - } - - inline void addBits(int x1, int x2, uchar newbits, int xo, int yo) - { - for (int i=x1; i<=x2; i++) - if ( newbits & (1<resize(800,600); - dbg_wid->show(); - dbg_ptr = new TQPainter(dbg_wid); - dbg_ptr->setBrush(TQt::NoBrush); - } - dbg_ptr->fillRect(dbg_wid->rect(),TQt::white); - } -#endif - - void doSpans(int n, TQPoint* pt, int* w) - { - int cs = canvas->chunkSize(); - for (int j=0; j= bitmap.height() || y < 0) continue; - uchar* l = bitmap.scanLine(y); - int x = pt[j].x(); - int x1 = x/cs-bounds.x(); - if (x1 > bounds.width()) continue; - x1 = TQMAX(0,x1); - int x2 = (x+w[j])/cs-bounds.x(); - if (x2 < 0) continue; - x2 = TQMIN(bounds.width(), x2); - int x1q = x1/8; - int x1r = x1%8; - int x2q = x2/8; - int x2r = x2%8; -#ifdef TQCANVAS_POLYGONS_DEBUG - if ( dbg_ptr ) dbg_ptr->setPen(TQt::yellow); -#endif - if ( x1q == x2q ) { - uchar newbits = (~l[x1q]) & (((2<<(x2r-x1r))-1)<setPen(TQt::darkGreen); -#endif - addBits(x1r,x2r,newbits,x1q*8,y); - l[x1q] |= newbits; - } - } else { -#ifdef TQCANVAS_POLYGONS_DEBUG - if ( dbg_ptr ) dbg_ptr->setPen(TQt::blue); -#endif - uchar newbits1 = (~l[x1q]) & (0xff<setPen(TQt::green); -#endif - addBits(x1r,7,newbits1,x1q*8,y); - l[x1q] |= newbits1; - } - for (int i=x1q+1; i>(7-x2r)); - if ( newbits2 ) { -#ifdef TQCANVAS_POLYGONS_DEBUG - if ( dbg_ptr ) dbg_ptr->setPen(TQt::red); -#endif - addBits(0,x2r,newbits2,x2q*8,y); - l[x2q] |= newbits2; - } - } -#ifdef TQCANVAS_POLYGONS_DEBUG - if ( dbg_ptr ) { - dbg_ptr->drawLine(pt[j],pt[j]+TQPoint(w[j],0)); - } -#endif - } - result.resize(pnt); - } - - int pnt; - TQPointArray result; - TQCanvas* canvas; - TQRect bounds; - TQImage bitmap; -}; - - -TQPointArray TQCanvasPolygonalItem::chunks() const -{ - TQPointArray pa = areaPoints(); - - if ( !pa.size() ) { - pa.detach(); // Explicit sharing is stupid. - return pa; - } - - TQPolygonalProcessor processor(canvas(),pa); - - scanPolygon(pa, wind, processor); - - return processor.result; -} -/*! - Simply calls TQCanvasItem::chunks(). -*/ -TQPointArray TQCanvasRectangle::chunks() const -{ - // No need to do a polygon scan! - return TQCanvasItem::chunks(); -} - -/*! - Returns the bounding rectangle of the polygonal item, based on - areaPoints(). -*/ -TQRect TQCanvasPolygonalItem::boundingRect() const -{ - return areaPoints().boundingRect(); -} - -/*! - Reimplemented from TQCanvasItem, this draws the polygonal item by - setting the pen and brush for the item on the painter \a p and - calling drawShape(). -*/ -void TQCanvasPolygonalItem::draw(TQPainter & p) -{ - p.setPen(pn); - p.setBrush(br); - drawShape(p); -} - -/*! - \fn void TQCanvasPolygonalItem::drawShape(TQPainter & p) - - Subclasses must reimplement this function to draw their shape. The - pen and brush of \a p are already set to pen() and brush() prior - to calling this function. - - \warning When you reimplement this function, make sure that you - leave the painter in the same state as you found it. For example, - if you start by calling TQPainter::translate(50, 50), end your - code by calling TQPainter::translate(-50, -50). Be also aware that - the painter might already have some transformations set (i.e., - don't call TQPainter::resetXForm() when you're done). - - \sa draw() -*/ - -/*! - \fn TQPen TQCanvasPolygonalItem::pen() const - - Returns the TQPen used to draw the outline of the item, if any. - - \sa setPen() -*/ - -/*! - \fn TQBrush TQCanvasPolygonalItem::brush() const - - Returns the TQBrush used to fill the item, if filled. - - \sa setBrush() -*/ - -/*! - Sets the TQPen used when drawing the item to the pen \a p. - Note that many TQCanvasPolygonalItems do not use the pen value. - - \sa setBrush(), pen(), drawShape() -*/ -void TQCanvasPolygonalItem::setPen(TQPen p) -{ - if ( pn != p ) { - removeFromChunks(); - pn = p; - addToChunks(); - } -} - -/*! - Sets the TQBrush used when drawing the polygonal item to the brush \a b. - - \sa setPen(), brush(), drawShape() -*/ -void TQCanvasPolygonalItem::setBrush(TQBrush b) -{ - if ( br != b) { - br = b; - changeChunks(); - } -} - - -/*! - \class TQCanvasPolygon ntqcanvas.h - \brief The TQCanvasPolygon class provides a polygon on a TQCanvas. -\if defined(commercial) - It is part of the TQt Enterprise Edition. -\endif - - \module canvas - \ingroup graphics - \ingroup images - - Paints a polygon with a TQBrush. The polygon's points can be set in - the constructor or set or changed later using setPoints(). Use - points() to retrieve the points, or areaPoints() to retrieve the - points relative to the canvas's origin. - - The polygon can be drawn on a painter with drawShape(). - - Like any other canvas item polygons can be moved with - TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting - coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and - TQCanvasItem::setZ(). - - Note: TQCanvasPolygon does not use the pen. -*/ - -/*! - Constructs a point-less polygon on the canvas \a canvas. You - should call setPoints() before using it further. -*/ -TQCanvasPolygon::TQCanvasPolygon(TQCanvas* canvas) : - TQCanvasPolygonalItem(canvas) -{ -} - -/*! - Destroys the polygon. -*/ -TQCanvasPolygon::~TQCanvasPolygon() -{ - hide(); -} - -/*! - Draws the polygon using the painter \a p. - - Note that TQCanvasPolygon does not support an outline (the pen is - always NoPen). -*/ -void TQCanvasPolygon::drawShape(TQPainter & p) -{ - // ### why can't we draw outlines? We could use drawPolyline for it. Lars - // ### see other message. Warwick - - p.setPen(NoPen); // since TQRegion(TQPointArray) excludes outline :-( )-: - p.drawPolygon(poly); -} - -/*! - Sets the points of the polygon to be \a pa. These points will have - their x and y coordinates automatically translated by x(), y() as - the polygon is moved. -*/ -void TQCanvasPolygon::setPoints(TQPointArray pa) -{ - removeFromChunks(); - poly = pa; - poly.detach(); // Explicit sharing is stupid. - poly.translate((int)x(),(int)y()); - addToChunks(); -} - -/*! - \reimp -*/ -void TQCanvasPolygon::moveBy(double dx, double dy) -{ - // Note: does NOT call TQCanvasPolygonalItem::moveBy(), since that - // only does half this work. - // - int idx = int(x()+dx)-int(x()); - int idy = int(y()+dy)-int(y()); - if ( idx || idy ) { - removeFromChunks(); - poly.translate(idx,idy); - } - myx+=dx; - myy+=dy; - if ( idx || idy ) { - addToChunks(); - } -} - -/*! - \class TQCanvasSpline ntqcanvas.h - \brief The TQCanvasSpline class provides multi-bezier splines on a TQCanvas. -\if defined(commercial) - It is part of the TQt Enterprise Edition. -\endif - - \module canvas - \ingroup graphics - \ingroup images - - A TQCanvasSpline is a sequence of 4-point bezier curves joined - together to make a curved shape. - - You set the control points of the spline with setControlPoints(). - - If the bezier is closed(), then the first control point will be - re-used as the last control point. Therefore, a closed bezier must - have a multiple of 3 control points and an open bezier must have - one extra point. - - The beziers are not necessarily joined "smoothly". To ensure this, - set control points appropriately (general reference texts about - beziers will explain this in detail). - - Like any other canvas item splines can be moved with - TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting - coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and - TQCanvasItem::setZ(). - -*/ - -/*! - Create a spline with no control points on the canvas \a canvas. - - \sa setControlPoints() -*/ -TQCanvasSpline::TQCanvasSpline(TQCanvas* canvas) : - TQCanvasPolygon(canvas), - cl(TRUE) -{ -} - -/*! - Destroy the spline. -*/ -TQCanvasSpline::~TQCanvasSpline() -{ -} - -// ### shouldn't we handle errors more gracefully than with an assert? Lars -// ### no, since it's a programming error. Warwick -/*! - Set the spline control points to \a ctrl. - - If \a close is TRUE, then the first point in \a ctrl will be - re-used as the last point, and the number of control points must - be a multiple of 3. If \a close is FALSE, one additional control - point is required, and the number of control points must be one of - (4, 7, 10, 13, ...). - - If the number of control points doesn't meet the above conditions, - the number of points will be truncated to the largest number of - points that do meet the requirement. -*/ -void TQCanvasSpline::setControlPoints(TQPointArray ctrl, bool close) -{ - if ( (int)ctrl.count() % 3 != (close ? 0 : 1) ) { - tqWarning( "TQCanvasSpline::setControlPoints(): Number of points doesn't fit." ); - int numCurves = (ctrl.count() - (close ? 0 : 1 ))/ 3; - ctrl.resize( numCurves*3 + ( close ? 0 : 1 ) ); - } - - cl = close; - bez = ctrl; - recalcPoly(); -} - -/*! - Returns the current set of control points. - - \sa setControlPoints(), closed() -*/ -TQPointArray TQCanvasSpline::controlPoints() const -{ - return bez; -} - -/*! - Returns TRUE if the control points are a closed set; otherwise - returns FALSE. -*/ -bool TQCanvasSpline::closed() const -{ - return cl; -} - -void TQCanvasSpline::recalcPoly() -{ - TQPtrList segs; - segs.setAutoDelete(TRUE); - int n=0; - for (int i=0; i<(int)bez.count()-1; i+=3) { - TQPointArray ctrl(4); - ctrl[0] = bez[i+0]; - ctrl[1] = bez[i+1]; - ctrl[2] = bez[i+2]; - if ( cl ) - ctrl[3] = bez[(i+3)%(int)bez.count()]; - else - ctrl[3] = bez[i+3]; - TQPointArray *seg = new TQPointArray(ctrl.cubicBezier()); - n += seg->count()-1; - segs.append(seg); - } - TQPointArray p(n+1); - n=0; - for (TQPointArray* seg = segs.first(); seg; seg = segs.next()) { - for (int i=0; i<(int)seg->count()-1; i++) - p[n++] = seg->point(i); - if ( n == (int)p.count()-1 ) - p[n] = seg->point(seg->count()-1); - } - TQCanvasPolygon::setPoints(p); -} - -/*! - \fn TQPointArray TQCanvasPolygonalItem::areaPoints() const - - This function must be reimplemented by subclasses. It \e must - return the points bounding (i.e. outside and not touching) the - shape or drawing errors will occur. -*/ - -/*! - \fn TQPointArray TQCanvasPolygon::points() const - - Returns the vertices of the polygon, not translated by the position. - - \sa setPoints(), areaPoints() -*/ -TQPointArray TQCanvasPolygon::points() const -{ - TQPointArray pa = areaPoints(); - pa.translate(int(-x()),int(-y())); - return pa; -} - -/*! - Returns the vertices of the polygon translated by the polygon's - current x(), y() position, i.e. relative to the canvas's origin. - - \sa setPoints(), points() -*/ -TQPointArray TQCanvasPolygon::areaPoints() const -{ - return poly.copy(); -} - -// ### mark: Why don't we offer a constructor that lets the user set the -// points -- that way for some uses just the constructor call would be -// required? -/*! - \class TQCanvasLine ntqcanvas.h - \brief The TQCanvasLine class provides a line on a TQCanvas. -\if defined(commercial) - It is part of the TQt Enterprise Edition. -\endif - - \module canvas - \ingroup graphics - \ingroup images - - The line inherits functionality from TQCanvasPolygonalItem, for - example the setPen() function. The start and end points of the - line are set with setPoints(). - - Like any other canvas item lines can be moved with - TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting - coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and - TQCanvasItem::setZ(). -*/ - -/*! - Constructs a line from (0,0) to (0,0) on \a canvas. - - \sa setPoints(). -*/ -TQCanvasLine::TQCanvasLine(TQCanvas* canvas) : - TQCanvasPolygonalItem(canvas) -{ - x1 = y1 = x2 = y2 = 0; -} - -/*! - Destroys the line. -*/ -TQCanvasLine::~TQCanvasLine() -{ - hide(); -} - -/*! - \reimp -*/ -void TQCanvasLine::setPen(TQPen p) -{ - TQCanvasPolygonalItem::setPen(p); -} - -/*! - \fn TQPoint TQCanvasLine::startPoint () const - - Returns the start point of the line. - - \sa setPoints(), endPoint() -*/ - -/*! - \fn TQPoint TQCanvasLine::endPoint () const - - Returns the end point of the line. - - \sa setPoints(), startPoint() -*/ - -/*! - Sets the line's start point to (\a xa, \a ya) and its end point to - (\a xb, \a yb). -*/ -void TQCanvasLine::setPoints(int xa, int ya, int xb, int yb) -{ - if ( x1 != xa || x2 != xb || y1 != ya || y2 != yb ) { - removeFromChunks(); - x1 = xa; - y1 = ya; - x2 = xb; - y2 = yb; - addToChunks(); - } -} - -/*! - \reimp -*/ -void TQCanvasLine::drawShape(TQPainter &p) -{ - p.drawLine((int)(x()+x1), (int)(y()+y1), (int)(x()+x2), (int)(y()+y2)); -} - -/*! - \reimp - - Note that the area defined by the line is somewhat thicker than - the line that is actually drawn. -*/ -TQPointArray TQCanvasLine::areaPoints() const -{ - TQPointArray p(4); - int xi = int(x()); - int yi = int(y()); - int pw = pen().width(); - int dx = TQABS(x1-x2); - int dy = TQABS(y1-y2); - pw = pw*4/3+2; // approx pw*sqrt(2) - int px = x1 dy ? (dx*2/dy <= 2) : (dy*2/dx <= 2)) ) { - // steep - if ( px == py ) { - p[0] = TQPoint(x1+xi ,y1+yi+py); - p[1] = TQPoint(x2+xi-px,y2+yi ); - p[2] = TQPoint(x2+xi ,y2+yi-py); - p[3] = TQPoint(x1+xi+px,y1+yi ); - } else { - p[0] = TQPoint(x1+xi+px,y1+yi ); - p[1] = TQPoint(x2+xi ,y2+yi-py); - p[2] = TQPoint(x2+xi-px,y2+yi ); - p[3] = TQPoint(x1+xi ,y1+yi+py); - } - } else if ( dx > dy ) { - // horizontal - p[0] = TQPoint(x1+xi+px,y1+yi+py); - p[1] = TQPoint(x2+xi-px,y2+yi+py); - p[2] = TQPoint(x2+xi-px,y2+yi-py); - p[3] = TQPoint(x1+xi+px,y1+yi-py); - } else { - // vertical - p[0] = TQPoint(x1+xi+px,y1+yi+py); - p[1] = TQPoint(x2+xi+px,y2+yi-py); - p[2] = TQPoint(x2+xi-px,y2+yi-py); - p[3] = TQPoint(x1+xi-px,y1+yi+py); - } - return p; -} - -/*! - \reimp - -*/ - -void TQCanvasLine::moveBy(double dx, double dy) -{ - TQCanvasPolygonalItem::moveBy(dx, dy); -} - -/*! - \class TQCanvasRectangle ntqcanvas.h - \brief The TQCanvasRectangle class provides a rectangle on a TQCanvas. -\if defined(commercial) - It is part of the TQt Enterprise Edition. -\endif - - \module canvas - \ingroup graphics - \ingroup images - - This item paints a single rectangle which may have any pen() and - brush(), but may not be tilted/rotated. For rotated rectangles, - use TQCanvasPolygon. - - The rectangle's size and initial position can be set in the - constructor. The size can be set or changed later using setSize(). - Use height() and width() to retrieve the rectangle's dimensions. - - The rectangle can be drawn on a painter with drawShape(). - - Like any other canvas item rectangles can be moved with - TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting - coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and - TQCanvasItem::setZ(). - -*/ - -/*! - Constructs a rectangle at position (0,0) with both width and - height set to 32 pixels on \a canvas. -*/ -TQCanvasRectangle::TQCanvasRectangle(TQCanvas* canvas) : - TQCanvasPolygonalItem(canvas), - w(32), h(32) -{ -} - -/*! - Constructs a rectangle positioned and sized by \a r on \a canvas. -*/ -TQCanvasRectangle::TQCanvasRectangle(const TQRect& r, TQCanvas* canvas) : - TQCanvasPolygonalItem(canvas), - w(r.width()), h(r.height()) -{ - move(r.x(),r.y()); -} - -/*! - Constructs a rectangle at position (\a x, \a y) and size \a width - by \a height, on \a canvas. -*/ -TQCanvasRectangle::TQCanvasRectangle(int x, int y, int width, int height, - TQCanvas* canvas) : - TQCanvasPolygonalItem(canvas), - w(width), h(height) -{ - move(x,y); -} - -/*! - Destroys the rectangle. -*/ -TQCanvasRectangle::~TQCanvasRectangle() -{ - hide(); -} - - -/*! - Returns the width of the rectangle. -*/ -int TQCanvasRectangle::width() const -{ - return w; -} - -/*! - Returns the height of the rectangle. -*/ -int TQCanvasRectangle::height() const -{ - return h; -} - -/*! - Sets the \a width and \a height of the rectangle. -*/ -void TQCanvasRectangle::setSize(int width, int height) -{ - if ( w != width || h != height ) { - removeFromChunks(); - w = width; - h = height; - addToChunks(); - } -} - -/*! - \fn TQSize TQCanvasRectangle::size() const - - Returns the width() and height() of the rectangle. - - \sa rect(), setSize() -*/ - -/*! - \fn TQRect TQCanvasRectangle::rect() const - - Returns the integer-converted x(), y() position and size() of the - rectangle as a TQRect. -*/ - -/*! - \reimp -*/ -TQPointArray TQCanvasRectangle::areaPoints() const -{ - TQPointArray pa(4); - int pw = (pen().width()+1)/2; - if ( pw < 1 ) pw = 1; - if ( pen() == NoPen ) pw = 0; - pa[0] = TQPoint((int)x()-pw,(int)y()-pw); - pa[1] = pa[0] + TQPoint(w+pw*2,0); - pa[2] = pa[1] + TQPoint(0,h+pw*2); - pa[3] = pa[0] + TQPoint(0,h+pw*2); - return pa; -} - -/*! - Draws the rectangle on painter \a p. -*/ -void TQCanvasRectangle::drawShape(TQPainter & p) -{ - p.drawRect((int)x(), (int)y(), w, h); -} - - -/*! - \class TQCanvasEllipse ntqcanvas.h - \brief The TQCanvasEllipse class provides an ellipse or ellipse segment on a TQCanvas. -\if defined(commercial) - It is part of the TQt Enterprise Edition. -\endif - - \module canvas - \ingroup graphics - \ingroup images - - A canvas item that paints an ellipse or ellipse segment with a TQBrush. - The ellipse's height, width, start angle and angle length can be set - at construction time. The size can be changed at runtime with - setSize(), and the angles can be changed (if you're displaying an - ellipse segment rather than a whole ellipse) with setAngles(). - - Note that angles are specified in 16ths of a degree. - - \target anglediagram - \img qcanvasellipse.png Ellipse - - If a start angle and length angle are set then an ellipse segment - will be drawn. The start angle is the angle that goes from zero in a - counter-clockwise direction (shown in green in the diagram). The - length angle is the angle from the start angle in a - counter-clockwise direction (shown in blue in the diagram). The blue - segment is the segment of the ellipse that would be drawn. If no - start angle and length angle are specified the entire ellipse is - drawn. - - The ellipse can be drawn on a painter with drawShape(). - - Like any other canvas item ellipses can be moved with move() and - moveBy(), or by setting coordinates with setX(), setY() and setZ(). - - Note: TQCanvasEllipse does not use the pen. -*/ - -/*! - Constructs a 32x32 ellipse, centered at (0, 0) on \a canvas. -*/ -TQCanvasEllipse::TQCanvasEllipse(TQCanvas* canvas) : - TQCanvasPolygonalItem(canvas), - w(32), h(32), - a1(0), a2(360*16) -{ -} - -/*! - Constructs a \a width by \a height pixel ellipse, centered at - (0, 0) on \a canvas. -*/ -TQCanvasEllipse::TQCanvasEllipse(int width, int height, TQCanvas* canvas) : - TQCanvasPolygonalItem(canvas), - w(width),h(height), - a1(0),a2(360*16) -{ -} - -// ### add a constructor taking degrees in float. 1/16 degrees is stupid. Lars -// ### it's how TQPainter does it, so TQCanvas does too for consistency. If it's -// ### a good idea, it should be added to TQPainter, not just to TQCanvas. Warwick -/*! - Constructs a \a width by \a height pixel ellipse, centered at - (0, 0) on \a canvas. Only a segment of the ellipse is drawn, - starting at angle \a startangle, and extending for angle \a angle - (the angle length). - - Note that angles are specified in - 1/16ths of a degree. -*/ -TQCanvasEllipse::TQCanvasEllipse(int width, int height, - int startangle, int angle, TQCanvas* canvas) : - TQCanvasPolygonalItem(canvas), - w(width),h(height), - a1(startangle),a2(angle) -{ -} - -/*! - Destroys the ellipse. -*/ -TQCanvasEllipse::~TQCanvasEllipse() -{ - hide(); -} - -/*! - Returns the width of the ellipse. -*/ -int TQCanvasEllipse::width() const -{ - return w; -} - -/*! - Returns the height of the ellipse. -*/ -int TQCanvasEllipse::height() const -{ - return h; -} - -/*! - Sets the \a width and \a height of the ellipse. -*/ -void TQCanvasEllipse::setSize(int width, int height) -{ - if ( w != width || h != height ) { - removeFromChunks(); - w = width; - h = height; - addToChunks(); - } -} - -/*! - \fn int TQCanvasEllipse::angleStart() const - - Returns the start angle in 16ths of a degree. Initially - this will be 0. - - \sa setAngles(), angleLength() -*/ - -/*! - \fn int TQCanvasEllipse::angleLength() const - - Returns the length angle (the extent of the ellipse segment) in - 16ths of a degree. Initially this will be 360 * 16 (a complete - ellipse). - - \sa setAngles(), angleStart() -*/ - -/*! - Sets the angles for the ellipse. The start angle is \a start and - the extent of the segment is \a length (the angle length) from the - \a start. The angles are specified in 16ths of a degree. By - default the ellipse will start at 0 and have an angle length of - 360 * 16 (a complete ellipse). - - \sa angleStart(), angleLength() -*/ -void TQCanvasEllipse::setAngles(int start, int length) -{ - if ( a1 != start || a2 != length ) { - removeFromChunks(); - a1 = start; - a2 = length; - addToChunks(); - } -} - -/*! - \reimp -*/ -TQPointArray TQCanvasEllipse::areaPoints() const -{ - TQPointArray r; - // makeArc at 0,0, then translate so that fixed point math doesn't overflow - r.makeArc(int(x()-w/2.0+0.5)-1, int(y()-h/2.0+0.5)-1, w+3, h+3, a1, a2); - r.resize(r.size()+1); - r.setPoint(r.size()-1,int(x()),int(y())); - return r; -} - -// ### support outlines! Lars -// ### TQRegion doesn't, so we cannot (try it). Warwick -/*! - Draws the ellipse, centered at x(), y() using the painter \a p. - - Note that TQCanvasEllipse does not support an outline (the pen is - always NoPen). -*/ -void TQCanvasEllipse::drawShape(TQPainter & p) -{ - p.setPen(NoPen); // since TQRegion(TQPointArray) excludes outline :-( )-: - if ( !a1 && a2 == 360*16 ) { - p.drawEllipse(int(x()-w/2.0+0.5), int(y()-h/2.0+0.5), w, h); - } else { - p.drawPie(int(x()-w/2.0+0.5), int(y()-h/2.0+0.5), w, h, a1, a2); - } -} - - -/*! - \class TQCanvasText ntqcanvas.h - \brief The TQCanvasText class provides a text object on a TQCanvas. -\if defined(commercial) - It is part of the TQt Enterprise Edition. -\endif - - \module canvas - \ingroup graphics - \ingroup images - - A canvas text item has text with font, color and alignment - attributes. The text and font can be set in the constructor or set - or changed later with setText() and setFont(). The color is set - with setColor() and the alignment with setTextFlags(). The text - item's bounding rectangle is retrieved with boundingRect(). - - The text can be drawn on a painter with draw(). - - Like any other canvas item text items can be moved with - TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting - coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and - TQCanvasItem::setZ(). -*/ - -/*! - Constructs a TQCanvasText with the text "\", on \a canvas. -*/ -TQCanvasText::TQCanvasText(TQCanvas* canvas) : - TQCanvasItem(canvas), - txt(""), flags(0) -{ - setRect(); -} - -// ### add textflags to the constructor? Lars -/*! - Constructs a TQCanvasText with the text \a t, on canvas \a canvas. -*/ -TQCanvasText::TQCanvasText(const TQString& t, TQCanvas* canvas) : - TQCanvasItem(canvas), - txt(t), flags(0) -{ - setRect(); -} - -// ### see above -/*! - Constructs a TQCanvasText with the text \a t and font \a f, on the - canvas \a canvas. -*/ -TQCanvasText::TQCanvasText(const TQString& t, TQFont f, TQCanvas* canvas) : - TQCanvasItem(canvas), - txt(t), flags(0), - fnt(f) -{ - setRect(); -} - -/*! - Destroys the canvas text item. -*/ -TQCanvasText::~TQCanvasText() -{ - removeFromChunks(); -} - -/*! - Returns the bounding rectangle of the text. -*/ -TQRect TQCanvasText::boundingRect() const { return brect; } - -void TQCanvasText::setRect() -{ - brect = TQFontMetrics(fnt).boundingRect(int(x()), int(y()), 0, 0, flags, txt); - brect.setWidth(brect.width()+1); -} - -/*! - \fn int TQCanvasText::textFlags() const - - Returns the currently set alignment flags. - - \sa setTextFlags() TQt::AlignmentFlags -*/ - - -/*! - Sets the alignment flags to \a f. These are a bitwise OR of the - flags available to TQPainter::drawText() -- see the - \l{TQt::AlignmentFlags}. - - \sa setFont() setColor() -*/ -void TQCanvasText::setTextFlags(int f) -{ - if ( flags != f ) { - removeFromChunks(); - flags = f; - setRect(); - addToChunks(); - } -} - -/*! - Returns the text item's text. - - \sa setText() -*/ -TQString TQCanvasText::text() const -{ - return txt; -} - - -/*! - Sets the text item's text to \a t. The text may contain newlines. - - \sa text(), setFont(), setColor() setTextFlags() -*/ -void TQCanvasText::setText( const TQString& t ) -{ - if ( txt != t ) { - removeFromChunks(); - txt = t; - setRect(); - addToChunks(); - } -} - -/*! - Returns the font in which the text is drawn. - - \sa setFont() -*/ -TQFont TQCanvasText::font() const -{ - return fnt; -} - -/*! - Sets the font in which the text is drawn to font \a f. - - \sa font() -*/ -void TQCanvasText::setFont( const TQFont& f ) -{ - if ( f != fnt ) { - removeFromChunks(); - fnt = f; - setRect(); - addToChunks(); - } -} - -/*! - Returns the color of the text. - - \sa setColor() -*/ -TQColor TQCanvasText::color() const -{ - return col; -} - -/*! - Sets the color of the text to the color \a c. - - \sa color(), setFont() -*/ -void TQCanvasText::setColor(const TQColor& c) -{ - col=c; - changeChunks(); -} - - -/*! - \reimp -*/ -void TQCanvasText::moveBy(double dx, double dy) -{ - int idx = int(x()+dx)-int(x()); - int idy = int(y()+dy)-int(y()); - if ( idx || idy ) { - removeFromChunks(); - } - myx+=dx; - myy+=dy; - if ( idx || idy ) { - brect.moveBy(idx,idy); - addToChunks(); - } -} - -/*! - Draws the text using the painter \a painter. -*/ -void TQCanvasText::draw(TQPainter& painter) -{ - painter.setFont(fnt); - painter.setPen(col); - painter.drawText(brect, flags, txt); -} - -/*! - \reimp -*/ -void TQCanvasText::changeChunks() -{ - if (isVisible() && canvas()) { - int chunksize=canvas()->chunkSize(); - for (int j=brect.top()/chunksize; j<=brect.bottom()/chunksize; j++) { - for (int i=brect.left()/chunksize; i<=brect.right()/chunksize; i++) { - canvas()->setChangedChunk(i,j); - } - } - } -} - -/*! - Adds the text item to the appropriate chunks. -*/ -void TQCanvasText::addToChunks() -{ - if (isVisible() && canvas()) { - int chunksize=canvas()->chunkSize(); - for (int j=brect.top()/chunksize; j<=brect.bottom()/chunksize; j++) { - for (int i=brect.left()/chunksize; i<=brect.right()/chunksize; i++) { - canvas()->addItemToChunk(this,i,j); - } - } - } -} - -/*! - Removes the text item from the appropriate chunks. -*/ -void TQCanvasText::removeFromChunks() -{ - if (isVisible() && canvas()) { - int chunksize=canvas()->chunkSize(); - for (int j=brect.top()/chunksize; j<=brect.bottom()/chunksize; j++) { - for (int i=brect.left()/chunksize; i<=brect.right()/chunksize; i++) { - canvas()->removeItemFromChunk(this,i,j); - } - } - } -} - - -/*! - Returns 0 (TQCanvasItem::Rtti_Item). - - Make your derived classes return their own values for rtti(), so - that you can distinguish between objects returned by - TQCanvas::at(). You should use values greater than 1000 to allow - for extensions to this class. - - Overuse of this functionality can damage it's extensibility. For - example, once you have identified a base class of a TQCanvasItem - found by TQCanvas::at(), cast it to that type and call meaningful - methods rather than acting upon the object based on its rtti - value. - - For example: - - \code - TQCanvasItem* item; - // Find an item, e.g. with TQCanvasItem::collisions(). - ... - if (item->rtti() == MySprite::RTTI ) { - MySprite* s = (MySprite*)item; - if (s->isDamagable()) s->loseHitPoints(1000); - if (s->isHot()) myself->loseHitPoints(1000); - ... - } - \endcode -*/ -int TQCanvasItem::rtti() const { return RTTI; } -int TQCanvasItem::RTTI = Rtti_Item; - -/*! - Returns 1 (TQCanvasItem::Rtti_Sprite). - - \sa TQCanvasItem::rtti() -*/ -int TQCanvasSprite::rtti() const { return RTTI; } -int TQCanvasSprite::RTTI = Rtti_Sprite; - -/*! - Returns 2 (TQCanvasItem::Rtti_PolygonalItem). - - \sa TQCanvasItem::rtti() -*/ -int TQCanvasPolygonalItem::rtti() const { return RTTI; } -int TQCanvasPolygonalItem::RTTI = Rtti_PolygonalItem; - -/*! - Returns 3 (TQCanvasItem::Rtti_Text). - - \sa TQCanvasItem::rtti() -*/ -int TQCanvasText::rtti() const { return RTTI; } -int TQCanvasText::RTTI = Rtti_Text; - -/*! - Returns 4 (TQCanvasItem::Rtti_Polygon). - - \sa TQCanvasItem::rtti() -*/ -int TQCanvasPolygon::rtti() const { return RTTI; } -int TQCanvasPolygon::RTTI = Rtti_Polygon; - -/*! - Returns 5 (TQCanvasItem::Rtti_Rectangle). - - \sa TQCanvasItem::rtti() -*/ -int TQCanvasRectangle::rtti() const { return RTTI; } -int TQCanvasRectangle::RTTI = Rtti_Rectangle; - -/*! - Returns 6 (TQCanvasItem::Rtti_Ellipse). - - \sa TQCanvasItem::rtti() -*/ -int TQCanvasEllipse::rtti() const { return RTTI; } -int TQCanvasEllipse::RTTI = Rtti_Ellipse; - -/*! - Returns 7 (TQCanvasItem::Rtti_Line). - - \sa TQCanvasItem::rtti() -*/ -int TQCanvasLine::rtti() const { return RTTI; } -int TQCanvasLine::RTTI = Rtti_Line; - -/*! - Returns 8 (TQCanvasItem::Rtti_Spline). - - \sa TQCanvasItem::rtti() -*/ -int TQCanvasSpline::rtti() const { return RTTI; } -int TQCanvasSpline::RTTI = Rtti_Spline; - -/*! - Constructs a TQCanvasSprite which uses images from the - TQCanvasPixmapArray \a a. - - The sprite in initially positioned at (0, 0) on \a canvas, using - frame 0. -*/ -TQCanvasSprite::TQCanvasSprite(TQCanvasPixmapArray* a, TQCanvas* canvas) : - TQCanvasItem(canvas), - frm(0), - anim_val(0), - anim_state(0), - anim_type(0), - images(a) -{ -} - - -/*! - Set the array of images used for displaying the sprite to the - TQCanvasPixmapArray \a a. - - If the current frame() is larger than the number of images in \a - a, the current frame will be reset to 0. -*/ -void TQCanvasSprite::setSequence(TQCanvasPixmapArray* a) -{ - bool isvisible = isVisible(); - if ( isvisible && images ) - hide(); - images = a; - if ( frm >= (int)images->count() ) - frm = 0; - if ( isvisible ) - show(); -} - -/*! -\internal - -Marks any chunks the sprite touches as changed. -*/ -void TQCanvasSprite::changeChunks() -{ - if (isVisible() && canvas()) { - int chunksize=canvas()->chunkSize(); - for (int j=topEdge()/chunksize; j<=bottomEdge()/chunksize; j++) { - for (int i=leftEdge()/chunksize; i<=rightEdge()/chunksize; i++) { - canvas()->setChangedChunk(i,j); - } - } - } -} - -/*! - Destroys the sprite and removes it from the canvas. Does \e not - delete the images. -*/ -TQCanvasSprite::~TQCanvasSprite() -{ - removeFromChunks(); -} - -/*! - Sets the animation frame used for displaying the sprite to \a f, - an index into the TQCanvasSprite's TQCanvasPixmapArray. The call - will be ignored if \a f is larger than frameCount() or smaller - than 0. - - \sa frame() move() -*/ -void TQCanvasSprite::setFrame(int f) -{ - move(x(),y(),f); -} - -/*! - \enum TQCanvasSprite::FrameAnimationType - - This enum is used to identify the different types of frame - animation offered by TQCanvasSprite. - - \value Cycle at each advance the frame number will be incremented by - 1 (modulo the frame count). - \value Oscillate at each advance the frame number will be - incremented by 1 up to the frame count then decremented to by 1 to - 0, repeating this sequence forever. -*/ - -/*! - Sets the animation characteristics for the sprite. - - For \a type == \c Cycle, the frames will increase by \a step - at each advance, modulo the frameCount(). - - For \a type == \c Oscillate, the frames will increase by \a step - at each advance, up to the frameCount(), then decrease by \a step - back to 0, repeating forever. - - The \a state parameter is for internal use. -*/ -void TQCanvasSprite::setFrameAnimation(FrameAnimationType type, int step, int state) -{ - anim_val = step; - anim_type = type; - anim_state = state; - setAnimated(TRUE); -} - -/*! - Extends the default TQCanvasItem implementation to provide the - functionality of setFrameAnimation(). - - The \a phase is 0 or 1: see TQCanvasItem::advance() for details. - - \sa TQCanvasItem::advance() setVelocity() -*/ -void TQCanvasSprite::advance(int phase) -{ - if ( phase==1 ) { - int nf = frame(); - if ( anim_type == Oscillate ) { - if ( anim_state ) - nf += anim_val; - else - nf -= anim_val; - if ( nf < 0 ) { - nf = abs(anim_val); - anim_state = !anim_state; - } else if ( nf >= frameCount() ) { - nf = frameCount()-1-abs(anim_val); - anim_state = !anim_state; - } - } else { - nf = (nf + anim_val + frameCount()) % frameCount(); - } - move(x()+xVelocity(),y()+yVelocity(),nf); - } -} - - -/*! - \fn int TQCanvasSprite::frame() const - - Returns the index of the current animation frame in the - TQCanvasSprite's TQCanvasPixmapArray. - - \sa setFrame(), move() -*/ - -/*! - \fn int TQCanvasSprite::frameCount() const - - Returns the number of frames in the TQCanvasSprite's - TQCanvasPixmapArray. -*/ - - -/*! - \reimp - \internal - Moves the sprite to the position \a x, \a y. - Keep it visible. -*/ -void TQCanvasSprite::move(double x, double y) { TQCanvasItem::move(x,y); } - -/*! - \fn void TQCanvasSprite::move(double nx, double ny, int nf) - - Set the position of the sprite to \a nx, \a ny and the current - frame to \a nf. \a nf will be ignored if it is larger than - frameCount() or smaller than 0. -*/ -void TQCanvasSprite::move(double nx, double ny, int nf) -{ - if (isVisible() && canvas()) { - hide(); - TQCanvasItem::move(nx,ny); - if ( nf >= 0 && nf < frameCount() ) - frm=nf; - show(); - } else { - TQCanvasItem::move(nx,ny); - if ( nf >= 0 && nf < frameCount() ) - frm=nf; - } -} - -class TQCanvasPolygonScanner : public TQPolygonScanner { - TQPolygonalProcessor& processor; -public: - TQCanvasPolygonScanner(TQPolygonalProcessor& p) : - processor(p) - { - } - void processSpans( int n, TQPoint* point, int* width ) - { - processor.doSpans(n,point,width); - } -}; - -void TQCanvasPolygonalItem::scanPolygon(const TQPointArray& pa, int winding, TQPolygonalProcessor& process) const -{ - TQCanvasPolygonScanner scanner(process); - scanner.scan(pa,winding); -} - - -#endif // TQT_NO_CANVAS diff --git a/src/canvas/qt_canvas.pri b/src/canvas/qt_canvas.pri index e0f295b4..0cd9c442 100644 --- a/src/canvas/qt_canvas.pri +++ b/src/canvas/qt_canvas.pri @@ -1,6 +1,6 @@ # TQt canvas module canvas { - HEADERS += $$CANVAS_H/ntqcanvas.h - SOURCES += $$CANVAS_CPP/qcanvas.cpp + HEADERS += $$CANVAS_H/tqcanvas.h + SOURCES += $$CANVAS_CPP/tqcanvas.cpp } diff --git a/src/canvas/tqcanvas.cpp b/src/canvas/tqcanvas.cpp new file mode 100644 index 00000000..cd03790a --- /dev/null +++ b/src/canvas/tqcanvas.cpp @@ -0,0 +1,5415 @@ +/********************************************************************** +** +** Implementation of TQCanvas and associated classes +** +** Created : 991211 +** +** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the canvas module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial licenses may use this file in accordance with the TQt +** Commercial License Agreement provided with the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#include "tqcanvas.h" +#ifndef TQT_NO_CANVAS +#include "ntqapplication.h" +#include "ntqbitmap.h" +#include "ntqimage.h" +#include "ntqptrdict.h" +#include "ntqpainter.h" +#include "ntqpolygonscanner.h" +#include "ntqtimer.h" +#include "ntqtl.h" + +#include + +class TQCanvasData { +public: + TQCanvasData() : + itemDict(1013), animDict(503) + { + } + + TQPtrList viewList; + TQPtrDict itemDict; + TQPtrDict animDict; +}; + +class TQCanvasViewData { +public: + TQCanvasViewData() : repaint_from_moving( FALSE ) {} +#ifndef TQT_NO_TRANSFORMATIONS + TQWMatrix xform; + TQWMatrix ixform; +#endif + bool repaint_from_moving; +}; + +// clusterizer + +class TQCanvasClusterizer { +public: + TQCanvasClusterizer(int maxclusters); + ~TQCanvasClusterizer(); + + void add(int x, int y); // 1x1 rectangle (point) + void add(int x, int y, int w, int h); + void add(const TQRect& rect); + + void clear(); + int clusters() { return count; } + const TQRect& operator[](int i); + +private: + TQRect* cluster; + int count; + const int maxcl; +}; + +static +void include(TQRect& r, const TQRect& rect) +{ + if (rect.left()r.right()) { + r.setRight(rect.right()); + } + if (rect.top()r.bottom()) { + r.setBottom(rect.bottom()); + } +} + +/* +A TQCanvasClusterizer groups rectangles (TQRects) into non-overlapping rectangles +by a merging heuristic. +*/ +TQCanvasClusterizer::TQCanvasClusterizer(int maxclusters) : + cluster(new TQRect[maxclusters]), + count(0), + maxcl(maxclusters) +{ } + +TQCanvasClusterizer::~TQCanvasClusterizer() +{ + delete [] cluster; +} + +void TQCanvasClusterizer::clear() +{ + count=0; +} + +void TQCanvasClusterizer::add(int x, int y) +{ + add(TQRect(x,y,1,1)); +} + +void TQCanvasClusterizer::add(int x, int y, int w, int h) +{ + add(TQRect(x,y,w,h)); +} + +void TQCanvasClusterizer::add(const TQRect& rect) +{ + TQRect biggerrect(rect.x()-1,rect.y()-1,rect.width()+2,rect.height()+2); + + //assert(rect.width()>0 && rect.height()>0); + + int cursor; + + for (cursor=0; cursor=0) { + include(cluster[cheapest],rect); + return; + } + + if (count < maxcl) { + cluster[count++]=rect; + return; + } + + // Do cheapest of: + // add to closest cluster + // do cheapest cluster merge, add to new cluster + + lowestcost=9999999; + cheapest=-1; + cursor=0; + while( cursor=0) { + include(cluster[cheapestmerge1],cluster[cheapestmerge2]); + cluster[cheapestmerge2]=cluster[count--]; + } else { + // if (!cheapest) debugRectangles(rect); + include(cluster[cheapest],rect); + } + + // NB: clusters do not intersect (or intersection will + // overwrite). This is a result of the above algorithm, + // given the assumption that (x,y) are ordered topleft + // to bottomright. + + // ### + // + // add explicit x/y ordering to that comment, move it to the top + // and rephrase it as pre-/post-conditions. +} + +const TQRect& TQCanvasClusterizer::operator[](int i) +{ + return cluster[i]; +} + +// end of clusterizer + + + +class TQM_EXPORT_CANVAS TQCanvasItemPtr { +public: + TQCanvasItemPtr() : ptr(0) { } + TQCanvasItemPtr( TQCanvasItem* p ) : ptr(p) { } + + bool operator<=(const TQCanvasItemPtr& that) const + { + // Order same-z objects by identity. + if (that.ptr->z()==ptr->z()) + return that.ptr <= ptr; + return that.ptr->z() <= ptr->z(); + } + bool operator<(const TQCanvasItemPtr& that) const + { + // Order same-z objects by identity. + if (that.ptr->z()==ptr->z()) + return that.ptr < ptr; + return that.ptr->z() < ptr->z(); + } + bool operator>(const TQCanvasItemPtr& that) const + { + // Order same-z objects by identity. + if (that.ptr->z()==ptr->z()) + return that.ptr > ptr; + return that.ptr->z() > ptr->z(); + } + bool operator==(const TQCanvasItemPtr& that) const + { + return that.ptr == ptr; + } + operator TQCanvasItem*() const { return ptr; } + +private: + TQCanvasItem* ptr; +}; + + +/*! + \class TQCanvasItemList + \brief The TQCanvasItemList class is a list of TQCanvasItems. +\if defined(commercial) + It is part of the TQt Enterprise Edition. +\endif + + \module canvas + \ingroup graphics + \ingroup images + + TQCanvasItemList is a TQValueList of pointers to \l{TQCanvasItem}s. + This class is used by some methods in TQCanvas that need to return + a list of canvas items. + + The \l TQValueList documentation describes how to use this list. +*/ + +/*! + \internal +*/ +void TQCanvasItemList::sort() +{ + qHeapSort(*((TQValueList*)this)); +} + +/*! + \internal +*/ +void TQCanvasItemList::drawUnique( TQPainter& painter ) +{ + TQCanvasItem* prev=0; + for (Iterator it=fromLast(); it!=end(); --it) { + TQCanvasItem *g=*it; + if (g!=prev) { + g->draw(painter); + prev=g; + } + } +} + +/*! + Returns the concatenation of this list and list \a l. +*/ +TQCanvasItemList TQCanvasItemList::operator+(const TQCanvasItemList &l) const +{ + TQCanvasItemList l2(*this); + for(const_iterator it = l.begin(); it != l.end(); ++it) + l2.append(*it); + return l2; +} + +class TQCanvasChunk { +public: + TQCanvasChunk() : changed(TRUE) { } + // Other code assumes lists are not deleted. Assignment is also + // done on ChunkRecs. So don't add that sort of thing here. + + void sort() + { + list.sort(); + } + + const TQCanvasItemList* listPtr() const + { + return &list; + } + + void add(TQCanvasItem* item) + { + list.prepend(item); + changed = TRUE; + } + + void remove(TQCanvasItem* item) + { + list.remove(item); + changed = TRUE; + } + + void change() + { + changed = TRUE; + } + + bool hasChanged() const + { + return changed; + } + + bool takeChange() + { + bool y = changed; + changed = FALSE; + return y; + } + +private: + TQCanvasItemList list; + bool changed; +}; + + +static int gcd(int a, int b) +{ + int r; + while ( (r = a%b) ) { + a=b; + b=r; + } + return b; +} + +static int scm(int a, int b) +{ + int g = gcd(a,b); + return a/g*b; +} + + + +/*! + \class TQCanvas tqcanvas.h + \brief The TQCanvas class provides a 2D area that can contain TQCanvasItem objects. +\if defined(commercial) + It is part of the TQt Enterprise Edition. +\endif + + \ingroup abstractwidgets + \ingroup graphics + \ingroup images + \mainclass + \module canvas + + The TQCanvas class manages its 2D graphic area and all the canvas + items the area contains. The canvas has no visual appearance of + its own. Instead, it is displayed on screen using a TQCanvasView. + Multiple TQCanvasView widgets may be associated with a canvas to + provide multiple views of the same canvas. + + The canvas is optimized for large numbers of items, particularly + where only a small percentage of the items change at any + one time. If the entire display changes very frequently, you should + consider using your own custom TQScrollView subclass. + + TQt provides a rich + set of canvas item classes, e.g. TQCanvasEllipse, TQCanvasLine, + TQCanvasPolygon, TQCanvasPolygonalItem, TQCanvasRectangle, TQCanvasSpline, + TQCanvasSprite and TQCanvasText. You can subclass to create your own + canvas items; TQCanvasPolygonalItem is the most common base class used + for this purpose. + + Items appear on the canvas after their \link TQCanvasItem::show() + show()\endlink function has been called (or \link + TQCanvasItem::setVisible() setVisible(TRUE)\endlink), and \e after + update() has been called. The canvas only shows items that are + \link TQCanvasItem::setVisible() visible\endlink, and then only if + \l update() is called. (By default the canvas is white and so are + canvas items, so if nothing appears try changing colors.) + + If you created the canvas without passing a width and height to + the constructor you must also call resize(). + + Although a canvas may appear to be similar to a widget with child + widgets, there are several notable differences: + + \list + \i Canvas items are usually much faster to manipulate and redraw than + child widgets, with the speed advantage becoming especially great when + there are \e many canvas items and non-rectangular items. In most + situations canvas items are also a lot more memory efficient than child + widgets. + + \i It's easy to detect overlapping items (collision detection). + + \i The canvas can be larger than a widget. A million-by-million canvas + is perfectly possible. At such a size a widget might be very + inefficient, and some window systems might not support it at all, + whereas TQCanvas scales well. Even with a billion pixels and a million + items, finding a particular canvas item, detecting collisions, etc., + is still fast (though the memory consumption may be prohibitive + at such extremes). + + \i Two or more TQCanvasView objects can view the same canvas. + + \i An arbitrary transformation matrix can be set on each TQCanvasView + which makes it easy to zoom, rotate or shear the viewed canvas. + + \i Widgets provide a lot more functionality, such as input (TQKeyEvent, + TQMouseEvent etc.) and layout management (TQGridLayout etc.). + + \endlist + + A canvas consists of a background, a number of canvas items organized by + x, y and z coordinates, and a foreground. A canvas item's z coordinate + can be treated as a layer number -- canvas items with a higher z + coordinate appear in front of canvas items with a lower z coordinate. + + The background is white by default, but can be set to a different color + using setBackgroundColor(), or to a repeated pixmap using + setBackgroundPixmap() or to a mosaic of smaller pixmaps using + setTiles(). Individual tiles can be set with setTile(). There + are corresponding get functions, e.g. backgroundColor() and + backgroundPixmap(). + + Note that TQCanvas does not inherit from TQWidget, even though it has some + functions which provide the same functionality as those in TQWidget. One + of these is setBackgroundPixmap(); some others are resize(), size(), + width() and height(). \l TQCanvasView is the widget used to display a + canvas on the screen. + + Canvas items are added to a canvas by constructing them and passing the + canvas to the canvas item's constructor. An item can be moved to a + different canvas using TQCanvasItem::setCanvas(). + + Canvas items are movable (and in the case of TQCanvasSprites, animated) + objects that inherit TQCanvasItem. Each canvas item has a position on the + canvas (x, y coordinates) and a height (z coordinate), all of which are + held as floating-point numbers. Moving canvas items also have x and y + velocities. It's possible for a canvas item to be outside the canvas + (for example TQCanvasItem::x() is greater than width()). When a canvas + item is off the canvas, onCanvas() returns FALSE and the canvas + disregards the item. (Canvas items off the canvas do not slow down any + of the common operations on the canvas.) + + Canvas items can be moved with TQCanvasItem::move(). The advance() + function moves all TQCanvasItem::animated() canvas items and + setAdvancePeriod() makes TQCanvas move them automatically on a periodic + basis. In the context of the TQCanvas classes, to `animate' a canvas item + is to set it in motion, i.e. using TQCanvasItem::setVelocity(). Animation + of a canvas item itself, i.e. items which change over time, is enabled + by calling TQCanvasSprite::setFrameAnimation(), or more generally by + subclassing and reimplementing TQCanvasItem::advance(). To detect collisions + use one of the TQCanvasItem::collisions() functions. + + The changed parts of the canvas are redrawn (if they are visible in a + canvas view) whenever update() is called. You can either call update() + manually after having changed the contents of the canvas, or force + periodic updates using setUpdatePeriod(). If you have moving objects on + the canvas, you must call advance() every time the objects should + move one step further. Periodic calls to advance() can be forced using + setAdvancePeriod(). The advance() function will call + TQCanvasItem::advance() on every item that is \link + TQCanvasItem::animated() animated\endlink and trigger an update of the + affected areas afterwards. (A canvas item that is `animated' is simply + a canvas item that is in motion.) + + TQCanvas organizes its canvas items into \e chunks; these are areas on + the canvas that are used to speed up most operations. Many operations + start by eliminating most chunks (i.e. those which haven't changed) + and then process only the canvas items that are in the few interesting + (i.e. changed) chunks. A valid chunk, validChunk(), is one which is on + the canvas. + + The chunk size is a key factor to TQCanvas's speed: if there are too many + chunks, the speed benefit of grouping canvas items into chunks is + reduced. If the chunks are too large, it takes too long to process each + one. The TQCanvas constructor tries to pick a suitable size, but you + can call retune() to change it at any time. The chunkSize() function + returns the current chunk size. The canvas items always make sure + they're in the right chunks; all you need to make sure of is that + the canvas uses the right chunk size. A good rule of thumb is that + the size should be a bit smaller than the average canvas item + size. If you have moving objects, the chunk size should be a bit + smaller than the average size of the moving items. + + The foreground is normally nothing, but if you reimplement + drawForeground(), you can draw things in front of all the canvas + items. + + Areas can be set as changed with setChanged() and set unchanged with + setUnchanged(). The entire canvas can be set as changed with + setAllChanged(). A list of all the items on the canvas is returned by + allItems(). + + An area can be copied (painted) to a TQPainter with drawArea(). + + If the canvas is resized it emits the resized() signal. + + The examples/canvas application and the 2D graphics page of the + examples/demo application demonstrate many of TQCanvas's facilities. + + \sa TQCanvasView TQCanvasItem +*/ +void TQCanvas::init(int w, int h, int chunksze, int mxclusters) +{ + d = new TQCanvasData; + awidth=w; + aheight=h; + chunksize=chunksze; + maxclusters=mxclusters; + chwidth=(w+chunksize-1)/chunksize; + chheight=(h+chunksize-1)/chunksize; + chunks=new TQCanvasChunk[chwidth*chheight]; + update_timer = 0; + bgcolor = white; + grid = 0; + htiles = 0; + vtiles = 0; + dblbuf = TRUE; + debug_redraw_areas = FALSE; +} + +/*! + Create a TQCanvas with no size. \a parent and \a name are passed to + the TQObject superclass. + + \warning You \e must call resize() at some time after creation to + be able to use the canvas. +*/ +TQCanvas::TQCanvas( TQObject* parent, const char* name ) + : TQObject( parent, name ) +{ + init(0,0); +} + +/*! + Constructs a TQCanvas that is \a w pixels wide and \a h pixels high. +*/ +TQCanvas::TQCanvas(int w, int h) +{ + init(w,h); +} + +/*! + Constructs a TQCanvas which will be composed of \a h tiles + horizontally and \a v tiles vertically. Each tile will be an image + \a tilewidth by \a tileheight pixels taken from pixmap \a p. + + The pixmap \a p is a list of tiles, arranged left to right, (and + in the case of pixmaps that have multiple rows of tiles, top to + bottom), with tile 0 in the top-left corner, tile 1 next to the + right, and so on, e.g. + + \table + \row \i 0 \i 1 \i 2 \i 3 + \row \i 4 \i 5 \i 6 \i 7 + \endtable + + The TQCanvas is initially sized to show exactly the given number of + tiles horizontally and vertically. If it is resized to be larger, + the entire matrix of tiles will be repeated as often as necessary + to cover the area. If it is smaller, tiles to the right and bottom + will not be visible. + + \sa setTiles() +*/ +TQCanvas::TQCanvas( TQPixmap p, + int h, int v, int tilewidth, int tileheight ) +{ + init(h*tilewidth, v*tileheight, scm(tilewidth,tileheight) ); + setTiles( p, h, v, tilewidth, tileheight ); +} + +void qt_unview(TQCanvas* c) +{ + for (TQCanvasView* view=c->d->viewList.first(); view != 0; view=c->d->viewList.next()) { + view->viewing = 0; + } +} + +/*! + Destroys the canvas and all the canvas's canvas items. +*/ +TQCanvas::~TQCanvas() +{ + qt_unview(this); + TQCanvasItemList all = allItems(); + for (TQCanvasItemList::Iterator it=all.begin(); it!=all.end(); ++it) + delete *it; + delete [] chunks; + delete [] grid; + delete d; +} + +/*! +\internal +Returns the chunk at a chunk position \a i, \a j. +*/ +TQCanvasChunk& TQCanvas::chunk(int i, int j) const +{ + return chunks[i+chwidth*j]; +} + +/*! +\internal +Returns the chunk at a pixel position \a x, \a y. +*/ +TQCanvasChunk& TQCanvas::chunkContaining(int x, int y) const +{ + return chunk(x/chunksize,y/chunksize); +} + +/*! + Returns a list of all the items in the canvas. +*/ +TQCanvasItemList TQCanvas::allItems() +{ + TQCanvasItemList list; + for (TQPtrDictIterator it=d->itemDict; it.currentKey(); ++it) { + list.prepend((TQCanvasItem*)it.currentKey()); + } + return list; +} + + +/*! + Changes the size of the canvas to have a width of \a w and a + height of \a h. This is a slow operation. +*/ +void TQCanvas::resize(int w, int h) +{ + if (awidth==w && aheight==h) + return; + + TQCanvasItem* item; + TQPtrList hidden; + for (TQPtrDictIterator it=d->itemDict; it.currentKey(); ++it) { + if (((TQCanvasItem*)it.currentKey())->isVisible()) { + ((TQCanvasItem*)it.currentKey())->hide(); + hidden.append(((TQCanvasItem*)it.currentKey())); + } + } + + int nchwidth=(w+chunksize-1)/chunksize; + int nchheight=(h+chunksize-1)/chunksize; + + TQCanvasChunk* newchunks = new TQCanvasChunk[nchwidth*nchheight]; + + // Commit the new values. + // + awidth=w; + aheight=h; + chwidth=nchwidth; + chheight=nchheight; + delete [] chunks; + chunks=newchunks; + + for (item=hidden.first(); item != 0; item=hidden.next()) { + item->show(); + } + + setAllChanged(); + + emit resized(); +} + +/*! + \fn void TQCanvas::resized() + + This signal is emitted whenever the canvas is resized. Each + TQCanvasView connects to this signal to keep the scrollview's size + correct. +*/ + +/*! + Change the efficiency tuning parameters to \a mxclusters clusters, + each of size \a chunksze. This is a slow operation if there are + many objects on the canvas. + + The canvas is divided into chunks which are rectangular areas \a + chunksze wide by \a chunksze high. Use a chunk size which is about + the average size of the canvas items. If you choose a chunk size + which is too small it will increase the amount of calculation + required when drawing since each change will affect many chunks. + If you choose a chunk size which is too large the amount of + drawing required will increase because for each change, a lot of + drawing will be required since there will be many (unchanged) + canvas items which are in the same chunk as the changed canvas + items. + + Internally, a canvas uses a low-resolution "chunk matrix" to keep + track of all the items in the canvas. A 64x64 chunk matrix is the + default for a 1024x1024 pixel canvas, where each chunk collects + canvas items in a 16x16 pixel square. This default is also + affected by setTiles(). You can tune this default using this + function. For example if you have a very large canvas and want to + trade off speed for memory then you might set the chunk size to 32 + or 64. + + The \a mxclusters argument is the number of rectangular groups of + chunks that will be separately drawn. If the canvas has a large + number of small, dispersed items, this should be about that + number. Our testing suggests that a large number of clusters is + almost always best. + +*/ +void TQCanvas::retune(int chunksze, int mxclusters) +{ + maxclusters=mxclusters; + + if ( chunksize!=chunksze ) { + TQPtrList hidden; + for (TQPtrDictIterator it=d->itemDict; it.currentKey(); ++it) { + if (((TQCanvasItem*)it.currentKey())->isVisible()) { + ((TQCanvasItem*)it.currentKey())->hide(); + hidden.append(((TQCanvasItem*)it.currentKey())); + } + } + + chunksize=chunksze; + + int nchwidth=(awidth+chunksize-1)/chunksize; + int nchheight=(aheight+chunksize-1)/chunksize; + + TQCanvasChunk* newchunks = new TQCanvasChunk[nchwidth*nchheight]; + + // Commit the new values. + // + chwidth=nchwidth; + chheight=nchheight; + delete [] chunks; + chunks=newchunks; + + for (TQCanvasItem* item=hidden.first(); item != 0; item=hidden.next()) { + item->show(); + } + } +} + +/*! + \fn int TQCanvas::width() const + + Returns the width of the canvas, in pixels. +*/ + +/*! + \fn int TQCanvas::height() const + + Returns the height of the canvas, in pixels. +*/ + +/*! + \fn TQSize TQCanvas::size() const + + Returns the size of the canvas, in pixels. +*/ + +/*! + \fn TQRect TQCanvas::rect() const + + Returns a rectangle the size of the canvas. +*/ + + +/*! + \fn bool TQCanvas::onCanvas( int x, int y ) const + + Returns TRUE if the pixel position (\a x, \a y) is on the canvas; + otherwise returns FALSE. + + \sa validChunk() +*/ + +/*! + \fn bool TQCanvas::onCanvas( const TQPoint& p ) const + \overload + + Returns TRUE if the pixel position \a p is on the canvas; + otherwise returns FALSE. + + \sa validChunk() +*/ + +/*! + \fn bool TQCanvas::validChunk( int x, int y ) const + + Returns TRUE if the chunk position (\a x, \a y) is on the canvas; + otherwise returns FALSE. + + \sa onCanvas() +*/ + +/*! + \fn bool TQCanvas::validChunk( const TQPoint& p ) const + \overload + + Returns TRUE if the chunk position \a p is on the canvas; otherwise + returns FALSE. + + \sa onCanvas() +*/ + +/*! + \fn int TQCanvas::chunkSize() const + + Returns the chunk size of the canvas. + + \sa retune() +*/ + +/*! +\fn bool TQCanvas::sameChunk(int x1, int y1, int x2, int y2) const +\internal +Tells if the points ( \a x1, \a y1 ) and ( \a x2, \a y2 ) are within the same chunk. +*/ + +/*! +\internal +This method adds an the item \a item to the list of TQCanvasItem objects +in the TQCanvas. The TQCanvasItem class calls this. +*/ +void TQCanvas::addItem(TQCanvasItem* item) +{ + d->itemDict.insert((void*)item,(void*)1); +} + +/*! +\internal +This method adds the item \a item to the list of TQCanvasItem objects +to be moved. The TQCanvasItem class calls this. +*/ +void TQCanvas::addAnimation(TQCanvasItem* item) +{ + d->animDict.insert((void*)item,(void*)1); +} + +/*! +\internal +This method adds the item \a item to the list of TQCanvasItem objects +which are no longer to be moved. The TQCanvasItem class calls this. +*/ +void TQCanvas::removeAnimation(TQCanvasItem* item) +{ + d->animDict.remove((void*)item); +} + +/*! +\internal +This method removes the item \a item from the list of TQCanvasItem objects +in this TQCanvas. The TQCanvasItem class calls this. +*/ +void TQCanvas::removeItem(TQCanvasItem* item) +{ + d->itemDict.remove((void*)item); +} + +/*! +\internal +This method adds the view \a view to the list of TQCanvasView objects +viewing this TQCanvas. The TQCanvasView class calls this. +*/ +void TQCanvas::addView(TQCanvasView* view) +{ + d->viewList.append(view); + if ( htiles>1 || vtiles>1 || pm.isNull() ) + view->viewport()->setBackgroundColor(backgroundColor()); +} + +/*! +\internal +This method removes the view \a view from the list of TQCanvasView objects +viewing this TQCanvas. The TQCanvasView class calls this. +*/ +void TQCanvas::removeView(TQCanvasView* view) +{ + d->viewList.removeRef(view); +} + +/*! + Sets the canvas to call advance() every \a ms milliseconds. Any + previous setting by setAdvancePeriod() or setUpdatePeriod() is + overridden. + + If \a ms is less than 0 advancing will be stopped. +*/ +void TQCanvas::setAdvancePeriod(int ms) +{ + if ( ms<0 ) { + if ( update_timer ) + update_timer->stop(); + } else { + if ( update_timer ) + delete update_timer; + update_timer = new TQTimer(this); + connect(update_timer,TQ_SIGNAL(timeout()),this,TQ_SLOT(advance())); + update_timer->start(ms); + } +} + +/*! + Sets the canvas to call update() every \a ms milliseconds. Any + previous setting by setAdvancePeriod() or setUpdatePeriod() is + overridden. + + If \a ms is less than 0 automatic updating will be stopped. +*/ +void TQCanvas::setUpdatePeriod(int ms) +{ + if ( ms<0 ) { + if ( update_timer ) + update_timer->stop(); + } else { + if ( update_timer ) + delete update_timer; + update_timer = new TQTimer(this); + connect(update_timer,TQ_SIGNAL(timeout()),this,TQ_SLOT(update())); + update_timer->start(ms); + } +} + +/*! + Moves all TQCanvasItem::animated() canvas items on the canvas and + refreshes all changes to all views of the canvas. (An `animated' + item is an item that is in motion; see setVelocity().) + + The advance takes place in two phases. In phase 0, the + TQCanvasItem::advance() function of each TQCanvasItem::animated() + canvas item is called with paramater 0. Then all these canvas + items are called again, with parameter 1. In phase 0, the canvas + items should not change position, merely examine other items on + the canvas for which special processing is required, such as + collisions between items. In phase 1, all canvas items should + change positions, ignoring any other items on the canvas. This + two-phase approach allows for considerations of "fairness", + although no TQCanvasItem subclasses supplied with TQt do anything + interesting in phase 0. + + The canvas can be configured to call this function periodically + with setAdvancePeriod(). + + \sa update() +*/ +void TQCanvas::advance() +{ + TQPtrDictIterator it=d->animDict; + while ( it.current() ) { + TQCanvasItem* i = (TQCanvasItem*)(void*)it.currentKey(); + ++it; + if ( i ) + i->advance(0); + } + // we expect the dict contains the exact same items as in the + // first pass. + it.toFirst(); + while ( it.current() ) { + TQCanvasItem* i = (TQCanvasItem*)(void*)it.currentKey(); + ++it; + if ( i ) + i->advance(1); + } + update(); +} + +// Don't call this unless you know what you're doing. +// p is in the content's co-ordinate example. +/*! + \internal +*/ +void TQCanvas::drawViewArea( TQCanvasView* view, TQPainter* p, const TQRect& vr, bool dbuf ) +{ + TQPoint tl = view->contentsToViewport(TQPoint(0,0)); + +#ifndef TQT_NO_TRANSFORMATIONS + TQWMatrix wm = view->worldMatrix(); + TQWMatrix iwm = wm.invert(); + // ivr = covers all chunks in vr + TQRect ivr = iwm.map(vr); + ivr.addCoords(-1, -1, 1, 1); + TQWMatrix twm; + twm.translate(tl.x(),tl.y()); +#else + TQRect ivr = vr; +#endif + + TQRect all(0,0,width(),height()); + + if ( !all.contains(ivr) ) { + // Need to clip with edge of canvas. + +#ifndef TQT_NO_TRANSFORMATIONS + // For translation-only transformation, it is safe to include the right + // and bottom edges, but otherwise, these must be excluded since they + // are not precisely defined (different bresenham paths). + TQPointArray a; + if ( wm.m12()==0.0 && wm.m21()==0.0 && wm.m11() == 1.0 && wm.m22() == 1.0 ) + a = TQPointArray( TQRect(all.x(),all.y(),all.width()+1,all.height()+1) ); + else + a = TQPointArray( all ); + + a = (wm*twm).map(a); +#else + TQPointArray a( TQRect(all.x(),all.y(),all.width()+1,all.height()+1) ); +#endif + if ( view->viewport()->backgroundMode() == NoBackground ) { + TQRect cvr = vr; cvr.moveBy(tl.x(),tl.y()); + p->setClipRegion(TQRegion(cvr)-TQRegion(a)); + p->fillRect(vr,view->viewport()->palette() + .brush(TQPalette::Active,TQColorGroup::Background)); + } + p->setClipRegion(a); + } + + if ( dbuf ) { + offscr = TQPixmap(vr.size().expandedTo(TQSize(1, 1))); +#ifdef TQ_WS_X11 + offscr.x11SetScreen(p->device()->x11Screen()); +#endif + TQPainter dbp(&offscr); +#ifndef TQT_NO_TRANSFORMATIONS + twm.translate(-vr.x(),-vr.y()); + twm.translate(-tl.x(),-tl.y()); + dbp.setWorldMatrix( wm*twm, TRUE ); +#else + dbp.translate(-vr.x()-tl.x(),-vr.y()-tl.y()); +#endif + dbp.setClipRect(0,0,vr.width(), vr.height()); + drawCanvasArea(ivr,&dbp,FALSE); + dbp.end(); + p->drawPixmap(vr.x(), vr.y(), offscr, 0, 0, vr.width(), vr.height()); + } else { + TQRect r = vr; r.moveBy(tl.x(),tl.y()); // move to untransformed co-ords + if ( !all.contains(ivr) ) { + TQRegion inside = p->clipRegion() & r; + //TQRegion outside = p->clipRegion() - r; + //p->setClipRegion(outside); + //p->fillRect(outside.boundingRect(),red); + p->setClipRegion(inside); + } else { + p->setClipRect(r); + } +#ifndef TQT_NO_TRANSFORMATIONS + p->setWorldMatrix( wm*twm ); +#else +#endif + p->setBrushOrigin(tl.x(), tl.y()); + drawCanvasArea(ivr,p,FALSE); + } +} + +/*! + Repaints changed areas in all views of the canvas. + + \sa advance() +*/ +void TQCanvas::update() +{ + TQCanvasClusterizer clusterizer(d->viewList.count()); +#ifndef TQT_NO_TRANSFORMATIONS + TQPtrList doneareas; + doneareas.setAutoDelete(TRUE); +#endif + + TQPtrListIterator it(d->viewList); + TQCanvasView* view; + while( (view=it.current()) != 0 ) { + ++it; +#ifndef TQT_NO_TRANSFORMATIONS + TQWMatrix wm = view->worldMatrix(); +#endif + TQRect area(view->contentsX(),view->contentsY(), + view->visibleWidth(),view->visibleHeight()); + if (area.width()>0 && area.height()>0) { +#ifndef TQT_NO_TRANSFORMATIONS + if ( !wm.isIdentity() ) { + // r = Visible area of the canvas where there are changes + TQRect r = changeBounds(view->inverseWorldMatrix().map(area)); + if ( !r.isEmpty() ) { + TQPainter p(view->viewport()); + // Translate to the coordinate system of drawViewArea(). + TQPoint tl = view->contentsToViewport(TQPoint(0,0)); + p.translate(tl.x(),tl.y()); + drawViewArea( view, &p, wm.map(r), dblbuf ); + doneareas.append(new TQRect(r)); + } + } else +#endif + { + clusterizer.add(area); + } + } + } + + for (int i=0; ichwidth) + mx=chwidth; + if (my>chheight) + my=chheight; + + int x=thearea.x()/chunksize; + while( xchwidth) + mx=chwidth; + if (my>chheight) + my=chheight; + + int x=thearea.x()/chunksize; + while( x chwidth) + mx=chwidth; + if (my > chheight) + my=chheight; + + TQRect result; + + int x=area.x()/chunksize; + while( x chwidth) + mx=chwidth; + if (my > chheight) + my=chheight; + + int x=area.x()/chunksize; + while( xviewList.first() && !p) return; // Nothing to do. + + int lx=area.x()/chunksize; + int ly=area.y()/chunksize; + int mx=area.right()/chunksize; + int my=area.bottom()/chunksize; + if (mx>=chwidth) + mx=chwidth-1; + if (my>=chheight) + my=chheight-1; + + TQCanvasItemList allvisible; + + // Stores the region within area that need to be drawn. It is relative + // to area.topLeft() (so as to keep within bounds of 16-bit XRegions) + TQRegion rgn; + + for (int x=lx; x<=mx; x++) { + for (int y=ly; y<=my; y++) { + // Only reset change if all views updating, and + // wholy within area. (conservative: ignore entire boundary) + // + // Disable this to help debugging. + // + if (!p) { + if ( chunk(x,y).takeChange() ) { + // ### should at least make bands + rgn |= TQRegion(x*chunksize-area.x(),y*chunksize-area.y(), + chunksize,chunksize); + allvisible += *chunk(x,y).listPtr(); + } + } else { + allvisible += *chunk(x,y).listPtr(); + } + } + } + allvisible.sort(); + + if ( double_buffer ) { + offscr = TQPixmap(area.size().expandedTo(TQSize(1, 1))); +#ifdef TQ_WS_X11 + if (p) + offscr.x11SetScreen(p->device()->x11Screen()); +#endif + } + + if ( double_buffer && !offscr.isNull() ) { + TQPainter painter; + painter.begin(&offscr); + painter.translate(-area.x(),-area.y()); + painter.setBrushOrigin(-area.x(),-area.y()); + if ( p ) { + painter.setClipRect(TQRect(0,0,area.width(),area.height())); + } else { + painter.setClipRegion(rgn); + } + drawBackground(painter,area); + allvisible.drawUnique(painter); + drawForeground(painter,area); + painter.end(); + if ( p ) { + p->drawPixmap( area.x(), area.y(), offscr, + 0, 0, area.width(), area.height() ); + return; + } + } else if ( p ) { + drawBackground(*p,area); + allvisible.drawUnique(*p); + drawForeground(*p,area); + return; + } + + TQPoint trtr; // keeps track of total translation of rgn + + trtr -= area.topLeft(); + + for (TQCanvasView* view=d->viewList.first(); view; view=d->viewList.next()) { +#ifndef TQT_NO_TRANSFORMATIONS + if ( !view->worldMatrix().isIdentity() ) + continue; // Cannot paint those here (see callers). +#endif + TQPainter painter(view->viewport()); + TQPoint tr = view->contentsToViewport(area.topLeft()); + TQPoint nrtr = view->contentsToViewport(TQPoint(0,0)); // new translation + TQPoint rtr = nrtr - trtr; // extra translation of rgn + trtr += rtr; // add to total + if (double_buffer) { + rgn.translate(rtr.x(),rtr.y()); + painter.setClipRegion(rgn); + painter.drawPixmap(tr,offscr, TQRect(TQPoint(0,0),area.size())); + } else { + painter.translate(nrtr.x(),nrtr.y()); + rgn.translate(rtr.x(),rtr.y()); + painter.setClipRegion(rgn); + drawBackground(painter,area); + allvisible.drawUnique(painter); + drawForeground(painter,area); + painter.translate(-nrtr.x(),-nrtr.y()); + } + } +} + +/*! +\internal +This method to informs the TQCanvas that a given chunk is +`dirty' and needs to be redrawn in the next Update. + +(\a x,\a y) is a chunk location. + +The sprite classes call this. Any new derived class of TQCanvasItem +must do so too. SetChangedChunkContaining can be used instead. +*/ +void TQCanvas::setChangedChunk(int x, int y) +{ + if (validChunk(x,y)) { + TQCanvasChunk& ch=chunk(x,y); + ch.change(); + } +} + +/*! +\internal +This method to informs the TQCanvas that the chunk containing a given +pixel is `dirty' and needs to be redrawn in the next Update. + +(\a x,\a y) is a pixel location. + +The item classes call this. Any new derived class of TQCanvasItem must +do so too. SetChangedChunk can be used instead. +*/ +void TQCanvas::setChangedChunkContaining(int x, int y) +{ + if (x>=0 && x=0 && y=0 && x=0 && y=0 && x=0 && yviewList.first(); + while ( view != 0 ) { + /* XXX this doesn't look right. Shouldn't this + be more like setBackgroundPixmap? : Ian */ + view->viewport()->setEraseColor( bgcolor ); + view=d->viewList.next(); + } + setAllChanged(); + } +} + +/*! + Returns the pixmap set by setBackgroundPixmap(). By default, + this is a null pixmap. + + \sa setBackgroundPixmap(), backgroundColor() +*/ +TQPixmap TQCanvas::backgroundPixmap() const +{ + return pm; +} + +/*! + Sets the solid background to be the pixmap \a p repeated as + necessary to cover the entire canvas. + + \sa backgroundPixmap(), setBackgroundColor(), setTiles() +*/ +void TQCanvas::setBackgroundPixmap( const TQPixmap& p ) +{ + setTiles(p, 1, 1, p.width(), p.height()); + TQCanvasView* view = d->viewList.first(); + while ( view != 0 ) { + view->updateContents(); + view = d->viewList.next(); + } +} + +/*! + This virtual function is called for all updates of the canvas. It + renders any background graphics using the painter \a painter, in + the area \a clip. If the canvas has a background pixmap or a tiled + background, that graphic is used, otherwise the canvas is cleared + using the background color. + + If the graphics for an area change, you must explicitly call + setChanged(const TQRect&) for the result to be visible when + update() is next called. + + \sa setBackgroundColor(), setBackgroundPixmap(), setTiles() +*/ +void TQCanvas::drawBackground(TQPainter& painter, const TQRect& clip) +{ + if ( pm.isNull() ) { + painter.fillRect(clip,bgcolor); + } else if ( !grid ) { + for (int x=clip.x()/pm.width(); + x<(clip.x()+clip.width()+pm.width()-1)/pm.width(); x++) + { + for (int y=clip.y()/pm.height(); + y<(clip.y()+clip.height()+pm.height()-1)/pm.height(); y++) + { + painter.drawPixmap(x*pm.width(), y*pm.height(),pm); + } + } + } else { + const int x1 = clip.left()/tilew; + int x2 = clip.right()/tilew; + const int y1 = clip.top()/tileh; + int y2 = clip.bottom()/tileh; + + const int roww = pm.width()/tilew; + + for (int j=y1; j<=y2; j++) { + int jj = j%tilesVertically(); + for (int i=x1; i<=x2; i++) { + int t = tile(i%tilesHorizontally(), jj); + int tx = t % roww; + int ty = t / roww; + painter.drawPixmap( i*tilew, j*tileh, pm, + tx*tilew, ty*tileh, tilew, tileh ); + } + } + } +} + +/*! + This virtual function is called for all updates of the canvas. It + renders any foreground graphics using the painter \a painter, in + the area \a clip. + + If the graphics for an area change, you must explicitly call + setChanged(const TQRect&) for the result to be visible when + update() is next called. + + The default is to draw nothing. +*/ +void TQCanvas::drawForeground(TQPainter& painter, const TQRect& clip) +{ + if ( debug_redraw_areas ) { + painter.setPen(red); + painter.setBrush(NoBrush); + painter.drawRect(clip); + } +} + +/*! + If \a y is TRUE (the default) double-buffering is switched on; + otherwise double-buffering is switched off. + + Turning off double-buffering causes the redrawn areas to flicker a + little and also gives a (usually small) performance improvement. +*/ +void TQCanvas::setDoubleBuffering(bool y) +{ + dblbuf = y; +} + + +/*! + Sets the TQCanvas to be composed of \a h tiles horizontally and \a + v tiles vertically. Each tile will be an image \a tilewidth by \a + tileheight pixels from pixmap \a p. + + The pixmap \a p is a list of tiles, arranged left to right, (and + in the case of pixmaps that have multiple rows of tiles, top to + bottom), with tile 0 in the top-left corner, tile 1 next to the + right, and so on, e.g. + + \table + \row \i 0 \i 1 \i 2 \i 3 + \row \i 4 \i 5 \i 6 \i 7 + \endtable + + If the canvas is larger than the matrix of tiles, the entire + matrix is repeated as necessary to cover the whole canvas. If it + is smaller, tiles to the right and bottom are not visible. + + The width and height of \a p must be a multiple of \a tilewidth + and \a tileheight. If they are not the function will do nothing. + + If you want to unset any tiling set, then just pass in a null + pixmap and 0 for \a h, \a v, \a tilewidth, and + \a tileheight. +*/ +void TQCanvas::setTiles( TQPixmap p, + int h, int v, int tilewidth, int tileheight ) +{ + if ( !p.isNull() && (!tilewidth || !tileheight || + p.width() % tilewidth != 0 || p.height() % tileheight != 0 ) ) + return; + + htiles = h; + vtiles = v; + delete[] grid; + pm = p; + if ( h && v && !p.isNull() ) { + grid = new ushort[h*v]; + memset( grid, 0, h*v*sizeof(ushort) ); + tilew = tilewidth; + tileh = tileheight; + } else { + grid = 0; + } + if ( h + v > 10 ) { + int s = scm(tilewidth,tileheight); + retune( s < 128 ? s : TQMAX(tilewidth,tileheight) ); + } + setAllChanged(); +} + +/*! + \fn int TQCanvas::tile( int x, int y ) const + + Returns the tile at position (\a x, \a y). Initially, all tiles + are 0. + + The parameters must be within range, i.e. + 0 \< \a x \< tilesHorizontally() and + 0 \< \a y \< tilesVertically(). + + \sa setTile() +*/ + +/*! + \fn int TQCanvas::tilesHorizontally() const + + Returns the number of tiles horizontally. +*/ + +/*! + \fn int TQCanvas::tilesVertically() const + + Returns the number of tiles vertically. +*/ + +/*! + \fn int TQCanvas::tileWidth() const + + Returns the width of each tile. +*/ + +/*! + \fn int TQCanvas::tileHeight() const + + Returns the height of each tile. +*/ + + +/*! + Sets the tile at (\a x, \a y) to use tile number \a tilenum, which + is an index into the tile pixmaps. The canvas will update + appropriately when update() is next called. + + The images are taken from the pixmap set by setTiles() and are + arranged left to right, (and in the case of pixmaps that have + multiple rows of tiles, top to bottom), with tile 0 in the + top-left corner, tile 1 next to the right, and so on, e.g. + + \table + \row \i 0 \i 1 \i 2 \i 3 + \row \i 4 \i 5 \i 6 \i 7 + \endtable + + \sa tile() setTiles() +*/ +void TQCanvas::setTile( int x, int y, int tilenum ) +{ + ushort& t = grid[x+y*htiles]; + if ( t != tilenum ) { + t = tilenum; + if ( tilew == tileh && tilew == chunksize ) + setChangedChunk( x, y ); // common case + else + setChanged( TQRect(x*tilew,y*tileh,tilew,tileh) ); + } +} + + +// lesser-used data in canvas item, plus room for extension. +// Be careful adding to this - check all usages. +class TQCanvasItemExtra { + TQCanvasItemExtra() : vx(0.0), vy(0.0) { } + double vx,vy; + friend class TQCanvasItem; +}; + + +/*! + \class TQCanvasItem tqcanvas.h + \brief The TQCanvasItem class provides an abstract graphic object on a TQCanvas. +\if defined(commercial) + It is part of the TQt Enterprise Edition. +\endif + + \module canvas + \ingroup graphics + \ingroup images + + A variety of TQCanvasItem subclasses provide immediately usable + behaviour. This class is a pure abstract superclass providing the + behaviour that is shared among all the concrete canvas item classes. + TQCanvasItem is not intended for direct subclassing. It is much easier + to subclass one of its subclasses, e.g. TQCanvasPolygonalItem (the + commonest base class), TQCanvasRectangle, TQCanvasSprite, TQCanvasEllipse + or TQCanvasText. + + Canvas items are added to a canvas by constructing them and passing the + canvas to the canvas item's constructor. An item can be moved to a + different canvas using setCanvas(). + + Items appear on the canvas after their \link show() show()\endlink + function has been called (or \link setVisible() + setVisible(TRUE)\endlink), and \e after update() has been called. The + canvas only shows items that are \link setVisible() visible\endlink, + and then only if \l update() is called. If you created the canvas + without passing a width and height to the constructor you'll also need + to call \link TQCanvas::resize() resize()\endlink. Since the canvas + background defaults to white and canvas items default to white, + you may need to change colors to see your items. + + A TQCanvasItem object can be moved in the x(), y() and z() dimensions + using functions such as move(), moveBy(), setX(), setY() and setZ(). A + canvas item can be set in motion, `animated', using setAnimated() and + given a velocity in the x and y directions with setXVelocity() and + setYVelocity() -- the same effect can be achieved by calling + setVelocity(). Use the collidesWith() function to see if the canvas item + will collide on the \e next advance(1) and use collisions() to see what + collisions have occurred. + + Use TQCanvasSprite or your own subclass of TQCanvasSprite to create canvas + items which are animated, i.e. which change over time. + + The size of a canvas item is given by boundingRect(). Use + boundingRectAdvanced() to see what the size of the canvas item will be + \e after the next advance(1) call. + + The rtti() function is used for identifying subclasses of TQCanvasItem. + The canvas() function returns a pointer to the canvas which contains the + canvas item. + + TQCanvasItem provides the show() and isVisible() functions like those in + TQWidget. + + TQCanvasItem also provides the setEnabled(), setActive() and + setSelected() functions; these functions set the relevant boolean and + cause a repaint but the boolean values they set are not used in + TQCanvasItem itself. You can make use of these booleans in your subclasses. + + By default, canvas items have no velocity, no size, and are not in + motion. The subclasses provided in TQt do not change these defaults + except where noted. + +*/ + +/*! + \enum TQCanvasItem::RttiValues + + This enum is used to name the different types of canvas item. + + \value Rtti_Item Canvas item abstract base class + \value Rtti_Ellipse + \value Rtti_Line + \value Rtti_Polygon + \value Rtti_PolygonalItem + \value Rtti_Rectangle + \value Rtti_Spline + \value Rtti_Sprite + \value Rtti_Text + +*/ + +/*! + \fn void TQCanvasItem::update() + + Call this function to repaint the canvas's changed chunks. +*/ + +/*! + Constructs a TQCanvasItem on canvas \a canvas. + + \sa setCanvas() +*/ +TQCanvasItem::TQCanvasItem(TQCanvas* canvas) : + cnv(canvas), + myx(0),myy(0),myz(0) +{ + ani=0; + vis=0; + val=0; + sel=0; + ena=0; + act=0; + + ext = 0; + if (cnv) cnv->addItem(this); +} + +/*! + Destroys the TQCanvasItem and removes it from its canvas. +*/ +TQCanvasItem::~TQCanvasItem() +{ + if (cnv) { + cnv->removeItem(this); + cnv->removeAnimation(this); + } + delete ext; +} + +TQCanvasItemExtra& TQCanvasItem::extra() +{ + if ( !ext ) + ext = new TQCanvasItemExtra; + return *ext; +} + +/*! + \fn double TQCanvasItem::x() const + + Returns the horizontal position of the canvas item. Note that + subclasses often have an origin other than the top-left corner. +*/ + +/*! + \fn double TQCanvasItem::y() const + + Returns the vertical position of the canvas item. Note that + subclasses often have an origin other than the top-left corner. +*/ + +/*! + \fn double TQCanvasItem::z() const + + Returns the z index of the canvas item, which is used for visual + order: higher-z items obscure (are in front of) lower-z items. +*/ + +/*! + \fn void TQCanvasItem::setX(double x) + + Moves the canvas item so that its x-position is \a x. + + \sa x(), move() +*/ + +/*! + \fn void TQCanvasItem::setY(double y) + + Moves the canvas item so that its y-position is \a y. + + \sa y(), move() +*/ + +/*! + \fn void TQCanvasItem::setZ(double z) + + Sets the z index of the canvas item to \a z. Higher-z items + obscure (are in front of) lower-z items. + + \sa z(), move() +*/ + + +/*! + Moves the canvas item relative to its current position by (\a dx, + \a dy). +*/ +void TQCanvasItem::moveBy( double dx, double dy ) +{ + if ( dx || dy ) { + removeFromChunks(); + myx += dx; + myy += dy; + addToChunks(); + } +} + + +/*! + Moves the canvas item to the absolute position (\a x, \a y). +*/ +void TQCanvasItem::move( double x, double y ) +{ + moveBy( x-myx, y-myy ); +} + + +/*! + Returns TRUE if the canvas item is in motion; otherwise returns + FALSE. + + \sa setVelocity(), setAnimated() +*/ +bool TQCanvasItem::animated() const +{ + return (bool)ani; +} + +/*! + Sets the canvas item to be in motion if \a y is TRUE, or not if \a + y is FALSE. The speed and direction of the motion is set with + setVelocity(), or with setXVelocity() and setYVelocity(). + + \sa advance(), TQCanvas::advance() +*/ +void TQCanvasItem::setAnimated(bool y) +{ + if ( y != (bool)ani ) { + ani = (uint)y; + if ( y ) { + cnv->addAnimation(this); + } else { + cnv->removeAnimation(this); + } + } +} + +/*! + \fn void TQCanvasItem::setXVelocity( double vx ) + + Sets the horizontal component of the canvas item's velocity to \a vx. + + \sa setYVelocity() setVelocity() +*/ + +/*! + \fn void TQCanvasItem::setYVelocity( double vy ) + + Sets the vertical component of the canvas item's velocity to \a vy. + + \sa setXVelocity() setVelocity() +*/ + +/*! + Sets the canvas item to be in motion, moving by \a vx and \a vy + pixels in the horizontal and vertical directions respectively. + + \sa advance() setXVelocity() setYVelocity() +*/ +void TQCanvasItem::setVelocity( double vx, double vy) +{ + if ( ext || vx!=0.0 || vy!=0.0 ) { + if ( !ani ) + setAnimated(TRUE); + extra().vx = vx; + extra().vy = vy; + } +} + +/*! + Returns the horizontal velocity component of the canvas item. +*/ +double TQCanvasItem::xVelocity() const +{ + return ext ? ext->vx : 0; +} + +/*! + Returns the vertical velocity component of the canvas item. +*/ +double TQCanvasItem::yVelocity() const +{ + return ext ? ext->vy : 0; +} + +/*! + The default implementation moves the canvas item, if it is + animated(), by the preset velocity if \a phase is 1, and does + nothing if \a phase is 0. + + Note that if you reimplement this function, the reimplementation + must not change the canvas in any way, for example it must not add + or remove items. + + \sa TQCanvas::advance() setVelocity() +*/ +void TQCanvasItem::advance(int phase) +{ + if ( ext && phase==1 ) + moveBy(ext->vx,ext->vy); +} + +/*! + \fn void TQCanvasItem::draw(TQPainter& painter) + + This abstract virtual function draws the canvas item using \a painter. + + \warning When you reimplement this function, make sure that you + leave the painter in the same state as you found it. For example, + if you start by calling TQPainter::translate(50, 50), end your + code by calling TQPainter::translate(-50, -50). Be also aware that + the painter might already have some transformations set (i.e., + don't call TQPainter::resetXForm() when you're done). +*/ + +/*! + Sets the TQCanvas upon which the canvas item is to be drawn to \a c. + + \sa canvas() +*/ +void TQCanvasItem::setCanvas(TQCanvas* c) +{ + bool v=isVisible(); + setVisible(FALSE); + if (cnv) { + if (ext) + cnv->removeAnimation(this); + cnv->removeItem(this); + } + cnv=c; + if (cnv) { + cnv->addItem(this); + if ( ext ) + cnv->addAnimation(this); + } + setVisible(v); +} + +/*! + \fn TQCanvas* TQCanvasItem::canvas() const + + Returns the canvas containing the canvas item. +*/ + +/*! Shorthand for setVisible(TRUE). */ +void TQCanvasItem::show() +{ + setVisible(TRUE); +} + +/*! Shorthand for setVisible(FALSE). */ +void TQCanvasItem::hide() +{ + setVisible(FALSE); +} + +/*! + Makes the canvas item visible if \a yes is TRUE, or invisible if + \a yes is FALSE. The change takes effect when TQCanvas::update() is + next called. +*/ +void TQCanvasItem::setVisible(bool yes) +{ + if ((bool)vis!=yes) { + if (yes) { + vis=(uint)yes; + addToChunks(); + } else { + removeFromChunks(); + vis=(uint)yes; + } + } +} +/*! + \obsolete + \fn bool TQCanvasItem::visible() const + Use isVisible() instead. +*/ + +/*! + \fn bool TQCanvasItem::isVisible() const + + Returns TRUE if the canvas item is visible; otherwise returns + FALSE. + + Note that in this context TRUE does \e not mean that the canvas + item is currently in a view, merely that if a view is showing the + area where the canvas item is positioned, and the item is not + obscured by items with higher z values, and the view is not + obscured by overlaying windows, it would be visible. + + \sa setVisible(), z() +*/ + +/*! + \obsolete + \fn bool TQCanvasItem::selected() const + Use isSelected() instead. +*/ + +/*! + \fn bool TQCanvasItem::isSelected() const + + Returns TRUE if the canvas item is selected; otherwise returns FALSE. +*/ + +/*! + Sets the selected flag of the item to \a yes. If this changes the + item's selected state the item will be redrawn when + TQCanvas::update() is next called. + + The TQCanvas, TQCanvasItem and the TQt-supplied TQCanvasItem + subclasses do not make use of this value. The setSelected() + function is supplied because many applications need it, but it is + up to you how you use the isSelected() value. +*/ +void TQCanvasItem::setSelected(bool yes) +{ + if ((bool)sel!=yes) { + sel=(uint)yes; + changeChunks(); + } +} + +/*! + \obsolete + \fn bool TQCanvasItem::enabled() const + Use isEnabled() instead. +*/ + +/*! + \fn bool TQCanvasItem::isEnabled() const + + Returns TRUE if the TQCanvasItem is enabled; otherwise returns FALSE. +*/ + +/*! + Sets the enabled flag of the item to \a yes. If this changes the + item's enabled state the item will be redrawn when + TQCanvas::update() is next called. + + The TQCanvas, TQCanvasItem and the TQt-supplied TQCanvasItem + subclasses do not make use of this value. The setEnabled() + function is supplied because many applications need it, but it is + up to you how you use the isEnabled() value. +*/ +void TQCanvasItem::setEnabled(bool yes) +{ + if (ena!=(uint)yes) { + ena=(uint)yes; + changeChunks(); + } +} + +/*! + \obsolete + \fn bool TQCanvasItem::active() const + Use isActive() instead. +*/ + +/*! + \fn bool TQCanvasItem::isActive() const + + Returns TRUE if the TQCanvasItem is active; otherwise returns FALSE. +*/ + +/*! + Sets the active flag of the item to \a yes. If this changes the + item's active state the item will be redrawn when + TQCanvas::update() is next called. + + The TQCanvas, TQCanvasItem and the TQt-supplied TQCanvasItem + subclasses do not make use of this value. The setActive() function + is supplied because many applications need it, but it is up to you + how you use the isActive() value. +*/ +void TQCanvasItem::setActive(bool yes) +{ + if (act!=(uint)yes) { + act=(uint)yes; + changeChunks(); + } +} + +bool qt_testCollision(const TQCanvasSprite* s1, const TQCanvasSprite* s2) +{ + const TQImage* s2image = s2->imageAdvanced()->collision_mask; + TQRect s2area = s2->boundingRectAdvanced(); + + TQRect cyourarea(s2area.x(),s2area.y(), + s2area.width(),s2area.height()); + + TQImage* s1image=s1->imageAdvanced()->collision_mask; + + TQRect s1area = s1->boundingRectAdvanced(); + + TQRect ourarea = s1area.intersect(cyourarea); + + if ( ourarea.isEmpty() ) + return FALSE; + + int x2=ourarea.x()-cyourarea.x(); + int y2=ourarea.y()-cyourarea.y(); + int x1=ourarea.x()-s1area.x(); + int y1=ourarea.y()-s1area.y(); + int w=ourarea.width(); + int h=ourarea.height(); + + if ( !s2image ) { + if ( !s1image ) + return w>0 && h>0; + // swap everything around + int t; + t=x1; x1=x2; x2=t; + t=y1; x1=y2; y2=t; + s2image = s1image; + s1image = 0; + } + + // s2image != 0 + + // A non-linear search may be more efficient. + // Perhaps spiralling out from the center, or a simpler + // vertical expansion from the centreline. + + // We assume that sprite masks don't have + // different bit orders. + // + // Q_ASSERT(s1image->bitOrder()==s2image->bitOrder()); + + if (s1image) { + if (s1image->bitOrder() == TQImage::LittleEndian) { + for (int j=0; jscanLine(y1+j); + uchar* yl = s2image->scanLine(y2+j); + for (int i=0; i> 3)) & (1 << ((x2+i) & 7)) + && *(ml + ((x1+i) >> 3)) & (1 << ((x1+i) & 7))) + { + return TRUE; + } + } + } + } else { + for (int j=0; jscanLine(y1+j); + uchar* yl = s2image->scanLine(y2+j); + for (int i=0; i> 3)) & (1 << (7-((x2+i) & 7))) + && *(ml + ((x1+i) >> 3)) & (1 << (7-((x1+i) & 7)))) + { + return TRUE; + } + } + } + } + } else { + if (s2image->bitOrder() == TQImage::LittleEndian) { + for (int j=0; jscanLine(y2+j); + for (int i=0; i> 3)) & (1 << ((x2+i) & 7))) + { + return TRUE; + } + } + } + } else { + for (int j=0; jscanLine(y2+j); + for (int i=0; i> 3)) & (1 << (7-((x2+i) & 7)))) + { + return TRUE; + } + } + } + } + } + + return FALSE; +} + +static bool collision_double_dispatch( const TQCanvasSprite* s1, + const TQCanvasPolygonalItem* p1, + const TQCanvasRectangle* r1, + const TQCanvasEllipse* e1, + const TQCanvasText* t1, + const TQCanvasSprite* s2, + const TQCanvasPolygonalItem* p2, + const TQCanvasRectangle* r2, + const TQCanvasEllipse* e2, + const TQCanvasText* t2 ) +{ + const TQCanvasItem* i1 = s1 ? + (const TQCanvasItem*)s1 : p1 ? + (const TQCanvasItem*)p1 : r1 ? + (const TQCanvasItem*)r1 : e1 ? + (const TQCanvasItem*)e1 : (const TQCanvasItem*)t1; + const TQCanvasItem* i2 = s2 ? + (const TQCanvasItem*)s2 : p2 ? + (const TQCanvasItem*)p2 : r2 ? + (const TQCanvasItem*)r2 : e2 ? + (const TQCanvasItem*)e2 : (const TQCanvasItem*)t2; + + if ( s1 && s2 ) { + // a + return qt_testCollision(s1,s2); + } else if ( (r1 || t1 || s1) && (r2 || t2 || s2) ) { + // b + TQRect rc1 = i1->boundingRectAdvanced(); + TQRect rc2 = i2->boundingRectAdvanced(); + return rc1.intersects(rc2); + } else if ( e1 && e2 + && e1->angleLength()>=360*16 && e2->angleLength()>=360*16 + && e1->width()==e1->height() + && e2->width()==e2->height() ) { + // c + double xd = (e1->x()+e1->xVelocity())-(e2->x()+e1->xVelocity()); + double yd = (e1->y()+e1->yVelocity())-(e2->y()+e1->yVelocity()); + double rd = (e1->width()+e2->width())/2; + return xd*xd+yd*yd <= rd*rd; + } else if ( p1 && (p2 || s2 || t2) ) { + // d + TQPointArray pa1 = p1->areaPointsAdvanced(); + TQPointArray pa2 = p2 ? p2->areaPointsAdvanced() + : TQPointArray(i2->boundingRectAdvanced()); + bool col= !(TQRegion(pa1) & TQRegion(pa2,TRUE)).isEmpty(); + + return col; + } else { + return collision_double_dispatch(s2,p2,r2,e2,t2, + s1,p1,r1,e1,t1); + } +} + +/*! + \fn bool TQCanvasItem::collidesWith( const TQCanvasItem* other ) const + + Returns TRUE if the canvas item will collide with the \a other + item \e after they have moved by their current velocities; + otherwise returns FALSE. + + \sa collisions() +*/ + + +/*! + \class TQCanvasSprite tqcanvas.h + \brief The TQCanvasSprite class provides an animated canvas item on a TQCanvas. +\if defined(commercial) + It is part of the TQt Enterprise Edition. +\endif + + \module canvas + \ingroup graphics + \ingroup images + + A canvas sprite is an object which can contain any number of images + (referred to as frames), only one of which is current, i.e. + displayed, at any one time. The images can be passed in the + constructor or set or changed later with setSequence(). If you + subclass TQCanvasSprite you can change the frame that is displayed + periodically, e.g. whenever TQCanvasItem::advance(1) is called to + create the effect of animation. + + The current frame can be set with setFrame() or with move(). The + number of frames available is given by frameCount(). The bounding + rectangle of the current frame is returned by boundingRect(). + + The current frame's image can be retrieved with image(); use + imageAdvanced() to retrieve the image for the frame that will be + shown after advance(1) is called. Use the image() overload passing + it an integer index to retrieve a particular image from the list of + frames. + + Use width() and height() to retrieve the dimensions of the current + frame. + + Use leftEdge() and rightEdge() to retrieve the current frame's + left-hand and right-hand x-coordinates respectively. Use + bottomEdge() and topEdge() to retrieve the current frame's bottom + and top y-coordinates respectively. These functions have an overload + which will accept an integer frame number to retrieve the + coordinates of a particular frame. + + TQCanvasSprite draws very quickly, at the expense of memory. + + The current frame's image can be drawn on a painter with draw(). + + Like any other canvas item, canvas sprites can be moved with + move() which sets the x and y coordinates and the frame number, as + well as with TQCanvasItem::move() and TQCanvasItem::moveBy(), or by + setting coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() + and TQCanvasItem::setZ(). + +*/ + + +/*! + \reimp +*/ +bool TQCanvasSprite::collidesWith( const TQCanvasItem* i ) const +{ + return i->collidesWith(this,0,0,0,0); +} + +/*! + Returns TRUE if the canvas item collides with any of the given + items; otherwise returns FALSE. The parameters, \a s, \a p, \a r, + \a e and \a t, are all the same object, this is just a type + resolution trick. +*/ +bool TQCanvasSprite::collidesWith( const TQCanvasSprite* s, + const TQCanvasPolygonalItem* p, + const TQCanvasRectangle* r, + const TQCanvasEllipse* e, + const TQCanvasText* t ) const +{ + return collision_double_dispatch(s,p,r,e,t,this,0,0,0,0); +} + +/*! + \reimp +*/ +bool TQCanvasPolygonalItem::collidesWith( const TQCanvasItem* i ) const +{ + return i->collidesWith(0,this,0,0,0); +} + +bool TQCanvasPolygonalItem::collidesWith( const TQCanvasSprite* s, + const TQCanvasPolygonalItem* p, + const TQCanvasRectangle* r, + const TQCanvasEllipse* e, + const TQCanvasText* t ) const +{ + return collision_double_dispatch(s,p,r,e,t,0,this,0,0,0); +} + +/*! + \reimp +*/ +bool TQCanvasRectangle::collidesWith( const TQCanvasItem* i ) const +{ + return i->collidesWith(0,this,this,0,0); +} + +bool TQCanvasRectangle::collidesWith( const TQCanvasSprite* s, + const TQCanvasPolygonalItem* p, + const TQCanvasRectangle* r, + const TQCanvasEllipse* e, + const TQCanvasText* t ) const +{ + return collision_double_dispatch(s,p,r,e,t,0,this,this,0,0); +} + + +/*! + \reimp +*/ +bool TQCanvasEllipse::collidesWith( const TQCanvasItem* i ) const +{ + return i->collidesWith(0,this,0,this,0); +} + +bool TQCanvasEllipse::collidesWith( const TQCanvasSprite* s, + const TQCanvasPolygonalItem* p, + const TQCanvasRectangle* r, + const TQCanvasEllipse* e, + const TQCanvasText* t ) const +{ + return collision_double_dispatch(s,p,r,e,t,0,this,0,this,0); +} + +/*! + \reimp +*/ +bool TQCanvasText::collidesWith( const TQCanvasItem* i ) const +{ + return i->collidesWith(0,0,0,0,this); +} + +bool TQCanvasText::collidesWith( const TQCanvasSprite* s, + const TQCanvasPolygonalItem* p, + const TQCanvasRectangle* r, + const TQCanvasEllipse* e, + const TQCanvasText* t ) const +{ + return collision_double_dispatch(s,p,r,e,t,0,0,0,0,this); +} + +/*! + Returns the list of canvas items that this canvas item has + collided with. + + A collision is generally defined as occurring when the pixels of + one item draw on the pixels of another item, but not all + subclasses are so precise. Also, since pixel-wise collision + detection can be slow, this function works in either exact or + inexact mode, according to the \a exact parameter. + + If \a exact is TRUE, the canvas items returned have been + accurately tested for collision with the canvas item. + + If \a exact is FALSE, the canvas items returned are \e near the + canvas item. You can test the canvas items returned using + collidesWith() if any are interesting collision candidates. By + using this approach, you can ignore some canvas items for which + collisions are not relevant. + + The returned list is a list of TQCanvasItems, but often you will + need to cast the items to their subclass types. The safe way to do + this is to use rtti() before casting. This provides some of the + functionality of the standard C++ dynamic cast operation even on + compilers where dynamic casts are not available. + + Note that a canvas item may be `on' a canvas, e.g. it was created + with the canvas as parameter, even though its coordinates place it + beyond the edge of the canvas's area. Collision detection only + works for canvas items which are wholly or partly within the + canvas's area. + + Note that if items have a velocity (see \l setVelocity()), then + collision testing is done based on where the item \e will be when + it moves, not its current location. For example, a "ball" item + doesn't need to actually embed into a "wall" item before a + collision is detected. For items without velocity, plain + intersection is used. +*/ +TQCanvasItemList TQCanvasItem::collisions(bool exact) const +{ + return canvas()->collisions(chunks(),this,exact); +} + +/*! + Returns a list of canvas items that collide with the point \a p. + The list is ordered by z coordinates, from highest z coordinate + (front-most item) to lowest z coordinate (rear-most item). +*/ +TQCanvasItemList TQCanvas::collisions(const TQPoint& p) const +{ + return collisions(TQRect(p,TQSize(1,1))); +} + +/*! + \overload + + Returns a list of items which collide with the rectangle \a r. The + list is ordered by z coordinates, from highest z coordinate + (front-most item) to lowest z coordinate (rear-most item). +*/ +TQCanvasItemList TQCanvas::collisions(const TQRect& r) const +{ + TQCanvasRectangle i(r,(TQCanvas*)this); + i.setPen(NoPen); + i.show(); // doesn't actually show, since we destroy it + TQCanvasItemList l = i.collisions(TRUE); + l.sort(); + return l; +} + +/*! + \overload + + Returns a list of canvas items which intersect with the chunks + listed in \a chunklist, excluding \a item. If \a exact is TRUE, + only those which actually \link TQCanvasItem::collidesWith() + collide with\endlink \a item are returned; otherwise canvas items + are included just for being in the chunks. + + This is a utility function mainly used to implement the simpler + TQCanvasItem::collisions() function. +*/ +TQCanvasItemList TQCanvas::collisions(const TQPointArray& chunklist, + const TQCanvasItem* item, bool exact) const +{ + TQPtrDict seen; + TQCanvasItemList result; + for (int i=0; i<(int)chunklist.count(); i++) { + int x = chunklist[i].x(); + int y = chunklist[i].y(); + if ( validChunk(x,y) ) { + const TQCanvasItemList* l = chunk(x,y).listPtr(); + for (TQCanvasItemList::ConstIterator it=l->begin(); it!=l->end(); ++it) { + TQCanvasItem *g=*it; + if ( g != item ) { + if ( !seen.find(g) ) { + seen.replace(g,(void*)1); + if ( !exact || item->collidesWith(g) ) + result.append(g); + } + } + } + } + } + return result; +} + +/*! + \internal + Adds the item to all the chunks it covers. +*/ +void TQCanvasItem::addToChunks() +{ + if (isVisible() && canvas()) { + TQPointArray pa = chunks(); + for (int i=0; i<(int)pa.count(); i++) + canvas()->addItemToChunk(this,pa[i].x(),pa[i].y()); + val=(uint)TRUE; + } +} + +/*! + \internal + Removes the item from all the chunks it covers. +*/ +void TQCanvasItem::removeFromChunks() +{ + if (isVisible() && canvas()) { + TQPointArray pa = chunks(); + for (int i=0; i<(int)pa.count(); i++) + canvas()->removeItemFromChunk(this,pa[i].x(),pa[i].y()); + } +} + +/*! + \internal + Sets all the chunks covered by the item to be refreshed with TQCanvas::update() + is next called. +*/ +void TQCanvasItem::changeChunks() +{ + if (isVisible() && canvas()) { + if (!val) + addToChunks(); + TQPointArray pa = chunks(); + for (int i=0; i<(int)pa.count(); i++) + canvas()->setChangedChunk(pa[i].x(),pa[i].y()); + } +} + +/*! + \fn TQRect TQCanvasItem::boundingRect() const + + Returns the bounding rectangle in pixels that the canvas item covers. + + \sa boundingRectAdvanced() +*/ + +/*! + Returns the bounding rectangle of pixels that the canvas item \e + will cover after advance(1) is called. + + \sa boundingRect() +*/ +TQRect TQCanvasItem::boundingRectAdvanced() const +{ + int dx = int(x()+xVelocity())-int(x()); + int dy = int(y()+yVelocity())-int(y()); + TQRect r = boundingRect(); + r.moveBy(dx,dy); + return r; +} + +/*! + \class TQCanvasPixmap tqcanvas.h + \brief The TQCanvasPixmap class provides pixmaps for TQCanvasSprites. +\if defined(commercial) + It is part of the TQt Enterprise Edition. +\endif + + \module canvas + \ingroup graphics + \ingroup images + + If you want to show a single pixmap on a TQCanvas use a + TQCanvasSprite with just one pixmap. + + When pixmaps are inserted into a TQCanvasPixmapArray they are held + as TQCanvasPixmaps. \l{TQCanvasSprite}s are used to show pixmaps on + \l{TQCanvas}es and hold their pixmaps in a TQCanvasPixmapArray. If + you retrieve a frame (pixmap) from a TQCanvasSprite it will be + returned as a TQCanvasPixmap. + + The pixmap is a TQPixmap and can only be set in the constructor. + There are three different constructors, one taking a TQPixmap, one + a TQImage and one a file name that refers to a file in any + supported file format (see TQImageIO). + + TQCanvasPixmap can have a hotspot which is defined in terms of an (x, + y) offset. When you create a TQCanvasPixmap from a PNG file or from + a TQImage that has a TQImage::offset(), the offset() is initialized + appropriately, otherwise the constructor leaves it at (0, 0). You + can set it later using setOffset(). When the TQCanvasPixmap is used + in a TQCanvasSprite, the offset position is the point at + TQCanvasItem::x() and TQCanvasItem::y(), not the top-left corner of + the pixmap. + + Note that for TQCanvasPixmap objects created by a TQCanvasSprite, the + position of each TQCanvasPixmap object is set so that the hotspot + stays in the same position. + + \sa TQCanvasPixmapArray TQCanvasItem TQCanvasSprite +*/ + +#ifndef TQT_NO_IMAGEIO + +/*! + Constructs a TQCanvasPixmap that uses the image stored in \a + datafilename. +*/ +TQCanvasPixmap::TQCanvasPixmap(const TQString& datafilename) +{ + TQImage image(datafilename); + init(image); +} + +#endif + +/*! + Constructs a TQCanvasPixmap from the image \a image. +*/ +TQCanvasPixmap::TQCanvasPixmap(const TQImage& image) +{ + init(image); +} +/*! + Constructs a TQCanvasPixmap from the pixmap \a pm using the offset + \a offset. +*/ +TQCanvasPixmap::TQCanvasPixmap(const TQPixmap& pm, const TQPoint& offset) +{ + init(pm,offset.x(),offset.y()); +} + +void TQCanvasPixmap::init(const TQImage& image) +{ + convertFromImage(image); + hotx = image.offset().x(); + hoty = image.offset().y(); +#ifndef TQT_NO_IMAGE_DITHER_TO_1 + if( image.hasAlphaBuffer() ) { + TQImage i = image.createAlphaMask(); + collision_mask = new TQImage(i); + } else +#endif + collision_mask = 0; +} + +void TQCanvasPixmap::init(const TQPixmap& pixmap, int hx, int hy) +{ + (TQPixmap&)*this = pixmap; + hotx = hx; + hoty = hy; + if( pixmap.mask() ) { + TQImage i = mask()->convertToImage(); + collision_mask = new TQImage(i); + } else + collision_mask = 0; +} + +/*! + Destroys the pixmap. +*/ +TQCanvasPixmap::~TQCanvasPixmap() +{ + delete collision_mask; +} + +/*! + \fn int TQCanvasPixmap::offsetX() const + + Returns the x-offset of the pixmap's hotspot. + + \sa setOffset() +*/ + +/*! + \fn int TQCanvasPixmap::offsetY() const + + Returns the y-offset of the pixmap's hotspot. + + \sa setOffset() +*/ + +/*! + \fn void TQCanvasPixmap::setOffset(int x, int y) + + Sets the offset of the pixmap's hotspot to (\a x, \a y). + + \warning Do not call this function if any TQCanvasSprites are + currently showing this pixmap. +*/ + +/*! + \class TQCanvasPixmapArray tqcanvas.h + \brief The TQCanvasPixmapArray class provides an array of TQCanvasPixmaps. +\if defined(commercial) + It is part of the TQt Enterprise Edition. +\endif + + \module canvas + \ingroup graphics + \ingroup images + + + This class is used by TQCanvasSprite to hold an array of pixmaps. + It is used to implement animated sprites, i.e. images that change + over time, with each pixmap in the array holding one frame. + + Depending on the constructor you use you can load multiple pixmaps + into the array either from a directory (specifying a wildcard + pattern for the files), or from a list of TQPixmaps. You can also + read in a set of pixmaps after construction using readPixmaps(). + + Individual pixmaps can be set with setImage() and retrieved with + image(). The number of pixmaps in the array is returned by + count(). + + TQCanvasSprite uses an image's mask for collision detection. You + can change this by reading in a separate set of image masks using + readCollisionMasks(). + +*/ + +/*! + Constructs an invalid array (i.e. isValid() will return FALSE). + You must call readPixmaps() before being able to use this + TQCanvasPixmapArray. +*/ +TQCanvasPixmapArray::TQCanvasPixmapArray() +: framecount( 0 ), img( 0 ) +{ +} + +#ifndef TQT_NO_IMAGEIO +/*! + Constructs a TQCanvasPixmapArray from files. + + The \a fc parameter sets the number of frames to be loaded for + this image. + + If \a fc is not 0, \a datafilenamepattern should contain "%1", + e.g. "foo%1.png". The actual filenames are formed by replacing the + %1 with four-digit integers from 0 to (fc - 1), e.g. foo0000.png, + foo0001.png, foo0002.png, etc. + + If \a fc is 0, \a datafilenamepattern is asssumed to be a + filename, and the image contained in this file will be loaded as + the first (and only) frame. + + If \a datafilenamepattern does not exist, is not readable, isn't + an image, or some other error occurs, the array ends up empty and + isValid() returns FALSE. +*/ + +TQCanvasPixmapArray::TQCanvasPixmapArray( const TQString& datafilenamepattern, + int fc ) +: framecount( 0 ), img( 0 ) +{ + readPixmaps(datafilenamepattern,fc); +} +#endif + +/*! + \obsolete + Use TQCanvasPixmapArray::TQCanvasPixmapArray( TQValueList, TQPointArray ) + instead. + + Constructs a TQCanvasPixmapArray from the list of TQPixmaps \a + list. The \a hotspots list has to be of the same size as \a list. +*/ +TQCanvasPixmapArray::TQCanvasPixmapArray(TQPtrList list, TQPtrList hotspots) : + framecount(list.count()), + img(new TQCanvasPixmap*[list.count()]) +{ + if (list.count() != hotspots.count()) { + tqWarning("TQCanvasPixmapArray: lists have different lengths"); + reset(); + img = 0; + } else { + list.first(); + hotspots.first(); + for (int i=0; i list, TQPointArray hotspots) : + framecount((int)list.size()), + img(new TQCanvasPixmap*[list.size()]) +{ + bool have_hotspots = ( hotspots.size() != 0 ); + if (have_hotspots && list.count() != hotspots.count()) { + tqWarning("TQCanvasPixmapArray: lists have different lengths"); + reset(); + img = 0; + } else { + TQValueList::iterator it; + it = list.begin(); + for (int i=0; i 1; + if ( !arg ) + framecount=1; + for (int i=0; icollision_mask) + img[i]->collision_mask = new TQImage(); + img[i]->collision_mask->load( + arg ? datafilenamepattern.arg(r) : datafilenamepattern); + ok = ok + && !img[i]->collision_mask->isNull() + && img[i]->collision_mask->depth()==1; + } else { + img[i]=new TQCanvasPixmap( + arg ? datafilenamepattern.arg(r) : datafilenamepattern); + ok = ok && !img[i]->isNull(); + } + } + if ( !ok ) { + reset(); + } + return ok; +} +#endif + +/*! + \obsolete + + Use isValid() instead. + + This returns FALSE if the array is valid, and TRUE if it is not. +*/ +bool TQCanvasPixmapArray::operator!() +{ + return img==0; +} + +/*! + Returns TRUE if the pixmap array is valid; otherwise returns + FALSE. +*/ +bool TQCanvasPixmapArray::isValid() const +{ + return (img != 0); +} + +/*! + \fn TQCanvasPixmap* TQCanvasPixmapArray::image(int i) const + + Returns pixmap \a i in the array, if \a i is non-negative and less + than than count(), and returns an unspecified value otherwise. +*/ + +// ### wouldn't it be better to put empty TQCanvasPixmaps in there instead of +// initializing the additional elements in the array to 0? Lars +/*! + Replaces the pixmap at index \a i with pixmap \a p. + + The array takes ownership of \a p and will delete \a p when the + array itself is deleted. + + If \a i is beyond the end of the array the array is extended to at + least i+1 elements, with elements count() to i-1 being initialized + to 0. +*/ +void TQCanvasPixmapArray::setImage(int i, TQCanvasPixmap* p) +{ + if ( i >= framecount ) { + TQCanvasPixmap** newimg = new TQCanvasPixmap*[i+1]; + memcpy(newimg, img, sizeof( TQCanvasPixmap * )*framecount); + memset(newimg + framecount, 0, sizeof( TQCanvasPixmap * )*( i+1 - framecount ) ); + framecount = i+1; + delete [] img; + img = newimg; + } + delete img[i]; img[i]=p; +} + +/*! + \fn uint TQCanvasPixmapArray::count() const + + Returns the number of pixmaps in the array. +*/ + +/*! + Returns the x-coordinate of the current left edge of the sprite. + (This may change as the sprite animates since different frames may + have different left edges.) + + \sa rightEdge() bottomEdge() topEdge() +*/ +int TQCanvasSprite::leftEdge() const +{ + return int(x()) - image()->hotx; +} + +/*! + \overload + + Returns what the x-coordinate of the left edge of the sprite would + be if the sprite (actually its hotspot) were moved to x-position + \a nx. + + \sa rightEdge() bottomEdge() topEdge() +*/ +int TQCanvasSprite::leftEdge(int nx) const +{ + return nx - image()->hotx; +} + +/*! + Returns the y-coordinate of the top edge of the sprite. (This may + change as the sprite animates since different frames may have + different top edges.) + + \sa leftEdge() rightEdge() bottomEdge() +*/ +int TQCanvasSprite::topEdge() const +{ + return int(y()) - image()->hoty; +} + +/*! + \overload + + Returns what the y-coordinate of the top edge of the sprite would + be if the sprite (actually its hotspot) were moved to y-position + \a ny. + + \sa leftEdge() rightEdge() bottomEdge() +*/ +int TQCanvasSprite::topEdge(int ny) const +{ + return ny - image()->hoty; +} + +/*! + Returns the x-coordinate of the current right edge of the sprite. + (This may change as the sprite animates since different frames may + have different right edges.) + + \sa leftEdge() bottomEdge() topEdge() +*/ +int TQCanvasSprite::rightEdge() const +{ + return leftEdge() + image()->width()-1; +} + +/*! + \overload + + Returns what the x-coordinate of the right edge of the sprite + would be if the sprite (actually its hotspot) were moved to + x-position \a nx. + + \sa leftEdge() bottomEdge() topEdge() +*/ +int TQCanvasSprite::rightEdge(int nx) const +{ + return leftEdge(nx) + image()->width()-1; +} + +/*! + Returns the y-coordinate of the current bottom edge of the sprite. + (This may change as the sprite animates since different frames may + have different bottom edges.) + + \sa leftEdge() rightEdge() topEdge() +*/ +int TQCanvasSprite::bottomEdge() const +{ + return topEdge() + image()->height()-1; +} + +/*! + \overload + + Returns what the y-coordinate of the top edge of the sprite would + be if the sprite (actually its hotspot) were moved to y-position + \a ny. + + \sa leftEdge() rightEdge() topEdge() +*/ +int TQCanvasSprite::bottomEdge(int ny) const +{ + return topEdge(ny) + image()->height()-1; +} + +/*! + \fn TQCanvasPixmap* TQCanvasSprite::image() const + + Returns the current frame's image. + + \sa frame(), setFrame() +*/ + +/*! + \fn TQCanvasPixmap* TQCanvasSprite::image(int f) const + \overload + + Returns the image for frame \a f. Does not do any bounds checking on \a f. +*/ + +/*! + Returns the image the sprite \e will have after advance(1) is + called. By default this is the same as image(). +*/ +TQCanvasPixmap* TQCanvasSprite::imageAdvanced() const +{ + return image(); +} + +/*! + Returns the bounding rectangle for the image in the sprite's + current frame. This assumes that the images are tightly cropped + (i.e. do not have transparent pixels all along a side). +*/ +TQRect TQCanvasSprite::boundingRect() const +{ + return TQRect(leftEdge(), topEdge(), width(), height()); +} + + +/*! + \internal + Returns the chunks covered by the item. +*/ +TQPointArray TQCanvasItem::chunks() const +{ + TQPointArray r; + int n=0; + TQRect br = boundingRect(); + if (isVisible() && canvas()) { + int chunksize=canvas()->chunkSize(); + br &= TQRect(0,0,canvas()->width(),canvas()->height()); + if ( br.isValid() ) { + r.resize((br.width()/chunksize+2)*(br.height()/chunksize+2)); + for (int j=br.top()/chunksize; j<=br.bottom()/chunksize; j++) { + for (int i=br.left()/chunksize; i<=br.right()/chunksize; i++) { + r[n++] = TQPoint(i,j); + } + } + } + } + r.resize(n); + return r; +} + + +/*! + \internal + Add the sprite to the chunks in its TQCanvas which it overlaps. +*/ +void TQCanvasSprite::addToChunks() +{ + if (isVisible() && canvas()) { + int chunksize=canvas()->chunkSize(); + for (int j=topEdge()/chunksize; j<=bottomEdge()/chunksize; j++) { + for (int i=leftEdge()/chunksize; i<=rightEdge()/chunksize; i++) { + canvas()->addItemToChunk(this,i,j); + } + } + } +} + +/*! + \internal + Remove the sprite from the chunks in its TQCanvas which it overlaps. + + \sa addToChunks() +*/ +void TQCanvasSprite::removeFromChunks() +{ + if (isVisible() && canvas()) { + int chunksize=canvas()->chunkSize(); + for (int j=topEdge()/chunksize; j<=bottomEdge()/chunksize; j++) { + for (int i=leftEdge()/chunksize; i<=rightEdge()/chunksize; i++) { + canvas()->removeItemFromChunk(this,i,j); + } + } + } +} + +/*! + The width of the sprite for the current frame's image. + + \sa frame() +*/ +//### mark: Why don't we have width(int) and height(int) to be +//consistent with leftEdge() and leftEdge(int)? +int TQCanvasSprite::width() const +{ + return image()->width(); +} + +/*! + The height of the sprite for the current frame's image. + + \sa frame() +*/ +int TQCanvasSprite::height() const +{ + return image()->height(); +} + + +/*! + Draws the current frame's image at the sprite's current position + on painter \a painter. +*/ +void TQCanvasSprite::draw(TQPainter& painter) +{ + painter.drawPixmap(leftEdge(),topEdge(),*image()); +} + +/*! + \class TQCanvasView tqcanvas.h + \brief The TQCanvasView class provides an on-screen view of a TQCanvas. +\if defined(commercial) + It is part of the TQt Enterprise Edition. +\endif + + \module canvas + \ingroup graphics + \ingroup images + + A TQCanvasView is widget which provides a view of a TQCanvas. + + If you want users to be able to interact with a canvas view, + subclass TQCanvasView. You might then reimplement + TQScrollView::contentsMousePressEvent(). For example, assuming no + transformation matrix is set: + + \code + void MyCanvasView::contentsMousePressEvent( TQMouseEvent* e ) + { + TQCanvasItemList l = canvas()->collisions(e->pos()); + for (TQCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) { + if ( (*it)->rtti() == TQCanvasRectangle::RTTI ) + tqDebug("A TQCanvasRectangle lies somewhere at this point"); + } + } + \endcode + + The canvas view shows canvas canvas(); this can be changed using + setCanvas(). + + A transformation matrix can be used to transform the view of the + canvas in various ways, for example, zooming in or out or rotating. + For example: + + \code + TQWMatrix wm; + wm.scale( 2, 2 ); // Zooms in by 2 times + wm.rotate( 90 ); // Rotates 90 degrees counter clockwise + // around the origin. + wm.translate( 0, -canvas->height() ); + // moves the canvas down so what was visible + // before is still visible. + myCanvasView->setWorldMatrix( wm ); + \endcode + + Use setWorldMatrix() to set the canvas view's world matrix: you must + ensure that the world matrix is invertible. The current world matrix + is retrievable with worldMatrix(), and its inversion is retrievable + with inverseWorldMatrix(). + + Example: + + The following code finds the part of the canvas that is visible in + this view, i.e. the bounding rectangle of the view in canvas coordinates. + + \code + TQRect rc = TQRect( myCanvasView->contentsX(), myCanvasView->contentsY(), + myCanvasView->visibleWidth(), myCanvasView->visibleHeight() ); + TQRect canvasRect = myCanvasView->inverseWorldMatrix().mapRect(rc); + \endcode + + \sa TQWMatrix TQPainter::setWorldMatrix() + +*/ + +/*! + Constructs a TQCanvasView with parent \a parent, and name \a name, + using the widget flags \a f. The canvas view is not associated + with a canvas, so you must to call setCanvas() to view a + canvas. +*/ +TQCanvasView::TQCanvasView(TQWidget* parent, const char* name, WFlags f) : + TQScrollView(parent,name,f|WResizeNoErase|WStaticContents) +{ + d = new TQCanvasViewData; + viewing = 0; + setCanvas(0); + connect(this,TQ_SIGNAL(contentsMoving(int,int)),this,TQ_SLOT(cMoving(int,int))); +} + +/*! + \overload + + Constructs a TQCanvasView which views canvas \a canvas, with parent + \a parent, and name \a name, using the widget flags \a f. +*/ +TQCanvasView::TQCanvasView(TQCanvas* canvas, TQWidget* parent, const char* name, WFlags f) : + TQScrollView(parent,name,f|WResizeNoErase|WStaticContents) +{ + d = new TQCanvasViewData; + viewing = 0; + setCanvas(canvas); + + connect(this,TQ_SIGNAL(contentsMoving(int,int)),this,TQ_SLOT(cMoving(int,int))); +} + +/*! + Destroys the canvas view. The associated canvas is \e not deleted. +*/ +TQCanvasView::~TQCanvasView() +{ + delete d; + d = 0; + setCanvas(0); +} + +/*! + \fn TQCanvas* TQCanvasView::canvas() const + + Returns a pointer to the canvas which the TQCanvasView is currently + showing. +*/ + + +/*! + Sets the canvas that the TQCanvasView is showing to the canvas \a + canvas. +*/ +void TQCanvasView::setCanvas(TQCanvas* canvas) +{ + if (viewing) { + disconnect(viewing); + viewing->removeView(this); + } + viewing=canvas; + if (viewing) { + connect(viewing,TQ_SIGNAL(resized()), this, TQ_SLOT(updateContentsSize())); + viewing->addView(this); + } + if ( d ) // called by d'tor + updateContentsSize(); +} + +#ifndef TQT_NO_TRANSFORMATIONS +/*! + Returns a reference to the canvas view's current transformation matrix. + + \sa setWorldMatrix() inverseWorldMatrix() +*/ +const TQWMatrix &TQCanvasView::worldMatrix() const +{ + return d->xform; +} + +/*! + Returns a reference to the inverse of the canvas view's current + transformation matrix. + + \sa setWorldMatrix() worldMatrix() +*/ +const TQWMatrix &TQCanvasView::inverseWorldMatrix() const +{ + return d->ixform; +} + +/*! + Sets the transformation matrix of the TQCanvasView to \a wm. The + matrix must be invertible (i.e. if you create a world matrix that + zooms out by 2 times, then the inverse of this matrix is one that + will zoom in by 2 times). + + When you use this, you should note that the performance of the + TQCanvasView will decrease considerably. + + Returns FALSE if \a wm is not invertable; otherwise returns TRUE. + + \sa worldMatrix() inverseWorldMatrix() TQWMatrix::isInvertible() +*/ +bool TQCanvasView::setWorldMatrix( const TQWMatrix & wm ) +{ + bool ok = wm.isInvertible(); + if ( ok ) { + d->xform = wm; + d->ixform = wm.invert(); + updateContentsSize(); + viewport()->update(); + } + return ok; +} +#endif + +void TQCanvasView::updateContentsSize() +{ + if ( viewing ) { + TQRect br; +#ifndef TQT_NO_TRANSFORMATIONS + br = d->xform.map(TQRect(0,0,viewing->width(),viewing->height())); +#else + br = TQRect(0,0,viewing->width(),viewing->height()); +#endif + + if ( br.width() < contentsWidth() ) { + TQRect r(contentsToViewport(TQPoint(br.width(),0)), + TQSize(contentsWidth()-br.width(),contentsHeight())); + viewport()->erase(r); + } + if ( br.height() < contentsHeight() ) { + TQRect r(contentsToViewport(TQPoint(0,br.height())), + TQSize(contentsWidth(),contentsHeight()-br.height())); + viewport()->erase(r); + } + + resizeContents(br.width(),br.height()); + } else { + viewport()->erase(); + resizeContents(1,1); + } +} + +void TQCanvasView::cMoving(int x, int y) +{ + // A little kludge to smooth up repaints when scrolling + int dx = x - contentsX(); + int dy = y - contentsY(); + d->repaint_from_moving = TQABS(dx) < width()/8 && TQABS(dy) < height()/8; +} + +/*! + Repaints part of the TQCanvas that the canvas view is showing + starting at \a cx by \a cy, with a width of \a cw and a height of \a + ch using the painter \a p. + + \warning When double buffering is enabled, drawContents() will + not respect the current settings of the painter when setting up + the painter for the double buffer (e.g., viewport() and + window()). Also, be aware that TQCanvas::update() bypasses + drawContents(), which means any reimplementation of + drawContents() is not called. + + \sa TQCanvas::setDoubleBuffering() +*/ +void TQCanvasView::drawContents(TQPainter *p, int cx, int cy, int cw, int ch) +{ + TQRect r(cx,cy,cw,ch); + if (viewing) { + //viewing->drawViewArea(this,p,r,TRUE); + viewing->drawViewArea(this,p,r,!d->repaint_from_moving); + d->repaint_from_moving = FALSE; + } else { + p->eraseRect(r); + } +} + +/*! + \reimp + \internal + + (Implemented to get rid of a compiler warning.) +*/ +void TQCanvasView::drawContents( TQPainter * ) +{ +} + +/*! + Suggests a size sufficient to view the entire canvas. +*/ +TQSize TQCanvasView::sizeHint() const +{ + if ( !canvas() ) + return TQScrollView::sizeHint(); + // should maybe take transformations into account + return ( canvas()->size() + 2 * TQSize(frameWidth(), frameWidth()) ) + .boundedTo( 3 * TQApplication::desktop()->size() / 4 ); +} + +// ### TQt 4.0 customer request: operate on doubles rather than int. +// ### I know, almost impossible due to the use of TQRegion etc. +/*! + \class TQCanvasPolygonalItem tqcanvas.h + \brief The TQCanvasPolygonalItem class provides a polygonal canvas item + on a TQCanvas. +\if defined(commercial) + It is part of the TQt Enterprise Edition. +\endif + + \module canvas + \ingroup graphics + \ingroup images + + The mostly rectangular classes, such as TQCanvasSprite and + TQCanvasText, use the object's bounding rectangle for movement, + repainting and collision calculations. For most other items, the + bounding rectangle can be far too large -- a diagonal line being + the worst case, and there are many other cases which are also bad. + TQCanvasPolygonalItem provides polygon-based bounding rectangle + handling, etc., which is much faster for non-rectangular items. + + Derived classes should try to define as small an area as possible + to maximize efficiency, but the polygon must \e definitely be + contained completely within the polygonal area. Calculating the + exact requirements is usually difficult, but if you allow a small + overestimate it can be easy and quick, while still getting almost + all of TQCanvasPolygonalItem's speed. + + Note that all subclasses \e must call hide() in their destructor + since hide() needs to be able to access areaPoints(). + + Normally, TQCanvasPolygonalItem uses the odd-even algorithm for + determining whether an object intersects this object. You can + change this to the winding algorithm using setWinding(). + + The bounding rectangle is available using boundingRect(). The + points bounding the polygonal item are retrieved with + areaPoints(). Use areaPointsAdvanced() to retrieve the bounding + points the polygonal item \e will have after + TQCanvasItem::advance(1) has been called. + + If the shape of the polygonal item is about to change while the + item is visible, call invalidate() before updating with a + different result from \l areaPoints(). + + By default, TQCanvasPolygonalItem objects have a black pen and no + brush (the default TQPen and TQBrush constructors). You can change + this with setPen() and setBrush(), but note that some + TQCanvasPolygonalItem subclasses only use the brush, ignoring the + pen setting. + + The polygonal item can be drawn on a painter with draw(). + Subclasses must reimplement drawShape() to draw themselves. + + Like any other canvas item polygonal items can be moved with + TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting coordinates + with TQCanvasItem::setX(), TQCanvasItem::setY() and TQCanvasItem::setZ(). + +*/ + + +/* + Since most polygonal items don't have a pen, the default is + NoPen and a black brush. +*/ +static const TQPen& defaultPolygonPen() +{ + static TQPen* dp=0; + if ( !dp ) + dp = new TQPen; + return *dp; +} + +static const TQBrush& defaultPolygonBrush() +{ + static TQBrush* db=0; + if ( !db ) + db = new TQBrush; + return *db; +} + +/*! + Constructs a TQCanvasPolygonalItem on the canvas \a canvas. +*/ +TQCanvasPolygonalItem::TQCanvasPolygonalItem(TQCanvas* canvas) : + TQCanvasItem(canvas), + br(defaultPolygonBrush()), + pn(defaultPolygonPen()) +{ + wind=0; +} + +/*! + Note that all subclasses \e must call hide() in their destructor + since hide() needs to be able to access areaPoints(). +*/ +TQCanvasPolygonalItem::~TQCanvasPolygonalItem() +{ +} + +/*! + Returns TRUE if the polygonal item uses the winding algorithm to + determine the "inside" of the polygon. Returns FALSE if it uses + the odd-even algorithm. + + The default is to use the odd-even algorithm. + + \sa setWinding() +*/ +bool TQCanvasPolygonalItem::winding() const +{ + return wind; +} + +/*! + If \a enable is TRUE, the polygonal item will use the winding + algorithm to determine the "inside" of the polygon; otherwise the + odd-even algorithm will be used. + + The default is to use the odd-even algorithm. + + \sa winding() +*/ +void TQCanvasPolygonalItem::setWinding(bool enable) +{ + wind = enable; +} + +/*! + Invalidates all information about the area covered by the canvas + item. The item will be updated automatically on the next call that + changes the item's status, for example, move() or update(). Call + this function if you are going to change the shape of the item (as + returned by areaPoints()) while the item is visible. +*/ +void TQCanvasPolygonalItem::invalidate() +{ + val = (uint)FALSE; + removeFromChunks(); +} + +/*! + \fn TQCanvasPolygonalItem::isValid() const + + Returns TRUE if the polygonal item's area information has not been + invalidated; otherwise returns FALSE. + + \sa invalidate() +*/ + +/*! + Returns the points the polygonal item \e will have after + TQCanvasItem::advance(1) is called, i.e. what the points are when + advanced by the current xVelocity() and yVelocity(). +*/ +TQPointArray TQCanvasPolygonalItem::areaPointsAdvanced() const +{ + int dx = int(x()+xVelocity())-int(x()); + int dy = int(y()+yVelocity())-int(y()); + TQPointArray r = areaPoints(); + r.detach(); // Explicit sharing is stupid. + if ( dx || dy ) + r.translate(dx,dy); + return r; +} + +//#define TQCANVAS_POLYGONS_DEBUG +#ifdef TQCANVAS_POLYGONS_DEBUG +static TQWidget* dbg_wid=0; +static TQPainter* dbg_ptr=0; +#endif + +class TQPolygonalProcessor { +public: + TQPolygonalProcessor(TQCanvas* c, const TQPointArray& pa) : + canvas(c) + { + TQRect pixelbounds = pa.boundingRect(); + int cs = canvas->chunkSize(); + TQRect canvasbounds = pixelbounds.intersect(canvas->rect()); + bounds.setLeft(canvasbounds.left()/cs); + bounds.setRight(canvasbounds.right()/cs); + bounds.setTop(canvasbounds.top()/cs); + bounds.setBottom(canvasbounds.bottom()/cs); + bitmap = TQImage(bounds.width() + 1, bounds.height(), 1, 2, TQImage::LittleEndian); + pnt = 0; + bitmap.fill(0); +#ifdef TQCANVAS_POLYGONS_DEBUG + dbg_start(); +#endif + } + + inline void add(int x, int y) + { + if ( pnt >= (int)result.size() ) { + result.resize(pnt*2+10); + } + result[pnt++] = TQPoint(x+bounds.x(),y+bounds.y()); +#ifdef TQCANVAS_POLYGONS_DEBUG + if ( dbg_ptr ) { + int cs = canvas->chunkSize(); + TQRect r(x*cs+bounds.x()*cs,y*cs+bounds.y()*cs,cs-1,cs-1); + dbg_ptr->setPen(TQt::blue); + dbg_ptr->drawRect(r); + } +#endif + } + + inline void addBits(int x1, int x2, uchar newbits, int xo, int yo) + { + for (int i=x1; i<=x2; i++) + if ( newbits & (1<resize(800,600); + dbg_wid->show(); + dbg_ptr = new TQPainter(dbg_wid); + dbg_ptr->setBrush(TQt::NoBrush); + } + dbg_ptr->fillRect(dbg_wid->rect(),TQt::white); + } +#endif + + void doSpans(int n, TQPoint* pt, int* w) + { + int cs = canvas->chunkSize(); + for (int j=0; j= bitmap.height() || y < 0) continue; + uchar* l = bitmap.scanLine(y); + int x = pt[j].x(); + int x1 = x/cs-bounds.x(); + if (x1 > bounds.width()) continue; + x1 = TQMAX(0,x1); + int x2 = (x+w[j])/cs-bounds.x(); + if (x2 < 0) continue; + x2 = TQMIN(bounds.width(), x2); + int x1q = x1/8; + int x1r = x1%8; + int x2q = x2/8; + int x2r = x2%8; +#ifdef TQCANVAS_POLYGONS_DEBUG + if ( dbg_ptr ) dbg_ptr->setPen(TQt::yellow); +#endif + if ( x1q == x2q ) { + uchar newbits = (~l[x1q]) & (((2<<(x2r-x1r))-1)<setPen(TQt::darkGreen); +#endif + addBits(x1r,x2r,newbits,x1q*8,y); + l[x1q] |= newbits; + } + } else { +#ifdef TQCANVAS_POLYGONS_DEBUG + if ( dbg_ptr ) dbg_ptr->setPen(TQt::blue); +#endif + uchar newbits1 = (~l[x1q]) & (0xff<setPen(TQt::green); +#endif + addBits(x1r,7,newbits1,x1q*8,y); + l[x1q] |= newbits1; + } + for (int i=x1q+1; i>(7-x2r)); + if ( newbits2 ) { +#ifdef TQCANVAS_POLYGONS_DEBUG + if ( dbg_ptr ) dbg_ptr->setPen(TQt::red); +#endif + addBits(0,x2r,newbits2,x2q*8,y); + l[x2q] |= newbits2; + } + } +#ifdef TQCANVAS_POLYGONS_DEBUG + if ( dbg_ptr ) { + dbg_ptr->drawLine(pt[j],pt[j]+TQPoint(w[j],0)); + } +#endif + } + result.resize(pnt); + } + + int pnt; + TQPointArray result; + TQCanvas* canvas; + TQRect bounds; + TQImage bitmap; +}; + + +TQPointArray TQCanvasPolygonalItem::chunks() const +{ + TQPointArray pa = areaPoints(); + + if ( !pa.size() ) { + pa.detach(); // Explicit sharing is stupid. + return pa; + } + + TQPolygonalProcessor processor(canvas(),pa); + + scanPolygon(pa, wind, processor); + + return processor.result; +} +/*! + Simply calls TQCanvasItem::chunks(). +*/ +TQPointArray TQCanvasRectangle::chunks() const +{ + // No need to do a polygon scan! + return TQCanvasItem::chunks(); +} + +/*! + Returns the bounding rectangle of the polygonal item, based on + areaPoints(). +*/ +TQRect TQCanvasPolygonalItem::boundingRect() const +{ + return areaPoints().boundingRect(); +} + +/*! + Reimplemented from TQCanvasItem, this draws the polygonal item by + setting the pen and brush for the item on the painter \a p and + calling drawShape(). +*/ +void TQCanvasPolygonalItem::draw(TQPainter & p) +{ + p.setPen(pn); + p.setBrush(br); + drawShape(p); +} + +/*! + \fn void TQCanvasPolygonalItem::drawShape(TQPainter & p) + + Subclasses must reimplement this function to draw their shape. The + pen and brush of \a p are already set to pen() and brush() prior + to calling this function. + + \warning When you reimplement this function, make sure that you + leave the painter in the same state as you found it. For example, + if you start by calling TQPainter::translate(50, 50), end your + code by calling TQPainter::translate(-50, -50). Be also aware that + the painter might already have some transformations set (i.e., + don't call TQPainter::resetXForm() when you're done). + + \sa draw() +*/ + +/*! + \fn TQPen TQCanvasPolygonalItem::pen() const + + Returns the TQPen used to draw the outline of the item, if any. + + \sa setPen() +*/ + +/*! + \fn TQBrush TQCanvasPolygonalItem::brush() const + + Returns the TQBrush used to fill the item, if filled. + + \sa setBrush() +*/ + +/*! + Sets the TQPen used when drawing the item to the pen \a p. + Note that many TQCanvasPolygonalItems do not use the pen value. + + \sa setBrush(), pen(), drawShape() +*/ +void TQCanvasPolygonalItem::setPen(TQPen p) +{ + if ( pn != p ) { + removeFromChunks(); + pn = p; + addToChunks(); + } +} + +/*! + Sets the TQBrush used when drawing the polygonal item to the brush \a b. + + \sa setPen(), brush(), drawShape() +*/ +void TQCanvasPolygonalItem::setBrush(TQBrush b) +{ + if ( br != b) { + br = b; + changeChunks(); + } +} + + +/*! + \class TQCanvasPolygon tqcanvas.h + \brief The TQCanvasPolygon class provides a polygon on a TQCanvas. +\if defined(commercial) + It is part of the TQt Enterprise Edition. +\endif + + \module canvas + \ingroup graphics + \ingroup images + + Paints a polygon with a TQBrush. The polygon's points can be set in + the constructor or set or changed later using setPoints(). Use + points() to retrieve the points, or areaPoints() to retrieve the + points relative to the canvas's origin. + + The polygon can be drawn on a painter with drawShape(). + + Like any other canvas item polygons can be moved with + TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting + coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and + TQCanvasItem::setZ(). + + Note: TQCanvasPolygon does not use the pen. +*/ + +/*! + Constructs a point-less polygon on the canvas \a canvas. You + should call setPoints() before using it further. +*/ +TQCanvasPolygon::TQCanvasPolygon(TQCanvas* canvas) : + TQCanvasPolygonalItem(canvas) +{ +} + +/*! + Destroys the polygon. +*/ +TQCanvasPolygon::~TQCanvasPolygon() +{ + hide(); +} + +/*! + Draws the polygon using the painter \a p. + + Note that TQCanvasPolygon does not support an outline (the pen is + always NoPen). +*/ +void TQCanvasPolygon::drawShape(TQPainter & p) +{ + // ### why can't we draw outlines? We could use drawPolyline for it. Lars + // ### see other message. Warwick + + p.setPen(NoPen); // since TQRegion(TQPointArray) excludes outline :-( )-: + p.drawPolygon(poly); +} + +/*! + Sets the points of the polygon to be \a pa. These points will have + their x and y coordinates automatically translated by x(), y() as + the polygon is moved. +*/ +void TQCanvasPolygon::setPoints(TQPointArray pa) +{ + removeFromChunks(); + poly = pa; + poly.detach(); // Explicit sharing is stupid. + poly.translate((int)x(),(int)y()); + addToChunks(); +} + +/*! + \reimp +*/ +void TQCanvasPolygon::moveBy(double dx, double dy) +{ + // Note: does NOT call TQCanvasPolygonalItem::moveBy(), since that + // only does half this work. + // + int idx = int(x()+dx)-int(x()); + int idy = int(y()+dy)-int(y()); + if ( idx || idy ) { + removeFromChunks(); + poly.translate(idx,idy); + } + myx+=dx; + myy+=dy; + if ( idx || idy ) { + addToChunks(); + } +} + +/*! + \class TQCanvasSpline tqcanvas.h + \brief The TQCanvasSpline class provides multi-bezier splines on a TQCanvas. +\if defined(commercial) + It is part of the TQt Enterprise Edition. +\endif + + \module canvas + \ingroup graphics + \ingroup images + + A TQCanvasSpline is a sequence of 4-point bezier curves joined + together to make a curved shape. + + You set the control points of the spline with setControlPoints(). + + If the bezier is closed(), then the first control point will be + re-used as the last control point. Therefore, a closed bezier must + have a multiple of 3 control points and an open bezier must have + one extra point. + + The beziers are not necessarily joined "smoothly". To ensure this, + set control points appropriately (general reference texts about + beziers will explain this in detail). + + Like any other canvas item splines can be moved with + TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting + coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and + TQCanvasItem::setZ(). + +*/ + +/*! + Create a spline with no control points on the canvas \a canvas. + + \sa setControlPoints() +*/ +TQCanvasSpline::TQCanvasSpline(TQCanvas* canvas) : + TQCanvasPolygon(canvas), + cl(TRUE) +{ +} + +/*! + Destroy the spline. +*/ +TQCanvasSpline::~TQCanvasSpline() +{ +} + +// ### shouldn't we handle errors more gracefully than with an assert? Lars +// ### no, since it's a programming error. Warwick +/*! + Set the spline control points to \a ctrl. + + If \a close is TRUE, then the first point in \a ctrl will be + re-used as the last point, and the number of control points must + be a multiple of 3. If \a close is FALSE, one additional control + point is required, and the number of control points must be one of + (4, 7, 10, 13, ...). + + If the number of control points doesn't meet the above conditions, + the number of points will be truncated to the largest number of + points that do meet the requirement. +*/ +void TQCanvasSpline::setControlPoints(TQPointArray ctrl, bool close) +{ + if ( (int)ctrl.count() % 3 != (close ? 0 : 1) ) { + tqWarning( "TQCanvasSpline::setControlPoints(): Number of points doesn't fit." ); + int numCurves = (ctrl.count() - (close ? 0 : 1 ))/ 3; + ctrl.resize( numCurves*3 + ( close ? 0 : 1 ) ); + } + + cl = close; + bez = ctrl; + recalcPoly(); +} + +/*! + Returns the current set of control points. + + \sa setControlPoints(), closed() +*/ +TQPointArray TQCanvasSpline::controlPoints() const +{ + return bez; +} + +/*! + Returns TRUE if the control points are a closed set; otherwise + returns FALSE. +*/ +bool TQCanvasSpline::closed() const +{ + return cl; +} + +void TQCanvasSpline::recalcPoly() +{ + TQPtrList segs; + segs.setAutoDelete(TRUE); + int n=0; + for (int i=0; i<(int)bez.count()-1; i+=3) { + TQPointArray ctrl(4); + ctrl[0] = bez[i+0]; + ctrl[1] = bez[i+1]; + ctrl[2] = bez[i+2]; + if ( cl ) + ctrl[3] = bez[(i+3)%(int)bez.count()]; + else + ctrl[3] = bez[i+3]; + TQPointArray *seg = new TQPointArray(ctrl.cubicBezier()); + n += seg->count()-1; + segs.append(seg); + } + TQPointArray p(n+1); + n=0; + for (TQPointArray* seg = segs.first(); seg; seg = segs.next()) { + for (int i=0; i<(int)seg->count()-1; i++) + p[n++] = seg->point(i); + if ( n == (int)p.count()-1 ) + p[n] = seg->point(seg->count()-1); + } + TQCanvasPolygon::setPoints(p); +} + +/*! + \fn TQPointArray TQCanvasPolygonalItem::areaPoints() const + + This function must be reimplemented by subclasses. It \e must + return the points bounding (i.e. outside and not touching) the + shape or drawing errors will occur. +*/ + +/*! + \fn TQPointArray TQCanvasPolygon::points() const + + Returns the vertices of the polygon, not translated by the position. + + \sa setPoints(), areaPoints() +*/ +TQPointArray TQCanvasPolygon::points() const +{ + TQPointArray pa = areaPoints(); + pa.translate(int(-x()),int(-y())); + return pa; +} + +/*! + Returns the vertices of the polygon translated by the polygon's + current x(), y() position, i.e. relative to the canvas's origin. + + \sa setPoints(), points() +*/ +TQPointArray TQCanvasPolygon::areaPoints() const +{ + return poly.copy(); +} + +// ### mark: Why don't we offer a constructor that lets the user set the +// points -- that way for some uses just the constructor call would be +// required? +/*! + \class TQCanvasLine tqcanvas.h + \brief The TQCanvasLine class provides a line on a TQCanvas. +\if defined(commercial) + It is part of the TQt Enterprise Edition. +\endif + + \module canvas + \ingroup graphics + \ingroup images + + The line inherits functionality from TQCanvasPolygonalItem, for + example the setPen() function. The start and end points of the + line are set with setPoints(). + + Like any other canvas item lines can be moved with + TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting + coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and + TQCanvasItem::setZ(). +*/ + +/*! + Constructs a line from (0,0) to (0,0) on \a canvas. + + \sa setPoints(). +*/ +TQCanvasLine::TQCanvasLine(TQCanvas* canvas) : + TQCanvasPolygonalItem(canvas) +{ + x1 = y1 = x2 = y2 = 0; +} + +/*! + Destroys the line. +*/ +TQCanvasLine::~TQCanvasLine() +{ + hide(); +} + +/*! + \reimp +*/ +void TQCanvasLine::setPen(TQPen p) +{ + TQCanvasPolygonalItem::setPen(p); +} + +/*! + \fn TQPoint TQCanvasLine::startPoint () const + + Returns the start point of the line. + + \sa setPoints(), endPoint() +*/ + +/*! + \fn TQPoint TQCanvasLine::endPoint () const + + Returns the end point of the line. + + \sa setPoints(), startPoint() +*/ + +/*! + Sets the line's start point to (\a xa, \a ya) and its end point to + (\a xb, \a yb). +*/ +void TQCanvasLine::setPoints(int xa, int ya, int xb, int yb) +{ + if ( x1 != xa || x2 != xb || y1 != ya || y2 != yb ) { + removeFromChunks(); + x1 = xa; + y1 = ya; + x2 = xb; + y2 = yb; + addToChunks(); + } +} + +/*! + \reimp +*/ +void TQCanvasLine::drawShape(TQPainter &p) +{ + p.drawLine((int)(x()+x1), (int)(y()+y1), (int)(x()+x2), (int)(y()+y2)); +} + +/*! + \reimp + + Note that the area defined by the line is somewhat thicker than + the line that is actually drawn. +*/ +TQPointArray TQCanvasLine::areaPoints() const +{ + TQPointArray p(4); + int xi = int(x()); + int yi = int(y()); + int pw = pen().width(); + int dx = TQABS(x1-x2); + int dy = TQABS(y1-y2); + pw = pw*4/3+2; // approx pw*sqrt(2) + int px = x1 dy ? (dx*2/dy <= 2) : (dy*2/dx <= 2)) ) { + // steep + if ( px == py ) { + p[0] = TQPoint(x1+xi ,y1+yi+py); + p[1] = TQPoint(x2+xi-px,y2+yi ); + p[2] = TQPoint(x2+xi ,y2+yi-py); + p[3] = TQPoint(x1+xi+px,y1+yi ); + } else { + p[0] = TQPoint(x1+xi+px,y1+yi ); + p[1] = TQPoint(x2+xi ,y2+yi-py); + p[2] = TQPoint(x2+xi-px,y2+yi ); + p[3] = TQPoint(x1+xi ,y1+yi+py); + } + } else if ( dx > dy ) { + // horizontal + p[0] = TQPoint(x1+xi+px,y1+yi+py); + p[1] = TQPoint(x2+xi-px,y2+yi+py); + p[2] = TQPoint(x2+xi-px,y2+yi-py); + p[3] = TQPoint(x1+xi+px,y1+yi-py); + } else { + // vertical + p[0] = TQPoint(x1+xi+px,y1+yi+py); + p[1] = TQPoint(x2+xi+px,y2+yi-py); + p[2] = TQPoint(x2+xi-px,y2+yi-py); + p[3] = TQPoint(x1+xi-px,y1+yi+py); + } + return p; +} + +/*! + \reimp + +*/ + +void TQCanvasLine::moveBy(double dx, double dy) +{ + TQCanvasPolygonalItem::moveBy(dx, dy); +} + +/*! + \class TQCanvasRectangle tqcanvas.h + \brief The TQCanvasRectangle class provides a rectangle on a TQCanvas. +\if defined(commercial) + It is part of the TQt Enterprise Edition. +\endif + + \module canvas + \ingroup graphics + \ingroup images + + This item paints a single rectangle which may have any pen() and + brush(), but may not be tilted/rotated. For rotated rectangles, + use TQCanvasPolygon. + + The rectangle's size and initial position can be set in the + constructor. The size can be set or changed later using setSize(). + Use height() and width() to retrieve the rectangle's dimensions. + + The rectangle can be drawn on a painter with drawShape(). + + Like any other canvas item rectangles can be moved with + TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting + coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and + TQCanvasItem::setZ(). + +*/ + +/*! + Constructs a rectangle at position (0,0) with both width and + height set to 32 pixels on \a canvas. +*/ +TQCanvasRectangle::TQCanvasRectangle(TQCanvas* canvas) : + TQCanvasPolygonalItem(canvas), + w(32), h(32) +{ +} + +/*! + Constructs a rectangle positioned and sized by \a r on \a canvas. +*/ +TQCanvasRectangle::TQCanvasRectangle(const TQRect& r, TQCanvas* canvas) : + TQCanvasPolygonalItem(canvas), + w(r.width()), h(r.height()) +{ + move(r.x(),r.y()); +} + +/*! + Constructs a rectangle at position (\a x, \a y) and size \a width + by \a height, on \a canvas. +*/ +TQCanvasRectangle::TQCanvasRectangle(int x, int y, int width, int height, + TQCanvas* canvas) : + TQCanvasPolygonalItem(canvas), + w(width), h(height) +{ + move(x,y); +} + +/*! + Destroys the rectangle. +*/ +TQCanvasRectangle::~TQCanvasRectangle() +{ + hide(); +} + + +/*! + Returns the width of the rectangle. +*/ +int TQCanvasRectangle::width() const +{ + return w; +} + +/*! + Returns the height of the rectangle. +*/ +int TQCanvasRectangle::height() const +{ + return h; +} + +/*! + Sets the \a width and \a height of the rectangle. +*/ +void TQCanvasRectangle::setSize(int width, int height) +{ + if ( w != width || h != height ) { + removeFromChunks(); + w = width; + h = height; + addToChunks(); + } +} + +/*! + \fn TQSize TQCanvasRectangle::size() const + + Returns the width() and height() of the rectangle. + + \sa rect(), setSize() +*/ + +/*! + \fn TQRect TQCanvasRectangle::rect() const + + Returns the integer-converted x(), y() position and size() of the + rectangle as a TQRect. +*/ + +/*! + \reimp +*/ +TQPointArray TQCanvasRectangle::areaPoints() const +{ + TQPointArray pa(4); + int pw = (pen().width()+1)/2; + if ( pw < 1 ) pw = 1; + if ( pen() == NoPen ) pw = 0; + pa[0] = TQPoint((int)x()-pw,(int)y()-pw); + pa[1] = pa[0] + TQPoint(w+pw*2,0); + pa[2] = pa[1] + TQPoint(0,h+pw*2); + pa[3] = pa[0] + TQPoint(0,h+pw*2); + return pa; +} + +/*! + Draws the rectangle on painter \a p. +*/ +void TQCanvasRectangle::drawShape(TQPainter & p) +{ + p.drawRect((int)x(), (int)y(), w, h); +} + + +/*! + \class TQCanvasEllipse tqcanvas.h + \brief The TQCanvasEllipse class provides an ellipse or ellipse segment on a TQCanvas. +\if defined(commercial) + It is part of the TQt Enterprise Edition. +\endif + + \module canvas + \ingroup graphics + \ingroup images + + A canvas item that paints an ellipse or ellipse segment with a TQBrush. + The ellipse's height, width, start angle and angle length can be set + at construction time. The size can be changed at runtime with + setSize(), and the angles can be changed (if you're displaying an + ellipse segment rather than a whole ellipse) with setAngles(). + + Note that angles are specified in 16ths of a degree. + + \target anglediagram + \img tqcanvasellipse.png Ellipse + + If a start angle and length angle are set then an ellipse segment + will be drawn. The start angle is the angle that goes from zero in a + counter-clockwise direction (shown in green in the diagram). The + length angle is the angle from the start angle in a + counter-clockwise direction (shown in blue in the diagram). The blue + segment is the segment of the ellipse that would be drawn. If no + start angle and length angle are specified the entire ellipse is + drawn. + + The ellipse can be drawn on a painter with drawShape(). + + Like any other canvas item ellipses can be moved with move() and + moveBy(), or by setting coordinates with setX(), setY() and setZ(). + + Note: TQCanvasEllipse does not use the pen. +*/ + +/*! + Constructs a 32x32 ellipse, centered at (0, 0) on \a canvas. +*/ +TQCanvasEllipse::TQCanvasEllipse(TQCanvas* canvas) : + TQCanvasPolygonalItem(canvas), + w(32), h(32), + a1(0), a2(360*16) +{ +} + +/*! + Constructs a \a width by \a height pixel ellipse, centered at + (0, 0) on \a canvas. +*/ +TQCanvasEllipse::TQCanvasEllipse(int width, int height, TQCanvas* canvas) : + TQCanvasPolygonalItem(canvas), + w(width),h(height), + a1(0),a2(360*16) +{ +} + +// ### add a constructor taking degrees in float. 1/16 degrees is stupid. Lars +// ### it's how TQPainter does it, so TQCanvas does too for consistency. If it's +// ### a good idea, it should be added to TQPainter, not just to TQCanvas. Warwick +/*! + Constructs a \a width by \a height pixel ellipse, centered at + (0, 0) on \a canvas. Only a segment of the ellipse is drawn, + starting at angle \a startangle, and extending for angle \a angle + (the angle length). + + Note that angles are specified in + 1/16ths of a degree. +*/ +TQCanvasEllipse::TQCanvasEllipse(int width, int height, + int startangle, int angle, TQCanvas* canvas) : + TQCanvasPolygonalItem(canvas), + w(width),h(height), + a1(startangle),a2(angle) +{ +} + +/*! + Destroys the ellipse. +*/ +TQCanvasEllipse::~TQCanvasEllipse() +{ + hide(); +} + +/*! + Returns the width of the ellipse. +*/ +int TQCanvasEllipse::width() const +{ + return w; +} + +/*! + Returns the height of the ellipse. +*/ +int TQCanvasEllipse::height() const +{ + return h; +} + +/*! + Sets the \a width and \a height of the ellipse. +*/ +void TQCanvasEllipse::setSize(int width, int height) +{ + if ( w != width || h != height ) { + removeFromChunks(); + w = width; + h = height; + addToChunks(); + } +} + +/*! + \fn int TQCanvasEllipse::angleStart() const + + Returns the start angle in 16ths of a degree. Initially + this will be 0. + + \sa setAngles(), angleLength() +*/ + +/*! + \fn int TQCanvasEllipse::angleLength() const + + Returns the length angle (the extent of the ellipse segment) in + 16ths of a degree. Initially this will be 360 * 16 (a complete + ellipse). + + \sa setAngles(), angleStart() +*/ + +/*! + Sets the angles for the ellipse. The start angle is \a start and + the extent of the segment is \a length (the angle length) from the + \a start. The angles are specified in 16ths of a degree. By + default the ellipse will start at 0 and have an angle length of + 360 * 16 (a complete ellipse). + + \sa angleStart(), angleLength() +*/ +void TQCanvasEllipse::setAngles(int start, int length) +{ + if ( a1 != start || a2 != length ) { + removeFromChunks(); + a1 = start; + a2 = length; + addToChunks(); + } +} + +/*! + \reimp +*/ +TQPointArray TQCanvasEllipse::areaPoints() const +{ + TQPointArray r; + // makeArc at 0,0, then translate so that fixed point math doesn't overflow + r.makeArc(int(x()-w/2.0+0.5)-1, int(y()-h/2.0+0.5)-1, w+3, h+3, a1, a2); + r.resize(r.size()+1); + r.setPoint(r.size()-1,int(x()),int(y())); + return r; +} + +// ### support outlines! Lars +// ### TQRegion doesn't, so we cannot (try it). Warwick +/*! + Draws the ellipse, centered at x(), y() using the painter \a p. + + Note that TQCanvasEllipse does not support an outline (the pen is + always NoPen). +*/ +void TQCanvasEllipse::drawShape(TQPainter & p) +{ + p.setPen(NoPen); // since TQRegion(TQPointArray) excludes outline :-( )-: + if ( !a1 && a2 == 360*16 ) { + p.drawEllipse(int(x()-w/2.0+0.5), int(y()-h/2.0+0.5), w, h); + } else { + p.drawPie(int(x()-w/2.0+0.5), int(y()-h/2.0+0.5), w, h, a1, a2); + } +} + + +/*! + \class TQCanvasText tqcanvas.h + \brief The TQCanvasText class provides a text object on a TQCanvas. +\if defined(commercial) + It is part of the TQt Enterprise Edition. +\endif + + \module canvas + \ingroup graphics + \ingroup images + + A canvas text item has text with font, color and alignment + attributes. The text and font can be set in the constructor or set + or changed later with setText() and setFont(). The color is set + with setColor() and the alignment with setTextFlags(). The text + item's bounding rectangle is retrieved with boundingRect(). + + The text can be drawn on a painter with draw(). + + Like any other canvas item text items can be moved with + TQCanvasItem::move() and TQCanvasItem::moveBy(), or by setting + coordinates with TQCanvasItem::setX(), TQCanvasItem::setY() and + TQCanvasItem::setZ(). +*/ + +/*! + Constructs a TQCanvasText with the text "\", on \a canvas. +*/ +TQCanvasText::TQCanvasText(TQCanvas* canvas) : + TQCanvasItem(canvas), + txt(""), flags(0) +{ + setRect(); +} + +// ### add textflags to the constructor? Lars +/*! + Constructs a TQCanvasText with the text \a t, on canvas \a canvas. +*/ +TQCanvasText::TQCanvasText(const TQString& t, TQCanvas* canvas) : + TQCanvasItem(canvas), + txt(t), flags(0) +{ + setRect(); +} + +// ### see above +/*! + Constructs a TQCanvasText with the text \a t and font \a f, on the + canvas \a canvas. +*/ +TQCanvasText::TQCanvasText(const TQString& t, TQFont f, TQCanvas* canvas) : + TQCanvasItem(canvas), + txt(t), flags(0), + fnt(f) +{ + setRect(); +} + +/*! + Destroys the canvas text item. +*/ +TQCanvasText::~TQCanvasText() +{ + removeFromChunks(); +} + +/*! + Returns the bounding rectangle of the text. +*/ +TQRect TQCanvasText::boundingRect() const { return brect; } + +void TQCanvasText::setRect() +{ + brect = TQFontMetrics(fnt).boundingRect(int(x()), int(y()), 0, 0, flags, txt); + brect.setWidth(brect.width()+1); +} + +/*! + \fn int TQCanvasText::textFlags() const + + Returns the currently set alignment flags. + + \sa setTextFlags() TQt::AlignmentFlags +*/ + + +/*! + Sets the alignment flags to \a f. These are a bitwise OR of the + flags available to TQPainter::drawText() -- see the + \l{TQt::AlignmentFlags}. + + \sa setFont() setColor() +*/ +void TQCanvasText::setTextFlags(int f) +{ + if ( flags != f ) { + removeFromChunks(); + flags = f; + setRect(); + addToChunks(); + } +} + +/*! + Returns the text item's text. + + \sa setText() +*/ +TQString TQCanvasText::text() const +{ + return txt; +} + + +/*! + Sets the text item's text to \a t. The text may contain newlines. + + \sa text(), setFont(), setColor() setTextFlags() +*/ +void TQCanvasText::setText( const TQString& t ) +{ + if ( txt != t ) { + removeFromChunks(); + txt = t; + setRect(); + addToChunks(); + } +} + +/*! + Returns the font in which the text is drawn. + + \sa setFont() +*/ +TQFont TQCanvasText::font() const +{ + return fnt; +} + +/*! + Sets the font in which the text is drawn to font \a f. + + \sa font() +*/ +void TQCanvasText::setFont( const TQFont& f ) +{ + if ( f != fnt ) { + removeFromChunks(); + fnt = f; + setRect(); + addToChunks(); + } +} + +/*! + Returns the color of the text. + + \sa setColor() +*/ +TQColor TQCanvasText::color() const +{ + return col; +} + +/*! + Sets the color of the text to the color \a c. + + \sa color(), setFont() +*/ +void TQCanvasText::setColor(const TQColor& c) +{ + col=c; + changeChunks(); +} + + +/*! + \reimp +*/ +void TQCanvasText::moveBy(double dx, double dy) +{ + int idx = int(x()+dx)-int(x()); + int idy = int(y()+dy)-int(y()); + if ( idx || idy ) { + removeFromChunks(); + } + myx+=dx; + myy+=dy; + if ( idx || idy ) { + brect.moveBy(idx,idy); + addToChunks(); + } +} + +/*! + Draws the text using the painter \a painter. +*/ +void TQCanvasText::draw(TQPainter& painter) +{ + painter.setFont(fnt); + painter.setPen(col); + painter.drawText(brect, flags, txt); +} + +/*! + \reimp +*/ +void TQCanvasText::changeChunks() +{ + if (isVisible() && canvas()) { + int chunksize=canvas()->chunkSize(); + for (int j=brect.top()/chunksize; j<=brect.bottom()/chunksize; j++) { + for (int i=brect.left()/chunksize; i<=brect.right()/chunksize; i++) { + canvas()->setChangedChunk(i,j); + } + } + } +} + +/*! + Adds the text item to the appropriate chunks. +*/ +void TQCanvasText::addToChunks() +{ + if (isVisible() && canvas()) { + int chunksize=canvas()->chunkSize(); + for (int j=brect.top()/chunksize; j<=brect.bottom()/chunksize; j++) { + for (int i=brect.left()/chunksize; i<=brect.right()/chunksize; i++) { + canvas()->addItemToChunk(this,i,j); + } + } + } +} + +/*! + Removes the text item from the appropriate chunks. +*/ +void TQCanvasText::removeFromChunks() +{ + if (isVisible() && canvas()) { + int chunksize=canvas()->chunkSize(); + for (int j=brect.top()/chunksize; j<=brect.bottom()/chunksize; j++) { + for (int i=brect.left()/chunksize; i<=brect.right()/chunksize; i++) { + canvas()->removeItemFromChunk(this,i,j); + } + } + } +} + + +/*! + Returns 0 (TQCanvasItem::Rtti_Item). + + Make your derived classes return their own values for rtti(), so + that you can distinguish between objects returned by + TQCanvas::at(). You should use values greater than 1000 to allow + for extensions to this class. + + Overuse of this functionality can damage it's extensibility. For + example, once you have identified a base class of a TQCanvasItem + found by TQCanvas::at(), cast it to that type and call meaningful + methods rather than acting upon the object based on its rtti + value. + + For example: + + \code + TQCanvasItem* item; + // Find an item, e.g. with TQCanvasItem::collisions(). + ... + if (item->rtti() == MySprite::RTTI ) { + MySprite* s = (MySprite*)item; + if (s->isDamagable()) s->loseHitPoints(1000); + if (s->isHot()) myself->loseHitPoints(1000); + ... + } + \endcode +*/ +int TQCanvasItem::rtti() const { return RTTI; } +int TQCanvasItem::RTTI = Rtti_Item; + +/*! + Returns 1 (TQCanvasItem::Rtti_Sprite). + + \sa TQCanvasItem::rtti() +*/ +int TQCanvasSprite::rtti() const { return RTTI; } +int TQCanvasSprite::RTTI = Rtti_Sprite; + +/*! + Returns 2 (TQCanvasItem::Rtti_PolygonalItem). + + \sa TQCanvasItem::rtti() +*/ +int TQCanvasPolygonalItem::rtti() const { return RTTI; } +int TQCanvasPolygonalItem::RTTI = Rtti_PolygonalItem; + +/*! + Returns 3 (TQCanvasItem::Rtti_Text). + + \sa TQCanvasItem::rtti() +*/ +int TQCanvasText::rtti() const { return RTTI; } +int TQCanvasText::RTTI = Rtti_Text; + +/*! + Returns 4 (TQCanvasItem::Rtti_Polygon). + + \sa TQCanvasItem::rtti() +*/ +int TQCanvasPolygon::rtti() const { return RTTI; } +int TQCanvasPolygon::RTTI = Rtti_Polygon; + +/*! + Returns 5 (TQCanvasItem::Rtti_Rectangle). + + \sa TQCanvasItem::rtti() +*/ +int TQCanvasRectangle::rtti() const { return RTTI; } +int TQCanvasRectangle::RTTI = Rtti_Rectangle; + +/*! + Returns 6 (TQCanvasItem::Rtti_Ellipse). + + \sa TQCanvasItem::rtti() +*/ +int TQCanvasEllipse::rtti() const { return RTTI; } +int TQCanvasEllipse::RTTI = Rtti_Ellipse; + +/*! + Returns 7 (TQCanvasItem::Rtti_Line). + + \sa TQCanvasItem::rtti() +*/ +int TQCanvasLine::rtti() const { return RTTI; } +int TQCanvasLine::RTTI = Rtti_Line; + +/*! + Returns 8 (TQCanvasItem::Rtti_Spline). + + \sa TQCanvasItem::rtti() +*/ +int TQCanvasSpline::rtti() const { return RTTI; } +int TQCanvasSpline::RTTI = Rtti_Spline; + +/*! + Constructs a TQCanvasSprite which uses images from the + TQCanvasPixmapArray \a a. + + The sprite in initially positioned at (0, 0) on \a canvas, using + frame 0. +*/ +TQCanvasSprite::TQCanvasSprite(TQCanvasPixmapArray* a, TQCanvas* canvas) : + TQCanvasItem(canvas), + frm(0), + anim_val(0), + anim_state(0), + anim_type(0), + images(a) +{ +} + + +/*! + Set the array of images used for displaying the sprite to the + TQCanvasPixmapArray \a a. + + If the current frame() is larger than the number of images in \a + a, the current frame will be reset to 0. +*/ +void TQCanvasSprite::setSequence(TQCanvasPixmapArray* a) +{ + bool isvisible = isVisible(); + if ( isvisible && images ) + hide(); + images = a; + if ( frm >= (int)images->count() ) + frm = 0; + if ( isvisible ) + show(); +} + +/*! +\internal + +Marks any chunks the sprite touches as changed. +*/ +void TQCanvasSprite::changeChunks() +{ + if (isVisible() && canvas()) { + int chunksize=canvas()->chunkSize(); + for (int j=topEdge()/chunksize; j<=bottomEdge()/chunksize; j++) { + for (int i=leftEdge()/chunksize; i<=rightEdge()/chunksize; i++) { + canvas()->setChangedChunk(i,j); + } + } + } +} + +/*! + Destroys the sprite and removes it from the canvas. Does \e not + delete the images. +*/ +TQCanvasSprite::~TQCanvasSprite() +{ + removeFromChunks(); +} + +/*! + Sets the animation frame used for displaying the sprite to \a f, + an index into the TQCanvasSprite's TQCanvasPixmapArray. The call + will be ignored if \a f is larger than frameCount() or smaller + than 0. + + \sa frame() move() +*/ +void TQCanvasSprite::setFrame(int f) +{ + move(x(),y(),f); +} + +/*! + \enum TQCanvasSprite::FrameAnimationType + + This enum is used to identify the different types of frame + animation offered by TQCanvasSprite. + + \value Cycle at each advance the frame number will be incremented by + 1 (modulo the frame count). + \value Oscillate at each advance the frame number will be + incremented by 1 up to the frame count then decremented to by 1 to + 0, repeating this sequence forever. +*/ + +/*! + Sets the animation characteristics for the sprite. + + For \a type == \c Cycle, the frames will increase by \a step + at each advance, modulo the frameCount(). + + For \a type == \c Oscillate, the frames will increase by \a step + at each advance, up to the frameCount(), then decrease by \a step + back to 0, repeating forever. + + The \a state parameter is for internal use. +*/ +void TQCanvasSprite::setFrameAnimation(FrameAnimationType type, int step, int state) +{ + anim_val = step; + anim_type = type; + anim_state = state; + setAnimated(TRUE); +} + +/*! + Extends the default TQCanvasItem implementation to provide the + functionality of setFrameAnimation(). + + The \a phase is 0 or 1: see TQCanvasItem::advance() for details. + + \sa TQCanvasItem::advance() setVelocity() +*/ +void TQCanvasSprite::advance(int phase) +{ + if ( phase==1 ) { + int nf = frame(); + if ( anim_type == Oscillate ) { + if ( anim_state ) + nf += anim_val; + else + nf -= anim_val; + if ( nf < 0 ) { + nf = abs(anim_val); + anim_state = !anim_state; + } else if ( nf >= frameCount() ) { + nf = frameCount()-1-abs(anim_val); + anim_state = !anim_state; + } + } else { + nf = (nf + anim_val + frameCount()) % frameCount(); + } + move(x()+xVelocity(),y()+yVelocity(),nf); + } +} + + +/*! + \fn int TQCanvasSprite::frame() const + + Returns the index of the current animation frame in the + TQCanvasSprite's TQCanvasPixmapArray. + + \sa setFrame(), move() +*/ + +/*! + \fn int TQCanvasSprite::frameCount() const + + Returns the number of frames in the TQCanvasSprite's + TQCanvasPixmapArray. +*/ + + +/*! + \reimp + \internal + Moves the sprite to the position \a x, \a y. + Keep it visible. +*/ +void TQCanvasSprite::move(double x, double y) { TQCanvasItem::move(x,y); } + +/*! + \fn void TQCanvasSprite::move(double nx, double ny, int nf) + + Set the position of the sprite to \a nx, \a ny and the current + frame to \a nf. \a nf will be ignored if it is larger than + frameCount() or smaller than 0. +*/ +void TQCanvasSprite::move(double nx, double ny, int nf) +{ + if (isVisible() && canvas()) { + hide(); + TQCanvasItem::move(nx,ny); + if ( nf >= 0 && nf < frameCount() ) + frm=nf; + show(); + } else { + TQCanvasItem::move(nx,ny); + if ( nf >= 0 && nf < frameCount() ) + frm=nf; + } +} + +class TQCanvasPolygonScanner : public TQPolygonScanner { + TQPolygonalProcessor& processor; +public: + TQCanvasPolygonScanner(TQPolygonalProcessor& p) : + processor(p) + { + } + void processSpans( int n, TQPoint* point, int* width ) + { + processor.doSpans(n,point,width); + } +}; + +void TQCanvasPolygonalItem::scanPolygon(const TQPointArray& pa, int winding, TQPolygonalProcessor& process) const +{ + TQCanvasPolygonScanner scanner(process); + scanner.scan(pa,winding); +} + + +#endif // TQT_NO_CANVAS diff --git a/src/canvas/tqcanvas.h b/src/canvas/tqcanvas.h new file mode 100644 index 00000000..9bf3d729 --- /dev/null +++ b/src/canvas/tqcanvas.h @@ -0,0 +1,816 @@ +/********************************************************************** +** +** Definition of TQCanvas classes +** +** Created : 991211 +** +** Copyright (C) 1999-2008 Trolltech ASA. All rights reserved. +** +** This file is part of the canvas module of the TQt GUI Toolkit. +** +** This file may be used under the terms of the GNU General +** Public License versions 2.0 or 3.0 as published by the Free +** Software Foundation and appearing in the files LICENSE.GPL2 +** and LICENSE.GPL3 included in the packaging of this file. +** Alternatively you may (at your option) use any later version +** of the GNU General Public License if such license has been +** publicly approved by Trolltech ASA (or its successors, if any) +** and the KDE Free TQt Foundation. +** +** Please review the following information to ensure GNU General +** Public Licensing requirements will be met: +** http://trolltech.com/products/qt/licenses/licensing/opensource/. +** If you are unsure which license is appropriate for your use, please +** review the following information: +** http://trolltech.com/products/qt/licenses/licensing/licensingoverview +** or contact the sales department at sales@trolltech.com. +** +** This file may be used under the terms of the Q Public License as +** defined by Trolltech ASA and appearing in the file LICENSE.TQPL +** included in the packaging of this file. Licensees holding valid TQt +** Commercial licenses may use this file in accordance with the TQt +** Commercial License Agreement provided with the Software. +** +** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, +** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE. Trolltech reserves all rights not granted +** herein. +** +**********************************************************************/ + +#ifndef TQCANVAS_H +#define TQCANVAS_H + +#ifndef QT_H +#include "ntqscrollview.h" +#include "ntqpixmap.h" +#include "ntqptrlist.h" +#include "ntqbrush.h" +#include "ntqpen.h" +#include "ntqvaluelist.h" +#include "ntqpointarray.h" +#endif // QT_H + +#if !defined( TQT_MODULE_CANVAS ) || defined( QT_LICENSE_PROFESSIONAL ) || defined( QT_INTERNAL_CANVAS ) +#define TQM_EXPORT_CANVAS +#define TQM_TEMPLATE_EXTERN_CANVAS +#else +#define TQM_EXPORT_CANVAS TQ_EXPORT +#define TQM_TEMPLATE_EXTERN_CANVAS Q_TEMPLATE_EXTERN +#endif + +#ifndef TQT_NO_CANVAS + + +class TQCanvasSprite; +class TQCanvasPolygonalItem; +class TQCanvasRectangle; +class TQCanvasPolygon; +class TQCanvasEllipse; +class TQCanvasText; +class TQCanvasLine; +class TQCanvasChunk; +class TQCanvas; +class TQCanvasItem; +class TQCanvasView; +class TQCanvasPixmap; + +#if defined(Q_TEMPLATEDLL) && ( !defined(Q_CC_BOR) || !defined(QT_MAKEDLL) || defined(Q_EXPORT_TEMPLATES) ) +// MOC_SKIP_BEGIN +TQM_TEMPLATE_EXTERN_CANVAS template class TQM_EXPORT_CANVAS TQValueListIterator< TQCanvasItem* >; +TQM_TEMPLATE_EXTERN_CANVAS template class TQM_EXPORT_CANVAS TQValueList< TQCanvasItem* >; +// MOC_SKIP_END +#endif + +class TQM_EXPORT_CANVAS TQCanvasItemList : public TQValueList { +public: + void sort(); + void drawUnique( TQPainter& painter ); + TQCanvasItemList operator+(const TQCanvasItemList &l) const; +}; + + +class TQCanvasItemExtra; + +class TQM_EXPORT_CANVAS TQCanvasItem : public TQt +{ +public: + TQCanvasItem(TQCanvas* canvas); + virtual ~TQCanvasItem(); + + double x() const + { return myx; } + double y() const + { return myy; } + double z() const + { return myz; } // (depth) + + virtual void moveBy(double dx, double dy); + void move(double x, double y); + void setX(double a) { move(a,y()); } + void setY(double a) { move(x(),a); } + void setZ(double a) { myz=a; changeChunks(); } + + bool animated() const; + virtual void setAnimated(bool y); + virtual void setVelocity( double vx, double vy); + void setXVelocity( double vx ) { setVelocity(vx,yVelocity()); } + void setYVelocity( double vy ) { setVelocity(xVelocity(),vy); } + double xVelocity() const; + double yVelocity() const; + virtual void advance(int stage); + + virtual bool collidesWith( const TQCanvasItem* ) const=0; + + TQCanvasItemList collisions(bool exact /* NO DEFAULT */ ) const; + + virtual void setCanvas(TQCanvas*); + + virtual void draw(TQPainter&)=0; + + void show(); + void hide(); + + virtual void setVisible(bool yes); + bool isVisible() const + { return (bool)vis; } + virtual void setSelected(bool yes); + bool isSelected() const + { return (bool)sel; } + virtual void setEnabled(bool yes); + bool isEnabled() const + { return (bool)ena; } + virtual void setActive(bool yes); + bool isActive() const + { return (bool)act; } +#ifndef TQT_NO_COMPAT + bool visible() const + { return (bool)vis; } + bool selected() const + { return (bool)sel; } + bool enabled() const + { return (bool)ena; } + bool active() const + { return (bool)act; } +#endif + + enum RttiValues { + Rtti_Item = 0, + Rtti_Sprite = 1, + Rtti_PolygonalItem = 2, + Rtti_Text = 3, + Rtti_Polygon = 4, + Rtti_Rectangle = 5, + Rtti_Ellipse = 6, + Rtti_Line = 7, + Rtti_Spline = 8 + }; + + virtual int rtti() const; + static int RTTI; + + virtual TQRect boundingRect() const=0; + virtual TQRect boundingRectAdvanced() const; + + TQCanvas* canvas() const + { return cnv; } + +protected: + void update() { changeChunks(); } + +private: + // For friendly subclasses... + + friend class TQCanvasPolygonalItem; + friend class TQCanvasSprite; + friend class TQCanvasRectangle; + friend class TQCanvasPolygon; + friend class TQCanvasEllipse; + friend class TQCanvasText; + friend class TQCanvasLine; + + virtual TQPointArray chunks() const; + virtual void addToChunks(); + virtual void removeFromChunks(); + virtual void changeChunks(); + virtual bool collidesWith( const TQCanvasSprite*, + const TQCanvasPolygonalItem*, + const TQCanvasRectangle*, + const TQCanvasEllipse*, + const TQCanvasText* ) const = 0; + // End of friend stuff + + TQCanvas* cnv; + static TQCanvas* current_canvas; + double myx,myy,myz; + TQCanvasItemExtra *ext; + TQCanvasItemExtra& extra(); + uint ani:1; + uint vis:1; + uint val:1; + uint sel:1; + uint ena:1; + uint act:1; +}; + + +class TQCanvasData; + +class TQM_EXPORT_CANVAS TQCanvas : public TQObject +{ + TQ_OBJECT +public: + TQCanvas( TQObject* parent = 0, const char* name = 0 ); + TQCanvas(int w, int h); + TQCanvas( TQPixmap p, int h, int v, int tilewidth, int tileheight ); + + virtual ~TQCanvas(); + + virtual void setTiles( TQPixmap tiles, int h, int v, + int tilewidth, int tileheight ); + virtual void setBackgroundPixmap( const TQPixmap& p ); + TQPixmap backgroundPixmap() const; + + virtual void setBackgroundColor( const TQColor& c ); + TQColor backgroundColor() const; + + virtual void setTile( int x, int y, int tilenum ); + int tile( int x, int y ) const + { return grid[x+y*htiles]; } + + int tilesHorizontally() const + { return htiles; } + int tilesVertically() const + { return vtiles; } + + int tileWidth() const + { return tilew; } + int tileHeight() const + { return tileh; } + + virtual void resize(int width, int height); + int width() const + { return awidth; } + int height() const + { return aheight; } + TQSize size() const + { return TQSize(awidth,aheight); } + TQRect rect() const + { return TQRect( 0, 0, awidth, aheight ); } + bool onCanvas( int x, int y ) const + { return x>=0 && y>=0 && x=0 && y>=0 && x, TQPtrList hotspots); + + TQCanvasPixmapArray(TQValueList, TQPointArray hotspots = TQPointArray() ); + ~TQCanvasPixmapArray(); + +#ifndef TQT_NO_IMAGEIO + bool readPixmaps(const TQString& datafilenamepattern, int framecount=0); + bool readCollisionMasks(const TQString& filenamepattern); +#endif + + // deprecated + bool operator!(); // Failure check. + bool isValid() const; + + TQCanvasPixmap* image(int i) const + { return img ? img[i] : 0; } + void setImage(int i, TQCanvasPixmap* p); + uint count() const + { return (uint)framecount; } + +private: +#if defined(TQ_DISABLE_COPY) + TQCanvasPixmapArray( const TQCanvasPixmapArray & ); + TQCanvasPixmapArray &operator=( const TQCanvasPixmapArray & ); +#endif +#ifndef TQT_NO_IMAGEIO + bool readPixmaps(const TQString& datafilenamepattern, int framecount, bool maskonly); +#endif + + void reset(); + int framecount; + TQCanvasPixmap** img; +}; + + +class TQM_EXPORT_CANVAS TQCanvasSprite : public TQCanvasItem +{ +public: + TQCanvasSprite(TQCanvasPixmapArray* array, TQCanvas* canvas); + + void setSequence(TQCanvasPixmapArray* seq); + + virtual ~TQCanvasSprite(); + + void move(double x, double y); + virtual void move(double x, double y, int frame); + void setFrame(int); + enum FrameAnimationType { Cycle, Oscillate }; + virtual void setFrameAnimation(FrameAnimationType=Cycle, int step=1, int state=0); + int frame() const + { return frm; } + int frameCount() const + { return images->count(); } + + int rtti() const; + static int RTTI; + + bool collidesWith( const TQCanvasItem* ) const; + + TQRect boundingRect() const; + + // is there a reason for these to be protected? Lars +//protected: + + int width() const; + int height() const; + + int leftEdge() const; + int topEdge() const; + int rightEdge() const; + int bottomEdge() const; + + int leftEdge(int nx) const; + int topEdge(int ny) const; + int rightEdge(int nx) const; + int bottomEdge(int ny) const; + TQCanvasPixmap* image() const + { return images->image(frm); } + virtual TQCanvasPixmap* imageAdvanced() const; + TQCanvasPixmap* image(int f) const + { return images->image(f); } + virtual void advance(int stage); + +public: + void draw(TQPainter& painter); + +private: +#if defined(TQ_DISABLE_COPY) + TQCanvasSprite( const TQCanvasSprite & ); + TQCanvasSprite &operator=( const TQCanvasSprite & ); +#endif + void addToChunks(); + void removeFromChunks(); + void changeChunks(); + + int frm; + ushort anim_val; + uint anim_state:2; + uint anim_type:14; + bool collidesWith( const TQCanvasSprite*, + const TQCanvasPolygonalItem*, + const TQCanvasRectangle*, + const TQCanvasEllipse*, + const TQCanvasText* ) const; + + friend bool qt_testCollision( const TQCanvasSprite* s1, + const TQCanvasSprite* s2 ); + + TQCanvasPixmapArray* images; +}; + +class TQPolygonalProcessor; + +class TQM_EXPORT_CANVAS TQCanvasPolygonalItem : public TQCanvasItem +{ +public: + TQCanvasPolygonalItem(TQCanvas* canvas); + virtual ~TQCanvasPolygonalItem(); + + bool collidesWith( const TQCanvasItem* ) const; + + virtual void setPen(TQPen p); + virtual void setBrush(TQBrush b); + + TQPen pen() const + { return pn; } + TQBrush brush() const + { return br; } + + virtual TQPointArray areaPoints() const=0; + virtual TQPointArray areaPointsAdvanced() const; + TQRect boundingRect() const; + + int rtti() const; + static int RTTI; + +protected: + void draw(TQPainter &); + virtual void drawShape(TQPainter &) = 0; + + bool winding() const; + void setWinding(bool); + + void invalidate(); + bool isValid() const + { return (bool)val; } + +private: + void scanPolygon( const TQPointArray& pa, int winding, + TQPolygonalProcessor& process ) const; + TQPointArray chunks() const; + + bool collidesWith( const TQCanvasSprite*, + const TQCanvasPolygonalItem*, + const TQCanvasRectangle*, + const TQCanvasEllipse*, + const TQCanvasText* ) const; + + TQBrush br; + TQPen pn; + uint wind:1; +}; + + +class TQM_EXPORT_CANVAS TQCanvasRectangle : public TQCanvasPolygonalItem +{ +public: + TQCanvasRectangle(TQCanvas* canvas); + TQCanvasRectangle(const TQRect&, TQCanvas* canvas); + TQCanvasRectangle(int x, int y, int width, int height, TQCanvas* canvas); + + ~TQCanvasRectangle(); + + int width() const; + int height() const; + void setSize(int w, int h); + TQSize size() const + { return TQSize(w,h); } + TQPointArray areaPoints() const; + TQRect rect() const + { return TQRect(int(x()),int(y()),w,h); } + + bool collidesWith( const TQCanvasItem* ) const; + + int rtti() const; + static int RTTI; + +protected: + void drawShape(TQPainter &); + TQPointArray chunks() const; + +private: + bool collidesWith( const TQCanvasSprite*, + const TQCanvasPolygonalItem*, + const TQCanvasRectangle*, + const TQCanvasEllipse*, + const TQCanvasText* ) const; + + int w, h; +}; + + +class TQM_EXPORT_CANVAS TQCanvasPolygon : public TQCanvasPolygonalItem +{ +public: + TQCanvasPolygon(TQCanvas* canvas); + ~TQCanvasPolygon(); + void setPoints(TQPointArray); + TQPointArray points() const; + void moveBy(double dx, double dy); + + TQPointArray areaPoints() const; + + int rtti() const; + static int RTTI; + +protected: + void drawShape(TQPainter &); + TQPointArray poly; +}; + + +class TQM_EXPORT_CANVAS TQCanvasSpline : public TQCanvasPolygon +{ +public: + TQCanvasSpline(TQCanvas* canvas); + ~TQCanvasSpline(); + + void setControlPoints(TQPointArray, bool closed=TRUE); + TQPointArray controlPoints() const; + bool closed() const; + + int rtti() const; + static int RTTI; + +private: + void recalcPoly(); + TQPointArray bez; + bool cl; +}; + + +class TQM_EXPORT_CANVAS TQCanvasLine : public TQCanvasPolygonalItem +{ +public: + TQCanvasLine(TQCanvas* canvas); + ~TQCanvasLine(); + void setPoints(int x1, int y1, int x2, int y2); + + TQPoint startPoint() const + { return TQPoint(x1,y1); } + TQPoint endPoint() const + { return TQPoint(x2,y2); } + + int rtti() const; + static int RTTI; + + void setPen(TQPen p); + void moveBy(double dx, double dy); + +protected: + void drawShape(TQPainter &); + TQPointArray areaPoints() const; + +private: + int x1,y1,x2,y2; +}; + + +class TQM_EXPORT_CANVAS TQCanvasEllipse : public TQCanvasPolygonalItem +{ + +public: + TQCanvasEllipse( TQCanvas* canvas ); + TQCanvasEllipse( int width, int height, TQCanvas* canvas ); + TQCanvasEllipse( int width, int height, int startangle, int angle, + TQCanvas* canvas ); + + ~TQCanvasEllipse(); + + int width() const; + int height() const; + void setSize(int w, int h); + void setAngles(int start, int length); + int angleStart() const + { return a1; } + int angleLength() const + { return a2; } + TQPointArray areaPoints() const; + + bool collidesWith( const TQCanvasItem* ) const; + + int rtti() const; + static int RTTI; + +protected: + void drawShape(TQPainter &); + +private: + bool collidesWith( const TQCanvasSprite*, + const TQCanvasPolygonalItem*, + const TQCanvasRectangle*, + const TQCanvasEllipse*, + const TQCanvasText* ) const; + int w, h; + int a1, a2; +}; + + +class TQCanvasTextExtra; + +class TQM_EXPORT_CANVAS TQCanvasText : public TQCanvasItem +{ +public: + TQCanvasText(TQCanvas* canvas); + TQCanvasText(const TQString&, TQCanvas* canvas); + TQCanvasText(const TQString&, TQFont, TQCanvas* canvas); + + virtual ~TQCanvasText(); + + void setText( const TQString& ); + void setFont( const TQFont& ); + void setColor( const TQColor& ); + TQString text() const; + TQFont font() const; + TQColor color() const; + + void moveBy(double dx, double dy); + + int textFlags() const + { return flags; } + void setTextFlags(int); + + TQRect boundingRect() const; + + bool collidesWith( const TQCanvasItem* ) const; + + int rtti() const; + static int RTTI; + +protected: + virtual void draw(TQPainter&); + +private: +#if defined(TQ_DISABLE_COPY) + TQCanvasText( const TQCanvasText & ); + TQCanvasText &operator=( const TQCanvasText & ); +#endif + void addToChunks(); + void removeFromChunks(); + void changeChunks(); + + void setRect(); + TQRect brect; + TQString txt; + int flags; + TQFont fnt; + TQColor col; + TQCanvasTextExtra* extra; + + bool collidesWith( const TQCanvasSprite*, + const TQCanvasPolygonalItem*, + const TQCanvasRectangle*, + const TQCanvasEllipse*, + const TQCanvasText* ) const; +}; + +#define Q_DEFINED_QCANVAS +#include "ntqwinexport.h" +#endif // TQT_NO_CANVAS + +#endif // TQCANVAS_H diff --git a/src/kernel/ntqt.h b/src/kernel/ntqt.h index 13f5eb68..78ff48a1 100644 --- a/src/kernel/ntqt.h +++ b/src/kernel/ntqt.h @@ -218,7 +218,7 @@ #include #include #include -#include +#include #include "ntqtranslator.h" #include #include diff --git a/src/kernel/qpointarray.cpp b/src/kernel/qpointarray.cpp index 09be3138..4a4031ff 100644 --- a/src/kernel/qpointarray.cpp +++ b/src/kernel/qpointarray.cpp @@ -483,7 +483,7 @@ static inline int fix_angle( int a ) whereas negative values mean the clockwise direction. Zero degrees is at the 3 o'clock position. - See the \link qcanvasellipse.html#anglediagram angle diagram\endlink. + See the \link tqcanvasellipse.html#anglediagram angle diagram\endlink. */ void TQPointArray::makeArc( int x, int y, int w, int h, int a1, int a2 ) @@ -586,7 +586,7 @@ qtr_elips(TQPointArray& a, int off, double dxP, double dyP, double dxQ, double d whereas negative values mean the clockwise direction. Zero degrees is at the 3 o'clock position. - See the \link qcanvasellipse.html#anglediagram angle diagram\endlink. + See the \link tqcanvasellipse.html#anglediagram angle diagram\endlink. */ void TQPointArray::makeArc( int x, int y, int w, int h, int a1, int a2, diff --git a/src/tools/ntqwinexport.h b/src/tools/ntqwinexport.h index 29d99a22..d2e5e58a 100644 --- a/src/tools/ntqwinexport.h +++ b/src/tools/ntqwinexport.h @@ -188,7 +188,7 @@ Q_TEMPLATE_EXTERN template class TQ_EXPORT TQValueList< TQPtrVector< TQStyleShee Q_TEMPLATE_EXTERN template class TQ_EXPORT TQValueList; #endif -// qcanvas template exports +// tqcanvas template exports #if defined(Q_DEFINED_QPTRLIST) && defined(Q_DEFINED_QCANVAS) && !defined(Q_EXPORTED_QCANVAS1_TEMPLATES) #define Q_EXPORTED_QCANVAS1_TEMPLATES TQM_TEMPLATE_EXTERN_CANVAS template class TQM_EXPORT_CANVAS TQPtrListIterator< TQCanvasItem >; diff --git a/src/tools/qfeatures.txt b/src/tools/qfeatures.txt index f8e5a069..84a25587 100644 --- a/src/tools/qfeatures.txt +++ b/src/tools/qfeatures.txt @@ -25,7 +25,7 @@ SeeAlso: ??? Feature: CANVAS Section: Widgets Requires: SCROLLVIEW BEZIER -Name: QCanvas +Name: TQCanvas SeeAlso: ??? Feature: TOOLBOX diff --git a/src/tools/qwinexport.cpp b/src/tools/qwinexport.cpp index 8abccb8b..bddee65d 100644 --- a/src/tools/qwinexport.cpp +++ b/src/tools/qwinexport.cpp @@ -1,6 +1,6 @@ #define Q_EXPORT_TEMPLATES -#include +#include #include #include #include -- cgit v1.2.1