Permalink
Browse files

Improve fs structure, factor out public API

* Create core/ directory containing internal code for GammaRay
* Create include/ directory for public headers

TODO: Make include/ header only (e.g. merge util.cpp into appropriate
modules)
  • Loading branch information...
1 parent e36a25d commit e09ffa1f5c35bdc326d8da96b2fa1af9ca08cdf3 @krf krf committed Jan 17, 2012
Showing with 91 additions and 107 deletions.
  1. +50 −43 CMakeLists.txt
  2. 0 { → core}/connectionfilterproxymodel.cpp
  3. 0 { → core}/connectionfilterproxymodel.h
  4. 0 { → core}/connectionmodel.cpp
  5. 0 { → core}/connectionmodel.h
  6. 0 { → core}/mainwindow.cpp
  7. 0 { → core}/mainwindow.h
  8. 0 { → core}/mainwindow.ui
  9. 0 { → core}/metaobject.cpp
  10. 0 { → core}/metaobject.h
  11. 0 { → core}/metaobjectmodel.h
  12. 0 { → core}/metaobjectrepository.cpp
  13. 0 { → core}/metaobjectrepository.h
  14. 0 { → core}/metaproperty.cpp
  15. 0 { → core}/metaproperty.h
  16. 0 { → core}/metapropertymodel.cpp
  17. 0 { → core}/metapropertymodel.h
  18. +0 −1 { → core}/metatypedeclarations.h
  19. 0 { → core}/methodargumentmodel.cpp
  20. 0 { → core}/methodargumentmodel.h
  21. 0 { → core}/methodinvocationdialog.cpp
  22. 0 { → core}/methodinvocationdialog.h
  23. 0 { → core}/methodinvocationdialog.ui
  24. 0 { → core}/multisignalmapper.cpp
  25. 0 { → core}/multisignalmapper.h
  26. 0 { → core}/objectclassinfomodel.cpp
  27. 0 { → core}/objectclassinfomodel.h
  28. 0 { → core}/objectdynamicpropertymodel.cpp
  29. 0 { → core}/objectdynamicpropertymodel.h
  30. 0 { → core}/objectenummodel.cpp
  31. 0 { → core}/objectenummodel.h
  32. 0 { → core}/objectlistmodel.cpp
  33. 0 { → core}/objectlistmodel.h
  34. 0 { → core}/objectmethodmodel.cpp
  35. 0 { → core}/objectmethodmodel.h
  36. 0 { → core}/objectmodelbase.h
  37. 0 { → core}/objectpropertymodel.cpp
  38. 0 { → core}/objectpropertymodel.h
  39. 0 { → core}/objectstaticpropertymodel.cpp
  40. 0 { → core}/objectstaticpropertymodel.h
  41. +0 −1 { → core}/objecttreemodel.cpp
  42. 0 { → core}/objecttreemodel.h
  43. 0 { → core}/paintbuffermodel.cpp
  44. 0 { → core}/paintbuffermodel.h
  45. +1 −1 { → core}/paintbufferreplaywidget.cpp
  46. 0 { → core}/paintbufferreplaywidget.h
  47. 0 { → core}/paintbufferviewer.cpp
  48. 0 { → core}/paintbufferviewer.h
  49. 0 { → core}/paintbufferviewer.ui
  50. 0 { → core}/palettemodel.cpp
  51. 0 { → core}/palettemodel.h
  52. 0 { → core}/pluginmanager.cpp
  53. 0 { → core}/pluginmanager.h
  54. 0 { → core}/probe.cpp
  55. 0 { → core}/probe.h
  56. 0 { → core}/propertywidget.cpp
  57. 0 { → core}/propertywidget.h
  58. 0 { → core}/propertywidget.ui
  59. 0 { → core}/proxydetacher.cpp
  60. 0 { → core}/proxydetacher.h
  61. 0 { → core}/proxytoolfactory.cpp
  62. 0 { → core}/proxytoolfactory.h
  63. 0 { → core}/readorwritelocker.h
  64. 0 { → core}/sidepane.cpp
  65. 0 { → core}/sidepane.h
  66. 0 { → core}/toolmodel.cpp
  67. 0 { → core}/toolmodel.h
  68. +12 −0 include/CMakeLists.txt
  69. 0 { → include}/objectmodel.h
  70. 0 { → include}/objecttypefilterproxymodel.h
  71. 0 { → include}/probeinterface.h
  72. +16 −3 { → include}/singlecolumnobjectproxymodel.h
  73. 0 { → include}/toolfactory.h
  74. +0 −1 { → include}/util.cpp
  75. 0 { → include}/util.h
  76. +0 −47 singlecolumnobjectproxymodel.cpp
  77. +4 −4 tools/objectvisualizer/CMakeLists.txt
  78. +2 −2 tools/scriptenginedebugger/CMakeLists.txt
  79. +4 −2 tools/statemachineviewer/CMakeLists.txt
  80. +2 −2 tools/webinspector/CMakeLists.txt
