Unverified Commit 7547c281 authored by Bryan Gardiner's avatar Bryan Gardiner

Merge branch 'maksbotan-some-new-widgets'

!14
parents f9b1c1cb eb772bbc
......@@ -87,6 +87,7 @@ executable qtah-generator
, 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.QPalette
, Graphics.UI.Qtah.Generator.Interface.Core.Types
, Graphics.UI.Qtah.Generator.Interface.Gui
, Graphics.UI.Qtah.Generator.Interface.Gui.QActionEvent
......@@ -94,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
......@@ -153,6 +155,7 @@ executable qtah-generator
, Graphics.UI.Qtah.Generator.Interface.Widgets.QDial
, Graphics.UI.Qtah.Generator.Interface.Widgets.QDialog
, Graphics.UI.Qtah.Generator.Interface.Widgets.QDialogButtonBox
, Graphics.UI.Qtah.Generator.Interface.Widgets.QDockWidget
, Graphics.UI.Qtah.Generator.Interface.Widgets.QDoubleSpinBox
, Graphics.UI.Qtah.Generator.Interface.Widgets.QFileDialog
, Graphics.UI.Qtah.Generator.Interface.Widgets.QFormLayout
......@@ -200,6 +203,7 @@ executable qtah-generator
, Graphics.UI.Qtah.Generator.Interface.Widgets.QTextEdit
, Graphics.UI.Qtah.Generator.Interface.Widgets.QToolBar
, Graphics.UI.Qtah.Generator.Interface.Widgets.QToolBox
, Graphics.UI.Qtah.Generator.Interface.Widgets.QToolButton
, Graphics.UI.Qtah.Generator.Interface.Widgets.QTreeView
, Graphics.UI.Qtah.Generator.Interface.Widgets.QTreeWidget
, Graphics.UI.Qtah.Generator.Interface.Widgets.QVBoxLayout
......
......@@ -77,6 +77,8 @@ forEachListener() {
# Keep the includes in the C++ section up-to-date with the types used here.
$fn Bool "bool"
$fn DockWidgetArea "Qt::DockWidgetArea"
$fn DockWidgetAreas "Qt::DockWidgetAreas"
$fn Double "double"
$fn Int "int"
$fn IntBool "int|bool"
......@@ -94,6 +96,7 @@ forEachListener() {
$fn QAbstractSliderAction "QAbstractSlider::SliderAction"
$fn QClipboardMode "QClipboard::Mode"
$fn QDate "QDate"
$fn QDockWidgetFeatures "QDockWidget::DockWidgetFeatures"
$fn QModelIndex "QModelIndex"
$fn QModelIndexIntInt "QModelIndex|int|int"
$fn QModelIndexIntIntQModelIndexInt "QModelIndex|int|int|QModelIndex|int"
......@@ -137,6 +140,7 @@ if [[ -n $cppDir ]]; then
sayHpp '#include <QAbstractSlider>'
sayHpp '#include <QAction>'
sayHpp '#include <QClipboard>'
sayHpp '#include <QDockWidget>'
sayHpp '#include <QIcon>'
sayHpp '#include <QItemSelection>'
sayHpp '#include <QModelIndex>'
......
......@@ -35,6 +35,7 @@ import qualified Graphics.UI.Qtah.Generator.Interface.Core.QMargins as QMargins
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QMarginsF as QMarginsF
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QModelIndex as QModelIndex
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QObject as QObject
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QPalette as QPalette
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QPersistentModelIndex as QPersistentModelIndex
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QPoint as QPoint
import qualified Graphics.UI.Qtah.Generator.Interface.Core.QPointF as QPointF
......@@ -76,6 +77,7 @@ modules =
, QMarginsF.aModule
, QModelIndex.aModule
, QObject.aModule
, QPalette.aModule
, QPersistentModelIndex.aModule
, QPoint.aModule
, QPointF.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/>.
-- | Top-level bindings and bindings in the @Qt::@ namespace.
module Graphics.UI.Qtah.Generator.Interface.Core.QPalette (
aModule,
e_ColorRole
) where
import Foreign.Hoppy.Generator.Spec (Export (ExportEnum), Include, ident1, includeStd)
import Foreign.Hoppy.Generator.Version (collect, just)
import Graphics.UI.Qtah.Generator.Module (AModule(AQtModule), makeQtModule)
import Graphics.UI.Qtah.Generator.Types
{-# ANN module "HLint: ignore Use camelCase" #-}
qPaletteInclude :: [Include]
qPaletteInclude = [includeStd "Qt", includeStd "QPalette"]
aModule :: AModule
aModule = AQtModule $ makeQtModule ["Core", "QPalette"] exports
exports :: [QtExport]
exports =
QtExportSpecials :
(map QtExport . collect)
[ just $ ExportEnum e_ColorRole
]
-- TODO QPalette
e_ColorRole =
makeQtEnum (ident1 "QPalette" "ColorRole") qPaletteInclude
[ (10, ["window"])
, (0, ["window", "text"])
, (9, ["base"])
, (16, ["alternate", "base"])
, (18, ["tool", "tip", "base"])
, (19, ["tool", "tip", "text"])
, (6, ["text"])
, (1, ["button"])
, (8, ["button", "text"])
, (7, ["bright", "text"])
]
......@@ -149,6 +149,7 @@ c_QVariant =
, just $ mkConstMethod "toRectF" [] $ objT c_QRectF
, just $ mkConstMethod "toSize" [] $ objT c_QSize
, just $ mkConstMethod "toSizeF" [] $ objT c_QSizeF
, just $ mkConstMethod "toList" [] $ objT c_QListQVariant
, just $ mkConstMethod "toStringList" [] $ objT c_QStringList
, just $ mkConstMethod "toString" [] $ objT c_QString
, just $ mkConstMethod "toUInt" [] uintT
......
......@@ -22,6 +22,7 @@ module Graphics.UI.Qtah.Generator.Interface.Core.Types (
gluint,
e_AlignmentFlag,
bs_Alignment,
e_ArrowType,
e_AspectRatioMode,
e_BrushStyle,
e_CaseSensitivity,
......@@ -29,6 +30,9 @@ module Graphics.UI.Qtah.Generator.Interface.Core.Types (
e_ContextMenuPolicy,
e_Corner,
e_CursorMoveStyle,
e_CursorShape,
e_DockWidgetArea,
bs_DockWidgetAreas,
e_DropAction,
bs_DropActions,
e_EventPriority,
......@@ -111,6 +115,7 @@ exports =
(map QtExport . collect)
[ just $ ExportEnum e_AlignmentFlag
, just $ ExportBitspace bs_Alignment
, just $ ExportEnum e_ArrowType
, just $ ExportEnum e_AspectRatioMode
, just $ ExportEnum e_BrushStyle
, just $ ExportEnum e_CaseSensitivity
......@@ -118,6 +123,9 @@ exports =
, just $ ExportEnum e_ContextMenuPolicy
, just $ ExportEnum e_Corner
, just $ ExportEnum e_CursorMoveStyle
, just $ ExportEnum e_CursorShape
, just $ ExportEnum e_DockWidgetArea
, just $ ExportBitspace bs_DockWidgetAreas
, just $ ExportEnum e_DropAction
, just $ ExportBitspace bs_DropActions
, just $ ExportEnum e_EventPriority
......@@ -191,6 +199,15 @@ gluint = word32T
, (0x10, ["align", "absolute"])
]
e_ArrowType =
makeQtEnum (ident1 "Qt" "ArrowType") qtInclude
[ (0, ["no", "arrow"])
, (1, ["up", "arrow"])
, (2, ["down", "arrow"])
, (3, ["left", "arrow"])
, (4, ["right", "arrow"])
]
e_AspectRatioMode =
makeQtEnum (ident1 "Qt" "AspectRatioMode") qtInclude
[ (0, ["ignore", "aspect", "ratio"])
......@@ -258,6 +275,43 @@ e_CursorMoveStyle =
, (1, ["visual", "move", "style"])
]
e_CursorShape =
makeQtEnum (ident1 "Qt" "CursorShape") qtInclude
[ (0, ["arrow", "cursor"])
, (1, ["up", "arrow", "cursor"])
, (2, ["cross", "cursor"])
, (3, ["wait", "cursor"])
, (4, ["i", "beam", "cursor"])
, (5, ["size", "ver", "cursor"])
, (6, ["size", "hor", "cursor"])
, (7, ["size", "b", "diag", "cursor"])
, (8, ["size", "f", "diag", "cursor"])
, (9, ["size", "all", "cursor"])
, (10, ["blank", "cursor"])
, (11, ["split", "v", "cursor"])
, (12, ["split", "h", "cursor"])
, (13, ["pointing", "hand", "cursor"])
, (14, ["forbidden", "cursor"])
, (15, ["whats", "this", "cursor"])
, (16, ["busy", "cursor"])
, (17, ["open", "hand", "cursor"])
, (18, ["closed", "hand", "cursor"])
, (19, ["drag", "copy", "cursor"])
, (20, ["drag", "move", "cursor"])
, (21, ["drag", "link", "cursor"])
, (24, ["bitmap", "cursor"])
]
(e_DockWidgetArea, bs_DockWidgetAreas) =
makeQtEnumBitspace (ident1 "Qt" "DockWidgetArea") "DockWidgetAreas" qtInclude
[ (0x0, ["no", "dock", "widget", "area"])
, (0x1, ["left", "dock", "widget", "area"])
, (0x2, ["right", "dock", "widget", "area"])
, (0x4, ["top", "dock", "widget", "area"])
, (0x8, ["bottom", "dock", "widget", "area"])
, (0xf, ["all", "dock", "widget", "areas"])
]
(e_DropAction, bs_DropActions) =
makeQtEnumBitspace (ident1 "Qt" "DropAction") "DropActions" qtInclude
[ (0x0, ["ignore", "action"])
......
......@@ -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
......
......@@ -20,6 +20,8 @@ module Graphics.UI.Qtah.Generator.Interface.Internal.Callback where
import Foreign.Hoppy.Generator.Spec (
Callback,
Export (ExportCallback),
addReqIncludes,
includeStd,
makeCallback,
makeModule,
moduleAddExports,
......@@ -53,6 +55,8 @@ import Graphics.UI.Qtah.Generator.Interface.Core.QSize (c_QSize)
import Graphics.UI.Qtah.Generator.Interface.Core.QString (c_QString)
import {-# SOURCE #-} Graphics.UI.Qtah.Generator.Interface.Core.QVector (c_QVectorInt)
import Graphics.UI.Qtah.Generator.Interface.Core.Types (
e_DockWidgetArea,
bs_DockWidgetAreas,
bs_ToolBarAreas,
e_Orientation,
e_ScreenOrientation,
......@@ -70,6 +74,9 @@ import {-# SOURCE #-} Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractButt
(c_QAbstractButton)
import {-# SOURCE #-} Graphics.UI.Qtah.Generator.Interface.Widgets.QAbstractSlider (e_SliderAction)
import {-# SOURCE #-} Graphics.UI.Qtah.Generator.Interface.Widgets.QAction (c_QAction)
import {-# SOURCE #-} Graphics.UI.Qtah.Generator.Interface.Widgets.QDockWidget (
bs_DockWidgetFeatures,
)
import Graphics.UI.Qtah.Generator.Interface.Widgets.QGraphicsItem (c_QGraphicsItem)
import {-# SOURCE #-} Graphics.UI.Qtah.Generator.Interface.Widgets.QSystemTrayIcon (
e_ActivationReason,
......@@ -86,6 +93,8 @@ aModule =
moduleAddHaskellName ["Internal", "Callback"]
moduleAddExports $ collect
[ just $ ExportCallback cb_BoolVoid
, just $ ExportCallback cb_DockWidgetAreaVoid
, just $ ExportCallback cb_DockWidgetAreasVoid
, just $ ExportCallback cb_DoubleVoid
, just $ ExportCallback cb_IntVoid
, just $ ExportCallback cb_IntBoolVoid
......@@ -106,6 +115,7 @@ aModule =
, just $ ExportCallback cb_QAbstractSliderActionVoid
, just $ ExportCallback cb_QClipboardModeVoid
, just $ ExportCallback cb_QDateVoid
, just $ ExportCallback cb_QDockWidgetFeaturesVoid
, just $ ExportCallback cb_QModelIndexVoid
, just $ ExportCallback cb_QModelIndexIntIntVoid
, just $ ExportCallback cb_QModelIndexIntIntQModelIndexIntVoid
......@@ -131,6 +141,14 @@ cb_BoolVoid =
makeCallback (toExtName "CallbackBoolVoid")
[boolT] voidT
cb_DockWidgetAreaVoid =
makeCallback (toExtName "CallbackDockWidgetAreaVoid")
[enumT e_DockWidgetArea] voidT
cb_DockWidgetAreasVoid =
makeCallback (toExtName "CallbackDockWidgetAreasVoid")
[bitspaceT bs_DockWidgetAreas] voidT
cb_DoubleVoid =
makeCallback (toExtName "CallbackDoubleVoid")
[doubleT] voidT
......@@ -214,6 +232,11 @@ cb_QDateVoid =
makeCallback (toExtName "CallbackQDateVoid")
[objT c_QDate] voidT
cb_QDockWidgetFeaturesVoid =
addReqIncludes [includeStd "QDockWidget"] $
makeCallback (toExtName "CallbackQDockWidgetFeaturesVoid")
[bitspaceT bs_DockWidgetFeatures] voidT
cb_QModelIndexVoid =
makeCallback (toExtName "CallbackQModelIndexVoid")
[objT c_QModelIndex] voidT
......
......@@ -35,6 +35,7 @@ import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QDateTimeEdit as Q
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QDial as QDial
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QDialog as QDialog
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QDialogButtonBox as QDialogButtonBox
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QDockWidget as QDockWidget
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QDoubleSpinBox as QDoubleSpinBox
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QFileDialog as QFileDialog
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QFormLayout as QFormLayout
......@@ -82,6 +83,7 @@ import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QTabWidget as QTab
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QTextEdit as QTextEdit
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QToolBar as QToolBar
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QToolBox as QToolBox
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QToolButton as QToolButton
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QTreeView as QTreeView
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QTreeWidget as QTreeWidget
import qualified Graphics.UI.Qtah.Generator.Interface.Widgets.QVBoxLayout as QVBoxLayout
......@@ -110,6 +112,7 @@ modules =
, QDial.aModule
, QDialog.aModule
, QDialogButtonBox.aModule
, QDockWidget.aModule
, QDoubleSpinBox.aModule
, QFileDialog.aModule
, QFormLayout.aModule
......@@ -157,6 +160,7 @@ modules =
, QTextEdit.aModule
, QToolBar.aModule
, QToolBox.aModule
, QToolButton.aModule
, QTreeView.aModule
, QTreeWidget.aModule
, QTreeWidget.itemModule
......
-- 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.Widgets.QDockWidget (
aModule,
c_QDockWidget,
e_DockWidgetFeature,
bs_DockWidgetFeatures,
) where
import Foreign.Hoppy.Generator.Spec (
Export (ExportBitspace, ExportClass, ExportEnum),
addReqIncludes,
classSetEntityPrefix,
ident,
ident1,
includeStd,
makeClass,
mkBoolIsProp,
mkConstMethod,
mkCtor,
mkProp,
)
import Foreign.Hoppy.Generator.Types (bitspaceT, boolT, enumT, objT, ptrT)
import Foreign.Hoppy.Generator.Version (collect, just, test)
import Graphics.UI.Qtah.Generator.Flags (qtVersion)
import Graphics.UI.Qtah.Generator.Interface.Core.Types (
e_DockWidgetArea,
bs_DockWidgetAreas,
)
import Graphics.UI.Qtah.Generator.Interface.Core.QString (c_QString)
import Graphics.UI.Qtah.Generator.Interface.Internal.Listener (
c_ListenerBool,
c_ListenerDockWidgetArea,
c_ListenerDockWidgetAreas,
c_ListenerQDockWidgetFeatures,
)
import Graphics.UI.Qtah.Generator.Interface.Widgets.QAction (c_QAction)
import Graphics.UI.Qtah.Generator.Interface.Widgets.QWidget (c_QWidget)
import Graphics.UI.Qtah.Generator.Module (AModule (AQtModule), makeQtModule)
import Graphics.UI.Qtah.Generator.Types
{-# ANN module "HLint: ignore Use camelCase" #-}
aModule =
AQtModule $
makeQtModule ["Widgets", "QDockWidget"] $
map QtExport
[ ExportClass c_QDockWidget
, ExportEnum e_DockWidgetFeature
, ExportBitspace bs_DockWidgetFeatures
] ++
map QtExportSignal signals
c_QDockWidget =
addReqIncludes [includeStd "QDockWidget"] $
classSetEntityPrefix "" $
makeClass (ident "QDockWidget") Nothing [c_QWidget] $
collect
[ just $ mkCtor "new" []
, just $ mkCtor "newWithParent" [ptrT $ objT c_QWidget]
, just $ mkCtor "newWithText" [objT c_QString]
, just $ mkCtor "newWithTextAndParent" [objT c_QString, ptrT $ objT c_QWidget]
-- TODO Ctor with Qt::WindowFlags.
, just $ mkProp "allowedAreas" $ bitspaceT bs_DockWidgetAreas
, just $ mkConstMethod "isAreaAllowed" [enumT e_DockWidgetArea] $ boolT
, just $ mkProp "features" $ bitspaceT bs_DockWidgetFeatures
, just $ mkBoolIsProp "floating"
, test (qtVersion >= [4, 3]) $ mkProp "titleBarWidget" $ ptrT $ objT c_QWidget
, just $ mkConstMethod "toggleViewAction" [] $ ptrT $ objT c_QAction
, just $ mkProp "widget" $ ptrT $ objT c_QWidget
]
signals =
collect
[ just $ makeSignal c_QDockWidget "allowedAreasChanged" c_ListenerDockWidgetAreas
, test (qtVersion >= [4, 3]) $
makeSignal c_QDockWidget "dockLocationChanged" c_ListenerDockWidgetArea
, just $ makeSignal c_QDockWidget "featuresChanged" c_ListenerQDockWidgetFeatures
, just $ makeSignal c_QDockWidget "topLevelChanged" c_ListenerBool
, just $ makeSignal c_QDockWidget "visibilityChanged" c_ListenerBool
]
(e_DockWidgetFeature, bs_DockWidgetFeatures) =
makeQtEnumBitspace (ident1 "QDockWidget" "DockWidgetFeature") "DockWidgetFeatures"
[includeStd "QDockWidget"] $
[ (0x0, ["no", "dock", "widget", "features"])
, (0x1, ["dock", "widget", "closable"])
, (0x2, ["dock", "widget", "movable"])
, (0x4, ["dock", "widget", "floatable"])
, (0x7, ["all", "dock", "widget", "features"]) -- Deprecated
, (0x8, ["dock", "widget", "vertical", "title", "bar"])
]
-- 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.Widgets.QDockWidget (
bs_DockWidgetFeatures,
) where
import Foreign.Hoppy.Generator.Spec (Bitspace)
bs_DockWidgetFeatures :: Bitspace
......@@ -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
......
......@@ -45,7 +45,11 @@ import Foreign.Hoppy.Generator.Types (
voidT,
)
import Graphics.UI.Qtah.Generator.Interface.Core.QString (c_QString)
import Graphics.UI.Qtah.Generator.Interface.Core.Types (bs_Alignment, e_TextFormat)
import Graphics.UI.Qtah.Generator.Interface.Core.Types (
bs_Alignment,
bs_TextInteractionFlags,
e_TextFormat,
)
import Graphics.UI.Qtah.Generator.Interface.Gui.QPixmap (c_QPixmap)
import Graphics.UI.Qtah.Generator.Interface.Internal.Listener (c_ListenerQString)
import Graphics.UI.Qtah.Generator.Interface.Widgets.QFrame (c_QFrame)
......@@ -90,7 +94,7 @@ c_QLabel =
, mkMethod "setSelection" [intT, intT] voidT
, mkProp "text" $ objT c_QString
, mkProp "textFormat" $ enumT e_TextFormat
-- TODO textInteractionFlags
, mkProp "textInteractionFlags" $ bitspaceT bs_TextInteractionFlags
, mkProp "wordWrap" boolT
]
......
......@@ -35,11 +35,17 @@ import Foreign.Hoppy.Generator.Spec (
mkMethod',
mkProp,
)
import Foreign.Hoppy.Generator.Types (boolT, intT, objT, ptrT, voidT)
import Foreign.Hoppy.Generator.Types (boolT, enumT, intT, objT, ptrT, voidT)
import Graphics.UI.Qtah.Generator.Interface.Core.QByteArray (c_QByteArray)
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.Types (
e_Corner,
e_DockWidgetArea,
e_Orientation,
)
import Graphics.UI.Qtah.Generator.Interface.Internal.Listener (c_ListenerQSize)
import Graphics.UI.Qtah.Generator.Interface.Widgets.QDockWidget (c_QDockWidget)
import Graphics.UI.Qtah.Generator.Interface.Widgets.QMenu (c_QMenu)
import Graphics.UI.Qtah.Generator.Interface.Widgets.QMenuBar (c_QMenuBar)
import Graphics.UI.Qtah.Generator.Interface.Widgets.QStatusBar (c_QStatusBar)
......@@ -65,7 +71,9 @@ c_QMainWindow =
[ mkCtor "new" []
, mkCtor "newWithParent" [ptrT $ objT c_QWidget]
-- TODO Ctor with Qt::WindowFlags.
-- TODO addDockWidget
, mkMethod "addDockWidget" [enumT e_DockWidgetArea, ptrT $ objT c_QDockWidget] voidT
, mkMethod' "addDockWidget" "addDockWidgetWithOrientation"
[enumT e_DockWidgetArea, ptrT $ objT c_QDockWidget, enumT e_Orientation] voidT
-- TODO mkMethod' "addToolBar" "addToolBarWithArea" [e_ToolBarArea, ptrT $ objT c_QToolBar]
-- voidT
, mkMethod "addToolBar" [ptrT $ objT c_QToolBar] voidT
......@@ -73,26 +81,28 @@ c_QMainWindow =
-- TODO addToolBarBreak
, mkBoolIsProp "animated"
, mkProp "centralWidget" $ ptrT $ objT c_QWidget
-- TODO corner
, mkConstMethod "corner" [enumT e_Corner] $ enumT e_DockWidgetArea
, mkMethod "createPopupMenu" [] $ ptrT $ objT c_QMenu
, mkBoolIsProp "dockNestingEnabled"
-- TODO dockOptions
-- TODO dockWidgetArea
, mkConstMethod "dockWidgetArea" [ptrT $ objT c_QDockWidget] $ enumT e_DockWidgetArea
, mkProp "documentMode" boolT
, mkProp "iconSize" $ objT c_QSize
-- TODO insertToolBar
-- TODO insertToolBarBreak
, mkProp "menuBar" $ ptrT $ objT c_QMenuBar
, mkProp "menuWidget" $ ptrT $ objT c_QWidget
-- TODO removeDockWidget
, mkMethod "removeDockWidget" [ptrT $ objT c_QDockWidget] voidT
, mkMethod "restoreDockWidget" [ptrT $ objT c_QDockWidget] boolT