Swiftray  1.0
Commands Namespace Reference

Undoable commands. More...

Classes

class  AddLayerCmd
 Command for adding layers. More...
 
class  AddShapeCmd
 Command for adding shapes. The command needs to manage shapes' lifecycle, but doesn't need to manage layers' lifecycle. More...
 
class  BaseCmd
 A class template for undoable commands, along with undo() / redo() implementation. More...
 
class  JoinedCmd
 A group of commands that can be considered as a single step in undo/redo. More...
 
class  RemoveLayerCmd
 Command for removing layers. More...
 
class  RemoveShapeCmd
 Command for removing shapes. The command needs to manage shapes' lifecycle, but doesn't need to manage layers' lifecycle. More...
 
class  SelectCmd
 Command for selection changes in document. More...
 
class  SetCmd
 Command for changing objects' property, and the property can be "passed by value". More...
 
class  SetRefCmd
 Command for changing objects' property, and the property is usually "passed by reference". More...
 

Typedefs

typedef shared_ptr< BaseCmdCmdPtr
 
typedef shared_ptr< JoinedCmdJoinedPtr
 

Functions

CmdPtr AddLayer (const LayerPtr &layer)
 
CmdPtr AddShape (Layer *layer, const ShapePtr &shape)
 
CmdPtr AddShapes (Layer *layer, const QList< ShapePtr > &shapes)
 
JoinedPtr Joined ()
 
JoinedPtr operator+ (const CmdPtr &a, const CmdPtr &b)
 
JoinedPtroperator<< (JoinedPtr &a, BaseCmd *b)
 
JoinedPtroperator<< (JoinedPtr &a, const CmdPtr &b)
 
CmdPtr RemoveLayer (const LayerPtr &layer)
 
CmdPtr RemoveSelections (Document *doc)
 
CmdPtr RemoveShape (const ShapePtr &shape)
 
CmdPtr RemoveShape (Layer *layer, const ShapePtr &shape)
 
CmdPtr RemoveShapes (const QList< ShapePtr > &shapes)
 
CmdPtr Select (Document *doc, const QList< ShapePtr > &new_selections)
 
template<typename T , typename PropType , PropType(T::*)() const PropGetter, void(T::*)(PropType) PropSetter>
CmdPtr Set (T *target, PropType new_value)
 
template<typename T , typename PropType , const PropType &(T::*)() const PropGetter, void(T::*)(const PropType &) PropSetter>
CmdPtr SetRef (T *target, PropType new_value)
 

Variables

constexpr CmdPtr(* SetFont )(TextShape *, QFont)
 
constexpr CmdPtr(* SetLayer )(Shape *, Layer *)
 
constexpr CmdPtr(* SetLineHeight )(TextShape *, float)
 
constexpr CmdPtr(* SetParent )(Shape *, Shape *)
 
constexpr CmdPtr(* SetRotation )(Shape *, qreal)
 
constexpr CmdPtr(* SetTransform )(Shape *, QTransform)
 

Detailed Description

Undoable commands.

Typedef Documentation

◆ CmdPtr

typedef shared_ptr<BaseCmd> Commands::CmdPtr

◆ JoinedPtr

typedef shared_ptr<JoinedCmd> Commands::JoinedPtr

Function Documentation

◆ AddLayer()

CmdPtr Commands::AddLayer ( const LayerPtr layer)

◆ AddShape()

CmdPtr Commands::AddShape ( Layer layer,
const ShapePtr shape 
)

◆ AddShapes()

CmdPtr Commands::AddShapes ( Layer layer,
const QList< ShapePtr > &  shapes 
)

◆ Joined()

JoinedPtr Commands::Joined ( )

◆ operator+()

JoinedPtr Commands::operator+ ( const CmdPtr a,
const CmdPtr b 
)

◆ operator<<() [1/2]

JoinedPtr & Commands::operator<< ( JoinedPtr a,
BaseCmd b 
)

◆ operator<<() [2/2]

JoinedPtr & Commands::operator<< ( JoinedPtr a,
const CmdPtr b 
)

◆ RemoveLayer()

CmdPtr Commands::RemoveLayer ( const LayerPtr layer)

◆ RemoveSelections()

CmdPtr Commands::RemoveSelections ( Document doc)

◆ RemoveShape() [1/2]

CmdPtr Commands::RemoveShape ( const ShapePtr shape)

◆ RemoveShape() [2/2]

CmdPtr Commands::RemoveShape ( Layer layer,
const ShapePtr shape 
)

◆ RemoveShapes()

CmdPtr Commands::RemoveShapes ( const QList< ShapePtr > &  shapes)

◆ Select()

CmdPtr Commands::Select ( Document doc,
const QList< ShapePtr > &  new_selections 
)

◆ Set()

template<typename T , typename PropType , PropType(T::*)() const PropGetter, void(T::*)(PropType) PropSetter>
CmdPtr Commands::Set ( T *  target,
PropType  new_value 
)

◆ SetRef()

template<typename T , typename PropType , const PropType &(T::*)() const PropGetter, void(T::*)(const PropType &) PropSetter>
CmdPtr Commands::SetRef ( T *  target,
PropType  new_value 
)

Variable Documentation

◆ SetFont

constexpr CmdPtr(* Commands::SetFont) (TextShape *, QFont) ( TextShape ,
QFont   
)
constexpr
Initial value:
=
&SetRef<TextShape, QFont, &TextShape::font, &TextShape::setFont>

◆ SetLayer

constexpr CmdPtr(* Commands::SetLayer) (Shape *, Layer *) ( Shape ,
Layer  
)
constexpr
Initial value:
=
&Set<Shape, Layer *, &Shape::layer, &Shape::setLayer>

◆ SetLineHeight

constexpr CmdPtr(* Commands::SetLineHeight) (TextShape *, float) ( TextShape ,
float   
)
constexpr
Initial value:
=
&Set<TextShape, float, &TextShape::lineHeight, &TextShape::setLineHeight>

◆ SetParent

constexpr CmdPtr(* Commands::SetParent) (Shape *, Shape *) ( Shape ,
Shape  
)
constexpr
Initial value:
=
&Set<Shape, Shape *, &Shape::parent, &Shape::setParent>

◆ SetRotation

constexpr CmdPtr(* Commands::SetRotation) (Shape *, qreal) ( Shape ,
qreal   
)
constexpr
Initial value:
=
&Set<Shape, qreal, &TextShape::rotation, &TextShape::setRotation>

◆ SetTransform

constexpr CmdPtr(* Commands::SetTransform) (Shape *, QTransform) ( Shape ,
QTransform   
)
constexpr
Initial value:
=
&SetRef<Shape, QTransform, &Shape::transform, &Shape::setTransform>