Krita Source Code Documentation
Loading...
Searching...
No Matches
SimpleCanvas Class Reference
+ Inheritance diagram for SimpleCanvas:

Public Member Functions

void addCommand (KUndo2Command *) override
 
const QWidget * canvasWidget () const override
 
QWidget * canvasWidget () override
 
void gridSize (QPointF *offset, QSizeF *spacing) const override
 
KoSelectedShapesProxyselectedShapesProxy () const override
 selectedShapesProxy() is a special interface for keeping a persistent connections to selectionChanged() and selectionContentChanged() signals. While shapeManager() can change throughout the life time of the canvas, selectedShapesProxy() is guaranteed to stay the same.
 
void setCursor (const QCursor &) override
 
KoShapeManagershapeManager () const override
 
 SimpleCanvas ()
 
bool snapToGrid () const override
 
KoToolProxytoolProxy () const override
 
KoUnit unit () const override
 
void updateCanvas (const QRectF &) override
 
const KoViewConverterviewConverter () const override
 
KoViewConverterviewConverter () override
 
 ~SimpleCanvas () override
 
- Public Member Functions inherited from KoCanvasBase
KoCanvasControllercanvasController () const
 
virtual bool canvasIsOpenGL () const
 
virtual void clipToDocument (const KoShape *shape, QPointF &move) const
 
virtual void disconnectCanvasObserver (QObject *object)
 
virtual QPoint documentOrigin () const
 
 KoCanvasBase (KoShapeControllerBase *shapeController, KoCanvasResourceProvider *sharedResourceManager=0)
 
 Private ()
 
KoCanvasResourceProviderresourceManager () const
 
void setCanvasController (KoCanvasController *controller)
 called by KoCanvasController to set the controller that handles this canvas.
 
KoShapeControllershapeController () const
 
KoSnapGuidesnapGuide () const
 
virtual QPointF viewToDocument (const QPointF &viewPoint) const
 
 ~KoCanvasBase () override
 
 ~Private ()
 

Private Attributes

QScopedPointer< KoSelectedShapesProxySimplem_selectedShapesProxy
 
QScopedPointer< KoShapeManagerm_shapeManager
 

Additional Inherited Members

- Public Attributes inherited from KoCanvasBase
KoCanvasControllercontroller
 
bool isResourceManagerShared
 
QPointer< KoCanvasResourceProviderresourceManager
 
QPointer< KoShapeControllershapeController
 
KoSnapGuidesnapGuide
 

Detailed Description

Definition at line 24 of file KoShapePainter.cpp.

Constructor & Destructor Documentation

◆ SimpleCanvas()

SimpleCanvas::SimpleCanvas ( )
inline

Definition at line 27 of file KoShapePainter.cpp.

28 : KoCanvasBase(0),
31 {
32 }
QScopedPointer< KoShapeManager > m_shapeManager
QScopedPointer< KoSelectedShapesProxySimple > m_selectedShapesProxy

◆ ~SimpleCanvas()

SimpleCanvas::~SimpleCanvas ( )
inlineoverride

Definition at line 34 of file KoShapePainter.cpp.

35 {
36 }

Member Function Documentation

◆ addCommand()

void SimpleCanvas::addCommand ( KUndo2Command * command)
inlineoverridevirtual

Adds a command to the history. Call this for each command you create. This will also execute the command. This means, most of the application's code will look like MyCommand * cmd = new MyCommand( parameters ); canvas.addCommand( cmd );

Note that the command history takes ownership of the command, it will delete it when the undo limit is reached, or when deleting the command history itself.

Parameters
commandthe command to add

Implements KoCanvasBase.

Definition at line 49 of file KoShapePainter.cpp.

50 {
51 }

◆ canvasWidget() [1/2]

const QWidget * SimpleCanvas::canvasWidget ( ) const
inlineoverridevirtual

Return the widget that will be added to the scrollArea.

Implements KoCanvasBase.

Definition at line 87 of file KoShapePainter.cpp.

88 {
89 return 0;
90 }

◆ canvasWidget() [2/2]

QWidget * SimpleCanvas::canvasWidget ( )
inlineoverridevirtual

Return the widget that will be added to the scrollArea.

Implements KoCanvasBase.

Definition at line 82 of file KoShapePainter.cpp.

83 {
84 return 0;
85 }

◆ gridSize()

void SimpleCanvas::gridSize ( QPointF * offset,
QSizeF * spacing ) const
inlineoverridevirtual

