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 Plottin= g Solid CoreAddons Sonnet) +find_package(KF5 CONFIG REQUIRED Auth ItemModels ItemViews Archive Plottin= g Solid CoreAddons Sonnet GuiAddons) = #option(PYKDEUIC4_ALTINSTALL "Enable parallel-installation of the PyKDE4 t= ools" 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.si= p 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::SonnetCo= re KF5::SonnetUi) = -set(PYKDE_MODULES "kitemmodels kitemviews karchive kplotting solid kcoread= dons 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 K= F5::GuiAddons) + +set(PYKDE_MODULES "kitemmodels kitemviews karchive kplotting solid kcoread= dons 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/kcolorcol= lection.sip new file mode 100644 index 0000000..f3a5b58 --- /dev/null +++ b/sip/kguiaddons/kcolorcollection.sip @@ -0,0 +1,53 @@ +// Copyright 2014 Simon Edwards + +// 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 +%End + +public: + static QStringList installedCollections (); + explicit KColorCollection (const QString& name =3D QStr= ing()); + KColorCollection (const KColorCollection&); + ~KColorCollection (); +//ig KColorCollection& operator=3D (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 editab= le); + 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 QStrin= g& newColorName =3D QString()); + int changeColor (int index, const QColor& newColor= , const QString& newColorName =3D QString()); + int changeColor (const QColor& oldColor, const QCo= lor& newColor, const QString& newColorName =3D QString()); +}; diff --git a/sip/kguiaddons/kcolormimedata.sip b/sip/kguiaddons/kcolormimed= ata.sip new file mode 100644 index 0000000..30a0d91 --- /dev/null +++ b/sip/kguiaddons/kcolormimedata.sip @@ -0,0 +1,30 @@ +// Copyright 2014 Simon Edwards + +// 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 +%End + +namespace KColorMimeData +{ +void populateMimeData (QMimeData* mimeData, const QColo= r& color); +bool canDecode (const QMimeData* mimeData); +QColor fromMimeData (const QMimeData* mimeData); +QDrag* createDrag (const QColor& color, QObject* dragsour= ce); +}; 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 + +// 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 +%End +namespace KColorUtils +{ +qreal luma (const QColor&); +void getHcy (const QColor&, qreal* hue, qreal* chroma, = qreal* luma, qreal* alpha =3D 0); +qreal contrastRatio (const QColor&, const QColor&); +QColor lighten (const QColor&, qreal amount =3D 0.5, qrea= l chromaInverseGain =3D 1.0); +QColor darken (const QColor&, qreal amount =3D 0.5, qreal= chromaGain =3D 1.0); +QColor shade (const QColor&, qreal lumaAmount, qreal chro= maAmount =3D 0.0); +QColor tint (const QColor& base, const QColor& color, qre= al amount =3D 0.3); +QColor mix (const QColor& c1, const QColor& c2, qreal bia= s =3D 0.5); +QColor overlayColors (const QColor& base, const QColor& p= aint, QPainter::CompositionMode comp =3D QPainter::CompositionMode_SourceOv= er); +}; diff --git a/sip/kguiaddons/kdatevalidator.sip b/sip/kguiaddons/kdatevalida= tor.sip new file mode 100644 index 0000000..2cef540 --- /dev/null +++ b/sip/kguiaddons/kdatevalidator.sip @@ -0,0 +1,42 @@ +// Copyright 2014 Simon Edwards + +// 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 +%End + +public: + explicit KDateValidator (QObject* parent =3D 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 =3D NULL; + + if (dynamic_cast(sipCpp)) + sipType =3D sipType_KDateValidator; +%End +}; +%ModuleHeaderCode +//ctscc +#include +%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 + +// 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 +%End + +namespace KFontUtils +{ +enum AdaptFontSizeOption +{ + NoFlags, + DoNotAllowWordWrap +}; +typedef QFlags AdaptFontSizeOptions; +qreal adaptFontSize (QPainter& painter, const QString& t= ext, qreal width, qreal height, qreal maxFontSize =3D 28.0, qreal minFontSi= ze =3D 1.0, KFontUtils::AdaptFontSizeOptions flags =3D KFontUtils::AdaptFon= tSizeOption::NoFlags); +qreal adaptFontSize (QPainter& painter, const QString& t= ext, const QSizeF& availableSize, qreal maxFontSize =3D 28.0, qreal minFont= Size =3D 1.0, KFontUtils::AdaptFontSizeOptions flags =3D KFontUtils::AdaptF= ontSizeOption::NoFlags); +}; diff --git a/sip/kguiaddons/kguiaddonsmod.sip b/sip/kguiaddons/kguiaddonsmo= d.sip new file mode 100644 index 0000000..4c33182 --- /dev/null +++ b/sip/kguiaddons/kguiaddonsmod.sip @@ -0,0 +1,39 @@ +// Copyright 2014 Simon Edwards + +// 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 + +// 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 +%End + +namespace KIconUtils +{ +QIcon addOverlay (const QIcon& icon, const QIcon& overla= y, Qt::Corner position); +QIcon addOverlays (const QIcon& icon, const QHash& 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 + +// 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/kloca= limagecacheimpl.sip new file mode 100644 index 0000000..f5e4290 --- /dev/null +++ b/sip/kguiaddons/klocalimagecacheimpl.sip @@ -0,0 +1,40 @@ +// Copyright 2014 Simon Edwards + +// 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 +%End + + KLocalImageCacheImplementation (unsigned defau= ltCacheSize); +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 Q= Pixmap& pixmap) const; + bool findLocalPixmap (const QString& key, QPixmap* = destination) const; + void clearLocalCache (); +}; diff --git a/sip/kguiaddons/kmodifierkeyinfo.sip b/sip/kguiaddons/kmodifier= keyinfo.sip new file mode 100644 index 0000000..c0e30fa --- /dev/null +++ b/sip/kguiaddons/kmodifierkeyinfo.sip @@ -0,0 +1,44 @@ +// Copyright 2014 Simon Edwards + +// 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 +%End + +public: + KModifierKeyInfo (QObject* parent =3D 0); + virtual ~KModifierKeyInfo (); + bool knowsKey (Qt::Key key) const; + const QList 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 pr= essed); + 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 + +// 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 +%End + +public: + enum + { + FadeOut, + Truncate + }; + static KWordWrap formatText (QFontMetrics& fm, const QRect& r, = int flags, const QString& str, int len =3D -1); + QRect boundingRect () const; + QString wrappedString () const; + QString truncatedString (bool dots =3D 1) const; + void drawText (QPainter* painter, int x, int y, int= flags =3D Qt::AlignLeft) const; + ~KWordWrap (); + KWordWrap (const KWordWrap& other); +//ig KWordWrap& operator=3D (const KWordWrap& other); + static void drawFadeoutText (QPainter* p, int x, int y, in= t maxW, const QString& t); + static void drawTruncateText (QPainter* p, int x, int y, i= nt 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 =3D Qt::white= , KPlotObject::PlotType otype =3D KPlotObject::PlotType::Points, double siz= e =3D 2, KPlotObject::PointStyle ps =3D KPlotObject::PointStyle::Circle); ~KPlotObject ();