Commit 43eaad2e authored by Roman 3237465's avatar Roman 3237465

added Qt graphics support

parent 5f6eab34
......@@ -45,6 +45,7 @@
/qtah/src/Graphics/UI/Qtah/Gui/Q*
/qtah/src/Graphics/UI/Qtah/Internal/Callback.hs
/qtah/src/Graphics/UI/Qtah/Internal/EventListener.hs
/qtah/src/Graphics/UI/Qtah/Internal/SceneEventListener.hs
/qtah/src/Graphics/UI/Qtah/Internal/Listener.hs
/qtah/src/Graphics/UI/Qtah/Std.hs
/qtah/src/Graphics/UI/Qtah/Widgets/Q*
......@@ -56,6 +57,11 @@
/qtah-qt?/src/Graphics/UI/Qtah/Gui/Q*
/qtah-qt?/src/Graphics/UI/Qtah/Internal/Callback.hs
/qtah-qt?/src/Graphics/UI/Qtah/Internal/EventListener.hs
/qtah-qt?/src/Graphics/UI/Qtah/Internal/SceneEventListener.hs
/qtah-qt?/src/Graphics/UI/Qtah/Internal/Listener.hs
/qtah-qt?/src/Graphics/UI/Qtah/Std.hs
/qtah-qt?/src/Graphics/UI/Qtah/Widgets/Q*
*.*~
.stack-work
......@@ -46,6 +46,30 @@ private:
int* deleted_;
};
class SceneEventListener : public QGraphicsItem {
public:
SceneEventListener(CallbackPtrQGraphicsItemPtrQEventBool callback, int* deletedPtr) :
callback_(callback), deleted_(deletedPtr) {}
~SceneEventListener() {
if (deleted_) {
*deleted_ = 1;
}
}
virtual QRectF boundingRect() const { return QRectF(); }
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0) { return; }
virtual bool sceneEventFilter(QGraphicsItem* receiver, QEvent* event) {
return callback_(receiver, event);
}
private:
CallbackPtrQGraphicsItemPtrQEventBool callback_;
int* deleted_;
};
} // namespace event
} // namespace qtah
......
......@@ -26,5 +26,5 @@ executable qtah-examples
, filepath >=1.0 && <1.5
, hoppy-runtime >=0.3 && <0.4
, qtah >=0.2 && <0.3
ghc-options: -W -fwarn-incomplete-patterns -fwarn-unused-do-bind
ghc-options: -W -fwarn-incomplete-patterns -fwarn-unused-do-bind -dynamic
default-language: Haskell2010
......@@ -76,12 +76,14 @@ executable qtah-generator
, Graphics.UI.Qtah.Generator.Interface.Core.QString
, Graphics.UI.Qtah.Generator.Interface.Core.QStringList
, Graphics.UI.Qtah.Generator.Interface.Core.QStringListModel
, Graphics.UI.Qtah.Generator.Interface.Core.QTimer
, Graphics.UI.Qtah.Generator.Interface.Core.QTimerEvent
, Graphics.UI.Qtah.Generator.Interface.Core.QVariant
, Graphics.UI.Qtah.Generator.Interface.Core.QVector
, Graphics.UI.Qtah.Generator.Interface.Core.Types
, Graphics.UI.Qtah.Generator.Interface.Gui
, Graphics.UI.Qtah.Generator.Interface.Gui.QActionEvent
, Graphics.UI.Qtah.Generator.Interface.Gui.QBrush
, Graphics.UI.Qtah.Generator.Interface.Gui.QClipboard
, Graphics.UI.Qtah.Generator.Interface.Gui.QCloseEvent
, Graphics.UI.Qtah.Generator.Interface.Gui.QColor
......@@ -95,10 +97,14 @@ executable qtah-generator
, Graphics.UI.Qtah.Generator.Interface.Gui.QIntValidator
, Graphics.UI.Qtah.Generator.Interface.Gui.QKeyEvent
, Graphics.UI.Qtah.Generator.Interface.Gui.QMouseEvent
, Graphics.UI.Qtah.Generator.Interface.Gui.QPainter
, Graphics.UI.Qtah.Generator.Interface.Gui.QPainterPath
, Graphics.UI.Qtah.Generator.Interface.Gui.QPen
, Graphics.UI.Qtah.Generator.Interface.Gui.QPolygon
, Graphics.UI.Qtah.Generator.Interface.Gui.QPolygonF
, Graphics.UI.Qtah.Generator.Interface.Gui.QRegion
, Graphics.UI.Qtah.Generator.Interface.Gui.QShowEvent
, Graphics.UI.Qtah.Generator.Interface.Gui.QTransform
, Graphics.UI.Qtah.Generator.Interface.Gui.QValidator
, Graphics.UI.Qtah.Generator.Interface.Gui.QWheelEvent
, Graphics.UI.Qtah.Generator.Interface.Imports
......@@ -106,8 +112,10 @@ executable qtah-generator
, Graphics.UI.Qtah.Generator.Interface.Internal.Callback
, Graphics.UI.Qtah.Generator.Interface.Internal.EventListener
, Graphics.UI.Qtah.Generator.Interface.Internal.Listener
, Graphics.UI.Qtah.Generator.Interface.Internal.SceneEventListener
, Graphics.UI.Qtah.Generator.Interface.Widgets
, Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractButton
, Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractGraphicsShapeItem
, Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractScrollArea
, Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractSlider
, Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractSpinBox
......@@ -124,6 +132,15 @@ executable qtah-generator
, Graphics.UI.Qtah.Generator.Interface.Widgets.QFileDialog
, Graphics.UI.Qtah.Generator.Interface.Widgets.QFormLayout
, Graphics.UI.Qtah.Generator.Interface.Widgets.QFrame
, Graphics.UI.Qtah.Generator.Interface.Widgets.QGraphicsEllipseItem
, Graphics.UI.Qtah.Generator.Interface.Widgets.QGraphicsItem
, Graphics.UI.Qtah.Generator.Interface.Widgets.QGraphicsPolygonItem
, Graphics.UI.Qtah.Generator.Interface.Widgets.QGraphicsRectItem
, Graphics.UI.Qtah.Generator.Interface.Widgets.QGraphicsScene
, Graphics.UI.Qtah.Generator.Interface.Widgets.QGraphicsSceneEvent
, Graphics.UI.Qtah.Generator.Interface.Widgets.QGraphicsSceneMouseEvent
, Graphics.UI.Qtah.Generator.Interface.Widgets.QGraphicsSceneWheelEvent
, Graphics.UI.Qtah.Generator.Interface.Widgets.QGraphicsView
, Graphics.UI.Qtah.Generator.Interface.Widgets.QGridLayout
, Graphics.UI.Qtah.Generator.Interface.Widgets.QGroupBox
, Graphics.UI.Qtah.Generator.Interface.Widgets.QHBoxLayout
......
......@@ -39,6 +39,7 @@ import qualified Graphics.UI.Qtah.Generator.Interface.Core.QSizeF as QSizeF
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QString as QString
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QStringList as QStringList
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QStringListModel as QStringListModel
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QTimer as QTimer
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QTimerEvent as QTimerEvent
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QVariant as QVariant
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QVector as QVector
......@@ -71,6 +72,7 @@ modules =
, QString.aModule
, QStringList.aModule
, QStringListModel.aModule
, QTimer.aModule
, QTimerEvent.aModule
, QVariant.aModule
, Types.aModule
......
......@@ -36,6 +36,7 @@ import Foreign.Hoppy.Generator.Types (boolT, intT, objT, ptrT, voidT)
import Foreign.Hoppy.Generator.Version (collect, just, test)
import Graphics.UI.Qtah.Generator.Flags (qtVersion)
import {-# SOURCE #-} Graphics.UI.Qtah.Generator.Interface.Internal.Listener
(c_ListenerPtrQObject, c_ListenerQString)
import {-# SOURCE #-} Graphics.UI.Qtah.Generator.Interface.Core.QList (c_QListQObject)
import Graphics.UI.Qtah.Generator.Interface.Core.QEvent (c_QEvent)
import Graphics.UI.Qtah.Generator.Interface.Core.QString (c_QString)
......
......@@ -38,7 +38,7 @@ import Foreign.Hoppy.Generator.Spec.ClassFeature (
ClassFeature (Assignable, Copyable, Equatable),
classAddFeatures,
)
import Foreign.Hoppy.Generator.Types (boolT, objT, voidT)
import Foreign.Hoppy.Generator.Types (boolT, objT, voidT, doubleT)
import Foreign.Hoppy.Generator.Version (collect, just, test)
import Graphics.UI.Qtah.Generator.Flags (qtVersion)
import Graphics.UI.Qtah.Generator.Interface.Core.QMarginsF (c_QMarginsF)
......@@ -64,6 +64,7 @@ c_QRectF =
makeClass (ident "QRectF") Nothing [] $
collect
[ just $ mkCtor "newNull" []
, just $ mkCtor "newCoord" [doubleT, doubleT, doubleT, doubleT]
, test (qtVersion >= [4, 3]) $ mkCtor "newFromPoints" [objT c_QPointF, objT c_QPointF]
, just $ mkCtor "newWithPointAndSize" [objT c_QPointF, objT c_QSizeF]
, just $ mkCtor "newWithRect" [objT c_QRect]
......
-- This file is part of Qtah.
--
-- Copyright 2016-2017 Bryan Gardiner <bog@khumba.net>
--
-- 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
-- the Free Software Foundation, either version 3 of the License, 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 Lesser General Public License for more details.
--
-- 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/>.
module Graphics.UI.Qtah.Generator.Interface.Core.QTimer (
aModule,
c_QTimer
) where
import Foreign.Hoppy.Generator.Spec (
Export(ExportClass),
addReqIncludes,
classSetEntityPrefix,
ident,
includeStd,
makeClass,
mkMethod,
mkConstMethod,
mkCtor,
)
import Foreign.Hoppy.Generator.Types (boolT, intT, voidT)
import Graphics.UI.Qtah.Generator.Interface.Internal.Listener (c_Listener)
import Graphics.UI.Qtah.Generator.Interface.Core.QObject (c_QObject)
import Graphics.UI.Qtah.Generator.Module (AModule (AQtModule), makeQtModule)
import Graphics.UI.Qtah.Generator.Types
{-# ANN module "HLint: ignore Use camelCase" #-}
aModule =
AQtModule $
makeQtModule ["Core", "QTimer"]
[ QtExport $ ExportClass c_QTimer
, QtExportSignal s_timeout
]
c_QTimer =
addReqIncludes [includeStd "QTimer"] $
classSetEntityPrefix "" $
makeClass (ident "QTimer") Nothing [c_QObject]
[ mkCtor "new" []
, mkConstMethod "interval" [] intT
-- , mkConstMethod "intervalAsDuration" [] $ objT c_std::chrono::milliseconds
, mkConstMethod "isActive" [] boolT
, mkConstMethod "isSingleShot" [] boolT
, mkConstMethod "remainingTime" [] intT
-- , mkConstMethod "remainingTimeAsDuration" [] $ objT c_std::chrono::milliseconds
, mkMethod "setInterval" [intT] voidT
-- , mkMethod' "setInterval" "setInterval" [objT c_std::chrono::milliseconds] voidT
, mkMethod "setSingleShot" [boolT] voidT
-- , mkMethod "setTimerType" [objT c_Qt::TimerType] voidT
, mkMethod "start" [intT] voidT
, mkConstMethod "timerId" [] intT
-- , mkConstMethod "timerType" [] $ objT c_Qt::TimerType
]
s_timeout = makeSignal c_QTimer "timeout" c_Listener
......@@ -58,6 +58,9 @@ module Graphics.UI.Qtah.Generator.Interface.Core.Types (
bs_WindowStates,
e_WindowType,
bs_WindowFlags,
e_MouseEventFlag_version,
e_MouseEventSource_version,
e_ScrollPhase_version
) where
import Data.Bits ((.|.))
......
......@@ -18,6 +18,7 @@
module Graphics.UI.Qtah.Generator.Interface.Gui (modules) where
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QActionEvent as QActionEvent
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QBrush as QBrush
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QClipboard as QClipboard
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QCloseEvent as QCloseEvent
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QColor as QColor
......@@ -31,10 +32,14 @@ import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QInputEvent as QInputE
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QIntValidator as QIntValidator
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QKeyEvent as QKeyEvent
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QMouseEvent as QMouseEvent
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QPainter as QPainter
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QPainterPath as QPainterPath
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QPen as QPen
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QPolygon as QPolygon
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QPolygonF as QPolygonF
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QRegion as QRegion
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QShowEvent as QShowEvent
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QTransform as QTransform
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QValidator as QValidator
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QWheelEvent as QWheelEvent
import Graphics.UI.Qtah.Generator.Module (AModule)
......@@ -44,6 +49,7 @@ import Graphics.UI.Qtah.Generator.Module (AModule)
modules :: [AModule]
modules =
[ QActionEvent.aModule
, QBrush.aModule
, QClipboard.aModule
, QCloseEvent.aModule
, QColor.aModule
......@@ -57,10 +63,14 @@ modules =
, QIntValidator.aModule
, QKeyEvent.aModule
, QMouseEvent.aModule
, QPainter.aModule
, QPainterPath.aModule
, QPen.aModule
, QPolygon.aModule
, QPolygonF.aModule
, QRegion.aModule
, QShowEvent.aModule
, QTransform.aModule
, QValidator.aModule
, QWheelEvent.aModule
]
-- This file is part of Qtah.
--
-- Copyright 2016-2017 Bryan Gardiner <bog@khumba.net>
--
-- 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
-- the Free Software Foundation, either version 3 of the License, 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 Lesser General Public License for more details.
--
-- 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/>.
module Graphics.UI.Qtah.Generator.Interface.Gui.QBrush (
aModule,
c_QBrush,
) where
import Foreign.Hoppy.Generator.Spec (
Export (ExportClass),
addReqIncludes,
classSetConversionToGc,
classSetEntityPrefix,
ident,
includeStd,
makeClass,
mkCtor,
)
import Foreign.Hoppy.Generator.Spec.ClassFeature (
ClassFeature (Assignable, Copyable, Equatable),
classAddFeatures,
)
import Foreign.Hoppy.Generator.Types (objT)
import Graphics.UI.Qtah.Generator.Interface.Gui.QColor (c_QColor)
import Graphics.UI.Qtah.Generator.Module (AModule (AQtModule), makeQtModule)
import Graphics.UI.Qtah.Generator.Types
{-# ANN module "HLint: ignore Use camelCase" #-}
aModule =
AQtModule $
makeQtModule ["Gui", "QBrush"]
[ QtExport $ ExportClass c_QBrush ]
c_QBrush =
addReqIncludes [includeStd "QBrush"] $
classSetConversionToGc $
classAddFeatures [Assignable, Copyable, Equatable] $
classSetEntityPrefix "" $
makeClass (ident "QBrush") Nothing [] $
[ mkCtor "new" []
, mkCtor "newWithColor" [objT c_QColor]
]
-- This file is part of Qtah.
--
-- Copyright 2016-2017 Bryan Gardiner <bog@khumba.net>
--
-- 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
-- the Free Software Foundation, either version 3 of the License, 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 Lesser General Public License for more details.
--
-- 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/>.
module Graphics.UI.Qtah.Generator.Interface.Gui.QPainter (
aModule,
c_QPainter,
e_RenderHint,
bs_RenderHints,
) where
import Foreign.Hoppy.Generator.Spec (
Export (ExportClass, ExportEnum, ExportBitspace),
addReqIncludes,
classSetEntityPrefix,
ident,
ident1,
includeStd,
makeClass,
mkCtor,
mkMethod,
)
import Foreign.Hoppy.Generator.Types (voidT, enumT)
import Foreign.Hoppy.Generator.Version (collect, just)
-- import Graphics.UI.Qtah.Generator.Flags (qtVersion)
import Graphics.UI.Qtah.Generator.Module (AModule (AQtModule), makeQtModule)
import Graphics.UI.Qtah.Generator.Types
{-# ANN module "HLint: ignore Use camelCase" #-}
aModule =
AQtModule $
makeQtModule ["Gui", "QPainter"] $
(QtExport $ ExportClass c_QPainter) :
(QtExport $ ExportEnum e_RenderHint) :
(QtExport $ ExportBitspace bs_RenderHints) :
[]
c_QPainter =
addReqIncludes [includeStd "QPainter"] $
classSetEntityPrefix "" $
makeClass (ident "QPainter") Nothing [] $
collect
[ just $ mkCtor "new" []
, just $ mkMethod "setRenderHint" [enumT e_RenderHint] voidT
]
(e_RenderHint, bs_RenderHints) =
makeQtEnumBitspace (ident1 "QPainter" "RenderHint") "RenderHints" [includeStd "QPainter"] $
[ (0x01, ["antialiasing"])
, (0x02, ["text","antialiasing"])
, (0x04, ["smooth","pixmap","transform"])
, (0x08, ["high","quality","antialiasing"])
, (0x10, ["non","cosmetic","default","pen"])
, (0x20, ["qt4","compatible","painting"])
]
-- This file is part of Qtah.
--
-- Copyright 2016-2017 Bryan Gardiner <bog@khumba.net>
--
-- 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
-- the Free Software Foundation, either version 3 of the License, 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 Lesser General Public License for more details.
--
-- 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/>.
module Graphics.UI.Qtah.Generator.Interface.Gui.QPainterPath (
aModule,
c_QPainterPath,
) where
import Foreign.Hoppy.Generator.Spec (
Export (ExportClass),
addReqIncludes,
classSetConversionToGc,
classSetEntityPrefix,
ident,
includeStd,
makeClass,
mkCtor,
mkMethod',
)
import Foreign.Hoppy.Generator.Spec.ClassFeature (
ClassFeature (Assignable, Copyable, Equatable),
classAddFeatures,
)
import Foreign.Hoppy.Generator.Types (voidT, doubleT)
import Foreign.Hoppy.Generator.Version (collect, just)
-- import Graphics.UI.Qtah.Generator.Flags (qtVersion)
import Graphics.UI.Qtah.Generator.Module (AModule (AQtModule), makeQtModule)
import Graphics.UI.Qtah.Generator.Types
{-# ANN module "HLint: ignore Use camelCase" #-}
aModule =
AQtModule $
makeQtModule ["Gui", "QPainterPath"]
[ QtExport $ ExportClass c_QPainterPath ]
c_QPainterPath =
addReqIncludes [includeStd "QPainterPath"] $
classSetConversionToGc $
classAddFeatures [Assignable, Copyable, Equatable] $
classSetEntityPrefix "" $
makeClass (ident "QPainterPath") Nothing [] $
collect
[ just $ mkCtor "new" []
, just $ mkMethod' "addRect" "addRectRaw" [doubleT, doubleT, doubleT, doubleT] voidT
]
-- This file is part of Qtah.
--
-- Copyright 2016-2017 Bryan Gardiner <bog@khumba.net>
--
-- 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
-- the Free Software Foundation, either version 3 of the License, 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 Lesser General Public License for more details.
--
-- 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/>.
module Graphics.UI.Qtah.Generator.Interface.Gui.QPen (
aModule,
c_QPen,
) where
import Foreign.Hoppy.Generator.Spec (
Export (ExportClass),
addReqIncludes,
classSetConversionToGc,
classSetEntityPrefix,
ident,
includeStd,
makeClass,
mkCtor,
)
import Foreign.Hoppy.Generator.Spec.ClassFeature (
ClassFeature (Assignable, Copyable, Equatable),
classAddFeatures,
)
import Foreign.Hoppy.Generator.Types (objT)
import Graphics.UI.Qtah.Generator.Interface.Gui.QColor (c_QColor)
import Graphics.UI.Qtah.Generator.Module (AModule (AQtModule), makeQtModule)
import Graphics.UI.Qtah.Generator.Types
{-# ANN module "HLint: ignore Use camelCase" #-}
aModule =
AQtModule $
makeQtModule ["Gui", "QPen"]
[ QtExport $ ExportClass c_QPen ]
c_QPen =
addReqIncludes [includeStd "QPen"] $
classSetConversionToGc $
classAddFeatures [Assignable, Copyable, Equatable] $
classSetEntityPrefix "" $
makeClass (ident "QPen") Nothing [] $
[ mkCtor "new" []
, mkCtor "newWithColor" [objT c_QColor]
]
......@@ -17,6 +17,7 @@
module Graphics.UI.Qtah.Generator.Interface.Gui.QPolygonF (
aModule,
c_QPolygonF
) where
import Foreign.Hoppy.Generator.Spec (
......
-- This file is part of Qtah.
--
-- Copyright 2016-2017 Bryan Gardiner <bog@khumba.net>
--
-- 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
-- the Free Software Foundation, either version 3 of the License, 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 Lesser General Public License for more details.
--
-- 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/>.
module Graphics.UI.Qtah.Generator.Interface.Gui.QTransform (
aModule,
c_QTransform,
) where
import Foreign.Hoppy.Generator.Spec (
Export (ExportClass),
addReqIncludes,
classSetConversionToGc,
classSetEntityPrefix,
ident,
includeStd,
makeClass,
mkCtor,
)
import Foreign.Hoppy.Generator.Spec.ClassFeature (
ClassFeature (Assignable, Copyable, Equatable),
classAddFeatures,
)
import Foreign.Hoppy.Generator.Types (doubleT)
import Graphics.UI.Qtah.Generator.Module (AModule (AQtModule), makeQtModule)
import Graphics.UI.Qtah.Generator.Types
{-# ANN module "HLint: ignore Use camelCase" #-}
aModule =
AQtModule $
makeQtModule ["Gui", "QTransform"]
[ QtExport $ ExportClass c_QTransform ]
c_QTransform =
addReqIncludes [includeStd "QTransform"] $
classSetConversionToGc $
classAddFeatures [Assignable, Copyable, Equatable] $
classSetEntityPrefix "" $
makeClass (ident "QTransform") Nothing [] $
[ mkCtor "new" [doubleT, doubleT, doubleT, doubleT, doubleT, doubleT]
]
......@@ -24,6 +24,7 @@ module Graphics.UI.Qtah.Generator.Interface.Imports (
importForForeign,
importForForeignC,
importForPrelude,
importForSceneEvent,
importForSignal,
importForRuntime,
) where
......@@ -45,6 +46,9 @@ importForForeignC = hsQualifiedImport "Foreign.C" "QtahFC"
importForPrelude :: HsImportSet
importForPrelude = hsQualifiedImport "Prelude" "QtahP"
importForSceneEvent :: HsImportSet
importForSceneEvent = hsQualifiedImport "Graphics.UI.Qtah.SceneEvent" "QtahSceneEvent"
importForSignal :: HsImportSet
importForSignal = hsQualifiedImport "Graphics.UI.Qtah.Signal" "QtahSignal"
......
......@@ -20,6 +20,7 @@ module Graphics.UI.Qtah.Generator.Interface.Internal (modules) where
import qualified Graphics.UI.Qtah.Generator.Interface.Internal.Callback as Callback
import qualified Graphics.UI.Qtah.Generator.Interface.Internal.EventListener as EventListener
import qualified Graphics.UI.Qtah.Generator.Interface.Internal.Listener as Listener
import qualified Graphics.UI.Qtah.Generator.Interface.Internal.SceneEventListener as SceneEventListener
import Graphics.UI.Qtah.Generator.Module (AModule)
{-# ANN module "HLint: ignore Use camelCase" #-}
......@@ -29,4 +30,5 @@ modules =
[ Callback.aModule
, EventListener.aModule
, Listener.aModule
, SceneEventListener.aModule
]
......@@ -35,12 +35,9 @@ import Graphics.UI.Qtah.Generator.Interface.Core.QSize (c_QSize)
import Graphics.UI.Qtah.Generator.Interface.Core.QString (c_QString)
import Graphics.UI.Qtah.Generator.Interface.Core.QVector (c_QVectorInt)
import {-# SOURCE #-} qualified Graphics.UI.Qtah.Generator.Interface.Gui.QClipboard as QClipboard
import {-# SOURCE #-} Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractButton (
c_QAbstractButton,
)
import {-# SOURCE #-} Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractSlider (
e_SliderAction,
)
import {-# SOURCE #-} Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractButton (c_QAbstractButton)
import {-# SOURCE #-} Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractSlider (e_SliderAction)
import Graphics.UI.Qtah.Generator.Interface.Widgets.QGraphicsItem (c_QGraphicsItem)
import {-# SOURCE #-} Graphics.UI.Qtah.Generator.Interface.Widgets.QAction (c_QAction)
import {-# SOURCE #-} Graphics.UI.Qtah.Generator.Interface.Widgets.QWidget (c_QWidget)
import Graphics.UI.Qtah.Generator.Module (AModule (AHoppyModule))
......@@ -60,6 +57,7 @@ aModule =
, ExportCallback cb_PtrQAbstractButtonVoid
, ExportCallback cb_PtrQAbstractButtonBoolVoid
, ExportCallback cb_PtrQActionVoid
, ExportCallback cb_PtrQGraphicsItemPtrQEventBool
, ExportCallback cb_PtrQObjectPtrQEventBool
, ExportCallback cb_PtrQObjectVoid
, ExportCallback cb_PtrQWidgetPtrQWidgetVoid
......@@ -106,6 +104,10 @@ cb_PtrQActionVoid =
makeCallback (toExtName "CallbackPtrQActionVoid")
[ptrT $ objT c_QAction] voidT
cb_PtrQGraphicsItemPtrQEventBool =
makeCallback (toExtName "CallbackPtrQGraphicsItemPtrQEventBool")
[ptrT $ objT c_QGraphicsItem, ptrT $ objT c_QEvent] boolT
cb_PtrQObjectPtrQEventBool =
makeCallback (toExtName "CallbackPtrQObjectPtrQEventBool")
[ptrT $ objT c_QObject, ptrT $ objT c_QEvent] boolT
......
-- This file is part of Qtah.
--
-- Copyright 2016-2017 Bryan Gardiner <bog@khumba.net>
--
-- 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
-- the Free Software Foundation, either version 3 of the License, 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 Lesser General Public License for more details.
--
-- 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/>.
module Graphics.UI.Qtah.Generator.Interface.Internal.SceneEventListener (
aModule,
) where
import Foreign.Hoppy.Generator.Spec (
Export (ExportClass),
addReqIncludes,
classSetEntityPrefix,