KDE/kdevplatform
Andreas Pakulat
apaku at gmx.de
Sun Jan 11 14:41:37 UTC 2009
SVN commit 909418 by apaku:
Implement a simple selection interface across platform. Now anything can
provide a selection and anything can listen to selection changes. This
should make quite a lot of ui-improvements possible.
@devs: Please have a look at the interface and let me know any
comments/opinions you have on it.
CCMAIL:kdevelop-devel at kdevelop.org
M +2 -0 interfaces/CMakeLists.txt
M +4 -0 interfaces/icore.h
A interfaces/iselectioncontroller.cpp [License: LGPL (v2+)]
A interfaces/iselectioncontroller.h [License: LGPL (v2+)]
M +2 -0 shell/CMakeLists.txt
M +14 -0 shell/core.cpp
M +4 -0 shell/core.h
M +2 -0 shell/core_p.h
A shell/selectioncontroller.cpp [License: LGPL (v2+)]
A shell/selectioncontroller.h [License: LGPL (v2+)]
--- trunk/KDE/kdevplatform/interfaces/CMakeLists.txt #909417:909418
@@ -21,6 +21,7 @@
isourceformattercontroller.cpp
contextmenuextension.cpp
icompletionsettings.cpp
+ iselectioncontroller.cpp
#scripting/scriptdocument.cpp
#scripting/scripttools.cpp
#scripting/scriptingmanager.cpp
@@ -66,6 +67,7 @@
iruncontroller.h
irunprovider.h
icompletionsettings.h
+ iselectioncontroller.h
contextmenuextension.h
DESTINATION ${INCLUDE_INSTALL_DIR}/kdevplatform/interfaces COMPONENT Devel
)
--- trunk/KDE/kdevplatform/interfaces/icore.h #909417:909418
@@ -47,6 +47,7 @@
class IRunController;
class ISourceFormatterController;
class ISession;
+class ISelectionController;
/**
* ICore is the container class for all the various objects in use by
@@ -102,6 +103,9 @@
/** @return the sourceformatter controller */
Q_SCRIPTABLE virtual KDevelop::ISourceFormatterController *sourceFormatterController() = 0;
+ /** @return the selection controller */
+ Q_SCRIPTABLE virtual KDevelop::ISelectionController* selectionController() = 0;
+
/** @return the component data of the framework, different from the main component which is created by the application */
virtual KComponentData componentData() const = 0;
--- trunk/KDE/kdevplatform/shell/CMakeLists.txt #909417:909418
@@ -30,6 +30,7 @@
openprojectpage.cpp
openprojectdialog.cpp
projectinfopage.cpp
+ selectioncontroller.cpp
)
set(kdevplatformshell_UI
@@ -88,6 +89,7 @@
sourceformattercontroller.h
language.h
shellexport.h
+ selectioncontroller.h
testshellexport.h
testcore.h
DESTINATION ${INCLUDE_INSTALL_DIR}/kdevplatform/shell COMPONENT Devel
--- trunk/KDE/kdevplatform/shell/core.cpp #909417:909418
@@ -44,6 +44,7 @@
#include "documentcontroller.h"
#include "runcontroller.h"
#include "sourceformattercontroller.h"
+#include "selectioncontroller.h"
#include "core_p.h"
namespace KDevelop {
@@ -103,6 +104,11 @@
sourceFormatterController = new SourceFormatterController(m_core);
}
+ if( !selectionController )
+ {
+ selectionController = new SelectionController(m_core);
+ }
+
kDebug() << "initializing ui controller";
sessionController->initialize();
if(!(mode & Core::NoUi)) uiController->initialize();
@@ -132,9 +138,11 @@
}
runController->initialize();
sourceFormatterController->initialize();
+ selectionController->initialize();
}
CorePrivate::~CorePrivate()
{
+ delete selectionController;
delete projectController;
delete languageController;
delete pluginController;
@@ -187,6 +195,7 @@
void Core::cleanup()
{
if (!d->m_cleanedUp) {
+ d->selectionController->cleanup();
// Save the layout of the ui here, so run it first
d->uiController->cleanup();
@@ -293,4 +302,9 @@
return d->sourceFormatterController;
}
+ISelectionController* Core::selectionController()
+{
+ return d->selectionController;
}
+
+}
--- trunk/KDE/kdevplatform/shell/core.h #909417:909418
@@ -35,6 +35,7 @@
class SessionController;
class CorePrivate;
class SourceFormatterController;
+class SelectionController;
class KDEVPLATFORMSHELL_EXPORT Core: public ICore {
public:
@@ -74,6 +75,9 @@
/** @copydoc ICore::sourceFormatterController() */
virtual ISourceFormatterController* sourceFormatterController();
+ /** @copydoc ICore::selectionController() */
+ virtual ISelectionController* selectionController();
+
/** @copydoc ICore::activeSession() */
virtual ISession *activeSession();
--- trunk/KDE/kdevplatform/shell/core_p.h #909417:909418
@@ -36,6 +36,7 @@
class UiController;
class SessionController;
class SourceFormatterController;
+class SelectionController;
class KDEVPLATFORMSHELL_EXPORT CorePrivate {
public:
@@ -51,6 +52,7 @@
QPointer<RunController> runController;
QPointer<SessionController> sessionController;
QPointer<SourceFormatterController> sourceFormatterController;
+ QPointer<SelectionController> selectionController;
KComponentData m_componentData;
Core *m_core;
More information about the KDevelop-devel
mailing list