[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [pykde5] /: Added kguiaddons.
From:       Simon Edwards <simon () simonzone ! com>
Date:       2014-04-13 13:36:41
Message-ID: E1WZKaP-0006uI-Ex () scm ! kde ! org
[Download RAW message or body]

Git commit e997e5f1474d794d36b375e7b3ed58c909b7c329 by Simon Edwards.
Committed on 13/04/2014 at 13:35.
Pushed by sedwards into branch 'master'.

Added kguiaddons.

M  +8    -3    CMakeLists.txt
M  +0    -1    sip/kcoreaddons/kdirwatch.sip
A  +53   -0    sip/kguiaddons/kcolorcollection.sip
A  +30   -0    sip/kguiaddons/kcolormimedata.sip
A  +34   -0    sip/kguiaddons/kcolorutils.sip
A  +42   -0    sip/kguiaddons/kdatevalidator.sip
A  +34   -0    sip/kguiaddons/kfontutils.sip
A  +39   -0    sip/kguiaddons/kguiaddonsmod.sip
A  +28   -0    sip/kguiaddons/kiconutils.sip
A  +19   -0    sip/kguiaddons/kimagecache.sip
A  +40   -0    sip/kguiaddons/klocalimagecacheimpl.sip
A  +44   -0    sip/kguiaddons/kmodifierkeyinfo.sip
A  +44   -0    sip/kguiaddons/kwordwrap.sip
M  +1    -1    sip/kplotting/kplotobject.sip

http://commits.kde.org/pykde5/e997e5f1474d794d36b375e7b3ed58c909b7c329

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 13bf9c9..77be745 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,7 +20,7 @@ include(PythonMacros)
 include(FeatureSummary)
 include(ECMSetupVersion)
 
-find_package(KF5 CONFIG REQUIRED Auth ItemModels ItemViews Archive Plotting Solid CoreAddons Sonnet)
+find_package(KF5 CONFIG REQUIRED Auth ItemModels ItemViews Archive Plotting Solid CoreAddons Sonnet \
GuiAddons)  
 #option(PYKDEUIC4_ALTINSTALL "Enable parallel-installation of the PyKDE4 tools" FALSE)
 
@@ -137,7 +137,7 @@ file(GLOB solid_files_sip sip/solid/*.sip)
 set(SIP_EXTRA_FILES_DEPEND ${solid_files_sip})
 add_sip_python_module(PyKDE5.solid sip/solid/solidmod.sip KF5::Solid)
 
-## kcoreaddons
+# kcoreaddons
 file(GLOB kcoreaddons_files_sip sip/kcoreaddons/*.sip)
 set(SIP_EXTRA_FILES_DEPEND ${kcoreaddons_files_sip})
 add_sip_python_module(PyKDE5.kcoreaddons sip/kcoreaddons/kcoreaddonsmod.sip KF5::CoreAddons)
@@ -147,7 +147,12 @@ file(GLOB sonnet_files_sip sip/sonnet/*.sip)
 set(SIP_EXTRA_FILES_DEPEND ${sonnet_files_sip})
 add_sip_python_module(PyKDE5.sonnet sip/sonnet/sonnetmod.sip KF5::SonnetCore KF5::SonnetUi)
 
-set(PYKDE_MODULES "kitemmodels kitemviews karchive kplotting solid kcoreaddons sonnet")
+# kguiaddons
+file(GLOB kguiaddons_files_sip sip/kguiaddons/*.sip)
+set(SIP_EXTRA_FILES_DEPEND ${kguiaddons_files_sip})
+add_sip_python_module(PyKDE5.kguiaddons sip/kguiaddons/kguiaddonsmod.sip KF5::GuiAddons)
+
+set(PYKDE_MODULES "kitemmodels kitemviews karchive kplotting solid kcoreaddons sonnet kguiaddons")
 
 ###############################################################################
 
diff --git a/sip/kcoreaddons/kdirwatch.sip b/sip/kcoreaddons/kdirwatch.sip
index a261890..1df417b 100644
--- a/sip/kcoreaddons/kdirwatch.sip
+++ b/sip/kcoreaddons/kdirwatch.sip
@@ -50,7 +50,6 @@ public:
     {
         FAM,
         INotify,
-        DNotify,
         Stat,
         QFSWatch
     };
diff --git a/sip/kguiaddons/kcolorcollection.sip b/sip/kguiaddons/kcolorcollection.sip
new file mode 100644
index 0000000..f3a5b58
--- /dev/null
+++ b/sip/kguiaddons/kcolorcollection.sip
@@ -0,0 +1,53 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+//                 Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, 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 Library 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.
+
+class KColorCollection
+{
+%TypeHeaderCode
+#include <kcolorcollection.h>
+%End
+
+public:
+    static QStringList      installedCollections ();
+    explicit                KColorCollection (const QString& name = QString());
+                            KColorCollection (const KColorCollection&);
+    ~KColorCollection ();
+//ig    KColorCollection&       operator= (const KColorCollection&);
+    bool                    save ();
+    QString                 description () const;
+    void                    setDescription (const QString& desc);
+    QString                 name () const;
+    void                    setName (const QString& name);
+    enum Editable
+    {
+        Yes,
+        No,
+        Ask
+    };
+    KColorCollection::Editable  editable () const;
+    void                    setEditable (KColorCollection::Editable editable);
+    int                     count () const;
+    QColor                  color (int index) const;
+    int                     findColor (const QColor& color) const;
+    QString                 name (int index) const;
+    QString                 name (const QColor& color) const;
+    int                     addColor (const QColor& newColor, const QString& newColorName = QString());
+    int                     changeColor (int index, const QColor& newColor, const QString& newColorName \
= QString()); +    int                     changeColor (const QColor& oldColor, const QColor& newColor, \
const QString& newColorName = QString()); +};
diff --git a/sip/kguiaddons/kcolormimedata.sip b/sip/kguiaddons/kcolormimedata.sip
new file mode 100644
index 0000000..30a0d91
--- /dev/null
+++ b/sip/kguiaddons/kcolormimedata.sip
@@ -0,0 +1,30 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+//                 Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, 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 Library 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.
+
+%ModuleHeaderCode
+#include <kcolormimedata.h>
+%End
+
+namespace KColorMimeData
+{
+void                    populateMimeData (QMimeData* mimeData, const QColor& color);
+bool                    canDecode (const QMimeData* mimeData);
+QColor                  fromMimeData (const QMimeData* mimeData);
+QDrag*                  createDrag (const QColor& color, QObject* dragsource);
+};
diff --git a/sip/kguiaddons/kcolorutils.sip b/sip/kguiaddons/kcolorutils.sip
new file mode 100644
index 0000000..4c82ba7
--- /dev/null
+++ b/sip/kguiaddons/kcolorutils.sip
@@ -0,0 +1,34 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+//                 Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, 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 Library 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.
+
+%ModuleHeaderCode
+#include <kcolorutils.h>
+%End
+namespace KColorUtils
+{
+qreal                   luma (const QColor&);
+void                    getHcy (const QColor&, qreal* hue, qreal* chroma, qreal* luma, qreal* alpha = \
0); +qreal                   contrastRatio (const QColor&, const QColor&);
+QColor                  lighten (const QColor&, qreal amount = 0.5, qreal chromaInverseGain = 1.0);
+QColor                  darken (const QColor&, qreal amount = 0.5, qreal chromaGain = 1.0);
+QColor                  shade (const QColor&, qreal lumaAmount, qreal chromaAmount = 0.0);
+QColor                  tint (const QColor& base, const QColor& color, qreal amount = 0.3);
+QColor                  mix (const QColor& c1, const QColor& c2, qreal bias = 0.5);
+QColor                  overlayColors (const QColor& base, const QColor& paint, \
QPainter::CompositionMode comp = QPainter::CompositionMode_SourceOver); +};
diff --git a/sip/kguiaddons/kdatevalidator.sip b/sip/kguiaddons/kdatevalidator.sip
new file mode 100644
index 0000000..2cef540
--- /dev/null
+++ b/sip/kguiaddons/kdatevalidator.sip
@@ -0,0 +1,42 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+//                 Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, 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 Library 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.
+
+class KDateValidator : QValidator
+{
+%TypeHeaderCode
+#include <kdatevalidator.h>
+%End
+
+public:
+    explicit                KDateValidator (QObject* parent = 0);
+    virtual State           validate (QString& text, int& e) const;
+    virtual void            fixup (QString& input) const;
+    State                   date (const QString& text, QDate& date) const;
+%ConvertToSubClassCode
+    // CTSCC for subclasses of 'KDateValidator'
+    sipType = NULL;
+
+    if (dynamic_cast<KDateValidator*>(sipCpp))
+        sipType = sipType_KDateValidator;
+%End
+};
+%ModuleHeaderCode
+//ctscc
+#include <kdatevalidator.h>
+%End
diff --git a/sip/kguiaddons/kfontutils.sip b/sip/kguiaddons/kfontutils.sip
new file mode 100644
index 0000000..44e9970
--- /dev/null
+++ b/sip/kguiaddons/kfontutils.sip
@@ -0,0 +1,34 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+//                 Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, 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 Library 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.
+
+%ModuleHeaderCode
+#include <kfontutils.h>
+%End
+
+namespace KFontUtils
+{
+enum AdaptFontSizeOption
+{
+    NoFlags,
+    DoNotAllowWordWrap
+};
+typedef QFlags<KFontUtils::AdaptFontSizeOption> AdaptFontSizeOptions;
+qreal                   adaptFontSize (QPainter& painter, const QString& text, qreal width, qreal \
height, qreal maxFontSize = 28.0, qreal minFontSize = 1.0, KFontUtils::AdaptFontSizeOptions flags = \
KFontUtils::AdaptFontSizeOption::NoFlags); +qreal                   adaptFontSize (QPainter& painter, \
const QString& text, const QSizeF& availableSize, qreal maxFontSize = 28.0, qreal minFontSize = 1.0, \
KFontUtils::AdaptFontSizeOptions flags = KFontUtils::AdaptFontSizeOption::NoFlags); +};
diff --git a/sip/kguiaddons/kguiaddonsmod.sip b/sip/kguiaddons/kguiaddonsmod.sip
new file mode 100644
index 0000000..4c33182
--- /dev/null
+++ b/sip/kguiaddons/kguiaddonsmod.sip
@@ -0,0 +1,39 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+//                 Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, 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 Library 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.
+
+%Module PyKDE5.kguiaddons
+
+%ModuleHeaderCode
+#pragma GCC visibility push(default)
+%End
+
+%Import typedefs.sip
+%Import QtCore/QtCoremod.sip
+%Import QtGui/QtGuimod.sip
+
+%Include kcolorcollection.sip
+%Include kcolormimedata.sip
+%Include kcolorutils.sip
+%Include kdatevalidator.sip
+%Include kfontutils.sip
+%Include kiconutils.sip
+%Include kimagecache.sip
+%Include klocalimagecacheimpl.sip
+%Include kmodifierkeyinfo.sip
+%Include kwordwrap.sip
diff --git a/sip/kguiaddons/kiconutils.sip b/sip/kguiaddons/kiconutils.sip
new file mode 100644
index 0000000..06bf4b3
--- /dev/null
+++ b/sip/kguiaddons/kiconutils.sip
@@ -0,0 +1,28 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+//                 Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, 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 Library 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.
+
+%ModuleHeaderCode
+#include <kiconutils.h>
+%End
+
+namespace KIconUtils
+{
+QIcon                   addOverlay (const QIcon& icon, const QIcon& overlay, Qt::Corner position);
+QIcon                   addOverlays (const QIcon& icon, const QHash<Qt::Corner,QIcon>& overlays);
+};
diff --git a/sip/kguiaddons/kimagecache.sip b/sip/kguiaddons/kimagecache.sip
new file mode 100644
index 0000000..4904fb1
--- /dev/null
+++ b/sip/kguiaddons/kimagecache.sip
@@ -0,0 +1,19 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+//                 Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, 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 Library 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.
+
diff --git a/sip/kguiaddons/klocalimagecacheimpl.sip b/sip/kguiaddons/klocalimagecacheimpl.sip
new file mode 100644
index 0000000..f5e4290
--- /dev/null
+++ b/sip/kguiaddons/klocalimagecacheimpl.sip
@@ -0,0 +1,40 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+//                 Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, 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 Library 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.
+
+class KLocalImageCacheImplementation
+{
+%TypeHeaderCode
+#include <klocalimagecacheimpl.h>
+%End
+
+                            KLocalImageCacheImplementation (unsigned defaultCacheSize);
+public:
+    virtual ~KLocalImageCacheImplementation ();
+    QDateTime               lastModifiedTime () const;
+    bool                    pixmapCaching () const;
+    void                    setPixmapCaching (bool enable);
+    int                     pixmapCacheLimit () const;
+    void                    setPixmapCacheLimit (int size);
+protected:
+    void                    updateModifiedTime ();
+    QByteArray              serializeImage (const QImage& image) const;
+    bool                    insertLocalPixmap (const QString& key, const QPixmap& pixmap) const;
+    bool                    findLocalPixmap (const QString& key, QPixmap* destination) const;
+    void                    clearLocalCache ();
+};
diff --git a/sip/kguiaddons/kmodifierkeyinfo.sip b/sip/kguiaddons/kmodifierkeyinfo.sip
new file mode 100644
index 0000000..c0e30fa
--- /dev/null
+++ b/sip/kguiaddons/kmodifierkeyinfo.sip
@@ -0,0 +1,44 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+//                 Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, 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 Library 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.
+
+class KModifierKeyInfo : QObject
+{
+%TypeHeaderCode
+#include <kmodifierkeyinfo.h>
+%End
+
+public:
+                            KModifierKeyInfo (QObject* parent = 0);
+    virtual ~KModifierKeyInfo ();
+    bool                    knowsKey (Qt::Key key) const;
+    const QList<Qt::Key>    knownKeys () const;
+    bool                    isKeyPressed (Qt::Key key) const;
+    bool                    isKeyLatched (Qt::Key key) const;
+    bool                    setKeyLatched (Qt::Key key, bool latched);
+    bool                    isKeyLocked (Qt::Key key) const;
+    bool                    setKeyLocked (Qt::Key key, bool locked);
+    bool                    isButtonPressed (Qt::MouseButton button) const;
+signals:
+    void                    keyPressed (Qt::Key key, bool pressed);
+    void                    keyLatched (Qt::Key key, bool latched);
+    void                    keyLocked (Qt::Key key, bool locked);
+    void                    buttonPressed (Qt::MouseButton button, bool pressed);
+    void                    keyAdded (Qt::Key key);
+    void                    keyRemoved (Qt::Key key);
+};
diff --git a/sip/kguiaddons/kwordwrap.sip b/sip/kguiaddons/kwordwrap.sip
new file mode 100644
index 0000000..85ac692
--- /dev/null
+++ b/sip/kguiaddons/kwordwrap.sip
@@ -0,0 +1,44 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+//                 Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, 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 Library 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.
+
+class KWordWrap
+{
+%TypeHeaderCode
+#include <kwordwrap.h>
+%End
+
+public:
+    enum
+    {
+        FadeOut,
+        Truncate
+    };
+    static KWordWrap        formatText (QFontMetrics& fm, const QRect& r, int flags, const QString& str, \
int len = -1); +    QRect                   boundingRect () const;
+    QString                 wrappedString () const;
+    QString                 truncatedString (bool dots = 1) const;
+    void                    drawText (QPainter* painter, int x, int y, int flags = Qt::AlignLeft) const;
+    ~KWordWrap ();
+                            KWordWrap (const KWordWrap& other);
+//ig    KWordWrap&              operator= (const KWordWrap& other);
+    static void             drawFadeoutText (QPainter* p, int x, int y, int maxW, const QString& t);
+    static void             drawTruncateText (QPainter* p, int x, int y, int maxW, const QString& t);
+private:
+                            KWordWrap (const QRect& r);
+};
diff --git a/sip/kplotting/kplotobject.sip b/sip/kplotting/kplotobject.sip
index 220b8d0..909e19e 100644
--- a/sip/kplotting/kplotobject.sip
+++ b/sip/kplotting/kplotobject.sip
@@ -43,7 +43,7 @@ public:
         Hexagon,
         Asterisk,
         Star,
-        UnknwonPoint
+        UnknownPoint
     };
     explicit                KPlotObject (const QColor& color = Qt::white, KPlotObject::PlotType otype = \
KPlotObject::PlotType::Points, double size = 2, KPlotObject::PointStyle ps = \
KPlotObject::PointStyle::Circle);  ~KPlotObject ();


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic