Unverified Commit b52e5e3c authored by Paul Tsupikoff's avatar Paul Tsupikoff Committed by Maxim Koltsov

Add QDockWidget

parent 5f4fdf0a
......@@ -154,6 +154,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
......
......@@ -78,6 +78,8 @@ forEachListener() {
# Keep the includes in the C++ section up-to-date with the types used here.
$fn Bool "bool"
$fn Double "double"
$fn DockWidgetArea "Qt::DockWidgetArea"
$fn DockWidgetAreas "Qt::DockWidgetAreas"
$fn Int "int"
$fn IntBool "int|bool"
$fn IntInt "int|int"
......@@ -93,6 +95,7 @@ forEachListener() {
$fn PtrQWidgetPtrQWidget "QWidget*|QWidget*"
$fn QAbstractSliderAction "QAbstractSlider::SliderAction"
$fn QClipboardMode "QClipboard::Mode"
$fn QDockWidgetFeatures "QDockWidget::DockWidgetFeatures"
$fn QDate "QDate"
$fn QModelIndex "QModelIndex"
$fn QModelIndexIntInt "QModelIndex|int|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>'
......
......@@ -31,6 +31,8 @@ module Graphics.UI.Qtah.Generator.Interface.Core.Types (
e_Corner,
e_CursorMoveStyle,
e_CursorShape,
e_DockWidgetArea,
bs_DockWidgetAreas,
e_DropAction,
bs_DropActions,
e_EventPriority,
......@@ -122,6 +124,8 @@ exports =
, 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
......@@ -298,6 +302,16 @@ e_CursorShape =
, (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"])
......
......@@ -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,7 @@ 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,
......@@ -87,6 +92,8 @@ aModule =
moduleAddExports $ collect
[ just $ ExportCallback cb_BoolVoid
, just $ ExportCallback cb_DoubleVoid
, just $ ExportCallback cb_DockWidgetAreaVoid
, just $ ExportCallback cb_DockWidgetAreasVoid
, just $ ExportCallback cb_IntVoid
, just $ ExportCallback cb_IntBoolVoid
, just $ ExportCallback cb_IntIntVoid
......@@ -106,6 +113,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
......@@ -135,6 +143,14 @@ cb_DoubleVoid =
makeCallback (toExtName "CallbackDoubleVoid")
[doubleT] voidT
cb_DockWidgetAreaVoid =
makeCallback (toExtName "CallbackDockWidgetAreaVoid")
[enumT e_DockWidgetArea] voidT
cb_DockWidgetAreasVoid =
makeCallback (toExtName "CallbackDockWidgetAreasVoid")
[bitspaceT bs_DockWidgetAreas] voidT
cb_IntVoid =
makeCallback (toExtName "CallbackIntVoid")
[intT] voidT
......@@ -214,6 +230,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
......@@ -111,6 +112,7 @@ modules =
, QDial.aModule
, QDialog.aModule
, QDialogButtonBox.aModule
, QDockWidget.aModule
, QDoubleSpinBox.aModule
, QFileDialog.aModule
, QFormLayout.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.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
......@@ -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,8 @@ 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 +80,27 @@ 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
, mkMethod "restoreState" [objT c_QByteArray] boolT
, mkMethod' "restoreState" "restoreStateWithVersion" [objT c_QByteArray, intT] boolT
, mkConstMethod "saveState" [] (objT c_QByteArray)
, mkConstMethod' "saveState" "saveStateWithVersion" [intT] (objT c_QByteArray)
-- TODO setCorner
, mkMethod "setCorner" [enumT e_Corner, enumT e_DockWidgetArea] voidT
-- TODO setTabPosition
-- TODO setTabShape
-- TODO splitDockWidget
, mkMethod "splitDockWidget" [ptrT $ objT c_QDockWidget, ptrT $ objT c_QDockWidget, enumT e_Orientation] voidT
, mkProp "statusBar" $ ptrT $ objT c_QStatusBar
-- TODO tabifiedDockWidgets
-- TODO tabifyDockWidget
......
......@@ -143,6 +143,7 @@ library
, Graphics.UI.Qtah.Widgets.QDial
, Graphics.UI.Qtah.Widgets.QDialog
, Graphics.UI.Qtah.Widgets.QDialogButtonBox
, Graphics.UI.Qtah.Widgets.QDockWidget
, Graphics.UI.Qtah.Widgets.QDoubleSpinBox
, Graphics.UI.Qtah.Widgets.QFileDialog
, Graphics.UI.Qtah.Widgets.QFormLayout
......@@ -306,6 +307,7 @@ library
, Graphics.UI.Qtah.Generated.Widgets.QDial
, Graphics.UI.Qtah.Generated.Widgets.QDialog
, Graphics.UI.Qtah.Generated.Widgets.QDialogButtonBox
, Graphics.UI.Qtah.Generated.Widgets.QDockWidget
, Graphics.UI.Qtah.Generated.Widgets.QDoubleSpinBox
, Graphics.UI.Qtah.Generated.Widgets.QFileDialog
, Graphics.UI.Qtah.Generated.Widgets.QFormLayout
......
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