View
@@ -81,6 +81,11 @@ include_directories(
${QT_INCLUDES}
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}
+
+ # TODO: These paths should be removed so we can be sure plugins don't include non-public headers
+ ${CMAKE_SOURCE_DIR}/core
+ ${CMAKE_SOURCE_DIR}/include
+
${CMAKE_SOURCE_DIR}/3rdparty
${CMAKE_SOURCE_DIR}/3rdparty/kde
)
@@ -194,15 +199,44 @@ find_package(VTK)
macro_log_feature(VTK_FOUND "VTK" "Graph visualizing library for the object visualization plugin." "http://www.vtk.org" FALSE)
set(gammaray_srcs
- mainwindow.cpp
- metaobject.cpp
- metaobjectrepository.cpp
- metaproperty.cpp
- metapropertymodel.cpp
- pluginmanager.cpp
- probe.cpp
-
- propertywidget.cpp
+ 3rdparty/kde/krecursivefilterproxymodel.cpp
+ 3rdparty/kde/kfilterproxysearchline.cpp
+ 3rdparty/qt/resourcemodel.cpp
+
+ # FIXME: Remove me
+ include/util.cpp
+
+ core/mainwindow.cpp
+ core/metaobject.cpp
+ core/metaobjectrepository.cpp
+ core/metaproperty.cpp
+ core/metapropertymodel.cpp
+ core/pluginmanager.cpp
+ core/probe.cpp
+ core/proxydetacher.cpp
+ core/objectlistmodel.cpp
+ core/objectpropertymodel.cpp
+ core/objectdynamicpropertymodel.cpp
+ core/objectstaticpropertymodel.cpp
+ core/objectclassinfomodel.cpp
+ core/objectmethodmodel.cpp
+ core/objectenummodel.cpp
+ core/objecttreemodel.cpp
+ core/connectionmodel.cpp
+ core/connectionfilterproxymodel.cpp
+ core/methodinvocationdialog.cpp
+ core/methodargumentmodel.cpp
+ core/multisignalmapper.cpp
+ core/toolmodel.cpp
+ core/proxydetacher.cpp
+ core/proxytoolfactory.cpp
+ core/sidepane.cpp
+ core/palettemodel.cpp
+ core/propertywidget.cpp
+ core/paintbuffermodel.cpp
+ core/paintbufferviewer.cpp
+ core/paintbufferreplaywidget.cpp
+
propertyeditor/propertycoloreditor.cpp
propertyeditor/propertydoublepaireditor.cpp
propertyeditor/propertyeditorfactory.cpp
@@ -212,29 +246,12 @@ set(gammaray_srcs
propertyeditor/propertypaletteeditor.cpp
propertyeditor/palettedialog.cpp
- proxydetacher.cpp
- objectlistmodel.cpp
- objectpropertymodel.cpp
- objectdynamicpropertymodel.cpp
- objectstaticpropertymodel.cpp
- objectclassinfomodel.cpp
- objectmethodmodel.cpp
- objectenummodel.cpp
- objecttreemodel.cpp
- connectionmodel.cpp
- connectionfilterproxymodel.cpp
- tools/sceneinspector/scenemodel.cpp
- util.cpp
- tools/widgetinspector/widgetpreviewwidget.cpp
- methodinvocationdialog.cpp
- methodargumentmodel.cpp
- multisignalmapper.cpp
- singlecolumnobjectproxymodel.cpp
tools/modelinspector/modeltester.cpp
tools/modelinspector/modelmodel.cpp
tools/modelinspector/modelcellmodel.cpp
tools/sceneinspector/graphicsview.cpp
tools/sceneinspector/graphicssceneview.cpp
+ tools/sceneinspector/scenemodel.cpp
tools/metatypebrowser/metatypesmodel.cpp
tools/fontbrowser/fontmodel.cpp
tools/localeinspector/localemodel.cpp
@@ -246,14 +263,6 @@ set(gammaray_srcs
tools/textdocumentinspector/textdocumentcontentview.cpp
tools/messagehandler/messagehandler.cpp
tools/messagehandler/messagemodel.cpp
- toolmodel.cpp
- proxydetacher.cpp
- proxytoolfactory.cpp
- sidepane.cpp
- palettemodel.cpp
- paintbuffermodel.cpp
- paintbufferviewer.cpp
- paintbufferreplaywidget.cpp
tools/codecbrowser/codecbrowser.cpp
tools/connectioninspector/connectioninspector.cpp
@@ -271,6 +280,7 @@ set(gammaray_srcs
tools/widgetinspector/widgetinspector.cpp
tools/widgetinspector/overlaywidget.cpp
tools/widgetinspector/widgettreemodel.cpp
+ tools/widgetinspector/widgetpreviewwidget.cpp
tools/styleinspector/styleinspector.cpp
tools/styleinspector/pixelmetricmodel.cpp
tools/styleinspector/standardiconmodel.cpp
@@ -283,10 +293,6 @@ set(gammaray_srcs
tools/styleinspector/complexcontrolmodel.cpp
tools/styleinspector/dynamicproxystyle.cpp
- 3rdparty/kde/krecursivefilterproxymodel.cpp
- 3rdparty/kde/kfilterproxysearchline.cpp
- 3rdparty/qt/resourcemodel.cpp
-
hooking/abstractfunctionoverwriter.cpp
hooking/functionoverwriterfactory.cpp
hooking/winfunctionoverwriter.cpp
@@ -315,10 +321,10 @@ endif()
qt4_automoc(${gammaray_srcs})
qt4_wrap_ui(gammaray_srcs
- mainwindow.ui
- propertywidget.ui
- methodinvocationdialog.ui
- paintbufferviewer.ui
+ core/mainwindow.ui
+ core/propertywidget.ui
+ core/methodinvocationdialog.ui
+ core/paintbufferviewer.ui
propertyeditor/propertydoublepaireditor.ui
propertyeditor/propertyextendededitor.ui
propertyeditor/propertyintpaireditor.ui
@@ -418,6 +424,7 @@ endif()
include(ExternalProject)
+add_subdirectory(include)
add_subdirectory(tests)
add_subdirectory(tools)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -46,4 +46,3 @@ Q_DECLARE_METATYPE(QPolygonF)
Q_DECLARE_METATYPE(const QStyle*)
#endif
-
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -213,4 +213,3 @@ QModelIndex ObjectTreeModel::indexForObject(QObject *object) const
}
#include "objecttreemodel.moc"
-
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -72,7 +72,7 @@ void PaintBufferReplayWidget::drawTransparencyPattern(QPainter* painter, const Q
void PaintBufferReplayWidget::paintEvent(QPaintEvent* event)
{
// didn't manage painting on the widget directly, even with the correct translation it is always clipping as if the widget was at 0,0 of its parent
- const QSize sourceSize = m_buffer.boundingRect().size().toSize();
+ const QSize sourceSize = m_buffer.boundingRect().size().toSize();
QImage img(sourceSize, QImage::Format_ARGB32);
QPainter imgPainter(&img);
drawTransparencyPattern(&imgPainter, QRect(QPoint(0,0), sourceSize));
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
@@ -0,0 +1,12 @@
+set(GAMMARAY_HEADERS
+ objectmodel.h
+ objecttypefilterproxymodel.h
+ probeinterface.h
+ singlecolumnobjectproxymodel.h
+ toolfactory.h
+
+ # Deprecated, not added:
+ #util.h
+)
+
+install(FILES ${GAMMARAY_HEADERS} DESTINATION include/gammaray/)
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -26,6 +26,9 @@
#include <qglobal.h>
+#include "objectmodel.h"
+#include "util.h"
+
#if QT_VERSION < QT_VERSION_CHECK(4, 8, 0)
#include <QSortFilterProxyModel>
typedef QSortFilterProxyModel QIdentityProxyModel;
@@ -37,10 +40,20 @@ namespace GammaRay {
class SingleColumnObjectProxyModel : public QIdentityProxyModel
{
- Q_OBJECT
public:
- explicit SingleColumnObjectProxyModel(QObject *parent = 0);
- QVariant data(const QModelIndex &proxyIndex, int role = Qt::DisplayRole) const;
+ explicit SingleColumnObjectProxyModel(QObject *parent = 0) {}
+
+ QVariant data(const QModelIndex &proxyIndex, int role = Qt::DisplayRole) const
+ {
+ if (proxyIndex.isValid() && role == Qt::DisplayRole && proxyIndex.column() == 0) {
+ const QObject *obj = proxyIndex.data(ObjectModel::ObjectRole).value<QObject*>();
+ if (obj) {
+ return Util::displayString(obj);
+ }
+ }
+
+ return QIdentityProxyModel::data(proxyIndex, role);
+ }
};
}
File renamed without changes.
@@ -403,4 +403,3 @@ QVariant Util::iconForObject(QObject *obj)
}
return QVariant();
}
-
File renamed without changes.
@@ -1,47 +0,0 @@
-/*
- singlecolumnobjectproxymodel.cpp
-
- This file is part of GammaRay, the Qt application inspection and
- manipulation tool.
-
- Copyright (C) 2010-2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
- Author: Volker Krause <volker.krause@kdab.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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "singlecolumnobjectproxymodel.h"
-#include "util.h"
-#include "objectmodel.h"
-
-using namespace GammaRay;
-
-SingleColumnObjectProxyModel::SingleColumnObjectProxyModel(QObject *parent)
- : QIdentityProxyModel(parent)
-{
-}
-
-QVariant SingleColumnObjectProxyModel::data(const QModelIndex &proxyIndex, int role) const
-{
- if (proxyIndex.isValid() && role == Qt::DisplayRole && proxyIndex.column() == 0) {
- const QObject *obj = proxyIndex.data(ObjectModel::ObjectRole).value<QObject*>();
- if (obj) {
- return Util::displayString(obj);
- }
- }
-
- return QIdentityProxyModel::data(proxyIndex, role);
-}
-
-#include "singlecolumnobjectproxymodel.moc"
@@ -10,14 +10,14 @@ include_directories(
link_directories(${VTK_LIBRARY_DIRS})
set(gammaray_objectvisualizer_plugin_srcs
+ ../../3rdparty/kde/kfilterproxysearchline.cpp
+ ../../3rdparty/kde/krecursivefilterproxymodel.cpp
+ ../../include/util.cpp
+
objectvisualizer.cpp
vtkcontainer.cpp
vtkpanel.cpp
vtkwidget.cpp
-
- ${CMAKE_SOURCE_DIR}/3rdparty/kde/kfilterproxysearchline.cpp
- ${CMAKE_SOURCE_DIR}/3rdparty/kde/krecursivefilterproxymodel.cpp
- ${CMAKE_SOURCE_DIR}/util.cpp
)
qt4_automoc(${gammaray_objectvisualizer_plugin_srcs})
@@ -4,8 +4,8 @@ include_directories(
set(gammaray_scriptenginedebugger_plugin_srcs
scriptenginedebugger.cpp
- ../../singlecolumnobjectproxymodel.cpp
- ../../util.cpp
+
+ ../../include/util.cpp
)
qt4_automoc(${gammaray_scriptenginedebugger_plugin_srcs})
qt4_wrap_ui(gammaray_scriptenginedebugger_plugin_srcs scriptenginedebugger.ui)
@@ -18,7 +18,7 @@ set(gammaray_statemachineviewer_plugin_srcs
transitionmodel.cpp
statemodel.cpp
- ${CMAKE_SOURCE_DIR}/util.cpp
+ ../../include/util.cpp
)
qt4_automoc(${gammaray_statemachineviewer_plugin_srcs})
qt4_wrap_ui(gammaray_statemachineviewer_plugin_srcs statemachineviewer.ui)
@@ -32,7 +32,9 @@ set(gammaray_statemachineviewer_plugin_libs
)
gammaray_add_plugin(gammaray_statemachineviewer_plugin gammaray_statemachineviewer.desktop ${gammaray_statemachineviewer_plugin_srcs})
-target_link_libraries(gammaray_statemachineviewer_plugin ${gammaray_statemachineviewer_plugin_libs})
+target_link_libraries(gammaray_statemachineviewer_plugin
+ ${gammaray_statemachineviewer_plugin_libs}
+)
add_executable(statemachineviewer_test
gvgraph/gvgraph.cpp
@@ -4,8 +4,8 @@ include_directories(
set(gammaray_webinspector_plugin_srcs
webinspector.cpp
- ../../singlecolumnobjectproxymodel.cpp
- ../../util.cpp
+
+ ../../include/util.cpp
)
qt4_automoc(${gammaray_webinspector_plugin_srcs})
qt4_wrap_ui(gammaray_webinspector_plugin_srcs webinspector.ui)

0 comments on commit e09ffa1

Please sign in to comment.