61#include <QPainterPath>
81#define HANDLE_DISTANCE 10
82#define HANDLE_DISTANCE_SQ (HANDLE_DISTANCE * HANDLE_DISTANCE)
84#define INNER_HANDLE_DISTANCE_SQ 16
87static const QString EditFillGradientFactoryId =
"edit_fill_gradient";
88static const QString EditStrokeGradientFactoryId =
"edit_stroke_gradient";
89static const QString EditFillMeshGradientFactoryId =
"edit_fill_meshgradient";
91enum TransformActionType {
147 void finishInteraction(Qt::KeyboardModifiers modifiers = QFlags<Qt::KeyboardModifier>())
override
161 Q_FOREACH (
KoShape * shape, shapes) {
228 if (shapes.size() == 1) {
229 shape = shapes.first();
241 const qreal distanceThresholdSq =
247 qreal minDistanceSq = std::numeric_limits<qreal>::max();
255 if (distanceSq < distanceThresholdSq && distanceSq < minDistanceSq) {
257 minDistanceSq = distanceSq;
349 if (shapes.size() == 1) {
350 shape = shapes.first();
364 const qreal distanceThresholdSq =
370 qreal minDistanceSq = std::numeric_limits<qreal>::max();
374 for (
const auto& handle: sh.
handles()) {
375 const QPointF handlePoint = converter->
documentToView(handle.pos);
378 if (distanceSq < distanceThresholdSq && distanceSq < minDistanceSq) {
380 minDistanceSq = distanceSq;
418 , m_hotPosition(
KoFlake::TopLeft)
419 , m_mouseWasInsideHandles(false)
421 , m_tabbedOptionWidget(0)
426 QPixmap rotatePixmap, shearPixmap;
427 rotatePixmap.load(
":/cursor_rotate.png");
428 Q_ASSERT(!rotatePixmap.isNull());
429 shearPixmap.load(
":/cursor_shear.png");
430 Q_ASSERT(!shearPixmap.isNull());
432 m_rotateCursors[0] = QCursor(rotatePixmap.transformed(QTransform().rotate(45)));
433 m_rotateCursors[1] = QCursor(rotatePixmap.transformed(QTransform().rotate(90)));
434 m_rotateCursors[2] = QCursor(rotatePixmap.transformed(QTransform().rotate(135)));
435 m_rotateCursors[3] = QCursor(rotatePixmap.transformed(QTransform().rotate(180)));
436 m_rotateCursors[4] = QCursor(rotatePixmap.transformed(QTransform().rotate(225)));
437 m_rotateCursors[5] = QCursor(rotatePixmap.transformed(QTransform().rotate(270)));
438 m_rotateCursors[6] = QCursor(rotatePixmap.transformed(QTransform().rotate(315)));
451 m_shearCursors[1] = QCursor(shearPixmap.transformed(QTransform().rotate(45)));
452 m_shearCursors[2] = QCursor(shearPixmap.transformed(QTransform().rotate(90)));
453 m_shearCursors[3] = QCursor(shearPixmap.transformed(QTransform().rotate(135)));
454 m_shearCursors[4] = QCursor(shearPixmap.transformed(QTransform().rotate(180)));
455 m_shearCursors[5] = QCursor(shearPixmap.transformed(QTransform().rotate(225)));
456 m_shearCursors[6] = QCursor(shearPixmap.transformed(QTransform().rotate(270)));
457 m_shearCursors[7] = QCursor(shearPixmap.transformed(QTransform().rotate(315)));
467 if (connectToSelectedShapesProxy) {
485 1, EditFillGradientFactoryId,
this));
497 0, EditStrokeGradientFactoryId,
this));
511 EditFillMeshGradientFactoryId,
this));
528 if (shapes.isEmpty())
return;
532 bool convertableShape =
false;
534 Q_FOREACH(
KoShape *shape, shapes) {
536 if (textShape && textShape->
textType() != type) {
538 if (!convertableShape) {
539 convertableShape =
true;
546 if (convertableShape) {
558 QAction *a =
action(actionId);
559 connect(a, SIGNAL(triggered()), mapper, SLOT(map()));
616 if (useEdgeRotation) {
622 direction = handlePosition - selectionCenter;
629 if (useEdgeRotation) {
635 direction = handlePosition - selectionCenter;
642 if (useEdgeRotation) {
648 direction = handlePosition - selectionCenter;
656 if (useEdgeRotation) {
662 direction = handlePosition - selectionCenter;
674 qreal rotation = atan2(direction.y(), direction.x()) * 180.0 /
M_PI;
678 if (useEdgeRotation) {
688 if (useEdgeRotation) {
698 if (useEdgeRotation) {
708 if (useEdgeRotation) {
721 if (rotation < 0.0) {
732 QCursor
cursor = Qt::ArrowCursor;
738 bool editable = !
selection->selectedEditableShapes().isEmpty();
742 int rotOctant = 8 + int(8.5 +
m_angle / 45);
744 bool rotateHandle =
false;
745 bool shearHandle =
false;
784 statusText = i18n(
"Left click rotates around center, right click around highlighted position.");
787 statusText = i18n(
"Click and drag to shear selection.");
792 statusText = i18n(
"Click and drag to resize selection.");
794 int rotOctant = 8 + int(8.5 +
m_angle / 45);
795 bool cornerHandle =
false;
826 cursor = Qt::SizeAllCursor;
827 statusText = i18n(
"Click and drag to move selection.");
831 statusText = i18n(
"Click and drag to resize selection. Middle click to set highlighted position.");
860 const bool isSelectionMask = node && node->inherits(
"KisSelectionMask");
901 i18n(
"This tool only works on vector layers. You probably want the move tool."),
916 if (bound.contains(event->
point)) {
953 bound.adjust(-border.x(), -border.y(), border.x(), border.y());
970 if (!(event->
modifiers() & Qt::ShiftModifier)) {
984 qreal x = 0.0, y = 0.0;
985 if (direction == Qt::Key_Left) {
987 }
else if (direction == Qt::Key_Right) {
989 }
else if (direction == Qt::Key_Up) {
991 }
else if (direction == Qt::Key_Down) {
995 if (x != 0.0 || y != 0.0) {
997 if ((modifiers & Qt::ShiftModifier) != 0) {
1000 }
else if ((modifiers & Qt::AltModifier) != 0) {
1007 if (!shapes.isEmpty()) {
1020 switch (event->key()) {
1058 if (!shapes.isEmpty()) {
1074 if (!shapes.empty()) {
1088 Q_ASSERT(
canvas()->selectedShapesProxy());
1101 Q_ASSERT(
canvas()->selectedShapesProxy());
1109 Q_ASSERT(
canvas()->selectedShapesProxy());
1137 if (innerHandleMeaning) {
1140 *innerHandleMeaning = path.contains(point) || path.intersects(
handlePaintRect(point));
1154 if (innerHandleMeaning) {
1156 *innerHandleMeaning =
true;
1170 QTransform matrix =
selection->absoluteTransformation();
1187 if (s->scaleX() < 0) {
1192 if (s->scaleY() < 0) {
1205 QAction *actionBringToFront =
action(
"object_order_front");
1208 QAction *actionRaise =
action(
"object_order_raise");
1211 QAction *actionLower =
action(
"object_order_lower");
1214 QAction *actionSendToBack =
action(
"object_order_back");
1217 QAction *actionGroupBottom =
action(
"object_group");
1218 connect(actionGroupBottom, SIGNAL(triggered()),
this, SLOT(
selectionGroup()), Qt::UniqueConnection);
1220 QAction *actionUngroupBottom =
action(
"object_ungroup");
1223 QAction *actionSplit =
action(
"object_split");
1238 const KisCanvas2 *canvas2 = qobject_cast<const KisCanvas2 *>(this->
canvas());
1253 QAction *actionBringToFront =
action(
"object_order_front");
1254 disconnect(actionBringToFront, 0,
this, 0);
1256 QAction *actionRaise =
action(
"object_order_raise");
1257 disconnect(actionRaise, 0,
this, 0);
1259 QAction *actionLower =
action(
"object_order_lower");
1260 disconnect(actionLower, 0,
this, 0);
1262 QAction *actionSendToBack =
action(
"object_order_back");
1263 disconnect(actionSendToBack, 0,
this, 0);
1265 QAction *actionGroupBottom =
action(
"object_group");
1266 disconnect(actionGroupBottom, 0,
this, 0);
1268 QAction *actionUngroupBottom =
action(
"object_ungroup");
1269 disconnect(actionUngroupBottom, 0,
this, 0);
1271 QAction *actionSplit =
action(
"object_split");
1272 disconnect(actionSplit, 0,
this, 0);
1280 const KisCanvas2 *canvas2 = qobject_cast<const KisCanvas2 *>(this->
canvas());
1298 if (selectedShapes.isEmpty())
return;
1300 const int groupZIndex = selectedShapes.last()->zIndex();
1329 Q_FOREACH (
KoShape *shape, selectedShapes) {
1336 newShapes << group->
shapes();
1355 if (editableShapes.isEmpty()) {
1359 QTransform applyTransform;
1360 bool shouldReset =
false;
1364 switch (TransformActionType(transformAction)) {
1365 case TransformRotate90CW:
1366 applyTransform.rotate(90.0);
1367 actionName =
kundo2_i18n(
"Rotate Object 90° CW");
1369 case TransformRotate90CCW:
1370 applyTransform.rotate(-90.0);
1371 actionName =
kundo2_i18n(
"Rotate Object 90° CCW");
1373 case TransformRotate180:
1374 applyTransform.rotate(180.0);
1377 case TransformMirrorX:
1378 applyTransform.scale(-1.0, 1.0);
1379 actionName =
kundo2_i18n(
"Mirror Object Horizontally");
1381 case TransformMirrorY:
1382 applyTransform.scale(1.0, -1.0);
1383 actionName =
kundo2_i18n(
"Mirror Object Vertically");
1385 case TransformReset:
1387 actionName =
kundo2_i18n(
"Reset Object Transformations");
1391 if (!shouldReset && applyTransform.isIdentity())
return;
1397 const QPointF centerPoint = outlineRect.center();
1398 const QTransform centerTrans = QTransform::fromTranslate(centerPoint.x(), centerPoint.y());
1399 const QTransform centerTransInv = QTransform::fromTranslate(-centerPoint.x(), -centerPoint.y());
1405 Q_FOREACH (
KoShape *shape, transformedShapes) {
1412 t = world * centerTransInv * applyTransform * centerTrans * world.inverted() * shape->
transformation();
1414 const QPointF center = shape->
outlineRect().center();
1415 const QPointF offset = shape->
transformation().map(center) - center;
1416 t = QTransform::fromTranslate(offset.x(), offset.y());
1419 newTransforms.append(t);
1433 if (editableShapes.isEmpty()) {
1438 QPainterPath dstOutline;
1442 const int referenceShapeIndex = 0;
1443 KoShape *referenceShape = editableShapes[referenceShapeIndex];
1447 const QTransform booleanWorkaroundTransform =
1450 Q_FOREACH (
KoShape *shape, editableShapes) {
1452 booleanWorkaroundTransform.map(
1457 if (booleanOp == BooleanUnion) {
1458 Q_FOREACH (
const QPainterPath &path, srcOutlines) {
1462 }
else if (booleanOp == BooleanIntersection) {
1463 for (
int i = 0; i < srcOutlines.size(); i++) {
1465 dstOutline = srcOutlines[i];
1467 dstOutline &= srcOutlines[i];
1473 dstOutline.closeSubpath();
1477 }
else if (booleanOp == BooleanSubtraction) {
1478 for (
int i = 0; i < srcOutlines.size(); i++) {
1479 dstOutline = srcOutlines[referenceShapeIndex];
1480 if (i != referenceShapeIndex) {
1481 dstOutline -= srcOutlines[i];
1488 dstOutline = booleanWorkaroundTransform.inverted().map(dstOutline);
1492 if (!dstOutline.isEmpty()) {
1510 newSelectedShapes << newShape;
1526 if (editableShapes.isEmpty()) {
1535 Q_FOREACH (
KoShape *shape, editableShapes) {
1537 if (!pathShape)
return;
1540 if (pathShape->
separate(splitShapes)) {
1541 QList<KoShape*> normalShapes = implicitCastList<KoShape*>(splitShapes);
1546 newShapes << normalShapes;
1564 if (editableShapes.isEmpty()) {
1574 if (editableShapes.count() == 1) {
1596 if (editableShapes.size() < 3) {
1633 if (selectedShapes.isEmpty()) {
1655 SIGNAL(sigSwitchModeEditFillGradient(
bool)),
1659 SIGNAL(sigSwitchModeEditStrokeGradient(
bool)),
1663 SIGNAL(sigSwitchModeEditFillGradient(
bool)),
1668 SIGNAL(sigMeshGradientResetted()),
1687 bool insideSelection =
false;
1690 bool editableShape = !
selection->selectedEditableShapes().isEmpty();
1692 const bool selectMultiple =
event->modifiers() & Qt::ShiftModifier;
1693 const bool selectNextInStack =
event->modifiers() & Qt::ControlModifier;
1694 const bool avoidSelection =
event->modifiers() & Qt::AltModifier;
1696 if (selectNextInStack) {
1746 if (!avoidSelection && editableShape) {
1750 if (insideSelection) {
1769 if (!selectMultiple && !selectNextInStack) {
1771 if (insideSelection) {
1780 if (!selectMultiple) {
1787 if (selectMultiple) {
1791 if (!selectMultiple) {
1812 const bool hasEditableShapes = !editableShapes.isEmpty();
1814 action(
"object_order_front")->setEnabled(hasEditableShapes);
1815 action(
"object_order_raise")->setEnabled(hasEditableShapes);
1816 action(
"object_order_lower")->setEnabled(hasEditableShapes);
1817 action(
"object_order_back")->setEnabled(hasEditableShapes);
1819 action(
"object_transform_rotate_90_cw")->setEnabled(hasEditableShapes);
1820 action(
"object_transform_rotate_90_ccw")->setEnabled(hasEditableShapes);
1821 action(
"object_transform_rotate_180")->setEnabled(hasEditableShapes);
1822 action(
"object_transform_mirror_horizontally")->setEnabled(hasEditableShapes);
1823 action(
"object_transform_mirror_vertically")->setEnabled(hasEditableShapes);
1824 action(
"object_transform_reset")->setEnabled(hasEditableShapes);
1826 const bool multipleSelected = editableShapes.size() > 1;
1828 const bool alignmentEnabled =
1830 (!editableShapes.isEmpty() &&
1833 action(
"object_align_horizontal_left")->setEnabled(alignmentEnabled);
1834 action(
"object_align_horizontal_center")->setEnabled(alignmentEnabled);
1835 action(
"object_align_horizontal_right")->setEnabled(alignmentEnabled);
1836 action(
"object_align_vertical_top")->setEnabled(alignmentEnabled);
1837 action(
"object_align_vertical_center")->setEnabled(alignmentEnabled);
1838 action(
"object_align_vertical_bottom")->setEnabled(alignmentEnabled);
1840 const bool distributionEnabled = editableShapes.size() > 2;
1842 action(
"object_distribute_horizontal_left")->setEnabled(distributionEnabled);
1843 action(
"object_distribute_horizontal_center")->setEnabled(distributionEnabled);
1844 action(
"object_distribute_horizontal_right")->setEnabled(distributionEnabled);
1845 action(
"object_distribute_horizontal_gaps")->setEnabled(distributionEnabled);
1847 action(
"object_distribute_vertical_top")->setEnabled(distributionEnabled);
1848 action(
"object_distribute_vertical_center")->setEnabled(distributionEnabled);
1849 action(
"object_distribute_vertical_bottom")->setEnabled(distributionEnabled);
1850 action(
"object_distribute_vertical_gaps")->setEnabled(distributionEnabled);
1858 const bool multipleSelected = editableShapes.size() > 1;
1860 action(
"object_group")->setEnabled(multipleSelected);
1862 action(
"object_unite")->setEnabled(multipleSelected);
1863 action(
"object_intersect")->setEnabled(multipleSelected);
1864 action(
"object_subtract")->setEnabled(multipleSelected);
1866 bool hasShapesWithMultipleSegments =
false;
1867 Q_FOREACH (
KoShape *shape, editableShapes) {
1870 hasShapesWithMultipleSegments =
true;
1874 action(
"object_split")->setEnabled(hasShapesWithMultipleSegments);
1877 bool hasGroupShape =
false;
1878 foreach (
KoShape *shape, editableShapes) {
1880 hasGroupShape =
true;
1884 action(
"object_ungroup")->setEnabled(hasGroupShape);
1886 bool enablePreformatted =
false;
1887 bool enablePrePositioned =
false;
1888 bool enableInlineWrapped =
false;
1889 Q_FOREACH (
KoShape *shape, editableShapes) {
1893 enablePreformatted =
true;
1896 enablePrePositioned =
true;
1899 enableInlineWrapped =
true;
1903 action(
"text_type_preformatted")->setEnabled(enablePreformatted);
1904 action(
"text_type_pre_positioned")->setEnabled(enablePrePositioned);
1905 action(
"text_type_inline_wrap")->setEnabled(enableInlineWrapped);
1922 QMenu *transform =
m_contextMenu->addMenu(i18n(
"Transform"));
1924 transform->addAction(
action(
"object_transform_rotate_90_cw"));
1925 transform->addAction(
action(
"object_transform_rotate_90_ccw"));
1926 transform->addAction(
action(
"object_transform_rotate_180"));
1927 transform->addSeparator();
1928 transform->addAction(
action(
"object_transform_mirror_horizontally"));
1929 transform->addAction(
action(
"object_transform_mirror_vertically"));
1930 transform->addSeparator();
1931 transform->addAction(
action(
"object_transform_reset"));
1933 if (
action(
"object_unite")->isEnabled() ||
1934 action(
"object_intersect")->isEnabled() ||
1935 action(
"object_subtract")->isEnabled() ||
1936 action(
"object_split")->isEnabled()) {
1938 QMenu *transform =
m_contextMenu->addMenu(i18n(
"Logical Operations"));
1939 transform->addAction(
action(
"object_unite"));
1940 transform->addAction(
action(
"object_intersect"));
1941 transform->addAction(
action(
"object_subtract"));
1942 transform->addAction(
action(
"object_split"));
1959 if (
action(
"object_group")->isEnabled() ||
action(
"object_ungroup")->isEnabled()) {
1972 menu->addAction(
action(
"object_transform_rotate_90_cw"));
1973 menu->addAction(
action(
"object_transform_rotate_90_ccw"));
1974 menu->addAction(
action(
"object_transform_rotate_180"));
1975 menu->addSeparator();
1976 menu->addAction(
action(
"object_transform_mirror_horizontally"));
1977 menu->addAction(
action(
"object_transform_mirror_vertically"));
1978 menu->addSeparator();
1979 menu->addAction(
action(
"object_transform_reset"));
1986 QTimer::singleShot(0, [tool = std::move(tool)]() {
2017 if (!
d->parent->selection()->hasSelection())
return props;
2019 for (
auto it =
d->shapes.begin(); it !=
d->shapes.end(); it++) {
2021 if (!textShape)
continue;
2036 if (
d->shapes.isEmpty())
return;
2039 d->parent->canvas()->addCommand(cmd);
2052 d->compressor.start();
2057 d->compressor.start();
2064 d->compressor.start();
2069 Q_FOREACH(
KoShape *shape,
d->shapes) {
2077 Q_FOREACH(
KoShape *shape,
d->shapes) {
2080 QList<KoShape*> shapes =
d->parent->canvas()->selectedShapesProxy()->selection()->selectedEditableShapes();
2083 Q_FOREACH(
KoShape *shape,
d->shapes) {
2086 d->compressor.start();
float value(const T *src, size_t ch)
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
void setText(const KUndo2MagicString &text)
KUndo2MagicString text() const
KisImageWSP image() const
KoShapeManager * localShapeManager() const
KisViewManager * viewManager() const
KisNodeSP activeNode()
Convenience function to get the active layer or mask.
The KisSignalMapper class bundles signals from identifiable senders.
void setMapping(QObject *sender, int id)
void setTextPropertiesInterface(KoSvgTextPropertiesInterface *interface)
setTextPropertiesInterface set the text properties interface. This should be done on tool activation....
KisNodeManager * nodeManager() const
The node manager handles everything about nodes.
KisTextPropertiesManager * textPropertyManager() const
void showFloatingMessage(const QString &message, const QIcon &icon, int timeout=4500, KisFloatingMessage::Priority priority=KisFloatingMessage::Medium, int alignment=Qt::AlignCenter|Qt::TextWordWrap)
shows a floating message in the top right corner of the canvas
QPointer< KoShapeController > shapeController
virtual KoShapeManager * shapeManager() const =0
virtual const KoViewConverter * viewConverter() const =0
virtual void updateCanvas(const QRectF &rc)=0
virtual void addCommand(KUndo2Command *command)=0
QPointer< KoCanvasResourceProvider > resourceManager
virtual KoSelectedShapesProxy * selectedShapesProxy() const =0
selectedShapesProxy() is a special interface for keeping a persistent connections to selectionChanged...
bool setSvg(const QList< KoShape * > shapes)
KoToolBase * tool() const
The position of a path point within a path shape.
bool separate(QList< KoPathShape * > &separatedPaths)
Creates separate path shapes, one for each existing subpath.
int subpathCount() const
Returns the number of subpaths in the path.
static KoPathShape * createShapeFromPainterPath(const QPainterPath &path)
Creates path shape from given QPainterPath.
Qt::MouseButtons buttons() const
return buttons pressed (see QMouseEvent::buttons());
bool isTabletEvent() const
Qt::KeyboardModifiers modifiers() const
QPointF point
The point in document coordinates.
virtual KoSelection * selection()=0
void deselectAll()
clear the selections list
const QList< KoShape * > selectedEditableShapesAndDelegates() const
void select(KoShape *shape)
const QList< KoShape * > selectedEditableShapes() const
KoShape * firstSelectedShape() const
const QList< KoShape * > selectedShapes() const
The undo / redo command for aligning shapes.
Align
The different alignment options for this command.
@ VerticalTopAlignment
Align top.
@ VerticalCenterAlignment
Align centered vertically.
@ HorizontalLeftAlignment
Align left.
@ HorizontalCenterAlignment
Align Centered horizontally.
@ VerticalBottomAlignment
Align bottom.
@ HorizontalRightAlignment
Align Right.
QList< KoShape * > shapes() const
The undo / redo command for distributing shapes.
Distribute
The different options to distribute with this command.
@ HorizontalRightDistribution
Horizontal Right.
@ VerticalTopDistribution
Vertical top.
@ VerticalCenterDistribution
Vertical centered.
@ HorizontalGapsDistribution
Horizontal Gaps.
@ VerticalBottomDistribution
Vertical bottom.
@ HorizontalCenterDistribution
Horizontal centered.
@ HorizontalLeftDistribution
Horizontal Left.
@ VerticalGapsDistribution
Vertical Gaps.
QVector< Handle > handles() const
The undo / redo command for grouping shapes.
QList< KoShape * > topLevelShapes() const
KoShape * shapeAt(const QPointF &position, KoFlake::ShapeSelection selection=KoFlake::ShapeOnTop, bool omitHiddenShapes=true)
The KoShapeMergeTextPropertiesCommand class This sets text properties on given text shapes....
QVector< Handle > handles() const
get all nodes in the mesh, don't use this for drawing the path but use path()
The undo / redo command for shape moving.
MoveShapeType
An enum for defining what kind of reordering to use.
@ RaiseShape
raise the selected shape to the level that it is above the shape that is on top of it.
@ SendToBack
Lower the selected shape to be below all other shapes.
@ LowerShape
Lower the selected shape to the level that it is below the shape that is below it.
@ BringToFront
Raise the selected shape to be on top of all shapes.
static KoShapeReorderCommand * createCommand(const QList< KoShape * > &shapes, KoShapeManager *manager, MoveShapeType move, KUndo2Command *parent=0)
virtual SelectionMode currentMode() const
QRectF selectedRectangle() const
void paint(QPainter &painter, const KoViewConverter &converter) override
The undo / redo command for ungrouping shapes.
virtual QRectF outlineRect() const
void addShapeChangeListener(ShapeChangeListener *listener)
void setZIndex(qint16 zIndex)
virtual QPainterPath outline() const
bool isSelectable() const
QPointF absolutePosition(KoFlake::AnchorPosition anchor=KoFlake::Center) const
void removeShapeChangeListener(ShapeChangeListener *listener)
virtual KoShapeStrokeModelSP stroke() const
static bool compareShapeZIndex(KoShape *s1, KoShape *s2)
bool isGeometryProtected() const
QRectF absoluteOutlineRect() const
KoShapeContainer * parent() const
virtual void setStroke(KoShapeStrokeModelSP stroke)
QTransform absoluteTransformation() const
virtual void setBackground(QSharedPointer< KoShapeBackground > background)
ChangeType
Used by shapeChanged() to select which change was made.
virtual QSharedPointer< KoShapeBackground > background() const
QTransform transformation() const
Returns the shapes local transformation matrix.
void paint(QPainter &painter, const KoViewConverter &converter)
paints the guide
QRectF boundingRect()
returns the bounding rect of the guide
bool isSnapping() const
returns if snapping is enabled
The SvgConvertTextTypeCommand class This command allows textshapes to be converted between preformatt...
The KoSvgTextPropertiesInterface class.
void textSelectionChanged()
@ PreformattedText
Text-on-Path falls under this or PrePositionedText depending on collapse of lines.
@ InlineWrap
Uses inline size to wrap and preserves spaces.
TextType textType() const
textType This enum gives an indication of what kind of text this shape is. The different text types a...
KoSvgTextProperties textProperties() const
virtual QPointF viewToDocument(const QPointF &viewPoint) const
virtual QPointF documentToView(const QPointF &documentPoint) const
KUndo2Command * createCommand() override
void paint(QPainter &painter, const KoViewConverter &converter) override
void finishInteraction(Qt::KeyboardModifiers) override
NopInteractionStrategy(KoToolBase *parent)
void handleMouseMove(const QPointF &, Qt::KeyboardModifiers) override
QPointer< KoSelection > m_selection
SelectionHandler(DefaultTool *parent)
bool hasSelection() override
return true if the tool currently has something selected that can be copied or deleted.
void cancelInteraction() override
void finishInteraction(Qt::KeyboardModifiers modifiers=QFlags< Qt::KeyboardModifier >()) override
void paint(QPainter &painter, const KoViewConverter &converter) override
SelectionInteractionStrategy(KoToolBase *parent, const QPointF &clicked, bool useSnapToGrid)
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
#define KIS_ASSERT_RECOVER_RETURN(cond)
qreal kisSquareDistance(const QPointF &pt1, const QPointF &pt2)
bool isSelectionMask(KisNodeSP node)
KUndo2MagicString kundo2_i18n(const char *text)
KUndo2MagicString kundo2_noi18n(const QString &text)
@ PageSize
The size of the (current) page in postscript points.
@ ShapeOnTop
return the shape highest z-ordering, regardless of selection.
@ NextUnselected
return the first unselected directly under a selected shape, or the top most one if nothing is select...
SelectionHandle
Enum determining which handle is meant, used in KoInteractionTool.
@ BottomRightHandle
The handle that is at the bottom right of a selection.
@ BottomLeftHandle
The handle that is at the bottom left of a selection.
@ RightMiddleHandle
The handle that is at the right - center of a selection.
@ TopRightHandle
The handle that is at the top - right of a selection.
@ TopLeftHandle
The handle that is at the top left of a selection.
@ LeftMiddleHandle
The handle that is at the left center of a selection.
@ NoHandle
Value to indicate no handle.
@ TopMiddleHandle
The handle that is at the top - center of a selection.
@ BottomMiddleHandle
The handle that is at the bottom center of a selection.
QTransform pathShapeBooleanSpaceWorkaround(KisImageSP image)
Interface to interact with the text property manager.
virtual bool spanSelection() override
Whether the tool is currently selecting a set of characters instead of whole paragraphs.
void slotSelectionChanged()
~DefaultToolTextPropertiesInterface()
virtual QList< KoSvgTextProperties > getSelectedProperties() override
getSelectedProperties
const QScopedPointer< Private > d
virtual void notifyShapeChanged(KoShape::ChangeType type, KoShape *shape) override
DefaultToolTextPropertiesInterface(DefaultTool *parent)
virtual KoSvgTextProperties getInheritedProperties() override
getInheritedProperties The properties that should be visible when a given property isn't available in...
QList< KoShape * > shapes
virtual void notifyCursorPosChanged(int pos, int anchor) override
Private(DefaultTool *parent)
KisSignalCompressor compressor
virtual void notifyMarkupChanged() override
virtual void setPropertiesOnSelected(KoSvgTextProperties properties, QSet< KoSvgTextProperties::PropertyId > removeProperties=QSet< KoSvgTextProperties::PropertyId >()) override
setPropertiesOnSelected This sets the properties on the selection. The implementation is responsible ...