Krita Source Code Documentation
Loading...
Searching...
No Matches
KisShapeSelectionCanvas Class Reference

#include <kis_shape_selection_canvas.h>

+ Inheritance diagram for KisShapeSelectionCanvas:

Public Member Functions

void addCommand (KUndo2Command *command) override
 
const QWidget * canvasWidget () const override
 
QWidget * canvasWidget () override
 
void gridSize (QPointF *offset, QSizeF *spacing) const override
 
 KisShapeSelectionCanvas (KoShapeControllerBase *shapeController)
 
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
 
bool snapToGrid () const override
 
KoToolProxytoolProxy () const override
 
KoUnit unit () const override
 
void updateCanvas (const QRectF &rc) override
 
const KoViewConverterviewConverter () const override
 
KoViewConverterviewConverter () override
 
 ~KisShapeSelectionCanvas () 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< KoSelectedShapesProxym_selectedShapesProxy
 
QScopedPointer< KoShapeManagerm_shapeManager
 

Additional Inherited Members

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

Detailed Description

Dummy canvas just to have a shapemanager for the shape selection

Definition at line 26 of file kis_shape_selection_canvas.h.

Constructor & Destructor Documentation

◆ KisShapeSelectionCanvas()

KisShapeSelectionCanvas::KisShapeSelectionCanvas ( KoShapeControllerBase * shapeController)

Definition at line 18 of file kis_shape_selection_canvas.cpp.

◆ ~KisShapeSelectionCanvas()

KisShapeSelectionCanvas::~KisShapeSelectionCanvas ( )
override

Definition at line 25 of file kis_shape_selection_canvas.cpp.

26{
27}

Member Function Documentation

◆ addCommand()

void KisShapeSelectionCanvas::addCommand ( KUndo2Command * command)
overridevirtual

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 42 of file kis_shape_selection_canvas.cpp.

43{
44 Q_ASSERT(false); // This should never be called as this canvas should have no tools.
45}

◆ canvasWidget() [1/2]

const QWidget * KisShapeSelectionCanvas::canvasWidget ( ) const
overridevirtual

Return the widget that will be added to the scrollArea.

Implements KoCanvasBase.

Definition at line 84 of file kis_shape_selection_canvas.cpp.

85{
86 return 0;
87}

◆ canvasWidget() [2/2]

QWidget * KisShapeSelectionCanvas::canvasWidget ( )
overridevirtual

Return the widget that will be added to the scrollArea.

Implements KoCanvasBase.

Definition at line 79 of file kis_shape_selection_canvas.cpp.

80{
81 return 0;
82}

◆ gridSize()

void KisShapeSelectionCanvas::gridSize ( QPointF * offset,
QSizeF * spacing ) const
overridevirtual

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 29 of file kis_shape_selection_canvas.cpp.

30{
31 Q_ASSERT(false); // This should never be called as this canvas should have no tools.
32 Q_UNUSED(offset);
33 Q_UNUSED(spacing);
34}

◆ selectedShapesProxy()

KoSelectedShapesProxy * KisShapeSelectionCanvas::selectedShapesProxy ( ) const
overridevirtual

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 52 of file kis_shape_selection_canvas.cpp.

53{
54 return m_selectedShapesProxy.data();
55}

References m_selectedShapesProxy.

◆ setCursor()

void KisShapeSelectionCanvas::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 46 of file kis_shape_selection_canvas.h.

46{}

◆ shapeManager()

KoShapeManager * KisShapeSelectionCanvas::shapeManager ( ) const
overridevirtual

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 47 of file kis_shape_selection_canvas.cpp.

48{
49 return m_shapeManager.data();
50}

References m_shapeManager.

◆ snapToGrid()

bool KisShapeSelectionCanvas::snapToGrid ( ) const
overridevirtual

return if snap to grid is enabled.

Returns
if snap to grid is enabled.

Implements KoCanvasBase.

Definition at line 36 of file kis_shape_selection_canvas.cpp.

37{
38 Q_ASSERT(false); // This should never be called as this canvas should have no tools.
39 return false;
40}

◆ toolProxy()

KoToolProxy * KisShapeSelectionCanvas::toolProxy ( ) const
overridevirtual

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 63 of file kis_shape_selection_canvas.cpp.

64{
65 // Q_ASSERT(false); // This should never be called as this canvas should have no tools.
66 return 0;
67}

◆ unit()

KoUnit KisShapeSelectionCanvas::unit ( ) const
overridevirtual

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 89 of file kis_shape_selection_canvas.cpp.

90{
91 Q_ASSERT(false); // This should never be called as this canvas should have no tools.
92 return KoUnit(KoUnit::Point);
93}
@ Point
Postscript point, 1/72th of an Inco.
Definition KoUnit.h:76

References KoUnit::Point.

◆ updateCanvas()

void KisShapeSelectionCanvas::updateCanvas ( const QRectF & rc)
overridevirtual

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

Implements KoCanvasBase.

Definition at line 57 of file kis_shape_selection_canvas.cpp.

58{
59 Q_UNUSED(rc);
60 m_shapeManager->explicitlyIssueShapeChangedSignals();
61}

References m_shapeManager.

◆ viewConverter() [1/2]

const KoViewConverter * KisShapeSelectionCanvas::viewConverter ( ) const
overridevirtual

Return the viewConverter for this view.

Returns
the viewConverter for this view.

Implements KoCanvasBase.

Definition at line 69 of file kis_shape_selection_canvas.cpp.

70{
71 return 0;
72}

◆ viewConverter() [2/2]

KoViewConverter * KisShapeSelectionCanvas::viewConverter ( )
overridevirtual

Implements KoCanvasBase.

Definition at line 74 of file kis_shape_selection_canvas.cpp.

75{
76 return 0;
77}

Member Data Documentation

◆ m_selectedShapesProxy

QScopedPointer<KoSelectedShapesProxy> KisShapeSelectionCanvas::m_selectedShapesProxy
private

Definition at line 49 of file kis_shape_selection_canvas.h.

◆ m_shapeManager

QScopedPointer<KoShapeManager> KisShapeSelectionCanvas::m_shapeManager
private

Definition at line 48 of file kis_shape_selection_canvas.h.


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