Add QCursor; fix QWidget::setCursor() argument type.

parent bd1cf7bc
......@@ -95,6 +95,7 @@ executable qtah-generator
, Graphics.UI.Qtah.Generator.Interface.Gui.QClipboard
, Graphics.UI.Qtah.Generator.Interface.Gui.QCloseEvent
, Graphics.UI.Qtah.Generator.Interface.Gui.QColor
, Graphics.UI.Qtah.Generator.Interface.Gui.QCursor
, Graphics.UI.Qtah.Generator.Interface.Gui.QDoubleValidator
, Graphics.UI.Qtah.Generator.Interface.Gui.QEnterEvent
, Graphics.UI.Qtah.Generator.Interface.Gui.QExposeEvent
......
......@@ -22,6 +22,7 @@ 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
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QCursor as QCursor
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QDoubleValidator as QDoubleValidator
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QEnterEvent as QEnterEvent
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QExposeEvent as QExposeEvent
......@@ -67,6 +68,7 @@ modules =
, QClipboard.aModule
, QCloseEvent.aModule
, QColor.aModule
, QCursor.aModule
, QDoubleValidator.aModule
, QEnterEvent.aModule
, QExposeEvent.aModule
......
-- This file is part of Qtah.
--
-- 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
-- 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.QCursor (
aModule,
c_QCursor,
) where
import Foreign.Hoppy.Generator.Spec (
Export (ExportClass),
addReqIncludes,
classSetConversionToGc,
classSetEntityPrefix,
ident,
includeStd,
makeClass,
mkCtor,
mkStaticMethod,
mkStaticMethod',
)
import Foreign.Hoppy.Generator.Spec.ClassFeature (
ClassFeature (Assignable, Copyable, Equatable),
classAddFeatures,
)
import Foreign.Hoppy.Generator.Types (enumT, intT, objT, voidT)
import Foreign.Hoppy.Generator.Version (collect, just)
import Graphics.UI.Qtah.Generator.Flags (qtVersion)
import Graphics.UI.Qtah.Generator.Interface.Core.QPoint (c_QPoint)
import Graphics.UI.Qtah.Generator.Interface.Core.Types (e_CursorShape)
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", "QCursor"]
[ QtExport $ ExportClass c_QCursor ]
c_QCursor =
addReqIncludes [includeStd "QCursor"] $
classSetConversionToGc $
classAddFeatures (if qtVersion >= [5, 11]
then [Assignable, Copyable, Equatable]
else [Assignable, Copyable]) $
classSetEntityPrefix "" $
makeClass (ident "QCursor") Nothing [] $
collect
[ just $ mkCtor "new" []
, just $ mkCtor "newWithCursorShape" [enumT e_CursorShape]
-- TODO Methods.
-- Static methods.
, just $ mkStaticMethod "pos" [] $ objT c_QPoint
-- TODO QPoint pos(const QScreen*)
, just $ mkStaticMethod "setPos" [objT c_QPoint] voidT
, just $ mkStaticMethod' "setPos" "setPosRaw" [intT, intT] voidT
-- TODO void setPos(QScreen*, int, int)
-- TODO void setPos(QScreen*, const QPoint&)
]
......@@ -55,6 +55,7 @@ import Graphics.UI.Qtah.Generator.Interface.Core.Types (
e_WindowType,
qreal,
)
import Graphics.UI.Qtah.Generator.Interface.Gui.QCursor (c_QCursor)
import Graphics.UI.Qtah.Generator.Interface.Gui.QIcon (c_QIcon)
import Graphics.UI.Qtah.Generator.Interface.Gui.QRegion (c_QRegion)
import Graphics.UI.Qtah.Generator.Interface.Gui.QSurface (c_QSurface, e_SurfaceType)
......@@ -99,7 +100,7 @@ c_QWindow =
, just $ mkMethod "close" [] voidT
, just $ mkConstMethod "contentOrientation" [] $ enumT e_ScreenOrientation
, just $ mkMethod "create" [] voidT
-- TODO mkProp "cursor" $ objT c_QCursor
, just $ mkProp "cursor" $ objT c_QCursor
, just $ mkMethod "destroy" [] voidT
, just $ mkConstMethod "devicePixelRatio" [] qreal
, just $ mkProp "filePath" $ objT c_QString
......
......@@ -32,10 +32,11 @@ import Foreign.Hoppy.Generator.Spec (
ident1,
includeStd,
makeClass,
mkMethod,
mkConstMethod,
mkConstMethod',
mkMethod,
mkMethod',
mkConstMethod'
mkProp,
)
import Foreign.Hoppy.Generator.Types (voidT, objT, ptrT, boolT, constT, intT)
import Foreign.Hoppy.Generator.Version (collect, just, test)
......@@ -44,6 +45,7 @@ import Graphics.UI.Qtah.Generator.Interface.Core.Types (qreal)
import Graphics.UI.Qtah.Generator.Interface.Core.QPointF (c_QPointF)
import Graphics.UI.Qtah.Generator.Interface.Core.QRectF (c_QRectF)
import Graphics.UI.Qtah.Generator.Interface.Core.QString (c_QString)
import Graphics.UI.Qtah.Generator.Interface.Gui.QCursor (c_QCursor)
-- import Graphics.UI.Qtah.Generator.Interface.Gui.QPolygonF (c_QPolygonF)
import Graphics.UI.Qtah.Generator.Interface.Gui.QPainterPath (c_QPainterPath)
-- import Graphics.UI.Qtah.Generator.Interface.Gui.QTransform (c_QTransform)
......@@ -95,7 +97,7 @@ c_QGraphicsItem =
, mkConstMethod "commonAncestorItem" [ptrT $ constT $ objT c_QGraphicsItem] $
ptrT $ objT c_QGraphicsItem
, mkConstMethod "contains" [objT c_QPointF] boolT
-- TODO mkConstMethod "cursor" [] $ objT c_QCursor
, mkProp "cursor" $ objT c_QCursor
-- TODO mkConstMethod "data" [intT] $ objT c_QVariant
-- TODO mkConstMethod "deviceTransform" [objT c_QTransform] $ objT c_QTransform
, mkConstMethod "effectiveOpacity" [] qreal
......@@ -270,7 +272,6 @@ c_QGraphicsItem =
, mkMethod "setBoundingRegionGranularity" [qreal] voidT
-- TODO mkMethod "setCacheMode" [objT c_CacheMode] voidT
-- TODO mkMethod' "setCacheMode" "setCacheModeAll" [objT c_CacheMode, objT c_QSize] voidT
-- TODO mkMethod "setCursor" [objT c_QCursor] voidT
-- TODO mkMethod "setData" [intT, objT c_QVariant] voidT
, mkMethod "setEnabled" [boolT] voidT
, mkMethod "setFiltersChildEvents" [boolT] voidT
......
......@@ -49,7 +49,6 @@ import Graphics.UI.Qtah.Generator.Interface.Core.Types (
bs_WindowFlags,
bs_WindowStates,
e_ContextMenuPolicy,
e_CursorShape,
e_LayoutDirection,
e_WindowModality,
e_WindowType,
......@@ -58,6 +57,7 @@ import Graphics.UI.Qtah.Generator.Interface.Core.Types (
import Graphics.UI.Qtah.Generator.Interface.Core.QPalette (
e_ColorRole
)
import Graphics.UI.Qtah.Generator.Interface.Gui.QCursor (c_QCursor)
import Graphics.UI.Qtah.Generator.Interface.Gui.QFont (c_QFont)
import Graphics.UI.Qtah.Generator.Interface.Gui.QIcon (c_QIcon)
import Graphics.UI.Qtah.Generator.Interface.Gui.QPaintDevice (c_QPaintDevice)
......@@ -110,8 +110,7 @@ c_QWidget =
, just $ mkConstMethod "contentsMargins" [] $ objT c_QMargins
, just $ mkConstMethod "contentsRect" [] $ objT c_QRect
, just $ mkProp "contextMenuPolicy" $ enumT e_ContextMenuPolicy
-- TODO cursor property made proper
, just $ mkMethod "setCursor" [enumT e_CursorShape] voidT
, just $ mkProp "cursor" $ objT c_QCursor
-- TODO effectiveWinId
, just $ mkConstMethod "ensurePolished" [] voidT
-- TODO find
......@@ -131,7 +130,7 @@ c_QWidget =
-- TODO grabGesture
, just $ mkMethod "grabKeyboard" [] voidT
, just $ mkMethod "grabMouse" [] voidT
-- TODO grabMouse(const QCursor&)
, just $ mkMethod' "grabMouse" "grabMouseWithCursor" [objT c_QCursor] voidT
-- TODO grabShortcut
-- TODO graphicsEffect
-- TODO graphicsProxyWidget
......
......@@ -85,6 +85,7 @@ library
, Graphics.UI.Qtah.Gui.QClipboard
, Graphics.UI.Qtah.Gui.QCloseEvent
, Graphics.UI.Qtah.Gui.QColor
, Graphics.UI.Qtah.Gui.QCursor
, Graphics.UI.Qtah.Gui.QDoubleValidator
, Graphics.UI.Qtah.Gui.QEnterEvent
, Graphics.UI.Qtah.Gui.QExposeEvent
......@@ -252,6 +253,7 @@ library
, Graphics.UI.Qtah.Generated.Gui.QClipboard
, Graphics.UI.Qtah.Generated.Gui.QCloseEvent
, Graphics.UI.Qtah.Generated.Gui.QColor
, Graphics.UI.Qtah.Generated.Gui.QCursor
, Graphics.UI.Qtah.Generated.Gui.QDoubleValidator
, Graphics.UI.Qtah.Generated.Gui.QEnterEvent
, Graphics.UI.Qtah.Generated.Gui.QExposeEvent
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment