|
Krita Source Code Documentation
|
#include <kis_action.h>
Inheritance diagram for KisAction:Public Types | |
| enum | ActivationCondition { NO_CONDITION = 0 , ACTIVE_NODE_EDITABLE = 0x1 , ACTIVE_NODE_EDITABLE_PAINT_DEVICE = 0x2 , SELECTION_EDITABLE = 0x4 , OPENGL_ENABLED = 0x8 } |
| enum | ActivationFlag { NONE = 0x0000 , ACTIVE_IMAGE = 0x0001 , MULTIPLE_IMAGES = 0x0002 , CURRENT_IMAGE_MODIFIED = 0x0004 , ACTIVE_NODE = 0x0008 , ACTIVE_DEVICE = 0x0010 , ACTIVE_LAYER = 0x0020 , ACTIVE_TRANSPARENCY_MASK = 0x0040 , ACTIVE_SHAPE_LAYER = 0x0080 , PIXELS_SELECTED = 0x0100 , SHAPES_SELECTED = 0x0200 , ANY_SELECTION_WITH_PIXELS = 0x0400 , PIXELS_IN_CLIPBOARD = 0x0800 , SHAPES_IN_CLIPBOARD = 0x1000 , NEVER_ACTIVATE = 0x2000 , LAYERS_IN_CLIPBOARD = 0x4000 , IMAGE_HAS_ANIMATION = 0x8000 , SHAPE_SELECTION_WITH_SHAPES = 0x10000 , PIXEL_SELECTION_WITH_PIXELS = 0x20000 , IMAGE_CAN_RESELECT = 0x40000 , IMAGE_IS_WRITABLE = 0x80000 } |
Signals | |
| void | sigEnableSlaves (bool value) |
Public Member Functions | |
| ActivationConditions | activationConditions () |
| ActivationFlags | activationFlags () |
| QKeySequence | defaultShortcut () const |
| const QStringList & | excludedNodeTypes () const |
| KisAction (const QIcon &icon, const QString &text, QObject *parent=0) | |
| KisAction (const QString &text, QObject *parent=0) | |
| KisAction (QObject *parent=0) | |
| Private () | |
| virtual void | setActionEnabled (bool enabled) |
| void | setActivationConditions (ActivationConditions conditions) |
| void | setActivationFlags (ActivationFlags flags) |
| void | setDefaultShortcut (const QKeySequence &shortcut) |
| void | setExcludedNodeTypes (const QStringList &nodeTypes) |
| void | setOperationID (const QString &id) |
| ~KisAction () override | |
Public Attributes | |
| KisActionManager * | actionManager |
| ActivationConditions | conditions |
| QStringList | excludedNodeTypes |
| ActivationFlags | flags |
| QString | operationID |
Private Slots | |
| void | slotChanged () |
| void | slotTriggered () |
Private Member Functions | |
| void | setActionManager (KisActionManager *actionManager) |
Private Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
Private Attributes | |
| Private *const | d |
Private Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
Friends | |
| class | KisActionManager |
KisAction, inheriting from QWidgetAction, is a convenience class for GUI actions, with Krita's configuration system and GUI states. A widget like a "save" button may be enabled/disabled, hidden or shown depending on the state of the application, e.g. whether the image currently being viewed was modified since it was opened.
Copies of these actions are created for each MainWindow instance. They are owned by a KisActionManager, of which there is one for each MainWindow. Most of these instantiations happen inside the constructor for KisMainWindow as well as the various functions called in KisViewManager::setupManagers().
Definition at line 12 of file kis_action.cpp.
| Enumerator | |
|---|---|
| NO_CONDITION | |
| ACTIVE_NODE_EDITABLE | |
| ACTIVE_NODE_EDITABLE_PAINT_DEVICE | |
| SELECTION_EDITABLE | |
| OPENGL_ENABLED | |
Definition at line 66 of file kis_action.h.
If you re-order these, you must change the associated values in krita.action and kritamenu.action!
| Enumerator | |
|---|---|
| NONE | Always activate. |
| ACTIVE_IMAGE | Activate if there is at least one image. |
| MULTIPLE_IMAGES | Activate if there is more than one image open. |
| CURRENT_IMAGE_MODIFIED | Activate if the current image is modified. |
| ACTIVE_NODE | Activate if there's an active node (layer or mask) |
| ACTIVE_DEVICE | Activate if the active node has a paint device, i.e. there are pixels to be modified. |
| ACTIVE_LAYER | Activate if the current node is a layer (vector or pixel) |
| ACTIVE_TRANSPARENCY_MASK | Activate if the current node is a transparency mask. |
| ACTIVE_SHAPE_LAYER | Activate if the current node is a vector layer. |
| PIXELS_SELECTED | Activate if any pixels are selected (with any kind of selection) |
| SHAPES_SELECTED | Activate if any vector shape is selected. |
| ANY_SELECTION_WITH_PIXELS | ??? |
| PIXELS_IN_CLIPBOARD | Activate if the clipboard contains pixels. |
| SHAPES_IN_CLIPBOARD | Activate if the clipboard contains vector data. |
| NEVER_ACTIVATE | ??? |
| LAYERS_IN_CLIPBOARD | ??? |
| IMAGE_HAS_ANIMATION | Activate if the image has an animation. |
| SHAPE_SELECTION_WITH_SHAPES | Activate there is a vector selection active. |
| PIXEL_SELECTION_WITH_PIXELS | Activate there is a raster selection active. |
| IMAGE_CAN_RESELECT | Activate there is a deselected selection in the image. |
| IMAGE_IS_WRITABLE | Activate KisDocument::isReadWrite() is active. |
Definition at line 41 of file kis_action.h.
|
explicit |
Definition at line 24 of file kis_action.cpp.
References connect(), and slotChanged().
| KisAction::KisAction | ( | const QString & | text, |
| QObject * | parent = 0 ) |
Definition at line 31 of file kis_action.cpp.
References connect(), and slotChanged().
| KisAction::KisAction | ( | const QIcon & | icon, |
| const QString & | text, | ||
| QObject * | parent = 0 ) |
Definition at line 39 of file kis_action.cpp.
References connect(), and slotChanged().
|
override |
| KisAction::ActivationConditions KisAction::activationConditions | ( | ) |
| KisAction::ActivationFlags KisAction::activationFlags | ( | ) |
| QKeySequence KisAction::defaultShortcut | ( | ) | const |
Definition at line 69 of file kis_action.cpp.
| const QStringList & KisAction::excludedNodeTypes | ( | ) | const |
|
inline |
Definition at line 15 of file kis_action.cpp.
|
virtual |
Definition at line 109 of file kis_action.cpp.
|
private |
Set the action manager. Only used by KisActionManager
Definition at line 114 of file kis_action.cpp.
References actionManager, and d.
| void KisAction::setActivationConditions | ( | ActivationConditions | conditions | ) |
Definition at line 89 of file kis_action.cpp.
References conditions, and d.
| void KisAction::setActivationFlags | ( | ActivationFlags | flags | ) |
| void KisAction::setDefaultShortcut | ( | const QKeySequence & | shortcut | ) |
Definition at line 59 of file kis_action.cpp.
| void KisAction::setExcludedNodeTypes | ( | const QStringList & | nodeTypes | ) |
Definition at line 99 of file kis_action.cpp.
References d.
| void KisAction::setOperationID | ( | const QString & | id | ) |
Set operation id. This will used to run an operation in the KisActionManager
Definition at line 119 of file kis_action.cpp.
References connect(), d, and slotTriggered().
|
signal |
|
privateslot |
Definition at line 132 of file kis_action.cpp.
References sigEnableSlaves().
|
privateslot |
|
friend |
Definition at line 108 of file kis_action.h.
| KisActionManager* KisAction::actionManager |
Definition at line 21 of file kis_action.cpp.
| ActivationConditions KisAction::conditions |
Definition at line 18 of file kis_action.cpp.
|
private |
Definition at line 117 of file kis_action.h.
| const QStringList & KisAction::excludedNodeTypes |
Definition at line 19 of file kis_action.cpp.
| ActivationFlags KisAction::flags |
Definition at line 17 of file kis_action.cpp.
| QString KisAction::operationID |
Definition at line 20 of file kis_action.cpp.