Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Krita
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tusooa Zhu
Krita
Commits
cad28844
Commit
cad28844
authored
Sep 29, 2008
by
Girish Ramakrishnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SVN_SILENT: Fix coding style
Somehow flake/ got left out. svn path=/trunk/koffice/; revision=865831
parent
49c5f68b
Changes
290
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
290 changed files
with
8107 additions
and
8845 deletions
+8107
-8845
libs/flake/KoCanvasBase.cpp
libs/flake/KoCanvasBase.cpp
+5
-5
libs/flake/KoCanvasBase.h
libs/flake/KoCanvasBase.h
+6
-3
libs/flake/KoCanvasController.cpp
libs/flake/KoCanvasController.cpp
+112
-115
libs/flake/KoCanvasController.h
libs/flake/KoCanvasController.h
+22
-21
libs/flake/KoCanvasController_p.cpp
libs/flake/KoCanvasController_p.cpp
+60
-68
libs/flake/KoCanvasController_p.h
libs/flake/KoCanvasController_p.h
+16
-13
libs/flake/KoCanvasResourceProvider.cpp
libs/flake/KoCanvasResourceProvider.cpp
+39
-41
libs/flake/KoCanvasResourceProvider.h
libs/flake/KoCanvasResourceProvider.h
+38
-36
libs/flake/KoColorBackground.cpp
libs/flake/KoColorBackground.cpp
+15
-17
libs/flake/KoColorBackground.h
libs/flake/KoColorBackground.h
+4
-4
libs/flake/KoConnectionShape.cpp
libs/flake/KoConnectionShape.cpp
+208
-246
libs/flake/KoConnectionShape.h
libs/flake/KoConnectionShape.h
+19
-20
libs/flake/KoConnectionShapeConfigWidget.cpp
libs/flake/KoConnectionShapeConfigWidget.cpp
+17
-18
libs/flake/KoConnectionShapeConfigWidget.h
libs/flake/KoConnectionShapeConfigWidget.h
+3
-1
libs/flake/KoConnectionShapeFactory.cpp
libs/flake/KoConnectionShapeFactory.cpp
+10
-10
libs/flake/KoConnectionShapeFactory.h
libs/flake/KoConnectionShapeFactory.h
+2
-2
libs/flake/KoDataCenter.h
libs/flake/KoDataCenter.h
+3
-2
libs/flake/KoDevice.cpp
libs/flake/KoDevice.cpp
+4
-5
libs/flake/KoDevice.h
libs/flake/KoDevice.h
+1
-1
libs/flake/KoDeviceEvent.cpp
libs/flake/KoDeviceEvent.cpp
+6
-7
libs/flake/KoDeviceEvent.h
libs/flake/KoDeviceEvent.h
+3
-3
libs/flake/KoDeviceRegistry.cpp
libs/flake/KoDeviceRegistry.cpp
+6
-8
libs/flake/KoDrag.cpp
libs/flake/KoDrag.cpp
+28
-31
libs/flake/KoDrag.h
libs/flake/KoDrag.h
+2
-2
libs/flake/KoDragOdfSaveHelper.cpp
libs/flake/KoDragOdfSaveHelper.cpp
+5
-5
libs/flake/KoDragOdfSaveHelper.h
libs/flake/KoDragOdfSaveHelper.h
+1
-1
libs/flake/KoEventAction.cpp
libs/flake/KoEventAction.cpp
+4
-5
libs/flake/KoEventAction.h
libs/flake/KoEventAction.h
+6
-6
libs/flake/KoEventActionData.cpp
libs/flake/KoEventActionData.cpp
+5
-6
libs/flake/KoEventActionData.h
libs/flake/KoEventActionData.h
+1
-1
libs/flake/KoEventActionFactory.cpp
libs/flake/KoEventActionFactory.cpp
+5
-6
libs/flake/KoEventActionFactory.h
libs/flake/KoEventActionFactory.h
+2
-2
libs/flake/KoEventActionRegistry.cpp
libs/flake/KoEventActionRegistry.cpp
+34
-41
libs/flake/KoEventActionRegistry.h
libs/flake/KoEventActionRegistry.h
+5
-5
libs/flake/KoEventActionWidget.cpp
libs/flake/KoEventActionWidget.cpp
+2
-2
libs/flake/KoEventActionWidget.h
libs/flake/KoEventActionWidget.h
+3
-3
libs/flake/KoFlake.h
libs/flake/KoFlake.h
+2
-1
libs/flake/KoFrameShape.cpp
libs/flake/KoFrameShape.cpp
+10
-12
libs/flake/KoFrameShape.h
libs/flake/KoFrameShape.h
+5
-5
libs/flake/KoGradientBackground.cpp
libs/flake/KoGradientBackground.cpp
+54
-61
libs/flake/KoGradientBackground.h
libs/flake/KoGradientBackground.h
+9
-9
libs/flake/KoImageCollection.cpp
libs/flake/KoImageCollection.cpp
+5
-6
libs/flake/KoImageCollection.h
libs/flake/KoImageCollection.h
+3
-2
libs/flake/KoImageData.cpp
libs/flake/KoImageData.cpp
+31
-35
libs/flake/KoImageData.h
libs/flake/KoImageData.h
+4
-3
libs/flake/KoInputDevice.cpp
libs/flake/KoInputDevice.cpp
+11
-12
libs/flake/KoInputDevice.h
libs/flake/KoInputDevice.h
+8
-7
libs/flake/KoLineBorder.cpp
libs/flake/KoLineBorder.cpp
+71
-75
libs/flake/KoLineBorder.h
libs/flake/KoLineBorder.h
+13
-12
libs/flake/KoLineBorderFactory.cpp
libs/flake/KoLineBorderFactory.cpp
+1
-1
libs/flake/KoLineBorderFactory.h
libs/flake/KoLineBorderFactory.h
+2
-1
libs/flake/KoParameterShape.cpp
libs/flake/KoParameterShape.cpp
+40
-46
libs/flake/KoParameterShape.h
libs/flake/KoParameterShape.h
+15
-15
libs/flake/KoPathPoint.cpp
libs/flake/KoPathPoint.cpp
+140
-160
libs/flake/KoPathPoint.h
libs/flake/KoPathPoint.h
+34
-35
libs/flake/KoPathPointData.h
libs/flake/KoPathPointData.h
+10
-13
libs/flake/KoPathSegment.cpp
libs/flake/KoPathSegment.cpp
+340
-440
libs/flake/KoPathSegment.h
libs/flake/KoPathSegment.h
+23
-23
libs/flake/KoPathShape.cpp
libs/flake/KoPathShape.cpp
+456
-555
libs/flake/KoPathShape.h
libs/flake/KoPathShape.h
+73
-73
libs/flake/KoPathShapeFactory.cpp
libs/flake/KoPathShapeFactory.cpp
+13
-14
libs/flake/KoPathShapeLoader.cpp
libs/flake/KoPathShapeLoader.cpp
+57
-61
libs/flake/KoPathShapeLoader.h
libs/flake/KoPathShapeLoader.h
+13
-13
libs/flake/KoPatternBackground.cpp
libs/flake/KoPatternBackground.cpp
+208
-236
libs/flake/KoPatternBackground.h
libs/flake/KoPatternBackground.h
+13
-13
libs/flake/KoPointGroup.cpp
libs/flake/KoPointGroup.cpp
+12
-15
libs/flake/KoPointGroup.h
libs/flake/KoPointGroup.h
+6
-4
libs/flake/KoPointerEvent.cpp
libs/flake/KoPointerEvent.cpp
+35
-36
libs/flake/KoPointerEvent.h
libs/flake/KoPointerEvent.h
+30
-20
libs/flake/KoPostscriptPaintDevice.cpp
libs/flake/KoPostscriptPaintDevice.cpp
+16
-16
libs/flake/KoPostscriptPaintDevice.h
libs/flake/KoPostscriptPaintDevice.h
+4
-3
libs/flake/KoSelection.cpp
libs/flake/KoSelection.cpp
+64
-68
libs/flake/KoSelection.h
libs/flake/KoSelection.h
+10
-9
libs/flake/KoShape.cpp
libs/flake/KoShape.cpp
+345
-384
libs/flake/KoShape.h
libs/flake/KoShape.h
+54
-52
libs/flake/KoShapeApplicationData.h
libs/flake/KoShapeApplicationData.h
+2
-1
libs/flake/KoShapeBackground.cpp
libs/flake/KoShapeBackground.cpp
+1
-1
libs/flake/KoShapeBackground.h
libs/flake/KoShapeBackground.h
+3
-3
libs/flake/KoShapeBorderFactory.cpp
libs/flake/KoShapeBorderFactory.cpp
+3
-3
libs/flake/KoShapeBorderFactory.h
libs/flake/KoShapeBorderFactory.h
+2
-1
libs/flake/KoShapeBorderModel.cpp
libs/flake/KoShapeBorderModel.cpp
+1
-1
libs/flake/KoShapeBorderModel.h
libs/flake/KoShapeBorderModel.h
+3
-2
libs/flake/KoShapeConfigFactory.h
libs/flake/KoShapeConfigFactory.h
+8
-3
libs/flake/KoShapeConfigWidgetBase.cpp
libs/flake/KoShapeConfigWidgetBase.cpp
+1
-1
libs/flake/KoShapeConfigWidgetBase.h
libs/flake/KoShapeConfigWidgetBase.h
+2
-1
libs/flake/KoShapeContainer.cpp
libs/flake/KoShapeContainer.cpp
+32
-30
libs/flake/KoShapeContainer.h
libs/flake/KoShapeContainer.h
+3
-2
libs/flake/KoShapeContainerModel.h
libs/flake/KoShapeContainerModel.h
+5
-2
libs/flake/KoShapeController.cpp
libs/flake/KoShapeController.cpp
+23
-24
libs/flake/KoShapeController.h
libs/flake/KoShapeController.h
+10
-10
libs/flake/KoShapeControllerBase.h
libs/flake/KoShapeControllerBase.h
+6
-5
libs/flake/KoShapeFactory.cpp
libs/flake/KoShapeFactory.cpp
+23
-24
libs/flake/KoShapeFactory.h
libs/flake/KoShapeFactory.h
+18
-15
libs/flake/KoShapeGroup.cpp
libs/flake/KoShapeGroup.cpp
+26
-30
libs/flake/KoShapeGroup.h
libs/flake/KoShapeGroup.h
+5
-4
libs/flake/KoShapeLayer.cpp
libs/flake/KoShapeLayer.cpp
+14
-15
libs/flake/KoShapeLayer.h
libs/flake/KoShapeLayer.h
+3
-3
libs/flake/KoShapeLoadingContext.cpp
libs/flake/KoShapeLoadingContext.cpp
+34
-38
libs/flake/KoShapeLoadingContext.h
libs/flake/KoShapeLoadingContext.h
+27
-30
libs/flake/KoShapeManager.cpp
libs/flake/KoShapeManager.cpp
+119
-134
libs/flake/KoShapeManager.h
libs/flake/KoShapeManager.h
+12
-12
libs/flake/KoShapeManagerPaintingStrategy.cpp
libs/flake/KoShapeManagerPaintingStrategy.cpp
+10
-11
libs/flake/KoShapeManagerPaintingStrategy.h
libs/flake/KoShapeManagerPaintingStrategy.h
+3
-3
libs/flake/KoShapeMoveStrategy.cpp
libs/flake/KoShapeMoveStrategy.cpp
+11
-11
libs/flake/KoShapeMoveStrategy.h
libs/flake/KoShapeMoveStrategy.h
+5
-3
libs/flake/KoShapeOdfSaveHelper.cpp
libs/flake/KoShapeOdfSaveHelper.cpp
+10
-12
libs/flake/KoShapeOdfSaveHelper.h
libs/flake/KoShapeOdfSaveHelper.h
+2
-2
libs/flake/KoShapePaste.cpp
libs/flake/KoShapePaste.cpp
+20
-23
libs/flake/KoShapePaste.h
libs/flake/KoShapePaste.h
+2
-2
libs/flake/KoShapeRegistry.cpp
libs/flake/KoShapeRegistry.cpp
+41
-45
libs/flake/KoShapeRegistry.h
libs/flake/KoShapeRegistry.h
+3
-3
libs/flake/KoShapeResizeStrategy.cpp
libs/flake/KoShapeResizeStrategy.cpp
+54
-57
libs/flake/KoShapeResizeStrategy.h
libs/flake/KoShapeResizeStrategy.h
+5
-3
libs/flake/KoShapeRotateStrategy.cpp
libs/flake/KoShapeRotateStrategy.cpp
+26
-26
libs/flake/KoShapeRotateStrategy.h
libs/flake/KoShapeRotateStrategy.h
+5
-3
libs/flake/KoShapeSavingContext.cpp
libs/flake/KoShapeSavingContext.cpp
+62
-69
libs/flake/KoShapeSavingContext.h
libs/flake/KoShapeSavingContext.h
+25
-26
libs/flake/KoShapeShadow.cpp
libs/flake/KoShapeShadow.cpp
+33
-34
libs/flake/KoShapeShadow.h
libs/flake/KoShapeShadow.h
+5
-5
libs/flake/KoShapeShearStrategy.cpp
libs/flake/KoShapeShearStrategy.cpp
+49
-58
libs/flake/KoShapeShearStrategy.h
libs/flake/KoShapeShearStrategy.h
+5
-3
libs/flake/KoShapeUserData.h
libs/flake/KoShapeUserData.h
+2
-1
libs/flake/KoSnapData.cpp
libs/flake/KoSnapData.cpp
+2
-2
libs/flake/KoSnapData.h
libs/flake/KoSnapData.h
+5
-5
libs/flake/KoSnapGuide.cpp
libs/flake/KoSnapGuide.cpp
+97
-117
libs/flake/KoSnapGuide.h
libs/flake/KoSnapGuide.h
+16
-16
libs/flake/KoSnapStrategy.cpp
libs/flake/KoSnapStrategy.cpp
+192
-234
libs/flake/KoSnapStrategy.h
libs/flake/KoSnapStrategy.h
+24
-24
libs/flake/KoSvgPathParser.cpp
libs/flake/KoSvgPathParser.cpp
+254
-303
libs/flake/KoSvgPathParser.h
libs/flake/KoSvgPathParser.h
+13
-13
libs/flake/KoTool.cpp
libs/flake/KoTool.cpp
+26
-26
libs/flake/KoTool.h
libs/flake/KoTool.h
+28
-20
libs/flake/KoToolFactory.cpp
libs/flake/KoToolFactory.cpp
+6
-7
libs/flake/KoToolFactory.h
libs/flake/KoToolFactory.h
+8
-3
libs/flake/KoToolManager.cpp
libs/flake/KoToolManager.cpp
+77
-90
libs/flake/KoToolManager.h
libs/flake/KoToolManager.h
+7
-6
libs/flake/KoToolManager_p.cpp
libs/flake/KoToolManager_p.cpp
+3
-3
libs/flake/KoToolManager_p.h
libs/flake/KoToolManager_p.h
+7
-3
libs/flake/KoToolProxy.cpp
libs/flake/KoToolProxy.cpp
+30
-30
libs/flake/KoToolProxy.h
libs/flake/KoToolProxy.h
+9
-8
libs/flake/KoToolRegistry.cpp
libs/flake/KoToolRegistry.cpp
+4
-4
libs/flake/KoToolRegistry.h
libs/flake/KoToolRegistry.h
+2
-1
libs/flake/KoToolSelection.cpp
libs/flake/KoToolSelection.cpp
+1
-1
libs/flake/KoToolSelection.h
libs/flake/KoToolSelection.h
+5
-2
libs/flake/ShapeDeleter_p.cpp
libs/flake/ShapeDeleter_p.cpp
+1
-1
libs/flake/ShapeDeleter_p.h
libs/flake/ShapeDeleter_p.h
+2
-1
libs/flake/SimpleShapeContainerModel.h
libs/flake/SimpleShapeContainerModel.h
+8
-5
libs/flake/SnapGuideConfigWidget.cpp
libs/flake/SnapGuideConfigWidget.cpp
+41
-41
libs/flake/SnapGuideConfigWidget.h
libs/flake/SnapGuideConfigWidget.h
+4
-4
libs/flake/commands/KoConnectionShapeTypeCommand.cpp
libs/flake/commands/KoConnectionShapeTypeCommand.cpp
+10
-10
libs/flake/commands/KoConnectionShapeTypeCommand.h
libs/flake/commands/KoConnectionShapeTypeCommand.h
+1
-1
libs/flake/commands/KoEventActionAddCommand.cpp
libs/flake/commands/KoEventActionAddCommand.cpp
+8
-8
libs/flake/commands/KoEventActionAddCommand.h
libs/flake/commands/KoEventActionAddCommand.h
+1
-1
libs/flake/commands/KoEventActionRemoveCommand.cpp
libs/flake/commands/KoEventActionRemoveCommand.cpp
+8
-8
libs/flake/commands/KoEventActionRemoveCommand.h
libs/flake/commands/KoEventActionRemoveCommand.h
+1
-1
libs/flake/commands/KoParameterHandleMoveCommand.cpp
libs/flake/commands/KoParameterHandleMoveCommand.cpp
+10
-10
libs/flake/commands/KoParameterHandleMoveCommand.h
libs/flake/commands/KoParameterHandleMoveCommand.h
+1
-1
libs/flake/commands/KoParameterToPathCommand.cpp
libs/flake/commands/KoParameterToPathCommand.cpp
+30
-35
libs/flake/commands/KoParameterToPathCommand.h
libs/flake/commands/KoParameterToPathCommand.h
+3
-3
libs/flake/commands/KoPathBaseCommand.cpp
libs/flake/commands/KoPathBaseCommand.cpp
+8
-9
libs/flake/commands/KoPathBaseCommand.h
libs/flake/commands/KoPathBaseCommand.h
+5
-4
libs/flake/commands/KoPathBreakAtPointCommand.cpp
libs/flake/commands/KoPathBreakAtPointCommand.cpp
+49
-70
libs/flake/commands/KoPathBreakAtPointCommand.h
libs/flake/commands/KoPathBreakAtPointCommand.h
+2
-2
libs/flake/commands/KoPathCombineCommand.cpp
libs/flake/commands/KoPathCombineCommand.cpp
+28
-35
libs/flake/commands/KoPathCombineCommand.h
libs/flake/commands/KoPathCombineCommand.h
+1
-1
libs/flake/commands/KoPathControlPointMoveCommand.cpp
libs/flake/commands/KoPathControlPointMoveCommand.cpp
+26
-37
libs/flake/commands/KoPathControlPointMoveCommand.h
libs/flake/commands/KoPathControlPointMoveCommand.h
+2
-2
libs/flake/commands/KoPathFillRuleCommand.cpp
libs/flake/commands/KoPathFillRuleCommand.cpp
+13
-14
libs/flake/commands/KoPathFillRuleCommand.h
libs/flake/commands/KoPathFillRuleCommand.h
+5
-4
libs/flake/commands/KoPathPointInsertCommand.cpp
libs/flake/commands/KoPathPointInsertCommand.cpp
+53
-68
libs/flake/commands/KoPathPointInsertCommand.h
libs/flake/commands/KoPathPointInsertCommand.h
+2
-2
libs/flake/commands/KoPathPointMoveCommand.cpp
libs/flake/commands/KoPathPointMoveCommand.cpp
+12
-14
libs/flake/commands/KoPathPointMoveCommand.h
libs/flake/commands/KoPathPointMoveCommand.h
+1
-1
libs/flake/commands/KoPathPointRemoveCommand.cpp
libs/flake/commands/KoPathPointRemoveCommand.cpp
+55
-79
libs/flake/commands/KoPathPointRemoveCommand.h
libs/flake/commands/KoPathPointRemoveCommand.h
+3
-3
libs/flake/commands/KoPathPointTypeCommand.cpp
libs/flake/commands/KoPathPointTypeCommand.cpp
+124
-137
libs/flake/commands/KoPathPointTypeCommand.h
libs/flake/commands/KoPathPointTypeCommand.h
+7
-10
libs/flake/commands/KoPathReverseCommand.cpp
libs/flake/commands/KoPathReverseCommand.cpp
+10
-13
libs/flake/commands/KoPathReverseCommand.h
libs/flake/commands/KoPathReverseCommand.h
+1
-1
libs/flake/commands/KoPathSegmentBreakCommand.cpp
libs/flake/commands/KoPathSegmentBreakCommand.cpp
+19
-30
libs/flake/commands/KoPathSegmentBreakCommand.h
libs/flake/commands/KoPathSegmentBreakCommand.h
+2
-2
libs/flake/commands/KoPathSegmentTypeCommand.cpp
libs/flake/commands/KoPathSegmentTypeCommand.cpp
+37
-52
libs/flake/commands/KoPathSegmentTypeCommand.h
libs/flake/commands/KoPathSegmentTypeCommand.h
+3
-5
libs/flake/commands/KoPathSeparateCommand.cpp
libs/flake/commands/KoPathSeparateCommand.cpp
+30
-38
libs/flake/commands/KoPathSeparateCommand.h
libs/flake/commands/KoPathSeparateCommand.h
+2
-2
libs/flake/commands/KoShapeAlignCommand.cpp
libs/flake/commands/KoShapeAlignCommand.cpp
+25
-26
libs/flake/commands/KoShapeAlignCommand.h
libs/flake/commands/KoShapeAlignCommand.h
+4
-4
libs/flake/commands/KoShapeBackgroundCommand.cpp
libs/flake/commands/KoShapeBackgroundCommand.cpp
+29
-33
libs/flake/commands/KoShapeBackgroundCommand.h
libs/flake/commands/KoShapeBackgroundCommand.h
+13
-12
libs/flake/commands/KoShapeBorderCommand.cpp
libs/flake/commands/KoShapeBorderCommand.cpp
+31
-31
libs/flake/commands/KoShapeBorderCommand.h
libs/flake/commands/KoShapeBorderCommand.h
+7
-6
libs/flake/commands/KoShapeCreateCommand.cpp
libs/flake/commands/KoShapeCreateCommand.cpp
+19
-20
libs/flake/commands/KoShapeCreateCommand.h
libs/flake/commands/KoShapeCreateCommand.h
+6
-5
libs/flake/commands/KoShapeDeleteCommand.cpp
libs/flake/commands/KoShapeDeleteCommand.cpp
+30
-31
libs/flake/commands/KoShapeDeleteCommand.h
libs/flake/commands/KoShapeDeleteCommand.h
+6
-5
libs/flake/commands/KoShapeDistributeCommand.cpp
libs/flake/commands/KoShapeDistributeCommand.cpp
+88
-87
libs/flake/commands/KoShapeDistributeCommand.h
libs/flake/commands/KoShapeDistributeCommand.h
+4
-5
libs/flake/commands/KoShapeGroupCommand.cpp
libs/flake/commands/KoShapeGroupCommand.cpp
+45
-57
libs/flake/commands/KoShapeGroupCommand.h
libs/flake/commands/KoShapeGroupCommand.h
+5
-4
libs/flake/commands/KoShapeKeepAspectRatioCommand.cpp
libs/flake/commands/KoShapeKeepAspectRatioCommand.cpp
+6
-6
libs/flake/commands/KoShapeKeepAspectRatioCommand.h
libs/flake/commands/KoShapeKeepAspectRatioCommand.h
+20
-20
libs/flake/commands/KoShapeLockCommand.cpp
libs/flake/commands/KoShapeLockCommand.cpp
+4
-4
libs/flake/commands/KoShapeLockCommand.h
libs/flake/commands/KoShapeLockCommand.h
+1
-1
libs/flake/commands/KoShapeMoveCommand.cpp
libs/flake/commands/KoShapeMoveCommand.cpp
+7
-7
libs/flake/commands/KoShapeMoveCommand.h
libs/flake/commands/KoShapeMoveCommand.h
+5
-4
libs/flake/commands/KoShapeReorderCommand.cpp
libs/flake/commands/KoShapeReorderCommand.cpp
+22
-25
libs/flake/commands/KoShapeReorderCommand.h
libs/flake/commands/KoShapeReorderCommand.h
+4
-3
libs/flake/commands/KoShapeShadowCommand.cpp
libs/flake/commands/KoShapeShadowCommand.cpp
+32
-36
libs/flake/commands/KoShapeShadowCommand.h
libs/flake/commands/KoShapeShadowCommand.h
+5
-5
libs/flake/commands/KoShapeShearCommand.cpp
libs/flake/commands/KoShapeShearCommand.cpp
+11
-11
libs/flake/commands/KoShapeShearCommand.h
libs/flake/commands/KoShapeShearCommand.h
+4
-3
libs/flake/commands/KoShapeSizeCommand.cpp
libs/flake/commands/KoShapeSizeCommand.cpp
+7
-7
libs/flake/commands/KoShapeSizeCommand.h
libs/flake/commands/KoShapeSizeCommand.h
+5
-4
libs/flake/commands/KoShapeTransformCommand.cpp
libs/flake/commands/KoShapeTransformCommand.cpp
+9
-11
libs/flake/commands/KoShapeTransformCommand.h
libs/flake/commands/KoShapeTransformCommand.h
+1
-1
libs/flake/commands/KoShapeUngroupCommand.cpp
libs/flake/commands/KoShapeUngroupCommand.cpp
+6
-6
libs/flake/commands/KoShapeUngroupCommand.h
libs/flake/commands/KoShapeUngroupCommand.h
+4
-3
libs/flake/commands/KoSubpathJoinCommand.cpp
libs/flake/commands/KoSubpathJoinCommand.cpp
+72
-86
libs/flake/commands/KoSubpathJoinCommand.h
libs/flake/commands/KoSubpathJoinCommand.h
+2
-3
libs/flake/commands/KoSubpathRemoveCommand.cpp
libs/flake/commands/KoSubpathRemoveCommand.cpp
+15
-19
libs/flake/commands/KoSubpathRemoveCommand.h
libs/flake/commands/KoSubpathRemoveCommand.h
+1
-1
libs/flake/flake_export.h
libs/flake/flake_export.h
+2
-2
libs/flake/tests/MockShapes.h
libs/flake/tests/MockShapes.h
+112
-54
libs/flake/tests/TestControlPointMoveCommand.cpp
libs/flake/tests/TestControlPointMoveCommand.cpp
+124
-124
libs/flake/tests/TestKoShapeFactory.cpp
libs/flake/tests/TestKoShapeFactory.cpp
+25
-25
libs/flake/tests/TestKoShapeRegistry.cpp
libs/flake/tests/TestKoShapeRegistry.cpp
+23
-23
libs/flake/tests/TestPathSegment.cpp
libs/flake/tests/TestPathSegment.cpp
+144
-144
libs/flake/tests/TestPathShape.cpp
libs/flake/tests/TestPathShape.cpp
+491
-492
libs/flake/tests/TestPathShape.h
libs/flake/tests/TestPathShape.h
+1
-1
libs/flake/tests/TestPathTool.cpp
libs/flake/tests/TestPathTool.cpp
+45
-45
libs/flake/tests/TestPointRemoveCommand.cpp
libs/flake/tests/TestPointRemoveCommand.cpp
+145
-145
libs/flake/tests/TestPointTypeCommand.cpp
libs/flake/tests/TestPointTypeCommand.cpp
+67
-67
libs/flake/tests/TestPosition.cpp
libs/flake/tests/TestPosition.cpp
+46
-40
libs/flake/tests/TestRemoveSubpathCommand.cpp
libs/flake/tests/TestRemoveSubpathCommand.cpp
+40
-40
libs/flake/tests/TestSelection.cpp
libs/flake/tests/TestSelection.cpp
+26
-26
libs/flake/tests/TestShapeAt.cpp
libs/flake/tests/TestShapeAt.cpp
+5
-4
libs/flake/tests/TestShapeContainer.cpp
libs/flake/tests/TestShapeContainer.cpp
+3
-2
libs/flake/tests/TestShapeGroupCommand.cpp
libs/flake/tests/TestShapeGroupCommand.cpp
+89
-89
libs/flake/tests/TestShapePainting.cpp
libs/flake/tests/TestShapePainting.cpp
+5
-3
libs/flake/tests/TestShapePainting.h
libs/flake/tests/TestShapePainting.h
+2
-1
libs/flake/tests/TestShapeReorderCommand.cpp
libs/flake/tests/TestShapeReorderCommand.cpp
+81
-81
libs/flake/tools/KoCreatePathTool.cpp
libs/flake/tools/KoCreatePathTool.cpp
+104
-126
libs/flake/tools/KoCreatePathTool.h
libs/flake/tools/KoCreatePathTool.h
+10
-10
libs/flake/tools/KoCreatePathToolFactory.cpp
libs/flake/tools/KoCreatePathToolFactory.cpp
+3
-3
libs/flake/tools/KoCreateShapeStrategy.cpp
libs/flake/tools/KoCreateShapeStrategy.cpp
+33
-37
libs/flake/tools/KoCreateShapeStrategy.h
libs/flake/tools/KoCreateShapeStrategy.h
+5
-4
libs/flake/tools/KoCreateShapesTool.cpp
libs/flake/tools/KoCreateShapesTool.cpp
+10
-10
libs/flake/tools/KoCreateShapesTool.h
libs/flake/tools/KoCreateShapesTool.h
+6
-6
libs/flake/tools/KoCreateShapesToolFactory.cpp
libs/flake/tools/KoCreateShapesToolFactory.cpp
+1
-1
libs/flake/tools/KoCreateShapesToolFactory.h
libs/flake/tools/KoCreateShapesToolFactory.h
+2
-1
libs/flake/tools/KoGuidesTool.cpp
libs/flake/tools/KoGuidesTool.cpp
+2
-2
libs/flake/tools/KoGuidesTool.h
libs/flake/tools/KoGuidesTool.h
+4
-4
libs/flake/tools/KoInteractionStrategy.cpp
libs/flake/tools/KoInteractionStrategy.cpp
+13
-13
libs/flake/tools/KoInteractionStrategy.h
libs/flake/tools/KoInteractionStrategy.h
+6
-5
libs/flake/tools/KoInteractionTool.cpp
libs/flake/tools/KoInteractionTool.cpp
+24
-29
libs/flake/tools/KoInteractionTool.h
libs/flake/tools/KoInteractionTool.h
+5
-5
libs/flake/tools/KoPanTool.cpp
libs/flake/tools/KoPanTool.cpp
+14
-14
libs/flake/tools/KoPanTool.h
libs/flake/tools/KoPanTool.h
+10
-7
libs/flake/tools/KoPanToolFactory.cpp
libs/flake/tools/KoPanToolFactory.cpp
+1
-1
libs/flake/tools/KoPanToolFactory.h
libs/flake/tools/KoPanToolFactory.h
+2
-1
libs/flake/tools/KoParameterChangeStrategy.cpp
libs/flake/tools/KoParameterChangeStrategy.cpp
+10
-11
libs/flake/tools/KoParameterChangeStrategy.h
libs/flake/tools/KoParameterChangeStrategy.h
+5
-3
libs/flake/tools/KoPathConnectionPointStrategy.cpp
libs/flake/tools/KoPathConnectionPointStrategy.cpp
+54
-64
libs/flake/tools/KoPathConnectionPointStrategy.h
libs/flake/tools/KoPathConnectionPointStrategy.h
+4
-4
libs/flake/tools/KoPathControlPointMoveStrategy.cpp
libs/flake/tools/KoPathControlPointMoveStrategy.cpp
+16
-17
libs/flake/tools/KoPathControlPointMoveStrategy.h
libs/flake/tools/KoPathControlPointMoveStrategy.h
+5
-5
libs/flake/tools/KoPathPointMoveStrategy.cpp
libs/flake/tools/KoPathPointMoveStrategy.cpp
+19
-20
libs/flake/tools/KoPathPointMoveStrategy.h
libs/flake/tools/KoPathPointMoveStrategy.h
+3
-3
libs/flake/tools/KoPathPointRubberSelectStrategy.cpp
libs/flake/tools/KoPathPointRubberSelectStrategy.cpp
+8
-8
libs/flake/tools/KoPathPointRubberSelectStrategy.h
libs/flake/tools/KoPathPointRubberSelectStrategy.h
+2
-2
libs/flake/tools/KoPathTool.cpp
libs/flake/tools/KoPathTool.cpp
+272
-337
libs/flake/tools/KoPathTool.h
libs/flake/tools/KoPathTool.h
+11
-10
libs/flake/tools/KoPathToolFactory.cpp
libs/flake/tools/KoPathToolFactory.cpp
+6
-6
libs/flake/tools/KoPathToolFactory.h
libs/flake/tools/KoPathToolFactory.h
+2
-1
libs/flake/tools/KoPathToolHandle.cpp
libs/flake/tools/KoPathToolHandle.cpp
+65
-79
libs/flake/tools/KoPathToolHandle.h
libs/flake/tools/KoPathToolHandle.h
+11
-11
libs/flake/tools/KoPathToolSelection.cpp
libs/flake/tools/KoPathToolSelection.cpp
+71
-97
libs/flake/tools/KoPathToolSelection.h
libs/flake/tools/KoPathToolSelection.h
+7
-7
libs/flake/tools/KoShapeRubberSelectStrategy.cpp
libs/flake/tools/KoShapeRubberSelectStrategy.cpp
+31
-32
libs/flake/tools/KoShapeRubberSelectStrategy.h
libs/flake/tools/KoShapeRubberSelectStrategy.h
+7
-5
libs/flake/tools/KoZoomStrategy.cpp
libs/flake/tools/KoZoomStrategy.cpp
+7
-7
libs/flake/tools/KoZoomStrategy.h
libs/flake/tools/KoZoomStrategy.h
+4
-3
libs/flake/tools/KoZoomTool.cpp
libs/flake/tools/KoZoomTool.cpp
+8
-8
libs/flake/tools/KoZoomTool.h
libs/flake/tools/KoZoomTool.h
+10
-8
libs/flake/tools/KoZoomToolFactory.cpp
libs/flake/tools/KoZoomToolFactory.cpp
+1
-1
libs/flake/tools/KoZoomToolFactory.h
libs/flake/tools/KoZoomToolFactory.h
+2
-1
libs/flake/tools/KoZoomToolWidget.cpp
libs/flake/tools/KoZoomToolWidget.cpp
+21
-24
libs/flake/tools/KoZoomToolWidget.h
libs/flake/tools/KoZoomToolWidget.h
+4
-3
libs/flake/tools/PathToolOptionWidget.cpp
libs/flake/tools/PathToolOptionWidget.cpp
+2
-2
libs/flake/tools/PathToolOptionWidget.h
libs/flake/tools/PathToolOptionWidget.h
+2
-1
No files found.
libs/flake/KoCanvasBase.cpp
View file @
cad28844
...
...
@@ -45,14 +45,14 @@ public:
KoSnapGuide
*
snapGuide
;
};
KoCanvasBase
::
KoCanvasBase
(
KoShapeControllerBase
*
shapeControllerBase
)
:
d
(
new
Private
())
KoCanvasBase
::
KoCanvasBase
(
KoShapeControllerBase
*
shapeControllerBase
)
:
d
(
new
Private
())
{
KConfigGroup
cfg
(
KGlobal
::
config
()
->
group
(
"canvas"
)
);
KConfigGroup
cfg
(
KGlobal
::
config
()
->
group
(
"canvas"
)
);
d
->
isAntialiased
=
cfg
.
readEntry
(
"antialiasing"
,
true
);
d
->
resourceProvider
=
new
KoCanvasResourceProvider
(
0
);
d
->
shapeController
=
new
KoShapeController
(
this
,
shapeControllerBase
);
d
->
snapGuide
=
new
KoSnapGuide
(
this
);
d
->
shapeController
=
new
KoShapeController
(
this
,
shapeControllerBase
);
d
->
snapGuide
=
new
KoSnapGuide
(
this
);
}
KoCanvasBase
::~
KoCanvasBase
()
...
...
libs/flake/KoCanvasBase.h
View file @
cad28844
...
...
@@ -50,7 +50,8 @@ class KoGuidesData;
* should implement. Flake tools know about the canvas, so they can
* do things like scroll, redraw, set a cursor etc.
*/
class
FLAKE_EXPORT
KoCanvasBase
{
class
FLAKE_EXPORT
KoCanvasBase
{
public:
...
...
@@ -59,7 +60,7 @@ public:
* @param shapeControllerBase the implementation of the shapeController that the
* application provides to allow shapes to be added in multiple views.
*/
explicit
KoCanvasBase
(
KoShapeControllerBase
*
shapeControllerBase
);
explicit
KoCanvasBase
(
KoShapeControllerBase
*
shapeControllerBase
);
virtual
~
KoCanvasBase
();
public:
...
...
@@ -144,7 +145,9 @@ public:
* By default the origin of the canvas widget and the position of the
* document origin are coincident, thus an empty point is returned.
*/
virtual
QPoint
documentOrigin
()
const
{
return
QPoint
(
0
,
0
);
}
virtual
QPoint
documentOrigin
()
const
{
return
QPoint
(
0
,
0
);
}
/**
* This method should somehow call QWidget::updateMicroFocus() on the canvas widget.
...
...
libs/flake/KoCanvasController.cpp
View file @
cad28844
...
...
@@ -52,8 +52,8 @@
class
KoCanvasController
::
Private
{
public:
Private
()
:
canvas
(
0
),
canvasMode
(
Centered
),
margin
(
0
)
,
ignoreScrollSignals
(
false
)
{}
Private
()
:
canvas
(
0
),
canvasMode
(
Centered
),
margin
(
0
)
,
ignoreScrollSignals
(
false
)
{}
KoCanvasBase
*
canvas
;
CanvasMode
canvasMode
;
int
margin
;
// The viewport margin around the document
...
...
@@ -66,11 +66,11 @@ public:
};
KoCanvasController
::
KoCanvasController
(
QWidget
*
parent
)
:
QAbstractScrollArea
(
parent
),
m_d
(
new
Private
())
:
QAbstractScrollArea
(
parent
),
m_d
(
new
Private
())
{
setFrameShape
(
NoFrame
);
m_d
->
viewportWidget
=
new
Viewport
(
this
);
m_d
->
viewportWidget
=
new
Viewport
(
this
);
setViewport
(
m_d
->
viewportWidget
);
setAutoFillBackground
(
false
);
...
...
@@ -86,12 +86,12 @@ KoCanvasController::KoCanvasController(QWidget *parent)
connect
(
horizontalScrollBar
(),
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
updateCanvasOffsetX
()));
connect
(
verticalScrollBar
(),
SIGNAL
(
valueChanged
(
int
)),
this
,
SLOT
(
updateCanvasOffsetY
()));
setMouseTracking
(
true
);
setMouseTracking
(
true
);
KConfigGroup
cfg
=
KGlobal
::
config
()
->
group
(
""
);
m_d
->
margin
=
cfg
.
readEntry
(
"canvasmargin"
,
0
);
connect
(
this
,
SIGNAL
(
moveDocumentOffset
(
const
QPoint
&
)
),
m_d
->
viewportWidget
,
SLOT
(
documentOffsetMoved
(
const
QPoint
&
)
)
);
connect
(
this
,
SIGNAL
(
moveDocumentOffset
(
const
QPoint
&
)),
m_d
->
viewportWidget
,
SLOT
(
documentOffsetMoved
(
const
QPoint
&
))
);
}
KoCanvasController
::~
KoCanvasController
()
...
...
@@ -99,16 +99,16 @@ KoCanvasController::~KoCanvasController()
delete
m_d
;
}
void
KoCanvasController
::
scrollContentsBy
(
int
dx
,
int
dy
)
void
KoCanvasController
::
scrollContentsBy
(
int
dx
,
int
dy
)
{
Q_UNUSED
(
dx
);
Q_UNUSED
(
dy
);
Q_UNUSED
(
dx
);
Q_UNUSED
(
dy
);
setDocumentOffset
();
}
void
KoCanvasController
::
setDrawShadow
(
bool
drawShadow
)
void
KoCanvasController
::
setDrawShadow
(
bool
drawShadow
)
{
m_d
->
viewportWidget
->
setDrawShadow
(
drawShadow
);
m_d
->
viewportWidget
->
setDrawShadow
(
drawShadow
);
}
...
...
@@ -133,7 +133,7 @@ void KoCanvasController::setCanvas(KoCanvasBase *canvas)
m_d
->
viewportWidget
->
setCanvas
(
canvas
->
canvasWidget
());
m_d
->
canvas
=
canvas
;
m_d
->
canvas
->
canvasWidget
()
->
installEventFilter
(
this
);
m_d
->
canvas
->
canvasWidget
()
->
setMouseTracking
(
true
);
m_d
->
canvas
->
canvasWidget
()
->
setMouseTracking
(
true
);
canvas
->
setCanvasController
(
this
);
emit
canvasSet
(
this
);
...
...
@@ -185,23 +185,23 @@ int KoCanvasController::visibleWidth() const
return
qMin
(
width1
,
width2
);
}
void
KoCanvasController
::
setCanvasMode
(
CanvasMode
mode
)
void
KoCanvasController
::
setCanvasMode
(
CanvasMode
mode
)
{
m_d
->
canvasMode
=
mode
;
switch
(
mode
)
{
case
AlignTop
:
m_d
->
preferredCenterFractionX
=
0
;
m_d
->
preferredCenterFractionY
=
0.5
;
break
;
case
Centered
:
m_d
->
preferredCenterFractionX
=
0.5
;
m_d
->
preferredCenterFractionY
=
0.5
;
break
;
case
Infinite
:
case
Presentation
:
m_d
->
preferredCenterFractionX
=
0
;
m_d
->
preferredCenterFractionY
=
0
;
break
;
switch
(
mode
)
{
case
AlignTop
:
m_d
->
preferredCenterFractionX
=
0
;
m_d
->
preferredCenterFractionY
=
0.5
;
break
;
case
Centered
:
m_d
->
preferredCenterFractionX
=
0.5
;
m_d
->
preferredCenterFractionY
=
0.5
;
break
;
case
Infinite
:
case
Presentation
:
m_d
->
preferredCenterFractionX
=
0
;
m_d
->
preferredCenterFractionY
=
0
;
break
;
};
}
...
...
@@ -247,7 +247,7 @@ void KoCanvasController::updateCanvasOffsetX()
emit
canvasOffsetXChanged
(
canvasOffsetX
());
if
(
m_d
->
viewportWidget
&&
m_d
->
viewportWidget
->
canvas
())
m_d
->
viewportWidget
->
canvas
()
->
setFocus
();
// workaround ugly bug in Qt that the focus is transferred to the sliders
m_d
->
preferredCenterFractionX
=
(
horizontalScrollBar
()
->
value
()
+
horizontalScrollBar
()
->
pageStep
()
/
2.0
)
/
m_d
->
documentSize
.
width
();
m_d
->
preferredCenterFractionX
=
(
horizontalScrollBar
()
->
value
()
+
horizontalScrollBar
()
->
pageStep
()
/
2.0
)
/
m_d
->
documentSize
.
width
();
}
void
KoCanvasController
::
updateCanvasOffsetY
()
...
...
@@ -257,7 +257,7 @@ void KoCanvasController::updateCanvasOffsetY()
emit
canvasOffsetYChanged
(
canvasOffsetY
());
if
(
m_d
->
viewportWidget
&&
m_d
->
viewportWidget
->
canvas
())
m_d
->
viewportWidget
->
canvas
()
->
setFocus
();
// workaround ugly bug in Qt that the focus is transferred to the sliders
m_d
->
preferredCenterFractionY
=
(
verticalScrollBar
()
->
value
()
+
verticalScrollBar
()
->
pageStep
()
/
2.0
)
/
m_d
->
documentSize
.
height
();
m_d
->
preferredCenterFractionY
=
(
verticalScrollBar
()
->
value
()
+
verticalScrollBar
()
->
pageStep
()
/
2.0
)
/
m_d
->
documentSize
.
height
();
}
bool
KoCanvasController
::
eventFilter
(
QObject
*
watched
,
QEvent
*
event
)
...
...
@@ -266,8 +266,7 @@ bool KoCanvasController::eventFilter(QObject* watched, QEvent* event)
if
((
event
->
type
()
==
QEvent
::
Resize
)
||
event
->
type
()
==
QEvent
::
Move
)
{
updateCanvasOffsetX
();
updateCanvasOffsetY
();
}
else
if
(
event
->
type
()
==
QEvent
::
MouseMove
||
event
->
type
()
==
QEvent
::
TabletMove
)
{
}
else
if
(
event
->
type
()
==
QEvent
::
MouseMove
||
event
->
type
()
==
QEvent
::
TabletMove
)
{
emitPointerPositionChangedSignals
(
event
);
}
}
...
...
@@ -276,16 +275,16 @@ bool KoCanvasController::eventFilter(QObject* watched, QEvent* event)
void
KoCanvasController
::
emitPointerPositionChangedSignals
(
QEvent
*
event
)
{
if
(
!
m_d
->
canvas
)
return
;
if
(
!
m_d
->
canvas
->
viewConverter
()
)
return
;
if
(
!
m_d
->
canvas
)
return
;
if
(
!
m_d
->
canvas
->
viewConverter
()
)
return
;
QPoint
pointerPos
;
QMouseEvent
*
mouseEvent
=
dynamic_cast
<
QMouseEvent
*>
(
event
);
if
(
mouseEvent
)
{
QMouseEvent
*
mouseEvent
=
dynamic_cast
<
QMouseEvent
*>
(
event
);
if
(
mouseEvent
)
{
pointerPos
=
mouseEvent
->
pos
();
}
else
{
QTabletEvent
*
tabletEvent
=
dynamic_cast
<
QTabletEvent
*>
(
event
);
if
(
tabletEvent
)
{
QTabletEvent
*
tabletEvent
=
dynamic_cast
<
QTabletEvent
*>
(
event
);
if
(
tabletEvent
)
{
pointerPos
=
tabletEvent
->
pos
();
}
}
...
...
@@ -293,23 +292,23 @@ void KoCanvasController::emitPointerPositionChangedSignals(QEvent *event)
QPoint
pixelPos
=
(
pointerPos
-
m_d
->
canvas
->
documentOrigin
())
+
m_d
->
documentOffset
;
QPointF
documentPos
=
m_d
->
canvas
->
viewConverter
()
->
viewToDocument
(
pixelPos
);
emit
documentMousePositionChanged
(
documentPos
);
emit
canvasMousePositionChanged
(
pointerPos
);
emit
documentMousePositionChanged
(
documentPos
);
emit
canvasMousePositionChanged
(
pointerPos
);
}
void
KoCanvasController
::
ensureVisible
(
KoShape
*
shape
)
void
KoCanvasController
::
ensureVisible
(
KoShape
*
shape
)
{
Q_ASSERT
(
shape
);
ensureVisible
(
shape
->
boundingRect
()
);
ensureVisible
(
shape
->
boundingRect
()
);
}
void
KoCanvasController
::
ensureVisible
(
const
QRectF
&
rect
,
bool
smooth
)
void
KoCanvasController
::
ensureVisible
(
const
QRectF
&
rect
,
bool
smooth
)
{
QRect
currentVisible
(
qMax
(
0
,
-
canvasOffsetX
()),
qMax
(
0
,
-
canvasOffsetY
()),
visibleWidth
(),
visibleHeight
());
QRect
currentVisible
(
qMax
(
0
,
-
canvasOffsetX
()),
qMax
(
0
,
-
canvasOffsetY
()),
visibleWidth
(),
visibleHeight
());
// convert the document based rect into a canvas based rect
QRect
viewRect
=
m_d
->
canvas
->
viewConverter
()
->
documentToView
(
rect
).
toRect
();
viewRect
.
translate
(
m_d
->
canvas
->
documentOrigin
()
);
QRect
viewRect
=
m_d
->
canvas
->
viewConverter
()
->
documentToView
(
rect
).
toRect
();
viewRect
.
translate
(
m_d
->
canvas
->
documentOrigin
()
);
if
(
!
viewRect
.
isValid
()
||
currentVisible
.
contains
(
viewRect
))
return
;
// its visible. Nothing to do.
...
...
@@ -343,52 +342,52 @@ void KoCanvasController::ensureVisible( const QRectF &rect, bool smooth )
void
KoCanvasController
::
recenterPreferred
()
{
if
(
viewport
()
->
width
()
>=
m_d
->
documentSize
.
width
()
&&
viewport
()
->
height
()
>=
m_d
->
documentSize
.
height
())
&&
viewport
()
->
height
()
>=
m_d
->
documentSize
.
height
())
return
;
// no need to center when image is smaller than viewport
const
bool
oldIgnoreScrollSignals
=
m_d
->
ignoreScrollSignals
;
m_d
->
ignoreScrollSignals
=
true
;
QPoint
center
=
QPoint
(
int
(
m_d
->
documentSize
.
width
()
*
m_d
->
preferredCenterFractionX
),
int
(
m_d
->
documentSize
.
height
()
*
m_d
->
preferredCenterFractionY
));
int
(
m_d
->
documentSize
.
height
()
*
m_d
->
preferredCenterFractionY
));
// convert into a viewport based point
center
.
rx
()
+=
m_d
->
canvas
->
canvasWidget
()
->
x
()
+
frameWidth
();
center
.
ry
()
+=
m_d
->
canvas
->
canvasWidget
()
->
y
()
+
frameWidth
();
// calculate the difference to the viewport centerpoint
QPoint
topLeft
=
center
-
0.5
*
QPoint
(
viewport
()
->
width
(),
viewport
()
->
height
()
);
QPoint
topLeft
=
center
-
0.5
*
QPoint
(
viewport
()
->
width
(),
viewport
()
->
height
()
);
QScrollBar
*
hBar
=
horizontalScrollBar
();
// try to centralize the centerpoint which we want to make visible
topLeft
.
rx
()
=
qMax
(
topLeft
.
x
(),
hBar
->
minimum
()
);
topLeft
.
rx
()
=
qMin
(
topLeft
.
x
(),
hBar
->
maximum
()
);
hBar
->
setValue
(
topLeft
.
x
()
);
topLeft
.
rx
()
=
qMax
(
topLeft
.
x
(),
hBar
->
minimum
()
);
topLeft
.
rx
()
=
qMin
(
topLeft
.
x
(),
hBar
->
maximum
()
);
hBar
->
setValue
(
topLeft
.
x
()
);
QScrollBar
*
vBar
=
verticalScrollBar
();
topLeft
.
ry
()
=
qMax
(
topLeft
.
y
(),
vBar
->
minimum
()
);
topLeft
.
ry
()
=
qMin
(
topLeft
.
y
(),
vBar
->
maximum
()
);
vBar
->
setValue
(
topLeft
.
y
()
);
topLeft
.
ry
()
=
qMax
(
topLeft
.
y
(),
vBar
->
minimum
()
);
topLeft
.
ry
()
=
qMin
(
topLeft
.
y
(),
vBar
->
maximum
()
);
vBar
->
setValue
(
topLeft
.
y
()
);
m_d
->
ignoreScrollSignals
=
oldIgnoreScrollSignals
;
}
void
KoCanvasController
::
zoomIn
(
const
QPoint
&
center
)
{
zoomBy
(
center
,
sqrt
(
2.0
));
zoomBy
(
center
,
sqrt
(
2.0
));
}
void
KoCanvasController
::
zoomOut
(
const
QPoint
&
center
)
{
zoomBy
(
center
,
sqrt
(
0.5
));
zoomBy
(
center
,
sqrt
(
0.5
));
}
void
KoCanvasController
::
zoomBy
(
const
QPoint
&
center
,
qreal
zoom
)
void
KoCanvasController
::
zoomBy
(
const
QPoint
&
center
,
qreal
zoom
)
{
m_d
->
preferredCenterFractionX
=
1.0
*
center
.
x
()
/
m_d
->
documentSize
.
width
();
m_d
->
preferredCenterFractionY
=
1.0
*
center
.
y
()
/
m_d
->
documentSize
.
height
();
const
bool
oldIgnoreScrollSignals
=
m_d
->
ignoreScrollSignals
;
m_d
->
ignoreScrollSignals
=
true
;
emit
zoomBy
(
zoom
);
emit
zoomBy
(
zoom
);
m_d
->
ignoreScrollSignals
=
oldIgnoreScrollSignals
;
recenterPreferred
();
m_d
->
canvas
->
canvasWidget
()
->
update
();
...
...
@@ -419,7 +418,7 @@ void KoCanvasController::setToolOptionWidgets(const QMap<QString, QWidget *>&wid
emit
toolOptionWidgetsChanged
(
widgetMap
);
}
void
KoCanvasController
::
setDocumentSize
(
const
QSize
&
sz
,
bool
recalculateCenter
)
void
KoCanvasController
::
setDocumentSize
(
const
QSize
&
sz
,
bool
recalculateCenter
)
{
if
(
!
recalculateCenter
)
{
// assume the distance from the top stays equal and recalculate the center.
...
...
@@ -430,7 +429,7 @@ void KoCanvasController::setDocumentSize( const QSize & sz, bool recalculateCent
const
bool
oldIgnoreScrollSignals
=
m_d
->
ignoreScrollSignals
;
m_d
->
ignoreScrollSignals
=
true
;
m_d
->
documentSize
=
sz
;
m_d
->
viewportWidget
->
setDocumentSize
(
sz
);
m_d
->
viewportWidget
->
setDocumentSize
(
sz
);
resetScrollBars
();
m_d
->
ignoreScrollSignals
=
oldIgnoreScrollSignals
;
...
...
@@ -448,12 +447,12 @@ void KoCanvasController::setDocumentOffset()
// the canvas must add to the update rect in its paint event, to
// compensate.
QPoint
pt
(
horizontalScrollBar
()
->
value
(),
verticalScrollBar
()
->
value
()
);
if
(
pt
.
x
()
<
m_d
->
margin
)
pt
.
setX
(
0
);
if
(
pt
.
y
()
<
m_d
->
margin
)
pt
.
setY
(
0
);
if
(
pt
.
x
()
>
m_d
->
documentSize
.
width
()
)
pt
.
setX
(
m_d
->
documentSize
.
width
()
);
if
(
pt
.
y
()
>
m_d
->
documentSize
.
height
()
)
pt
.
setY
(
m_d
->
documentSize
.
height
()
);
emit
(
moveDocumentOffset
(
pt
)
);
QPoint
pt
(
horizontalScrollBar
()
->
value
(),
verticalScrollBar
()
->
value
()
);
if
(
pt
.
x
()
<
m_d
->
margin
)
pt
.
setX
(
0
);
if
(
pt
.
y
()
<
m_d
->
margin
)
pt
.
setY
(
0
);
if
(
pt
.
x
()
>
m_d
->
documentSize
.
width
())
pt
.
setX
(
m_d
->
documentSize
.
width
()
);
if
(
pt
.
y
()
>
m_d
->
documentSize
.
height
())
pt
.
setY
(
m_d
->
documentSize
.
height
()
);
emit
(
moveDocumentOffset
(
pt
)
);
QWidget
*
canvasWidget
=
m_d
->
canvas
->
canvasWidget
();
...
...
@@ -497,15 +496,15 @@ void KoCanvasController::resetScrollBars()
if
(
docH
<=
drawH
&&
docW
<=
drawW
)
{
// we need no scrollbars
vScroll
->
setRange
(
0
,
0
);
hScroll
->
setRange
(
0
,
0
);
vScroll
->
setRange
(
0
,
0
);
hScroll
->
setRange
(
0
,
0
);
}
else
if
(
docH
<=
drawH
)
{
// we need a horizontal scrollbar only
vScroll
->
setRange
(
0
,
0
);
vScroll
->
setRange
(
0
,
0
);
hScroll
->
setRange
(
0
,
docW
-
drawW
);
}
else
if
(
docW
<=
drawW
)
{
// we need a vertical scrollbar only
hScroll
->
setRange
(
0
,
0
);
hScroll
->
setRange
(
0
,
0
);
vScroll
->
setRange
(
0
,
docH
-
drawH
);
}
else
{
// we need both scrollbars
...
...
@@ -514,7 +513,7 @@ void KoCanvasController::resetScrollBars()
}
int
fontheight
=
QFontMetrics
(
font
()).
height
();
vScroll
->
setPageStep
(
drawH
);
vScroll
->
setSingleStep
(
fontheight
);
hScroll
->
setPageStep
(
drawW
);
...
...
@@ -525,14 +524,14 @@ void KoCanvasController::resetScrollBars()
void
KoCanvasController
::
pan
(
const
QPoint
&
distance
)
{
QScrollBar
*
hBar
=
horizontalScrollBar
();
if
(
hBar
&&
hBar
->
isVisible
()
)
hBar
->
setValue
(
hBar
->
value
()
+
distance
.
x
());
if
(
hBar
&&
hBar
->
isVisible
()
)
hBar
->
setValue
(
hBar
->
value
()
+
distance
.
x
());
QScrollBar
*
vBar
=
verticalScrollBar
();
if
(
vBar
&&
vBar
->
isVisible
()
)
vBar
->
setValue
(
vBar
->
value
()
+
distance
.
y
());
if
(
vBar
&&
vBar
->
isVisible
()
)
vBar
->
setValue
(
vBar
->
value
()
+
distance
.
y
());
}
void
KoCanvasController
::
setPreferredCenter
(
const
QPoint
&
viewPoint
)
void
KoCanvasController
::
setPreferredCenter
(
const
QPoint
&
viewPoint
)
{
m_d
->
preferredCenterFractionX
=
1.0
*
viewPoint
.
x
()
/
m_d
->
documentSize
.
width
();
m_d
->
preferredCenterFractionY
=
1.0
*
viewPoint
.
y
()
/
m_d
->
documentSize
.
height
();
...
...
@@ -542,35 +541,35 @@ void KoCanvasController::setPreferredCenter( const QPoint &viewPoint )
QPoint
KoCanvasController
::
preferredCenter
()
const
{
QPoint
center
;
center
.
setX
(
qRound
(
m_d
->
preferredCenterFractionX
*
m_d
->
documentSize
.
width
()
)
);
center
.
setY
(
qRound
(
m_d
->
preferredCenterFractionY
*
m_d
->
documentSize
.
height
()
)
);
center
.
setX
(
qRound
(
m_d
->
preferredCenterFractionX
*
m_d
->
documentSize
.
width
())
);
center
.
setY
(
qRound
(
m_d
->
preferredCenterFractionY
*
m_d
->
documentSize
.
height
())
);
return
center
;
}
void
KoCanvasController
::
paintEvent
(
QPaintEvent
*
event
)
void
KoCanvasController
::
paintEvent
(
QPaintEvent
*
event
)
{
QPainter
gc
(
viewport
()
);
m_d
->
viewportWidget
->
handlePaintEvent
(
gc
,
event
);
QPainter
gc
(
viewport
()
);
m_d
->
viewportWidget
->
handlePaintEvent
(
gc
,
event
);
}
void
KoCanvasController
::
dragEnterEvent
(
QDragEnterEvent
*
event
)
void
KoCanvasController
::
dragEnterEvent
(
QDragEnterEvent
*
event
)
{
m_d
->
viewportWidget
->
handleDragEnterEvent
(
event
);
m_d
->
viewportWidget
->
handleDragEnterEvent
(
event
);
}
void
KoCanvasController
::
dropEvent
(
QDropEvent
*
event
)
void
KoCanvasController
::
dropEvent
(
QDropEvent
*
event
)
{
m_d
->
viewportWidget
->
handleDropEvent
(
event
);
m_d
->
viewportWidget
->
handleDropEvent
(
event
);
}
void
KoCanvasController
::
dragMoveEvent
(
QDragMoveEvent
*
event
)
void
KoCanvasController
::
dragMoveEvent
(
QDragMoveEvent
*
event
)
{
m_d
->
viewportWidget
->
handleDragMoveEvent
(
event
);
m_d
->
viewportWidget
->
handleDragMoveEvent
(
event
);
}
void
KoCanvasController
::
dragLeaveEvent
(
QDragLeaveEvent
*
event
)
void
KoCanvasController
::
dragLeaveEvent
(
QDragLeaveEvent
*
event
)
{
m_d
->
viewportWidget
->
handleDragLeaveEvent
(
event
);
m_d
->
viewportWidget
->
handleDragLeaveEvent
(
event
);
}
void
KoCanvasController
::
keyPressEvent
(
QKeyEvent
*
event
)
...
...
@@ -578,69 +577,67 @@ void KoCanvasController::keyPressEvent(QKeyEvent *event)
KoToolManager
::
instance
()
->
switchToolByShortcut
(
event
);
}
void
KoCanvasController
::
wheelEvent
(
QWheelEvent
*
event
)
void
KoCanvasController
::
wheelEvent
(
QWheelEvent
*
event
)
{
if
((
event
->
modifiers
()
&
Qt
::
ControlModifier
)
==
Qt
::
ControlModifier
)
{
const
bool
oldIgnoreScrollSignals
=
m_d
->
ignoreScrollSignals
;
m_d
->
ignoreScrollSignals
=
true
;
const
QPoint
offset
(
horizontalScrollBar
()
->
value
(),
verticalScrollBar
()
->
value
()
);
const
QPoint
mousePos
(
event
->
pos
()
+
offset
);
const
QPoint
offset
(
horizontalScrollBar
()
->
value
(),
verticalScrollBar
()
->
value
()
);
const
QPoint
mousePos
(
event
->
pos
()
+
offset
);
const
qreal
zoomLevel
=
event
->
delta
()
>
0
?
sqrt
(
2.0
)
:
sqrt
(
0.5
);
QPointF
oldCenter
=
preferredCenter
();
if
(
visibleWidth
()
>=
m_d
->
documentSize
.
width
()
)
if
(
visibleWidth
()
>=
m_d
->
documentSize
.
width
()
)
oldCenter
.
rx
()
=
m_d
->
documentSize
.
width
()
*
0.5
;
if
(
visibleHeight
()
>=
m_d
->
documentSize
.
height
()
)
if
(
visibleHeight
()
>=
m_d
->
documentSize
.
height
()
)
oldCenter
.
ry
()
=
m_d
->
documentSize
.
height
()
*
0.5
;
const
QPointF
newCenter
=
mousePos
-
(
1.0
/
zoomLevel
)
*
(
mousePos
-
oldCenter
);
if
(
event
->
delta
()
>
0
)
zoomIn
(
newCenter
.
toPoint
()
);
zoomIn
(
newCenter
.
toPoint
()
);
else
zoomOut
(
newCenter
.
toPoint
()
);
zoomOut
(
newCenter
.
toPoint
()
);
event
->
accept
();
m_d
->
ignoreScrollSignals
=
oldIgnoreScrollSignals
;
}
else
}
else
QAbstractScrollArea
::
wheelEvent
(
event
);
}
void
KoCanvasController
::
activate
()
{
QWidget
*
parent
=
this
;
while
(
parent
->
parentWidget
()
)
while
(
parent
->
parentWidget
()
)