diff options
Diffstat (limited to 'optional/projectexplorer')
14 files changed, 235 insertions, 0 deletions
diff --git a/optional/projectexplorer/binding.cpp b/optional/projectexplorer/binding.cpp new file mode 100644 index 0000000..a544beb --- /dev/null +++ b/optional/projectexplorer/binding.cpp @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Python Extensions Plugin for QtCreator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +#include "binding.h" + +#include <QtCore/QDebug> +#include <QtCore/QString> + +#undef signals +#undef slots + +#include <sbkpython.h> +#include <sbkconverter.h> +#include <sbkmodule.h> + +#if PY_MAJOR_VERSION >= 3 +extern "C" PyObject *PyInit_QtCreatorBindingProjectExplorer(); +#else +extern "C" void initQtCreatorBindingProjectExplorer(); +#endif + +extern PyObject *SbkQtCreatorBindingProjectExplorerModuleObject; + +namespace PyUtil { + extern bool bindSubPyObject(const QString &moduleName, const QString &name, void *obj); +} + +void bind() +{ + // Init module + #if PY_MAJOR_VERSION >= 3 + const bool pythonInitialized = PyInit_QtCreatorBindingProjectExplorer() != nullptr; + #else + const bool pythonInitialized = true; + initQtCreatorBindingProjectExplorer(); + #endif + // Bind module into interpreter + bool pythonError = PyErr_Occurred() != nullptr; + if (pythonInitialized && !pythonError) { + PyUtil::bindSubPyObject("PythonExtension.QtCreator", "ProjectExplorer", (void *)SbkQtCreatorBindingProjectExplorerModuleObject); + } else { + if (pythonError) + PyErr_Print(); + qDebug() << "There was a problem initializing the ProjectExplorer bindings."; + + } +} diff --git a/optional/projectexplorer/binding_custom.pri b/optional/projectexplorer/binding_custom.pri new file mode 100644 index 0000000..b9e3faf --- /dev/null +++ b/optional/projectexplorer/binding_custom.pri @@ -0,0 +1,57 @@ +# Additional sources + +SOURCES += \ + # optional + +HEADERS += \ + # optional + + +# Declare dependencies and name + +# This has to be PythonBinding{PluginName} +QTC_PLUGIN_NAME = PythonBindingProjectExplorer +QTC_LIB_DEPENDS += \ + extensionsystem \ + utils + +QTC_PLUGIN_DEPENDS += \ + coreplugin \ + projectexplorer \ + pythonextensions + +QTC_PLUGIN_RECOMMENDS += \ + # optional plugin dependencies. nothing here at this time + + +# Shiboken binding generation setup + +WRAPPED_HEADER = wrappedclasses.h +WRAPPER_DIR = $$OUT_PWD/QtCreatorBindingProjectExplorer +TYPESYSTEM_FILE = typesystem_projectexplorer.xml + +TYPESYSTEM_NAME = qtcreatorbindingprojectexplorer + +## Include additional QtCreator paths +QT_INCLUDEPATHS += \ + -I"$$IDE_SOURCE_TREE/src/plugins/projectexplorer" + +INCLUDEPATH += \ + $$IDE_SOURCE_TREE/src/plugins/projectexplorer \ + $$IDE_SOURCE_TREE/src/libs/utils + +## These headers are needed so the generated wrappers are added to the +## build. Right now they are empty files, however there might be a more elegant +## option. +WRAPPED_CLASSES = \ + bindingheaders/projectexplorer.h \ + bindingheaders/projectexplorer_buildconfiguration.h \ + bindingheaders/projectexplorer_projectconfiguration.h \ + bindingheaders/projectexplorer_statefulprojectconfiguration.h \ + # bindingheaders/projectexplorer_ibuildconfigurationfactory.h \ + bindingheaders/projectexplorer_runconfiguration.h \ + bindingheaders/projectexplorer_project.h \ + bindingheaders/projectexplorer_projecttree.h \ + bindingheaders/utils.h \ + bindingheaders/utils_filename.h \ +# Sentinel line diff --git a/optional/projectexplorer/bindingheaders/projectexplorer.h b/optional/projectexplorer/bindingheaders/projectexplorer.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/optional/projectexplorer/bindingheaders/projectexplorer.h diff --git a/optional/projectexplorer/bindingheaders/projectexplorer_buildconfiguration.h b/optional/projectexplorer/bindingheaders/projectexplorer_buildconfiguration.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/optional/projectexplorer/bindingheaders/projectexplorer_buildconfiguration.h diff --git a/optional/projectexplorer/bindingheaders/projectexplorer_ibuildconfigurationfactory.h b/optional/projectexplorer/bindingheaders/projectexplorer_ibuildconfigurationfactory.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/optional/projectexplorer/bindingheaders/projectexplorer_ibuildconfigurationfactory.h diff --git a/optional/projectexplorer/bindingheaders/projectexplorer_project.h b/optional/projectexplorer/bindingheaders/projectexplorer_project.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/optional/projectexplorer/bindingheaders/projectexplorer_project.h diff --git a/optional/projectexplorer/bindingheaders/projectexplorer_projectconfiguration.h b/optional/projectexplorer/bindingheaders/projectexplorer_projectconfiguration.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/optional/projectexplorer/bindingheaders/projectexplorer_projectconfiguration.h diff --git a/optional/projectexplorer/bindingheaders/projectexplorer_projecttree.h b/optional/projectexplorer/bindingheaders/projectexplorer_projecttree.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/optional/projectexplorer/bindingheaders/projectexplorer_projecttree.h diff --git a/optional/projectexplorer/bindingheaders/projectexplorer_runconfiguration.h b/optional/projectexplorer/bindingheaders/projectexplorer_runconfiguration.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/optional/projectexplorer/bindingheaders/projectexplorer_runconfiguration.h diff --git a/optional/projectexplorer/bindingheaders/projectexplorer_statefulprojectconfiguration.h b/optional/projectexplorer/bindingheaders/projectexplorer_statefulprojectconfiguration.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/optional/projectexplorer/bindingheaders/projectexplorer_statefulprojectconfiguration.h diff --git a/optional/projectexplorer/bindingheaders/utils.h b/optional/projectexplorer/bindingheaders/utils.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/optional/projectexplorer/bindingheaders/utils.h diff --git a/optional/projectexplorer/bindingheaders/utils_filename.h b/optional/projectexplorer/bindingheaders/utils_filename.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/optional/projectexplorer/bindingheaders/utils_filename.h diff --git a/optional/projectexplorer/typesystem_projectexplorer.xml b/optional/projectexplorer/typesystem_projectexplorer.xml new file mode 100644 index 0000000..b663619 --- /dev/null +++ b/optional/projectexplorer/typesystem_projectexplorer.xml @@ -0,0 +1,72 @@ +<?xml version="1.0"?> +<!-- +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Python Extensions Plugin for QtCreator. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +--> + +<!-- Typesystem for Qt Creator Python host plugin --> +<typesystem package="QtCreatorBindingProjectExplorer"> + + <!-- Load PySide QtWidgets typesystem (is this correct? yup) --> + <load-typesystem name="typesystem_widgets.xml" generate="no"/> + <!-- Currently there are problems with getting this to work ... --> + <!-- <load-typesystem name="../../plugins/pythonextensions/typesystem_qtcreator.xml" generate="no"/> --> + + <namespace-type name="ProjectExplorer"> + <object-type name="BuildConfiguration"> + <enum-type name="BuildType"/> + </object-type> + <object-type name="ProjectConfiguration"/> + <object-type name="RunConfiguration"> + <enum-type name="ConfigurationState"/> + </object-type> + <object-type name="StatefulProjectConfiguration"/> + <object-type name="ProjectTree"/> + <object-type name="Project"> + <enum-type name="ModelRoles"/> + <enum-type name="RestoreResult"/> + </object-type> + </namespace-type> + + <namespace-type name="Utils"> + <value-type name="FileName"/> + <modify-function signature="operator<<(QTextStream&,Utils::FileName)" remove="all"/> + </namespace-type> + +</typesystem> diff --git a/optional/projectexplorer/wrappedclasses.h b/optional/projectexplorer/wrappedclasses.h new file mode 100644 index 0000000..2d043bb --- /dev/null +++ b/optional/projectexplorer/wrappedclasses.h @@ -0,0 +1,37 @@ +/**************************************************************************** +** +** Copyright (C) 2018 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Python Extensions Plugin for QtCreator. +** +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-3.0.html. +** +****************************************************************************/ + +#ifndef WRAPPEDCLASSES_H +#define WRAPPEDCLASSES_H + +#include <QAbstractSocket> + +#include <projectexplorer/buildconfiguration.h> +#include <projectexplorer/projectconfiguration.h> +#include <projectexplorer/runconfiguration.h> +#include <projectexplorer/project.h> +#include <projectexplorer/projecttree.h> + +#endif // header end |