retrieve the grid size setting. The grid spacing will be provided in pt.

Parameters
horizontala pointer to a qreal that will be filled with the horizontal grid-spacing
verticala pointer to a qreal that will be filled with the vertical grid-spacing

Implements KoCanvasBase.

Definition at line 38 of file KoShapePainter.cpp.

39 {
40 *offset = QPointF();
41 *spacing = QSizeF();
42 };

◆ selectedShapesProxy()

KoSelectedShapesProxy * SimpleCanvas::selectedShapesProxy ( ) const
inlineoverridevirtual

selectedShapesProxy() is a special interface for keeping a persistent connections to selectionChanged() and selectionContentChanged() signals. While shapeManager() can change throughout the life time of the canvas, selectedShapesProxy() is guaranteed to stay the same.

Returns
persistent KoSelectedShapesProxy object

Implements KoCanvasBase.

Definition at line 58 of file KoShapePainter.cpp.

59 {
60 return m_selectedShapesProxy.data();
61 }

References m_selectedShapesProxy.

◆ setCursor()

void SimpleCanvas::setCursor ( const QCursor & cursor)
inlineoverridevirtual

set the specified cursor on this canvas

Parameters
cursorthe new cursor
Returns
the old cursor

Implements KoCanvasBase.

Definition at line 97 of file KoShapePainter.cpp.

97{}

◆ shapeManager()

KoShapeManager * SimpleCanvas::shapeManager ( ) const
inlineoverridevirtual

Return the current shapeManager. WARNING: the shape manager can switch in time, e.g. when a layer is changed. Please don't keep any persistent connections to it. Instead please use selectedShapesProxy(), which is guaranteed to be the same throughout the life of the canvas.

Returns
the current shapeManager

Implements KoCanvasBase.

Definition at line 53 of file KoShapePainter.cpp.

54 {
55 return m_shapeManager.data();
56 }

References m_shapeManager.

◆ snapToGrid()

bool SimpleCanvas::snapToGrid ( ) const
inlineoverridevirtual

return if snap to grid is enabled.

Returns
if snap to grid is enabled.

Implements KoCanvasBase.

Definition at line 44 of file KoShapePainter.cpp.

45 {
46 return false;
47 }

◆ toolProxy()

KoToolProxy * SimpleCanvas::toolProxy ( ) const
inlineoverridevirtual

Return the proxy to the active tool (determining which tool is really, really active is hard when tablets are involved, so leave that to others.

Implements KoCanvasBase.

Definition at line 67 of file KoShapePainter.cpp.

68 {
69 return 0;
70 }

◆ unit()

KoUnit SimpleCanvas::unit ( ) const
inlineoverridevirtual

Return the unit of the current document for initialization of the widgets created by the flake framework.

See also
KoDocument::unit()

Implements KoCanvasBase.

Definition at line 92 of file KoShapePainter.cpp.

93 {
94 return KoUnit(KoUnit::Point);
95 }
@ Point
Postscript point, 1/72th of an Inco.
Definition KoUnit.h:76

References KoUnit::Point.

◆ updateCanvas()

void SimpleCanvas::updateCanvas ( const QRectF & rc)
inlineoverridevirtual

Tell the canvas to repaint the specified rectangle. The coordinates are document coordinates, not view coordinates.

Implements KoCanvasBase.

Definition at line 63 of file KoShapePainter.cpp.

64 {
65 }

◆ viewConverter() [1/2]

const KoViewConverter * SimpleCanvas::viewConverter ( ) const
inlineoverridevirtual

Return the viewConverter for this view.

Returns
the viewConverter for this view.

Implements KoCanvasBase.

Definition at line 72 of file KoShapePainter.cpp.

73 {
74 return 0;
75 }

◆ viewConverter() [2/2]

KoViewConverter * SimpleCanvas::viewConverter ( )
inlineoverridevirtual

Implements KoCanvasBase.

Definition at line 77 of file KoShapePainter.cpp.

78 {
79 return 0;
80 }

Member Data Documentation

◆ m_selectedShapesProxy

QScopedPointer<KoSelectedShapesProxySimple> SimpleCanvas::m_selectedShapesProxy
private

Definition at line 101 of file KoShapePainter.cpp.

◆ m_shapeManager

QScopedPointer<KoShapeManager> SimpleCanvas::m_shapeManager
private

Definition at line 100 of file KoShapePainter.cpp.


The documentation for this class was generated from the following file: