Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_deselect_global_selection_command.cpp
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: 2007 Sven Langkamp <sven.langkamp@gmail.com>
3
*
4
* SPDX-License-Identifier: GPL-2.0-or-later
5
*/
6
7
#include "
kis_deselect_global_selection_command.h
"
8
9
#include <klocalizedstring.h>
10
11
#include "
kis_image.h
"
12
#include "
kis_group_layer.h
"
13
#include "
kis_selection_mask.h
"
14
#include "
KisImageGlobalSelectionManagementInterface.h
"
15
#include "
KisChangeDeselectedMaskCommand.h
"
16
#include "
kis_image_layer_remove_command.h
"
17
#include "
KisNotifySelectionChangedCommand.h
"
18
19
20
KisDeselectGlobalSelectionCommand::KisDeselectGlobalSelectionCommand
(
KisImageWSP
image,
KUndo2Command
* parent)
21
:
KisCommandUtils
::AggregateCommand(
kundo2_i18n
(
"Deselect"
), parent)
22
, m_image(image)
23
{
24
}
25
26
KisDeselectGlobalSelectionCommand::~KisDeselectGlobalSelectionCommand
()
27
{
28
}
29
30
void
KisDeselectGlobalSelectionCommand::populateChildCommands
()
31
{
32
KisImageSP
image =
m_image
.
toStrongRef
();
33
KIS_SAFE_ASSERT_RECOVER_RETURN
(image);
34
35
KisSelectionMaskSP
selectionMask = image->
rootLayer
()->
selectionMask
();
36
if
(selectionMask) {
37
addCommand
(
new
KisNotifySelectionChangedCommand
(image,
KisNotifySelectionChangedCommand::INITIALIZING
));
38
addCommand
(
new
KisChangeDeselectedMaskCommand
(image, selectionMask));
39
addCommand
(
new
KisImageLayerRemoveCommand
(image, selectionMask,
false
,
false
));
40
addCommand
(
new
KisNotifySelectionChangedCommand
(image,
KisNotifySelectionChangedCommand::FINALIZING
));
41
}
42
}
KisChangeDeselectedMaskCommand.h
KisImageGlobalSelectionManagementInterface.h
KisNotifySelectionChangedCommand.h
KUndo2Command
Definition
kundo2stack.h:87
KisChangeDeselectedMaskCommand
Definition
KisChangeDeselectedMaskCommand.h:16
KisDeselectGlobalSelectionCommand::m_image
KisImageWSP m_image
Definition
kis_deselect_global_selection_command.h:29
KisDeselectGlobalSelectionCommand::populateChildCommands
void populateChildCommands() override
Definition
kis_deselect_global_selection_command.cpp:30
KisDeselectGlobalSelectionCommand::KisDeselectGlobalSelectionCommand
KisDeselectGlobalSelectionCommand(KisImageWSP image, KUndo2Command *parent=0)
Definition
kis_deselect_global_selection_command.cpp:20
KisDeselectGlobalSelectionCommand::~KisDeselectGlobalSelectionCommand
~KisDeselectGlobalSelectionCommand() override
Definition
kis_deselect_global_selection_command.cpp:26
KisImageLayerRemoveCommand
Definition
kis_image_layer_remove_command.h:16
KisImage::rootLayer
KisGroupLayerSP rootLayer() const
Definition
kis_image.cc:1600
KisNotifySelectionChangedCommand
Definition
KisNotifySelectionChangedCommand.h:15
KisSharedPtr< KisImage >
KisWeakSharedPtr< KisImage >
KisWeakSharedPtr::toStrongRef
KisSharedPtr< T > toStrongRef() const
toStrongRef returns a KisSharedPtr which may be dereferenced.
Definition
kis_shared_ptr.h:418
KIS_SAFE_ASSERT_RECOVER_RETURN
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
Definition
kis_assert.h:128
kis_deselect_global_selection_command.h
kis_group_layer.h
kis_image.h
kis_image_layer_remove_command.h
kis_selection_mask.h
kundo2_i18n
KUndo2MagicString kundo2_i18n(const char *text)
Definition
kundo2magicstring.h:180
KisCommandUtils
Definition
kis_command_ids.h:10
KisCommandUtils::AggregateCommand::addCommand
void addCommand(KUndo2Command *cmd)
Definition
kis_command_utils.cpp:36
KisCommandUtils::FlipFlopCommand::INITIALIZING
@ INITIALIZING
Definition
kis_command_utils.h:99
KisCommandUtils::FlipFlopCommand::FINALIZING
@ FINALIZING
Definition
kis_command_utils.h:100
KisLayer::selectionMask
virtual KisSelectionMaskSP selectionMask() const
Definition
kis_layer.cc:498
libs
image
commands
kis_deselect_global_selection_command.cpp
Generated at
2025-11-04 02:30:02+01:00
from
Krita
branch
master
, commit
c9dde2e79561a8aea4a7e8d9ac99c98a7bac9e52