[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [calligra/krita-scripting-rempt] krita/plugins/extensions/pyqt/sip: Create basic wrappers for libkis
From: Boudewijn Rempt <boud () valdyas ! org>
Date: 2014-07-29 14:03:41
Message-ID: E1XC80D-0003UD-Sj () scm ! kde ! org
[Download RAW message or body]
Git commit 658b18213a3cdc40f27463efaab965e122dfa064 by Boudewijn Rempt.
Committed on 29/07/2014 at 07:55.
Pushed by rempt into branch 'krita-scripting-rempt'.
Create basic wrappers for libkis
M +1 -1 krita/plugins/extensions/pyqt/sip/CMakeLists.txt
A +14 -0 krita/plugins/extensions/pyqt/sip/krita/application.sip
D +0 -87 krita/plugins/extensions/pyqt/sip/krita/bak/application.sip
D +0 -57 krita/plugins/extensions/pyqt/sip/krita/bak/documentmanager.sip
D +0 -76 krita/plugins/extensions/pyqt/sip/krita/bak/mainwindow.sip
D +0 -62 krita/plugins/extensions/pyqt/sip/krita/bak/plugin.sip
D +0 -75 krita/plugins/extensions/pyqt/sip/krita/bak/pluginconfigpageinterface.sip
D +0 -47 krita/plugins/extensions/pyqt/sip/krita/bak/pluginmanager.sip
A +16 -0 krita/plugins/extensions/pyqt/sip/krita/document.sip
A +15 -0 krita/plugins/extensions/pyqt/sip/krita/image.sip
M +10 -34 krita/plugins/extensions/pyqt/sip/krita/kritamod.sip
A +16 -0 krita/plugins/extensions/pyqt/sip/krita/mainwindow.sip
A +21 -0 krita/plugins/extensions/pyqt/sip/krita/module.sip
A +16 -0 krita/plugins/extensions/pyqt/sip/krita/node.sip
A +15 -0 krita/plugins/extensions/pyqt/sip/krita/view.sip
http://commits.kde.org/calligra/658b18213a3cdc40f27463efaab965e122dfa064
diff --git a/krita/plugins/extensions/pyqt/sip/CMakeLists.txt \
b/krita/plugins/extensions/pyqt/sip/CMakeLists.txt index 895aef9..f7cc864 100644
--- a/krita/plugins/extensions/pyqt/sip/CMakeLists.txt
+++ b/krita/plugins/extensions/pyqt/sip/CMakeLists.txt
@@ -11,7 +11,7 @@ else (PYQT4_VERSION STRLESS "040905")
set(SIP_EXTRA_OPTIONS -g -x PyKDE_QVector)
endif(PYQT4_VERSION STRLESS "040905")
-add_sip_python_module(PyKrita4.krita ./krita/kritamod.sip kritaui kritaimage \
kritalibbrush) +add_sip_python_module(PyKrita4.krita ./krita/kritamod.sip kritalibkis \
kritaui kritaimage kritalibbrush)
install(FILES
./__init__.py
diff --git a/krita/plugins/extensions/pyqt/sip/krita/application.sip \
b/krita/plugins/extensions/pyqt/sip/krita/application.sip new file mode 100644
index 0000000..e8a24ca
--- /dev/null
+++ b/krita/plugins/extensions/pyqt/sip/krita/application.sip
@@ -0,0 +1,14 @@
+%Module PyKrita4.Application
+
+%Import QtCore/QtCoremod.sip
+%Import QtGui/QtGuimod.sip
+
+class Application : public QObject
+{
+%TypeHeaderCode
+#include <../../libkis/application.h>
+%End
+
+public:
+ explicit Application(QObject *parent /TransferThis/ = 0);
+};
diff --git a/krita/plugins/extensions/pyqt/sip/krita/bak/application.sip \
b/krita/plugins/extensions/pyqt/sip/krita/bak/application.sip deleted file mode \
100644 index 232f9c4..0000000
--- a/krita/plugins/extensions/pyqt/sip/krita/bak/application.sip
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// Copyright 2007 Jim Bublitz <jbublitz@nwinternet.com>
-// Earlier copyrights 1998 - 2006 Jim Bublitz also apply
-
-
-// Generated by preSip
-// PyKDE4 module krita version KDE 3.92.0
-
-
-// This file is part of PyKDE4.
-
-// PyKDE4 is free software; you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 2.1 of
-// the License, or (at your option) any later version.
-
-// PyKDE4 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/>.
-
-%ModuleHeaderCode
-//ctscc
-#include <application.h>
-#include <documentmanager.h>
-#include <mainwindow.h>
-#include <plugin.h>
-#include <pluginconfigpageinterface.h>
-#include <pluginmanager.h>
-%End
-
-%ModuleHeaderCode
-#include <application.h>
-%End
-
-namespace Krita
-{
-
-class Application : QObject
-{
-%TypeHeaderCode
-#include <application.h>
-%End
-
-
-public:
- Application (void* /In/);
-
-public:
- Krita::DocumentManager* documentManager ();
- Krita::PluginManager* pluginManager ();
- KTextEditor::Editor* editor ();
- Krita::MainWindow* activeMainWindow ();
- const QList<Krita::MainWindow*>& mainWindows () const;
-
-// Subclasses for QObject
-
-public:
-%ConvertToSubClassCode
-
- if (dynamic_cast<Krita::Application*>(sipCpp))
- sipClass = sipClass_Krita_Application;
- else if (dynamic_cast<Krita::DocumentManager*>(sipCpp))
- sipClass = sipClass_Krita_DocumentManager;
- else if (dynamic_cast<Krita::MainWindow*>(sipCpp))
- sipClass = sipClass_Krita_MainWindow;
- else if (dynamic_cast<Krita::Plugin*>(sipCpp))
- sipClass = sipClass_Krita_Plugin;
- else if (dynamic_cast<Krita::PluginConfigPage*>(sipCpp))
- sipClass = sipClass_Krita_PluginConfigPage;
- else if (dynamic_cast<Krita::PluginManager*>(sipCpp))
- sipClass = sipClass_Krita_PluginManager;
- else if (dynamic_cast<Krita::PluginView*>(sipCpp))
- sipClass = sipClass_Krita_PluginView;
- else
- sipClass = NULL;
-%End
-
-
-}; // class Application
-
-Krita::Application* application ();
-}; // namespace Krita
-
diff --git a/krita/plugins/extensions/pyqt/sip/krita/bak/documentmanager.sip \
b/krita/plugins/extensions/pyqt/sip/krita/bak/documentmanager.sip deleted file mode \
100644 index 99e0668..0000000
--- a/krita/plugins/extensions/pyqt/sip/krita/bak/documentmanager.sip
+++ /dev/null
@@ -1,57 +0,0 @@
-//
-// Copyright 2007 Jim Bublitz <jbublitz@nwinternet.com>
-// Earlier copyrights 1998 - 2006 Jim Bublitz also apply
-
-
-// Generated by preSip
-// PyKDE4 module krita version KDE 3.92.0
-
-
-// This file is part of PyKDE4.
-
-// PyKDE4 is free software; you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 2.1 of
-// the License, or (at your option) any later version.
-
-// PyKDE4 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/>.
-
-%ModuleHeaderCode
-#include <documentmanager.h>
-%End
-
-namespace Krita
-{
-
-class DocumentManager : QObject
-{
-%TypeHeaderCode
-#include <documentmanager.h>
-%End
-
-
-public:
- DocumentManager (void* /In/);
-
-public:
- const QList<KTextEditor::Document*>& documents () const;
- KTextEditor::Document* findUrl (const KUrl&) const;
- KTextEditor::Document* openUrl (const KUrl&, const QString& = QString ());
- bool closeDocument (KTextEditor::Document*);
-
-signals:
- void documentCreated (KTextEditor::Document*);
- void documentWillBeDeleted (KTextEditor::Document*);
- void documentDeleted (KTextEditor::Document*);
-
-}; // class DocumentManager
-
-Krita::DocumentManager* documentManager ();
-}; // namespace Krita
-
diff --git a/krita/plugins/extensions/pyqt/sip/krita/bak/mainwindow.sip \
b/krita/plugins/extensions/pyqt/sip/krita/bak/mainwindow.sip deleted file mode 100644
index 582cc03..0000000
--- a/krita/plugins/extensions/pyqt/sip/krita/bak/mainwindow.sip
+++ /dev/null
@@ -1,76 +0,0 @@
-//
-// Copyright 2007 Jim Bublitz <jbublitz@nwinternet.com>
-// Earlier copyrights 1998 - 2006 Jim Bublitz also apply
-
-
-// Generated by preSip
-// PyKDE4 module krita version KDE 3.92.0
-
-
-// This file is part of PyKDE4.
-
-// PyKDE4 is free software; you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 2.1 of
-// the License, or (at your option) any later version.
-
-// PyKDE4 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/>.
-
-namespace Krita
-{
-
-class MainWindow : QObject
-{
-%TypeHeaderCode
-#include <mainwindow.h>
-%End
-
-
-public:
- MainWindow (void* /In/);
-
-public:
- KXMLGUIFactory* guiFactory () const;
- QWidget* window () const;
- QWidget* centralWidget () const;
-
-public:
- KTextEditor::View* activeView ();
- KTextEditor::View* activateView (KTextEditor::Document*);
- KTextEditor::View* openUrl (const KUrl&, const QString& = QString ());
- // http://kde.6490.n7.nabble.com/Can-I-know-the-project-configuration-from-python-plugin-td1523455.html
- Krita::PluginView* pluginView (const QString&);
-
-signals:
- void viewChanged ();
-
-public:
-
- enum Position
- {
- Left,
- Right,
- Top,
- Bottom
- };
-
- QWidget* createToolView (const QString&, \
Krita::MainWindow::Position, const QPixmap&, const QString&);
- bool moveToolView (QWidget*, Krita::MainWindow::Position);
- bool showToolView (QWidget*);
- bool hideToolView (QWidget*);
- // NOTE This method do not exist in C++ class, but needed for Python code!
- void destroyToolView(QWidget*);
-%MethodCode
- a0->blockSignals(true);
- a0->deleteLater();
-%End
-
-}; // class MainWindow
-
-}; // namespace Krita
diff --git a/krita/plugins/extensions/pyqt/sip/krita/bak/plugin.sip \
b/krita/plugins/extensions/pyqt/sip/krita/bak/plugin.sip deleted file mode 100644
index 471e92f..0000000
--- a/krita/plugins/extensions/pyqt/sip/krita/bak/plugin.sip
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// Copyright 2007 Jim Bublitz <jbublitz@nwinternet.com>
-// Earlier copyrights 1998 - 2006 Jim Bublitz also apply
-
-
-// Generated by preSip
-// PyKDE4 module krita version KDE 3.92.0
-
-
-// This file is part of PyKDE4.
-
-// PyKDE4 is free software; you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 2.1 of
-// the License, or (at your option) any later version.
-
-// PyKDE4 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/>.
-
-
-namespace Krita
-{
-
-class Plugin : QObject
-{
-%TypeHeaderCode
-#include <plugin.h>
-%End
-
-public:
- Plugin (Krita::Application* = 0, const char* = 0);
- Krita::Application* application () const;
- virtual Krita::PluginView* createView (Krita::MainWindow*);
- virtual void readSessionConfig (KConfigBase*, const QString&);
- virtual void writeSessionConfig (KConfigBase*, const QString&);
-
-}; // class Plugin
-
-Krita::Plugin* createPlugin (const char*, Krita::Application* = 0, const \
QStringList& = QStringList ());
-
-class PluginView : QObject
-{
-%TypeHeaderCode
-#include <plugin.h>
-%End
-
-public:
- PluginView (Krita::MainWindow*);
- Krita::MainWindow* mainWindow () const;
- virtual void readSessionConfig (KConfigBase*, const QString&);
- virtual void writeSessionConfig (KConfigBase*, const QString&);
-
-}; // class PluginView
-
-}; // namespace Krita
-
-
diff --git a/krita/plugins/extensions/pyqt/sip/krita/bak/pluginconfigpageinterface.sip \
b/krita/plugins/extensions/pyqt/sip/krita/bak/pluginconfigpageinterface.sip deleted \
file mode 100644 index 360e298..0000000
--- a/krita/plugins/extensions/pyqt/sip/krita/bak/pluginconfigpageinterface.sip
+++ /dev/null
@@ -1,75 +0,0 @@
-//
-// Copyright 2007 Jim Bublitz <jbublitz@nwinternet.com>
-// Earlier copyrights 1998 - 2006 Jim Bublitz also apply
-
-
-// Generated by preSip
-// PyKDE4 module krita version KDE 3.92.0
-
-
-// This file is part of PyKDE4.
-
-// PyKDE4 is free software; you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 2.1 of
-// the License, or (at your option) any later version.
-
-// PyKDE4 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/>.
-
-%ModuleHeaderCode
-#include <pluginconfigpageinterface.h>
-%End
-
-namespace Krita
-{
-
-class PluginConfigPage : QWidget
-{
-%TypeHeaderCode
-#include <pluginconfigpageinterface.h>
-%End
-
-
-public:
- PluginConfigPage (QWidget* = 0, const char* = 0);
-
-public:
- virtual void apply () = 0;
- virtual void reset () = 0;
- virtual void defaults () = 0;
-
-signals:
- void changed ();
-
-}; // class PluginConfigPage
-
-
-class PluginConfigPageInterface
-{
-%TypeHeaderCode
-#include <pluginconfigpageinterface.h>
-%End
-
-
-public:
- PluginConfigPageInterface ();
- uint pluginConfigPageInterfaceNumber () const;
-
-public:
- virtual uint configPages () const = 0;
- virtual Krita::PluginConfigPage* configPage (uint = 0, QWidget* = 0, const char* \
= 0) = 0;
- virtual QString configPageName (uint = 0) const = 0;
- virtual QString configPageFullName (uint = 0) const = 0;
- virtual KIcon configPageIcon (uint = 0) const = 0;
-
-}; // class PluginConfigPageInterface
-
-Krita::PluginConfigPageInterface* pluginConfigPageInterface (Krita::Plugin*);
-}; // namespace Krita
-
diff --git a/krita/plugins/extensions/pyqt/sip/krita/bak/pluginmanager.sip \
b/krita/plugins/extensions/pyqt/sip/krita/bak/pluginmanager.sip deleted file mode \
100644 index 0769753..0000000
--- a/krita/plugins/extensions/pyqt/sip/krita/bak/pluginmanager.sip
+++ /dev/null
@@ -1,47 +0,0 @@
-//
-// Copyright 2007 Jim Bublitz <jbublitz@nwinternet.com>
-// Earlier copyrights 1998 - 2006 Jim Bublitz also apply
-
-
-// Generated by preSip
-// PyKDE4 module krita version KDE 3.92.0
-
-
-// This file is part of PyKDE4.
-
-// PyKDE4 is free software; you can redistribute it and/or modify
-// it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 2.1 of
-// the License, or (at your option) any later version.
-
-// PyKDE4 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/>.
-
-namespace Krita
-{
-
-class PluginManager : QObject
-{
-%TypeHeaderCode
-#include <pluginmanager.h>
-%End
-
-
-public:
- PluginManager (void* /In/);
-
-public:
- Krita::Plugin* plugin (const QString&);
- bool pluginAvailable (const QString&);
- Krita::Plugin* loadPlugin (const QString&, bool = 1);
- void unloadPlugin (const QString&, bool = 1);
-
-}; // class PluginManager
-
-}; // namespace Krita
-
diff --git a/krita/plugins/extensions/pyqt/sip/krita/document.sip \
b/krita/plugins/extensions/pyqt/sip/krita/document.sip new file mode 100644
index 0000000..9b3281b
--- /dev/null
+++ b/krita/plugins/extensions/pyqt/sip/krita/document.sip
@@ -0,0 +1,16 @@
+%Module PyKrita4.Document
+
+%Import QtCore/QtCoremod.sip
+%Import QtGui/QtGuimod.sip
+
+class Document : public QObject
+{
+%TypeHeaderCode
+#include <../../libkis/document.h>
+%End
+
+public:
+ explicit Document(void */In/, QObject *parent /TransferThis/ = 0);
+
+ Image *image();
+};
diff --git a/krita/plugins/extensions/pyqt/sip/krita/image.sip \
b/krita/plugins/extensions/pyqt/sip/krita/image.sip new file mode 100644
index 0000000..5c18f4d
--- /dev/null
+++ b/krita/plugins/extensions/pyqt/sip/krita/image.sip
@@ -0,0 +1,15 @@
+%Module PyKrita4.Image
+
+%Import QtCore/QtCoremod.sip
+%Import QtGui/QtGuimod.sip
+
+class Image : public QObject
+{
+%TypeHeaderCode
+#include <../../libkis/image.h>
+%End
+
+public:
+ explicit Image(void */In/, QObject *parent /TransferThis/ = 0);
+
+};
\ No newline at end of file
diff --git a/krita/plugins/extensions/pyqt/sip/krita/kritamod.sip \
b/krita/plugins/extensions/pyqt/sip/krita/kritamod.sip index 11793ae..94256ec 100644
--- a/krita/plugins/extensions/pyqt/sip/krita/kritamod.sip
+++ b/krita/plugins/extensions/pyqt/sip/krita/kritamod.sip
@@ -1,32 +1,8 @@
-//
-// Copyright 2007 Jim Bublitz <jbublitz@nwinternet.com>
-// Earlier copyrights 1998 - 2006 Jim Bublitz also apply
-
-
-// Generated by preSip
-// PyKDE4 module krita version KDE_3_92_0
-
-%Copying
-
- This file is part of PyKDE4.
-
- PyKDE4 is free software; you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
-
- PyKDE4 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/>.
-
-%End
-
%Module PyKrita4.krita
+%Import QtCore/QtCoremod.sip
+%Import QtGui/QtGuimod.sip
+
%ModuleHeaderCode
#pragma GCC visibility push(default)
%End
@@ -35,10 +11,10 @@
%Import QtGui/QtGuimod.sip
%Import QtXml/QtXmlmod.sip
-//%Include application.sip
-//%Include documentmanager.sip
-//%Include mainwindow.sip
-//%Include plugin.sip
-//%Include pluginconfigpageinterface.sip
-//%Include pluginmanager.sip
-
+%Include application.sip
+%Include document.sip
+%Include image.sip
+%Include mainwindow.sip
+%Include module.sip
+%Include node.sip
+%Include view.sip
\ No newline at end of file
diff --git a/krita/plugins/extensions/pyqt/sip/krita/mainwindow.sip \
b/krita/plugins/extensions/pyqt/sip/krita/mainwindow.sip new file mode 100644
index 0000000..413998b
--- /dev/null
+++ b/krita/plugins/extensions/pyqt/sip/krita/mainwindow.sip
@@ -0,0 +1,16 @@
+%Module PyKrita4.MainWindow
+
+%Import QtCore/QtCoremod.sip
+%Import QtGui/QtGuimod.sip
+
+
+class MainWindow : public QObject
+{
+%TypeHeaderCode
+#include <mainwindow.h>
+%End
+
+public:
+ MainWindow(void */In/, QObject *parent /TransferThis/ = 0);
+ QList<View*> views();
+};
diff --git a/krita/plugins/extensions/pyqt/sip/krita/module.sip \
b/krita/plugins/extensions/pyqt/sip/krita/module.sip new file mode 100644
index 0000000..5303086
--- /dev/null
+++ b/krita/plugins/extensions/pyqt/sip/krita/module.sip
@@ -0,0 +1,21 @@
+%Module PyKrita4.Module
+
+%Import QtCore/QtCoremod.sip
+%Import QtGui/QtGuimod.sip
+
+class Module : public QObject
+{
+%TypeHeaderCode
+#include <module.h>
+%End
+
+public:
+ Module(QObject *parent /TransferThis/ = 0);
+
+ QList<MainWindow*> mainWindows();
+ QList<View*> views();
+ QList<Document*> documents();
+ QList<Image*> images();
+
+};
+
diff --git a/krita/plugins/extensions/pyqt/sip/krita/node.sip \
b/krita/plugins/extensions/pyqt/sip/krita/node.sip new file mode 100644
index 0000000..d3465c5
--- /dev/null
+++ b/krita/plugins/extensions/pyqt/sip/krita/node.sip
@@ -0,0 +1,16 @@
+%Module PyKrita4.Node
+
+%Import QtCore/QtCoremod.sip
+%Import QtGui/QtGuimod.sip
+
+class Node : public QObject
+{
+
+%TypeHeaderCode
+#include <../../libkis/node.h>
+%End
+
+public:
+ explicit Node(QObject *parent /TransferThis/ = 0);
+
+};
diff --git a/krita/plugins/extensions/pyqt/sip/krita/view.sip \
b/krita/plugins/extensions/pyqt/sip/krita/view.sip new file mode 100644
index 0000000..78d915d
--- /dev/null
+++ b/krita/plugins/extensions/pyqt/sip/krita/view.sip
@@ -0,0 +1,15 @@
+%Module PyKrita4.View
+
+%Import QtCore/QtCoremod.sip
+%Import QtGui/QtGuimod.sip
+
+class View : public QObject
+{
+%TypeHeaderCode
+#include <../../libkis/view.h>
+%End
+
+public:
+ explicit View(void */In/, QObject *parent /TransferThis/ = 0);
+
+};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic