QSplitter.hs 2.9 KB
Newer Older
1 2
-- This file is part of Qtah.
--
3
-- Copyright 2015-2018 The Qtah Authors.
4 5
--
-- This program is free software: you can redistribute it and/or modify
6 7 8
-- 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.
9 10 11 12
--
-- 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
13
-- GNU Lesser General Public License for more details.
14
--
15
-- You should have received a copy of the GNU Lesser General Public License
16 17
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.

18
module Graphics.UI.Qtah.Generator.Interface.Widgets.QSplitter (
19
  aModule,
Bryan Gardiner's avatar
Bryan Gardiner committed
20 21
  ) where

Bryan Gardiner's avatar
Bryan Gardiner committed
22
import Foreign.Hoppy.Generator.Spec (
23 24
  Export (ExportClass),
  addReqIncludes,
25
  classSetEntityPrefix,
26 27 28 29 30 31 32 33
  ident,
  includeStd,
  makeClass,
  mkConstMethod,
  mkCtor,
  mkMethod,
  mkProp,
  )
34
import Foreign.Hoppy.Generator.Types (boolT, enumT, intT, objT, ptrT, voidT)
35 36
import Graphics.UI.Qtah.Generator.Interface.Core.QList (c_QListInt)
import Graphics.UI.Qtah.Generator.Interface.Core.Types (e_Orientation)
37
import Graphics.UI.Qtah.Generator.Interface.Internal.Listener (c_ListenerIntInt)
38 39
import Graphics.UI.Qtah.Generator.Interface.Widgets.QFrame (c_QFrame)
import Graphics.UI.Qtah.Generator.Interface.Widgets.QWidget (c_QWidget)
40
import Graphics.UI.Qtah.Generator.Module (AModule (AQtModule), makeQtModule)
41
import Graphics.UI.Qtah.Generator.Types
42 43

{-# ANN module "HLint: ignore Use camelCase" #-}
Bryan Gardiner's avatar
Bryan Gardiner committed
44

45 46 47
aModule =
  AQtModule $
  makeQtModule ["Widgets", "QSplitter"] $
48 49
  (QtExport $ ExportClass c_QSplitter) :
  map QtExportSignal signals
Bryan Gardiner's avatar
Bryan Gardiner committed
50 51 52

c_QSplitter =
  addReqIncludes [includeStd "QSplitter"] $
53
  classSetEntityPrefix "" $
Bryan Gardiner's avatar
Bryan Gardiner committed
54
  makeClass (ident "QSplitter") Nothing [c_QFrame]
55
  [ mkCtor "new" []
56 57 58
  , mkCtor "newWithParent" [ptrT $ objT c_QWidget]
  , mkCtor "newWithOrientation" [enumT e_Orientation]
  , mkCtor "newWithOrientationAndParent" [enumT e_Orientation, ptrT $ objT c_QWidget]
59 60
  , mkMethod "addWidget" [ptrT $ objT c_QWidget] voidT
  , mkProp "childrenCollapsible" boolT
61
  , mkConstMethod "count" [] intT
Bryan Gardiner's avatar
Bryan Gardiner committed
62 63
    -- TODO getRange
    -- TODO handle
64
  , mkProp "handleWidth" intT
65 66 67
  , mkConstMethod "indexOf" [ptrT $ objT c_QWidget] intT
  , mkMethod "insertWidget" [intT, ptrT $ objT c_QWidget] voidT
  , mkConstMethod "isCollapsible" [intT] boolT
68 69
  , mkProp "opaqueResize" boolT
  , mkProp "orientation" $ enumT e_Orientation
70
  , mkMethod "refresh" [] voidT
Bryan Gardiner's avatar
Bryan Gardiner committed
71 72
    -- TODO restoreState
    -- TODO saveState
73 74 75 76 77
  , mkMethod "setCollapsible" [intT, boolT] voidT
  , mkMethod "setSizes" [objT c_QListInt] voidT
  , mkMethod "setStretchFactor" [intT, intT] voidT
  , mkMethod "sizes" [] $ objT c_QListInt
  , mkConstMethod "widget" [intT] $ ptrT $ objT c_QWidget
Bryan Gardiner's avatar
Bryan Gardiner committed
78 79 80
  ]

signals =
81
  [ makeSignal c_QSplitter "splitterMoved" c_ListenerIntInt ]