|
Krita Source Code Documentation
|
Base class for the Krita app. More...
#include <KisApplication.h>
Inheritance diagram for KisApplication:Classes | |
| class | Private |
| class | ResetStarting |
Public Slots | |
| void | executeRemoteArguments (QByteArray message, KisMainWindow *mainWindow) |
| void | fileOpenRequested (const QString &url) |
| void | remoteArguments (const QString &message) |
| void | setSplashScreenLoadingText (const QString &) |
Public Slots inherited from QtSingleApplication | |
| void | activateWindow () |
| bool | sendMessage (const QString &message, int timeout=5000) |
Public Member Functions | |
| void | addResourceTypes () |
| void | askResetConfig () |
| bool | event (QEvent *event) override |
| KisExtendedModifiersMapperPluginInterface * | extendedModifiersPluginInterface () |
| void | hideSplashScreen () |
| void | initializeGlobals (const KisApplicationArguments &args) |
| bool | isStoreApplication () |
| KisApplication (const QString &key, int &argc, char **argv) | |
| void | loadPlugins () |
| bool | notify (QObject *receiver, QEvent *event) override |
| Overridden to handle exceptions from event handlers. | |
| void | processPostponedSynchronizationEvents () |
| bool | registerResources () |
| void | setSplashScreen (QWidget *splash) |
| virtual bool | start (const KisApplicationArguments &args) |
| ~KisApplication () override | |
Public Member Functions inherited from QtSingleApplication | |
| QWidget * | activationWindow () const |
| QString | id () const |
| void | initialize (bool dummy=true) |
| bool | isRunning () |
| QtSingleApplication (const QString &id, int &argc, char **argv) | |
| QtSingleApplication (int &argc, char **argv, bool GUIenabled=true) | |
| QtSingleApplication (int &argc, char **argv, Type type) | |
| void | setActivationWindow (QWidget *aw, bool activateOnMessage=true) |
Static Public Member Functions | |
| static void | verifyMetatypeRegistration () |
Private Slots | |
| void | slotSetLongPress (bool enabled) |
Private Member Functions | |
| void | checkAutosaveFiles () |
| bool | createNewDocFromTemplate (const QString &fileName, KisMainWindow *m_mainWindow) |
| void | resetConfig () |
Private Attributes | |
| QScopedPointer< Private > | d |
Friends | |
| class | ResetStarting |
Additional Inherited Members | |
Signals inherited from QtSingleApplication | |
| void | messageReceived (const QString &message) |
Base class for the Krita app.
This class handles arguments given on the command line and shows a generic about dialog for the Krita app.
In addition it adds the standard directories where Krita can find its images etc.
If the last mainwindow becomes closed, KisApplication automatically calls QApplication::quit.
Definition at line 37 of file KisApplication.h.
|
explicit |
Creates an application object, adds some standard directories and initializes kimgio.
Load platform plugin for modifiers fetching
Definition at line 218 of file KisApplication.cpp.
References KisIconUtils::loadIcon(), setMouseCoalescingEnabled(), KritaVersionWrapper::versionString(), and KisConfig::widgetStyle().
|
override |
Destructor.
Definition at line 821 of file KisApplication.cpp.
References KisResourceCacheDb::deleteTemporaryResources(), QtSingleApplication::isRunning(), and KisResourceCacheDb::performHouseKeepingOnExit().
| void KisApplication::addResourceTypes | ( | ) |
Definition at line 367 of file KisApplication.cpp.
References KoResourcePaths::addAssetType(), ResourceType::FilterEffects, KoResourcePaths::saveLocation(), and ResourceType::SeExprScripts.
| void KisApplication::askResetConfig | ( | ) |
Checks if user is holding ctrl+alt+shift keys and asks if the settings file should be cleared.
Typically called during startup before reading the config.
Definition at line 1273 of file KisApplication.cpp.
References resetConfig().
|
private |
Definition at line 1105 of file KisApplication.cpp.
References KisAutoSaveRecoveryDialog::autoSaveLocation(), KisMainWindow::BatchMode, d, KisUsageLogger::log(), KisMainWindow::None, and KisMainWindow::RecoveryFile.
|
private |
Definition at line 1165 of file KisApplication.cpp.
References KisMainWindow::BatchMode, d, dbgUI, KoResourcePaths::findAllAssets(), KisMainWindow::Import, KisMainWindow::None, and KisMainWindow::openDocument().
|
override |
Definition at line 401 of file KisApplication.cpp.
References event(), and fileOpenRequested().
|
slot |
Definition at line 1001 of file KisApplication.cpp.
References KisPart::addDocument(), KisNodeCommandsAdapter::addNode(), KisMainWindow::BatchMode, KisApplicationArguments::createDocumentFromArguments(), createNewDocFromTemplate(), d, KisApplicationArguments::deserialize(), KisApplicationArguments::doNewImage(), KisApplicationArguments::doTemplate, KisApplicationArguments::fileLayer, KisApplicationArguments::filenames, KisViewManager::image(), KisPart::instance(), KisImage::nextLayerName(), KisFileLayer::None, KisMainWindow::None, OPACITY_OPAQUE_U8, KisMainWindow::openDocument(), KisNode::parent, KisFileLayer::path(), and KisMainWindow::viewManager.
| KisExtendedModifiersMapperPluginInterface * KisApplication::extendedModifiersPluginInterface | ( | ) |
Definition at line 1284 of file KisApplication.cpp.
References d.
|
slot |
Definition at line 1081 of file KisApplication.cpp.
References KisMainWindow::BatchMode, d, and KisMainWindow::None.
| void KisApplication::hideSplashScreen | ( | ) |
Definition at line 842 of file KisApplication.cpp.
References d.
| void KisApplication::initializeGlobals | ( | const KisApplicationArguments & | args | ) |
Definition at line 360 of file KisApplication.cpp.
| bool KisApplication::isStoreApplication | ( | ) |
Definition at line 921 of file KisApplication.cpp.
References KisWindowsPackageUtils::isRunningInPackage(), and KisMacosEntitlements::sandbox().
| void KisApplication::loadPlugins | ( | ) |
Definition at line 481 of file KisApplication.cpp.
References KoDockRegistry::instance(), KoShapeRegistry::instance(), KoToolRegistry::instance(), KisPaintOpRegistry::instance(), KisFilterRegistry::instance(), KisGeneratorRegistry::instance(), KisMetadataBackendRegistry::instance(), KoColorSpaceRegistry::instance(), and KisActionRegistry::instance().
|
override |
Overridden to handle exceptions from event handlers.
KisApplication::notify() is called for every event loop processed in any thread, so we need to make sure our counters and postponed events queues are stored in a per-thread way.
Definition at line 851 of file KisApplication.cpp.
References KisSynchronizedConnectionEvent::destination, event(), KisSynchronizedConnectionBase::eventType(), KIS_SAFE_ASSERT_RECOVER_NOOP, and processPostponedSynchronizationEvents().
| void KisApplication::processPostponedSynchronizationEvents | ( | ) |
We must pop event from the queue before we call QApplication::notify(), because it can throw!
Definition at line 899 of file KisApplication.cpp.
References KisSynchronizedConnectionEvent::destination.
| bool KisApplication::registerResources | ( | ) |
Definition at line 415 of file KisApplication.cpp.
References KoGenericRegistry< T >::add(), ResourceType::Brushes, connect(), ResourceType::CssStyles, ResourceType::GamutMasks, ResourceSubType::GbrBrushes, KoResourcePaths::getAppDataLocation(), KoResourcePaths::getApplicationRoot(), ResourceSubType::GihBrushes, ResourceType::Gradients, KisResourceLocator::initialize(), KisResourceCacheDb::initialize(), KisResourceLoaderRegistry::instance(), KisResourceLocator::instance(), ResourceSubType::KritaPaintOpPresets, KisResourceCacheDb::lastError(), ResourceType::LayerStyles, KisMimeDatabase::mimeTypeForSuffix(), KisResourceLocator::Ok, ResourceType::PaintOpPresets, ResourceType::Palettes, ResourceType::Patterns, ResourceSubType::PngBrushes, KisResourceLoaderRegistry::registerFixup(), ResourceType::SeExprScripts, ResourceSubType::SegmentedGradients, ResourceType::Sessions, setSplashScreenLoadingText(), ResourceSubType::StopGradients, ResourceSubType::SvgBrushes, ResourceType::Symbols, ResourceType::WindowLayouts, and ResourceType::Workspaces.
|
slot |
Definition at line 1062 of file KisApplication.cpp.
References d, executeRemoteArguments(), KisPart::instance(), and KisPart::mainWindows.
|
private |
Definition at line 1210 of file KisApplication.cpp.
References d, KisResourceServerProvider::instance(), KIS_ASSERT_RECOVER_RETURN, and KisResourceServerProvider::workspaceServer().
| void KisApplication::setSplashScreen | ( | QWidget * | splash | ) |
Tell KisApplication to show this splashscreen when you call start(); when start returns, the splashscreen is hidden. Use KSplashScreen to have the splash show correctly on Xinerama displays.
Definition at line 829 of file KisApplication.cpp.
References d.
|
slot |
|
privateslot |
|
virtual |
Call this to start the application.
Parses command line arguments and creates the initial main windows and docs from them (or an empty doc if no cmd-line argument is specified ).
You must call this method directly before calling QApplication::exec.
It is valid behaviour not to call this method at all. In this case you have to process your command line parameters by yourself.
Definition at line 497 of file KisApplication.cpp.
References KisPart::addDocument(), KisNodeCommandsAdapter::addNode(), addResourceTypes(), KisImage::animationInterface(), KisMainWindow::BatchMode, KisApplicationArguments::canvasOnly, KisConfig::canvasState(), checkAutosaveFiles(), KisSpinBoxUnitManagerFactory::clearUnitManagerBuilder(), connect(), KisPart::createDocument(), KisApplicationArguments::createDocumentFromArguments(), KisPart::createMainWindow(), createNewDocFromTemplate(), KisPart::currentMainwindow(), d, dbgKrita, KisImageAnimationInterface::documentPlaybackRange(), KisApplicationArguments::doNewImage(), KisApplicationArguments::doTemplate, errKrita, KisDocument::errorMessage(), executeRemoteArguments(), KisApplicationArguments::exportAs, KisDocument::exportDocumentSync(), KisApplicationArguments::exportFileName, KisApplicationArguments::exportSequence, KisApplicationArguments::fileLayer, KisApplicationArguments::filenames, KisApplicationArguments::fullScreen, KisImageAnimationInterface::hasAnimation(), hideSplashScreen(), KisDocument::image, initializeGlobals(), KisConfigNotifier::instance(), KisPart::instance(), KisResourceServerProvider::instance(), QtSingleApplication::isRunning(), loadPlugins(), KisConfig::longPressEnabled(), KisMimeDatabase::mimeTypeForFile(), KisFileLayer::None, KisMainWindow::None, OPACITY_OPAQUE_U8, KisDocument::openPath(), KisNode::parent, KisFileLayer::path(), ppVar, KisConfig::readEntry(), KisAsyncAnimationFramesSaveDialog::regenerateRange(), registerResources(), KisAsyncAnimationRenderDialogBase::RenderComplete, KoResourceServer< T >::resource(), KisPart::restoreSession(), KisUsageLogger::screenInformation(), KisApplicationArguments::session, KisConfig::sessionOnStartup(), KisAsyncAnimationRenderDialogBase::setBatchMode(), KisConfig::setCanvasState(), Digikam::ThemeManager::setCurrentTheme(), KisSpinBoxUnitManagerFactory::setDefaultUnitManagerBuilder(), KisDocument::setFileBatchMode(), setSplashScreenLoadingText(), KisPart::showSessionManager(), KisConfigNotifier::sigLongPressChanged(), slotSetLongPress(), KisConfig::SOS_PreviousSession, KisConfig::SOS_ShowSessionManager, KisPart::startBlankSession(), verifyMetatypeRegistration(), KisImage::waitForDone(), KisApplicationArguments::windowLayout, KisResourceServerProvider::windowLayoutServer(), KisApplicationArguments::workspace, KisResourceServerProvider::workspaceServer(), KisConfig::writeEntry(), and KisUsageLogger::writeSysInfo().
|
static |
Verify that all our statically registered types are actually registered. This check is skipped in release builds, when HIDE_SAFE_ASSERTS is defined
Definition at line 950 of file KisApplication.cpp.
|
friend |
Definition at line 123 of file KisApplication.h.
|
private |
Definition at line 121 of file KisApplication.h.