packages feed

qtah-cpp-qt5 0.3.1 → 0.4.0

raw patch · 21 files changed

+80/−30 lines, 21 filesdep ~processdep ~qtah-generatorsetup-changed

Dependency ranges changed: process, qtah-generator

Files

Setup.hs view
@@ -1,6 +1,6 @@ -- This file is part of Qtah. ----- Copyright 2015-2017 The Qtah Authors.+-- Copyright 2015-2018 The Qtah Authors. -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Lesser General Public License as published by@@ -16,14 +16,23 @@ -- along with this program.  If not, see <http://www.gnu.org/licenses/>.  {-# OPTIONS_GHC -W -fwarn-incomplete-patterns -fwarn-unused-do-bind #-}+{-# LANGUAGE CPP #-}  import Control.Applicative ((<|>)) import Control.Monad (unless, when) import Data.Char (isDigit) import Data.List (isPrefixOf, isSuffixOf) import Data.Maybe (fromMaybe)-import Distribution.Package (PackageName (PackageName), pkgName)-import Distribution.PackageDescription (FlagName (FlagName), PackageDescription, package)+import Distribution.Package (pkgName, unPackageName)+import Distribution.PackageDescription (+  PackageDescription,+  package,+#if MIN_VERSION_Cabal(2,0,0)+  FlagName, mkFlagName,+#else+  FlagName (FlagName),+#endif+  ) import Distribution.Simple (defaultMainWithHooks, simpleUserHooks) import Distribution.Simple.LocalBuildInfo (   LocalBuildInfo,@@ -87,6 +96,10 @@ import System.FilePath ((</>), takeDirectory) import System.Process (callProcess) +#if !MIN_VERSION_Cabal(2,0,0)+mkFlagName = FlagName+#endif+ packageName :: String -- Careful, this line is modified by set-qt-version.sh. packageName = "qtah-cpp-qt5"@@ -247,8 +260,8 @@   -- Determine what version of Qt to use.  If we have a Qt version preference   -- specified, either through package flags or through QTAH_QT, then   -- maybeQtMajor will get that value.-  let PackageName myName = pkgName $ package $ localPkgDescr localBuildInfo-  maybeQtMajor <- case reverse myName of+  let myName = pkgName $ package $ localPkgDescr localBuildInfo+  maybeQtMajor <- case reverse $ unPackageName myName of     -- If the package name ends in "-qtX", then build for Qt X (whatever the     -- available minor version is).  Ignore QTAH_QT and package flags.     n:'t':'q':'-':_ | isDigit n -> do@@ -260,8 +273,8 @@     _ -> do       -- Inspect the 'qt4' and 'qt5' package flags.       let flags = configConfigurationsFlags configFlags-          qt4Flag = fromMaybe False $ lookup (FlagName "qt4") flags-          qt5Flag = fromMaybe False $ lookup (FlagName "qt5") flags+          qt4Flag = fromMaybe False $ lookup (mkFlagName "qt4") flags+          qt5Flag = fromMaybe False $ lookup (mkFlagName "qt5") flags           qtFlag = if qt4Flag then Just 4 else if qt5Flag then Just 5 else Nothing       when (qt4Flag && qt5Flag) $         die $ concat
cpp/encode.cpp view
@@ -1,6 +1,6 @@ // This file is part of Qtah. //-// Copyright 2015-2017 The Qtah Authors.+// Copyright 2015-2018 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/encode.hpp view
@@ -3,7 +3,7 @@  // This file is part of Qtah. //-// Copyright 2015-2017 The Qtah Authors.+// Copyright 2015-2018 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/event.hpp view
@@ -3,7 +3,7 @@  // This file is part of Qtah. //-// Copyright 2015-2017 The Qtah Authors.+// Copyright 2015-2018 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/qtah.pro view
@@ -1,6 +1,6 @@ # This file is part of Qtah. #-# Copyright 2015-2017 The Qtah Authors.+# Copyright 2015-2018 The Qtah Authors. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by
cpp/qtahopenglwindow.hpp view
@@ -3,7 +3,7 @@  // This file is part of Qtah. //-// Copyright 2015-2017 The Qtah Authors.+// Copyright 2015-2018 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/qtahrasterwindow.hpp view
@@ -3,7 +3,7 @@  // This file is part of Qtah. //-// Copyright 2015-2017 The Qtah Authors.+// Copyright 2015-2018 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/wrap_qapplication.cpp view
@@ -1,6 +1,6 @@ // This file is part of Qtah. //-// Copyright 2015-2017 The Qtah Authors.+// Copyright 2015-2018 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by@@ -33,6 +33,14 @@     }      return new QApplication(*argc, argv);+}++QFont fontWithClass(const QString& className) {+    return QApplication::font(className.toStdString().c_str());+}++void setFontWithClass(const QFont& font, const QString& className) {+    QApplication::setFont(font, className.toStdString().c_str()); }  }  // namespace qapplication
cpp/wrap_qapplication.hpp view
@@ -3,7 +3,7 @@  // This file is part of Qtah. //-// Copyright 2015-2017 The Qtah Authors.+// Copyright 2015-2018 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by@@ -19,12 +19,18 @@ // along with this program.  If not, see <http://www.gnu.org/licenses/>.  #include <QApplication>+#include <QFont>+#include <QString> #include <QStringList>  namespace qtah { namespace qapplication {  QApplication* create(const QStringList&);++QFont fontWithClass(const QString& className);++void setFontWithClass(const QFont&, const QString&);  }  // namespace qapplication }  // namespace qtah
cpp/wrap_qcoreapplication.cpp view
@@ -1,6 +1,6 @@ // This file is part of Qtah. //-// Copyright 2015-2017 The Qtah Authors.+// Copyright 2015-2018 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/wrap_qcoreapplication.hpp view
@@ -3,7 +3,7 @@  // This file is part of Qtah. //-// Copyright 2015-2017 The Qtah Authors.+// Copyright 2015-2018 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/wrap_qformlayout.cpp view
@@ -1,6 +1,6 @@ // This file is part of Qtah. //-// Copyright 2015-2017 The Qtah Authors.+// Copyright 2015-2018 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/wrap_qformlayout.hpp view
@@ -3,7 +3,7 @@  // This file is part of Qtah. //-// Copyright 2015-2017 The Qtah Authors.+// Copyright 2015-2018 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/wrap_qgridlayout.cpp view
@@ -1,6 +1,6 @@ // This file is part of Qtah. //-// Copyright 2015-2017 The Qtah Authors.+// Copyright 2015-2018 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/wrap_qgridlayout.hpp view
@@ -3,7 +3,7 @@  // This file is part of Qtah. //-// Copyright 2015-2017 The Qtah Authors.+// Copyright 2015-2018 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/wrap_qimage.cpp view
@@ -1,6 +1,6 @@ // This file is part of Qtah. //-// Copyright 2015-2017 The Qtah Authors.+// Copyright 2015-2018 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by@@ -79,6 +79,11 @@     return new QImage(fileName, formatStr.c_str()); } +QImage* fromData(const QByteArray& data, const QString& format) {+    std::string formatStr(format.toStdString());+    return new QImage(QImage::fromData(data, formatStr.c_str()));+}+ QImage* fromData(const uchar* data, int len, const QString& format) {     std::string formatStr(format.toStdString());     return new QImage(QImage::fromData(data, len, formatStr.c_str()));@@ -87,6 +92,11 @@ bool load(QImage& image, const QString& fileName, const QString& format) {     std::string formatStr(format.toStdString());     return image.load(fileName, formatStr.c_str());+}++bool loadFromData(QImage& image, const QByteArray& data, const QString& format) {+    std::string formatStr(format.toStdString());+    return image.loadFromData(data, formatStr.c_str()); }  bool loadFromData(QImage& image, const uchar* data, int len, const QString& format) {
cpp/wrap_qimage.hpp view
@@ -3,7 +3,7 @@  // This file is part of Qtah. //-// Copyright 2015-2017 The Qtah Authors.+// Copyright 2015-2018 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by@@ -18,6 +18,7 @@ // You should have received a copy of the GNU Lesser General Public License // along with this program.  If not, see <http://www.gnu.org/licenses/>. +#include <QByteArray> #include <QImage> #include <QtGlobal> #include "b_callback.hpp"@@ -35,7 +36,11 @@  QImage* fromData(const uchar*, int, const QString&); +QImage* fromData(const QByteArray&, const QString&);+ bool load(QImage&, const QString&, const QString&);++bool loadFromData(QImage&, const QByteArray&, const QString&);  bool loadFromData(QImage&, const uchar*, int, const QString&); 
cpp/wrap_qstring.cpp view
@@ -1,6 +1,6 @@ // This file is part of Qtah. //-// Copyright 2015-2017 The Qtah Authors.+// Copyright 2015-2018 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
cpp/wrap_qstring.hpp view
@@ -3,7 +3,7 @@  // This file is part of Qtah. //-// Copyright 2015-2017 The Qtah Authors.+// Copyright 2015-2018 The Qtah Authors. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by
qtah-cpp-qt5.cabal view
@@ -1,12 +1,12 @@ name: qtah-cpp-qt5-version: 0.3.1+version: 0.4.0 synopsis: Qt bindings for Haskell - C++ library homepage: http://khumba.net/projects/qtah license: LGPL-3 license-files: LICENSE.GPL, LICENSE.LGPL author: Bryan Gardiner <bog@khumba.net> maintainer: Bryan Gardiner <bog@khumba.net>-copyright: Copyright 2015-2017 The Qtah Authors.+copyright: Copyright 2015-2018 The Qtah Authors. category: Graphics build-type: Custom -- Cabal 1.20 is needed for BuildFlags.buildNumJobs.@@ -41,6 +41,14 @@   exposed-modules: Graphics.UI.Qtah.NothingToSeeHere   build-depends:       base >=4 && <5-    , process >=1.2 && <1.5-    , qtah-generator >=0.3 && <0.4+    , process >=1.2 && <1.7+    , qtah-generator >=0.4 && <0.5   ghc-options: -W -fwarn-incomplete-patterns -fwarn-unused-do-bind++custom-setup+  setup-depends:+      base+    , Cabal+    , directory+    , filepath+    , process
src/Graphics/UI/Qtah/NothingToSeeHere.hs view
@@ -1,6 +1,6 @@ -- This file is part of Qtah. ----- Copyright 2015-2017 The Qtah Authors.+-- Copyright 2015-2018 The Qtah Authors. -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU Lesser General Public License as published by