Commit 6da7d1dd authored by Boudewijn Rempt's avatar Boudewijn Rempt

Clean up the defaultdockers plugin

It only contained the layers docker, so rename it. This means that
you need to remove the old defaultdockers plugin:

./lib/x86_64-linux-gnu/kritaplugins/kritadefaultdockers.so

A number of classes that were only used by the layers docker are now
moved into this plugin, out of libs/ui
parent 47cc24d8
......@@ -340,10 +340,6 @@ set(kritaui_LIB_SRCS
KisDetailsPane.cpp
KisDocument.cpp
KisCloneDocumentStroke.cpp
KisNodeDelegate.cpp
kis_node_view_visibility_delegate.cpp
KisNodeToolTip.cpp
KisNodeView.cpp
kis_node_view_color_scheme.cpp
KisImportExportFilter.cpp
KisFilterEntry.cpp
......@@ -541,8 +537,6 @@ ki18n_wrap_ui(kritaui_LIB_SRCS
)
QT5_WRAP_CPP(kritaui_HEADERS_MOC KisNodePropertyAction_p.h)
add_library(kritaui SHARED ${kritaui_HEADERS_MOC} ${kritaui_LIB_SRCS} )
generate_export_header(kritaui BASE_NAME kritaui)
......
......@@ -63,13 +63,6 @@ ecm_add_test( kis_node_juggler_compressed_test.cpp ../../../sdk/tests/testutil.
LINK_LIBRARIES kritaui Qt5::Test
NAME_PREFIX "libs-ui-")
set(kis_node_view_test_SRCS kis_node_view_test.cpp ../../../sdk/tests/testutil.cpp)
qt5_add_resources(kis_node_view_test_SRCS ${krita_QRCS})
ecm_add_test(${kis_node_view_test_SRCS}
TEST_NAME kis_node_view_test
LINK_LIBRARIES kritaui Qt5::Test
NAME_PREFIX "libs-ui-")
ecm_add_test(
kis_input_manager_test.cpp ../../../sdk/tests/testutil.cpp
TEST_NAME KisInputManagerTest
......
add_subdirectory(defaultdockers)
add_subdirectory(layerdocker)
if(HAVE_OPENEXR)
add_subdirectory(smallcolorselector)
endif()
......
add_subdirectory( tests )
set(kritadefaultdockers_SOURCES
kis_layer_box.cpp
defaultdockers.cpp
sync_button_and_action.cpp
)
set(kritadefaultdockers_PART_HEADERS
kis_layer_box.h
defaultdockers.h
)
ki18n_wrap_ui(kritadefaultdockers_SOURCES
wdglayerbox.ui
)
add_library(kritadefaultdockers MODULE ${kritadefaultdockers_SOURCES} ${kritadefaultdockers_PART_HEADERS})
generate_export_header(kritadefaultdockers BASE_NAME kritadefaultdockers EXPORT_MACRO_NAME KRITADEFAULTDOCKERS_EXPORT)
target_link_libraries(kritadefaultdockers kritaui)
install(TARGETS kritadefaultdockers DESTINATION ${KRITA_PLUGIN_INSTALL_DIR})
/*
* Copyright (c) 2015 Dmitry Kazakov <dimula73@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "sync_button_and_action.h"
// just for the moc's sake...
include_directories( ${CMAKE_SOURCE_DIR}/sdk/tests ${CMAKE_CURRENT_BINARY_DIR}/..)
macro_add_unittest_definitions()
add_subdirectory(tests)
set(kritalayerdocker_SOURCES
LayerBox.cpp
LayerDocker.cpp
NodeDelegate.cpp
NodeToolTip.cpp
NodeView.cpp
NodeViewVisibilityDelegate.cpp
)
set(kritalayerdocker_PART_HEADERS
LayerBox.h
LayerDocker.h
NodeDelegate.h
NodeToolTip.h
NodeView.h
NodeViewVisibilityDelegate.h
)
ki18n_wrap_ui(kritalayerdocker_SOURCES
WdgLayerBox.ui
)
QT5_WRAP_CPP(kritalayerdocker_HEADERS_MOC
NodePropertyAction_p.h
SyncButtonAndAction.h
)
add_library(kritalayerdocker MODULE ${kritalayerdocker_SOURCES}
${kritalayerdocker_PART_HEADERS}
${kritalayerdocker_HEADERS_MOC}
)
target_link_libraries(kritalayerdocker kritaui)
install(TARGETS kritalayerdocker DESTINATION ${KRITA_PLUGIN_INSTALL_DIR})
/*
* kis_layer_box.h - part of Krita aka Krayon aka KimageShop
* LayerBox.h - part of Krita aka Krayon aka KimageShop
*
* Copyright (c) 2002 Patrick Julien <freak@codepimps.org>
* Copyright (C) 2006 Gábor Lehel <illissius@gmail.com>
......@@ -66,16 +66,16 @@ class KisSelectionActionsAdapter;
* This widget adds docking functionality and command buttons.
*
*/
class KisLayerBox : public QDockWidget, public KisMainwindowObserver
class LayerBox : public QDockWidget, public KisMainwindowObserver
{
Q_OBJECT
public:
KisLayerBox();
~KisLayerBox() override;
QString observerName() override { return "KisLayerBox"; }
LayerBox();
~LayerBox() override;
QString observerName() override { return "LayerBox"; }
/// reimplemented from KisMainwindowObserver
void setViewManager(KisViewManager* kisview) override;
void setCanvas(KoCanvasBase *canvas) override;
......@@ -173,18 +173,18 @@ private:
bool m_blockOpacityUpdate {false};
};
class KisLayerBoxFactory : public KoDockFactoryBase
class LayerBoxFactory : public KoDockFactoryBase
{
public:
KisLayerBoxFactory() { }
LayerBoxFactory() { }
QString id() const override {
return QString("KisLayerBox");
return QString("LayerBox");
}
QDockWidget* createDockWidget() override {
KisLayerBox * dockWidget = new KisLayerBox();
LayerBox * dockWidget = new LayerBox();
dockWidget->setObjectName(id());
......
......@@ -15,7 +15,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "defaultdockers.h"
#include "LayerDocker.h"
#include <kpluginfactory.h>
......@@ -24,18 +24,18 @@
#include <KoDockRegistry.h>
#include "kis_debug.h"
#include "kis_layer_box.h"
#include "LayerBox.h"
K_PLUGIN_FACTORY_WITH_JSON(KritaDefaultDockersPluginFactory, "kritadefaultdockers.json", registerPlugin<KritaDefaultDockersPlugin>();)
K_PLUGIN_FACTORY_WITH_JSON(KritaLayerDockerPluginFactory, "kritalayerdocker.json", registerPlugin<KritaLayerDockerPlugin>();)
KritaDefaultDockersPlugin::KritaDefaultDockersPlugin(QObject *parent, const QVariantList &)
KritaLayerDockerPlugin::KritaLayerDockerPlugin(QObject *parent, const QVariantList &)
: QObject(parent)
{
KoDockRegistry::instance()->add(new KisLayerBoxFactory());
KoDockRegistry::instance()->add(new LayerBoxFactory());
}
KritaDefaultDockersPlugin::~KritaDefaultDockersPlugin()
KritaLayerDockerPlugin::~KritaLayerDockerPlugin()
{
}
#include "defaultdockers.moc"
#include "LayerDocker.moc"
......@@ -25,12 +25,12 @@
/**
* Template of view plugin
*/
class KritaDefaultDockersPlugin : public QObject
class KritaLayerDockerPlugin : public QObject
{
Q_OBJECT
public:
KritaDefaultDockersPlugin(QObject *parent, const QVariantList &);
~KritaDefaultDockersPlugin() override;
KritaLayerDockerPlugin(QObject *parent, const QVariantList &);
~KritaLayerDockerPlugin() override;
};
......
......@@ -21,24 +21,24 @@
#define KIS_DOCUMENT_SECTION_DELEGATE_H
#include <QAbstractItemDelegate>
class KisNodeView;
class NodeView;
class KisNodeModel;
/**
* See KisNodeModel and KisNodeView.
* See KisNodeModel and NodeView.
*
* A delegate provides the gui machinery, using Qt's model/view terminology.
* This class is owned by KisNodeView to do the work of generating the
* This class is owned by NodeView to do the work of generating the
* graphical representation of each item.
*/
class KisNodeDelegate: public QAbstractItemDelegate
class NodeDelegate: public QAbstractItemDelegate
{
Q_OBJECT
public:
explicit KisNodeDelegate(KisNodeView *view, QObject *parent = 0);
~KisNodeDelegate() override;
explicit NodeDelegate(NodeView *view, QObject *parent = 0);
~NodeDelegate() override;
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
......@@ -56,7 +56,7 @@ protected:
private:
typedef KisNodeModel Model;
typedef KisNodeView View;
typedef NodeView View;
class Private;
Private* const d;
......
......@@ -17,24 +17,24 @@
Boston, MA 02110-1301, USA.
*/
#ifndef KIS_DOCUMENT_SECTION_PROPERTY_ACTION_P_H
#define KIS_DOCUMENT_SECTION_PROPERTY_ACTION_P_H
#ifndef NODE_PROPERTY_ACTION_P_H
#define NODE_PROPERTY_ACTION_P_H
#include "kis_node_model.h"
#include <kis_node_model.h>
#include <kis_base_node.h>
#include "KisNodeView.h"
#include <QPersistentModelIndex>
#include <QAction>
#include "NodeView.h"
/**
* Internal class for the KisNodeView widget. Provides a
* Internal class for the NodeView widget. Provides a
* toggle action for a particular property associated with a document
* section, such as visible, selected, locked. Property actions have
* associated on/off icons to show their state in the
* KisNodeView.
* NodeView.
*/
class KisNodeView::PropertyAction: public QAction
class NodeView::PropertyAction: public QAction
{
typedef QAction super;
Q_OBJECT
......
......@@ -16,7 +16,7 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "KisNodeToolTip.h"
#include "NodeToolTip.h"
#include "kis_node_model.h"
#include <QImage>
......@@ -27,15 +27,15 @@
#include <kis_base_node.h>
KisNodeToolTip::KisNodeToolTip()
NodeToolTip::NodeToolTip()
{
}
KisNodeToolTip::~KisNodeToolTip()
NodeToolTip::~NodeToolTip()
{
}
QTextDocument *KisNodeToolTip::createDocument(const QModelIndex &index)
QTextDocument *NodeToolTip::createDocument(const QModelIndex &index)
{
QTextDocument *doc = new QTextDocument(this);
......
......@@ -25,16 +25,16 @@
class KisNodeModel;
/**
* A default tooltip for a KisNodeView that shows a thumbnail
* A default tooltip for a NodeView that shows a thumbnail
* image and the list of properties associated with a node.
*/
class KisNodeToolTip: public KoItemToolTip
class NodeToolTip: public KoItemToolTip
{
Q_OBJECT
public:
KisNodeToolTip();
~KisNodeToolTip() override;
NodeToolTip();
~NodeToolTip() override;
protected:
QTextDocument *createDocument(const QModelIndex &index) override;
......
......@@ -22,7 +22,6 @@
#include <QTreeView>
#include <QScroller>
#include "kritaui_export.h"
class QStyleOptionViewItem;
class KisNodeModel;
......@@ -41,7 +40,7 @@ class KisNodeModel;
*
* This widget should work correctly in your Qt designer .ui file.
*/
class KRITAUI_EXPORT KisNodeView: public QTreeView
class NodeView: public QTreeView
{
Q_OBJECT
Q_SIGNALS:
......@@ -55,10 +54,10 @@ Q_SIGNALS:
public:
/**
* Create a new KisNodeView.
* Create a new NodeView.
*/
explicit KisNodeView(QWidget *parent = 0);
~KisNodeView() override;
explicit NodeView(QWidget *parent = 0);
~NodeView() override;
/// how items should be displayed
enum DisplayMode {
......@@ -88,7 +87,7 @@ public:
/**
* Set the display mode of the view to one of the options.
*
* @param mode The KisNodeView::DisplayMode mode
* @param mode The NodeView::DisplayMode mode
*/
void setDisplayMode(DisplayMode mode);
......@@ -108,7 +107,7 @@ public:
*
* For instance
@code
KisNodeView * nodeView;
NodeView * nodeView;
QModelIndex index = getCurrentNode();
QMenu menu;
if (index.isValid()) {
......
......@@ -16,28 +16,28 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "kis_node_view_visibility_delegate.h"
#include "NodeViewVisibilityDelegate.h"
#include "kis_node_view_color_scheme.h"
KisNodeViewVisibilityDelegate::KisNodeViewVisibilityDelegate(QObject *parent)
NodeViewVisibilityDelegate::NodeViewVisibilityDelegate(QObject *parent)
: QAbstractItemDelegate(parent)
{
}
KisNodeViewVisibilityDelegate::~KisNodeViewVisibilityDelegate()
NodeViewVisibilityDelegate::~NodeViewVisibilityDelegate()
{
}
void KisNodeViewVisibilityDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
void NodeViewVisibilityDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
Q_UNUSED(painter);
Q_UNUSED(option);
Q_UNUSED(index);
}
QSize KisNodeViewVisibilityDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
QSize NodeViewVisibilityDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
{
Q_UNUSED(index);
......
......@@ -16,20 +16,20 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __KIS_NODE_VIEW_VISIBILITY_DELEGATE_H
#define __KIS_NODE_VIEW_VISIBILITY_DELEGATE_H
#ifndef __NODE_VIEW_VISIBILITY_DELEGATE_H
#define __NODE_VIEW_VISIBILITY_DELEGATE_H
#include <QAbstractItemDelegate>
class KisNodeViewVisibilityDelegate : public QAbstractItemDelegate
class NodeViewVisibilityDelegate : public QAbstractItemDelegate
{
public:
KisNodeViewVisibilityDelegate(QObject *parent);
~KisNodeViewVisibilityDelegate() override;
NodeViewVisibilityDelegate(QObject *parent);
~NodeViewVisibilityDelegate() override;
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override;
};
#endif /* __KIS_NODE_VIEW_VISIBILITY_DELEGATE_H */
#endif
......@@ -16,8 +16,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __SYNC_BUTTON_AND_ACTION_H
#define __SYNC_BUTTON_AND_ACTION_H
#ifndef SYNC_BUTTON_AND_ACTION_H
#define SYNC_BUTTON_AND_ACTION_H
#include <QPointer>
#include <QAbstractButton>
......
......@@ -123,7 +123,7 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="KisNodeView" name="listLayers" native="true">
<widget class="NodeView" name="listLayers" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Expanding">
<horstretch>0</horstretch>
......@@ -321,9 +321,9 @@
<header>kis_slider_spin_box.h</header>
</customwidget>
<customwidget>
<class>KisNodeView</class>
<class>NodeView</class>
<extends></extends>
<header location="global">KisNodeView.h</header>
<header location="global">NodeView.h</header>
</customwidget>
<customwidget>
<class>KisToolButton</class>
......
{
"Id": "Default Dockers",
"Id": "Layer Docker",
"Type": "Service",
"X-KDE-Library": "kritadefaultdockers",
"X-KDE-Library": "kritalayerdocker",
"X-KDE-ServiceTypes": [
"Krita/Dock"
],
......
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
include_directories(${CMAKE_SOURCE_DIR}/libs/image/metadata
${CMAKE_SOURCE_DIR}/sdk/tests )
include(ECMAddTests)
macro_add_unittest_definitions()
qt5_add_resources(kis_node_view_test_SRCS ${krita_QRCS})
ecm_add_test(${kis_node_view_test_SRCS}
TEST_NAME TestNodeView
LINK_LIBRARIES kritaui Qt5::Test
NAME_PREFIX "plugins-dockers-layerdocker-")
......@@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "kis_node_view_test.h"
#include "TestNodeView.h"
#include <QTest>
#include <QDialog>
......@@ -24,7 +24,7 @@
#include <QGridLayout>
#include <QLabel>
#include <KisNodeView.h>
#include <NodeView.h>
#include "KisDocument.h"
#include "KisPart.h"
......@@ -39,7 +39,7 @@
//#define ENABLE_GUI_TESTS
void KisNodeViewTest::init()
void NodeViewTest::init()
{
m_doc = KisPart::instance()->createDocument();
......@@ -49,7 +49,7 @@ void KisNodeViewTest::init()
initBase();
}
void KisNodeViewTest::cleanup()
void NodeViewTest::cleanup()
{
cleanupBase();
......@@ -59,7 +59,7 @@ void KisNodeViewTest::cleanup()
}
void KisNodeViewTest::testLayers()
void NodeViewTest::testLayers()
{
#ifndef ENABLE_GUI_TESTS
return;
......@@ -72,7 +72,7 @@ void KisNodeViewTest::testLayers()
dlg.setFont(font);
KisNodeModel *model = new KisNodeModel(this);
KisNodeView *view = new KisNodeView(&dlg);
NodeView *view = new NodeView(&dlg);
view->setModel(model);
......@@ -105,7 +105,7 @@ void KisNodeViewTest::testLayers()
#include "kis_color_label_selector_widget.h"
void KisNodeViewTest::testColorLabels()
void NodeViewTest::testColorLabels()
{
#ifndef ENABLE_GUI_TESTS
return;
......@@ -130,4 +130,4 @@ void KisNodeViewTest::testColorLabels()
dlg.exec();
}
KISTEST_MAIN(KisNodeViewTest)
KISTEST_MAIN(NodeViewTest)
......@@ -27,7 +27,7 @@ class KisNameServer;
class KisShapeController;
class KisNodeViewTest : public QObject, public TestUtil::EmptyNodesTest
class NodeViewTest : public QObject, public TestUtil::EmptyNodesTest
{
Q_OBJECT
private Q_SLOTS:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment