Add QWindow and related classes.

parent ee2925c2
......@@ -97,17 +97,22 @@ 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.QOpenGLWindow
, Graphics.UI.Qtah.Generator.Interface.Gui.QPaintDevice
, Graphics.UI.Qtah.Generator.Interface.Gui.QPaintDeviceWindow
, 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.QRasterWindow
, Graphics.UI.Qtah.Generator.Interface.Gui.QRegion
, Graphics.UI.Qtah.Generator.Interface.Gui.QShowEvent
, Graphics.UI.Qtah.Generator.Interface.Gui.QSurface
, 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.Gui.QWindow
, Graphics.UI.Qtah.Generator.Interface.Imports
, Graphics.UI.Qtah.Generator.Interface.Internal
, Graphics.UI.Qtah.Generator.Interface.Internal.Callback
......
......@@ -79,14 +79,19 @@ forEachListener() {
$fn PtrQAction "QAction*"
$fn PtrQObject "QObject*"
$fn PtrQWidgetPtrQWidget "QWidget*|QWidget*"
$fn ScreenOrientation "Qt::ScreenOrientation" 0x050000 '[5, 0]'
$fn QAbstractSliderAction "QAbstractSlider::SliderAction"
$fn QClipboardMode "QClipboard::Mode"
$fn QModelIndexIntInt "QModelIndex|int|int"
$fn QModelIndexIntIntQModelIndexInt "QModelIndex|int|int|QModelIndex|int"
$fn QModelIndexQModelIndexQVectorInt "QModelIndex|QModelIndex|QVector<int>"
$fn QPoint "QPoint"
$fn Qreal "qreal"
$fn QSize "QSize"
$fn QString "QString"
$fn QWindowVisibility "QWindow::Visibility" 0x050000 '[5, 0]'
$fn WindowModality "Qt::WindowModality"
$fn WindowState "Qt::WindowState"
$fn "" ""
}
......@@ -106,6 +111,8 @@ if [[ -n $cppDir ]]; then
sayHpp '#define QTAH_LISTENERS_HPP'
sayHpp
sayHpp '#include <string>'
sayHpp '#include <Qt>'
sayHpp '#include <QtGlobal>'
sayHpp '#include <QAbstractButton>'
sayHpp '#include <QAbstractSlider>'
sayHpp '#include <QAction>'
......@@ -116,6 +123,9 @@ if [[ -n $cppDir ]]; then
sayHpp '#include <QSize>'
sayHpp '#include <QVector>'
sayHpp '#include <QWidget>'
sayHpp '#if QT_VERSION >= 0x050000'
sayHpp '#include <QWindow>'
sayHpp '#endif'
sayHpp '#include "b_callback.hpp"'
sayCpp '////////// GENERATED FILE, EDITS WILL BE LOST //////////'
......@@ -125,7 +135,7 @@ if [[ -n $cppDir ]]; then
sayCpp '#include <iostream>'
writeCpp() {
local -r name="${1?}" params="${2?}"
local -r name="${1?}" params="${2?}" minVersion="${3-}"
local -r className="Listener${name}"
local -r callbackClassName="Callback${name}Void"
local paramList=""
......@@ -144,6 +154,10 @@ if [[ -n $cppDir ]]; then
done < <(tr '|' '\n' <<<"$params")
fi
if [[ -n $minVersion ]]; then
sayHpp
sayHpp "#if QT_VERSION >= ${minVersion}"
fi
sayHpp
sayHpp "class ${className} : public QObject {"
sayHpp " Q_OBJECT"
......@@ -160,7 +174,15 @@ if [[ -n $cppDir ]]; then
sayHpp " callback f_;"
sayHpp " bool connected_;"
sayHpp "};"
if [[ -n $minVersion ]]; then
sayHpp
sayHpp "#endif"
fi
if [[ -n $minVersion ]]; then
sayCpp
sayCpp "#if QT_VERSION >= ${minVersion}"
fi
sayCpp
sayCpp "${className}::${className}(${className}::callback f, QObject* parent) :"
sayCpp " QObject(parent), f_(f), connected_(false) {}"
......@@ -180,6 +202,10 @@ if [[ -n $cppDir ]]; then
sayCpp "void ${className}::invoke(${paramList}) {"
sayCpp " f_(${paramNameList});"
sayCpp "}"
if [[ -n $minVersion ]]; then
sayCpp
sayCpp "#endif"
fi
}
forEachListener writeCpp
......@@ -202,6 +228,8 @@ if [[ -n $hsDir ]]; then
say
say 'module Graphics.UI.Qtah.Generator.Interface.Internal.Listener where'
say
say 'import qualified Foreign.Hoppy.Generator.Version as V'
say 'import qualified Graphics.UI.Qtah.Generator.Flags as F'
say 'import qualified Foreign.Hoppy.Generator.Spec as S'
say 'import qualified Foreign.Hoppy.Generator.Types as S'
say 'import qualified Foreign.Hoppy.Generator.Std.String as String'
......@@ -236,14 +264,19 @@ if [[ -n $hsDir ]]; then
say " S.addReqIncludes [S.includeLocal \"listener.hpp\"] \$"
say " S.moduleModify' (S.makeModule \"listener\" \"b_listener.hpp\" \"b_listener.cpp\") \$ do"
say " S.moduleAddHaskellName [\"Internal\", \"Listener\"]"
say " S.moduleAddExports"
say " S.moduleAddExports \$ V.collect"
cont="["
writeHs() {
local -r name="${1?}"
local -r minVersion="${4-}"
local -r className="Listener${name}"
local -r classVar="c_${className}"
say " ${cont} S.ExportClass ${classVar}"
if [[ -n $minVersion ]]; then
say " ${cont} V.test (F.qtVersion >= ${minVersion}) \$ S.ExportClass ${classVar}"
else
say " ${cont} V.just \$ S.ExportClass ${classVar}"
fi
if [[ $cont = '[' ]]; then cont=','; fi
}
forEachListener writeHs
......
......@@ -19,6 +19,7 @@
module Graphics.UI.Qtah.Generator.Interface.Core.Types (
aModule,
qreal,
gluint,
e_AlignmentFlag,
bs_Alignment,
e_AspectRatioMode,
......@@ -43,13 +44,19 @@ module Graphics.UI.Qtah.Generator.Interface.Core.Types (
e_MouseButton,
bs_MouseButtons,
e_MouseEventFlag,
e_MouseEventFlag_minVersion,
bs_MouseEventFlags,
e_MouseEventSource,
e_MouseEventSource_minVersion,
e_NavigationMode,
e_Orientation,
bs_Orientations,
e_ScreenOrientation,
e_ScreenOrientation_minVersion,
bs_ScreenOrientations,
e_ScrollBarPolicy,
e_ScrollPhase,
e_ScrollPhase_minVersion,
e_SortOrder,
e_TextElideMode,
e_TextFormat,
......@@ -61,9 +68,6 @@ 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 ((.|.))
......@@ -77,7 +81,7 @@ import Foreign.Hoppy.Generator.Spec (
includeStd,
makeFn,
)
import Foreign.Hoppy.Generator.Types (doubleT, floatT, objT)
import Foreign.Hoppy.Generator.Types (doubleT, floatT, objT, word32T)
import Foreign.Hoppy.Generator.Version (collect, just, test)
import Graphics.UI.Qtah.Generator.Flags (qrealFloat, qtVersion)
import Graphics.UI.Qtah.Generator.Interface.Core.QString (c_QString)
......@@ -116,14 +120,16 @@ exports =
, just $ ExportEnum e_MaskMode
, just $ ExportEnum e_MouseButton
, just $ ExportBitspace bs_MouseButtons
, test (qtVersion >= e_MouseEventFlag_version) $ ExportEnum e_MouseEventFlag
, test (qtVersion >= e_MouseEventFlag_version) $ ExportBitspace bs_MouseEventFlags
, test (qtVersion >= e_MouseEventSource_version) $ ExportEnum e_MouseEventSource
, test (qtVersion >= e_MouseEventFlag_minVersion) $ ExportEnum e_MouseEventFlag
, test (qtVersion >= e_MouseEventFlag_minVersion) $ ExportBitspace bs_MouseEventFlags
, test (qtVersion >= e_MouseEventSource_minVersion) $ ExportEnum e_MouseEventSource
, just $ ExportEnum e_NavigationMode
, just $ ExportEnum e_Orientation
, just $ ExportBitspace bs_Orientations
, test (qtVersion >= e_ScreenOrientation_minVersion) $ ExportEnum e_ScreenOrientation
, test (qtVersion >= e_ScreenOrientation_minVersion) $ ExportBitspace bs_ScreenOrientations
, just $ ExportEnum e_ScrollBarPolicy
, test (qtVersion >= e_ScrollPhase_version) $ ExportEnum e_ScrollPhase
, test (qtVersion >= e_ScrollPhase_minVersion) $ ExportEnum e_ScrollPhase
, just $ ExportEnum e_SortOrder
, just $ ExportEnum e_TextElideMode
, just $ ExportEnum e_TextFormat
......@@ -144,6 +150,9 @@ qtInclude = [includeStd "Qt"]
qreal :: Type
qreal = if qrealFloat then floatT else doubleT
gluint :: Type
gluint = word32T
(e_AlignmentFlag, bs_Alignment) =
makeQtEnumBitspace (ident1 "Qt" "AlignmentFlag") "Alignment" qtInclude
[ -- Horizontal flags.
......@@ -373,7 +382,7 @@ e_MaskMode =
[ (0x01, ["mouse", "event", "created", "double", "click"])
]
e_MouseEventFlag_version = [5, 3]
e_MouseEventFlag_minVersion = [5, 3]
e_MouseEventSource =
makeQtEnum (ident1 "Qt" "MouseEventSource") qtInclude
......@@ -382,7 +391,7 @@ e_MouseEventSource =
, (2, ["mouse", "event", "synthesized", "by", "qt"])
]
e_MouseEventSource_version = [5, 3]
e_MouseEventSource_minVersion = [5, 3]
e_NavigationMode =
makeQtEnum (ident1 "Qt" "NavigationMode") qtInclude
......@@ -399,6 +408,17 @@ e_NavigationMode =
, (2, ["vertical"])
]
(e_ScreenOrientation, bs_ScreenOrientations) =
makeQtEnumBitspace (ident1 "Qt" "ScreenOrientation") "ScreenOrientations" qtInclude
[ (0x0, ["primary", "orientation"])
, (0x1, ["portrait", "orientation"])
, (0x2, ["landscape", "orientation"])
, (0x4, ["inverted", "portrait", "orientation"])
, (0x8, ["inverted", "landscape", "orientation"])
]
e_ScreenOrientation_minVersion = [5, 0]
e_ScrollBarPolicy =
makeQtEnum (ident1 "Qt" "ScrollBarPolicy") qtInclude
[ (0, ["scroll", "bar", "as", "needed"])
......@@ -413,7 +433,7 @@ e_ScrollPhase =
, (3, ["scroll", "end"])
]
e_ScrollPhase_version = [5, 2]
e_ScrollPhase_minVersion = [5, 2]
e_SortOrder =
makeQtEnum (ident1 "Qt" "SortOrder") qtInclude
......
......@@ -33,17 +33,22 @@ 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.QOpenGLWindow as QOpenGLWindow
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QPaintDevice as QPaintDevice
import qualified Graphics.UI.Qtah.Generator.Interface.Gui.QPaintDeviceWindow as QPaintDeviceWindow
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.QRasterWindow as QRasterWindow
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.QSurface as QSurface
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 qualified Graphics.UI.Qtah.Generator.Interface.Gui.QWindow as QWindow
import Graphics.UI.Qtah.Generator.Module (AModule)
{-# ANN module "HLint: ignore Use camelCase" #-}
......@@ -66,15 +71,20 @@ modules =
, QIntValidator.aModule
, QKeyEvent.aModule
, QMouseEvent.aModule
, QOpenGLWindow.aModule
, QPaintDevice.aModule
, QPaintDeviceWindow.aModule
, QPainter.aModule
, QPainterPath.aModule
, QPen.aModule
, QPolygon.aModule
, QPolygonF.aModule
, QRasterWindow.aModule
, QRegion.aModule
, QShowEvent.aModule
, QSurface.aModule
, QTransform.aModule
, QValidator.aModule
, QWheelEvent.aModule
, QWindow.aModule
]
......@@ -245,29 +245,29 @@ e_Format =
makeQtEnum (ident1 "QImage" "Format") [includeStd "QImage"] $
[ (0, ["format", "invalid"])
, (1, ["format", "mono"])
, (2, ["format", "mono", "lsb"])
, (3, ["format", "indexed8"])
, (4, ["format", "rgb32"])
, (5, ["format", "argb32"])
, (6, ["format", "argb32", "premultiplied"])
, (7, ["format", "rgb16"])
, (8, ["format", "argb8565", "premultiplied"])
, (9, ["format", "rgb666"])
, (10, ["format", "argb666", "premultiplied"])
, (11, ["format", "rgb555"])
, (12, ["format", "argb8555", "premultiplied"])
, (13, ["format", "rgb888"])
, (14, ["format", "rgb444"])
, (15, ["format", "argb4444", "premultiplied"])
, (16, ["format", "rgbx8888"])
, (17, ["format", "rgba8888"])
, (18, ["format", "rgba8888", "premultiplied"])
, (19, ["format", "bgr30"])
, (20, ["format", "a2bgr30", "premultiplied"])
, (21, ["format", "rgb30"])
, (22, ["format", "a2rgb30", "premultiplied"])
, (23, ["format", "alpha8"])
, (24, ["format", "grayscale8"])
, (2, ["format", "mono", "l", "s", "b"])
, (3, ["format", "indexed", "8"])
, (4, ["format", "r", "g", "b", "32"])
, (5, ["format", "a", "r", "g", "b", "32"])
, (6, ["format", "a", "r", "g", "b", "32", "premultiplied"])
, (7, ["format", "r", "g", "b", "16"])
, (8, ["format", "a", "r", "g", "b", "8565", "premultiplied"])
, (9, ["format", "r", "g", "b", "666"])
, (10, ["format", "a", "r", "g", "b", "666", "premultiplied"])
, (11, ["format", "r", "g", "b", "555"])
, (12, ["format", "a", "r", "g", "b", "8555", "premultiplied"])
, (13, ["format", "r", "g", "b", "888"])
, (14, ["format", "r", "g", "b", "444"])
, (15, ["format", "a", "r", "g", "b", "4444", "premultiplied"])
, (16, ["format", "r", "g", "b", "x", "8888"])
, (17, ["format", "r", "g", "b", "a", "8888"])
, (18, ["format", "r", "g", "b", "a", "8888", "premultiplied"])
, (19, ["format", "b", "g", "r", "30"])
, (20, ["format", "a", "2", "b", "g", "r", "30", "premultiplied"])
, (21, ["format", "r", "g", "b", "30"])
, (22, ["format", "a", "2", "r", "g", "b", "30", "premultiplied"])
, (23, ["format", "alpha", "8"])
, (24, ["format", "grayscale", "8"])
]
e_InvertMode =
......
-- This file is part of Qtah.
--
-- Copyright 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.QOpenGLWindow (
aModule,
c_QOpenGLWindow,
) where
import Foreign.Hoppy.Generator.Spec (
Export (ExportClass, ExportEnum),
addReqIncludes,
classSetEntityPrefix,
ident,
ident1,
includeStd,
makeClass,
mkConstMethod,
mkCtor,
mkMethod,
)
import Foreign.Hoppy.Generator.Types (boolT, enumT, objT, ptrT, voidT)
import Graphics.UI.Qtah.Generator.Interface.Core.Types (gluint)
import Graphics.UI.Qtah.Generator.Interface.Gui.QImage (c_QImage)
import Graphics.UI.Qtah.Generator.Interface.Gui.QPaintDeviceWindow (c_QPaintDeviceWindow)
import Graphics.UI.Qtah.Generator.Interface.Gui.QWindow (c_QWindow)
import Graphics.UI.Qtah.Generator.Interface.Internal.Listener (c_Listener)
import Graphics.UI.Qtah.Generator.Module (AModule (AQtModule), makeQtModuleWithMinVersion)
import Graphics.UI.Qtah.Generator.Types
{-# ANN module "HLint: ignore Use camelCase" #-}
minVersion = [5, 4]
aModule =
AQtModule $
makeQtModuleWithMinVersion ["Gui", "QOpenGLWindow"] minVersion $
[ QtExport $ ExportClass c_QOpenGLWindow ] ++
map QtExportSignal signals ++
[ QtExport $ ExportEnum e_UpdateBehavior ]
c_QOpenGLWindow =
addReqIncludes [includeStd "QOpenGLWindow"] $
classSetEntityPrefix "" $
makeClass (ident "QOpenGLWindow") Nothing [c_QPaintDeviceWindow]
[ mkCtor "new" []
, mkCtor "newWithUpdateBehavior" [enumT e_UpdateBehavior]
, mkCtor "newWithUpdateBehaviorAndParent" [enumT e_UpdateBehavior, ptrT $ objT c_QWindow]
-- TODO QOpenGLWindow(QOpenGLContext*, ...)
-- TODO QOpenGLContext* context() const
, mkConstMethod "defaultFramebufferObject" [] gluint
, mkMethod "doneCurrent" [] voidT
, mkMethod "grabFramebuffer" [] $ objT c_QImage
, mkConstMethod "isValid" [] boolT
, mkMethod "makeCurrent" [] voidT
-- TODO QOpenGLContext* shareContext() const
, mkConstMethod "updateBehavior" [] $ enumT e_UpdateBehavior
]
signals =
[ makeSignal c_QOpenGLWindow "frameSwapped" c_Listener
]
e_UpdateBehavior =
makeQtEnum (ident1 "QOpenGLWindow" "UpdateBehavior") [includeStd "QOpenGLWindow"]
[ (0, ["no", "partial", "update"])
, (1, ["partial", "update", "blit"])
, (2, ["partial", "update", "blend"])
]
-- This file is part of Qtah.
--
-- Copyright 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.QPaintDeviceWindow (
aModule,
c_QPaintDeviceWindow,
) where
import Foreign.Hoppy.Generator.Spec (
Export (ExportClass),
addReqIncludes,
classSetEntityPrefix,
ident,
includeStd,
makeClass,
mkMethod',
)
import Foreign.Hoppy.Generator.Types (objT, voidT)
import Graphics.UI.Qtah.Generator.Interface.Core.QRect (c_QRect)
import Graphics.UI.Qtah.Generator.Interface.Gui.QPaintDevice (c_QPaintDevice)
import Graphics.UI.Qtah.Generator.Interface.Gui.QRegion (c_QRegion)
import Graphics.UI.Qtah.Generator.Interface.Gui.QWindow (c_QWindow)
import Graphics.UI.Qtah.Generator.Module (AModule (AQtModule), makeQtModuleWithMinVersion)
import Graphics.UI.Qtah.Generator.Types
{-# ANN module "HLint: ignore Use camelCase" #-}
minVersion = [5, 4]
aModule =
AQtModule $
makeQtModuleWithMinVersion ["Gui", "QPaintDeviceWindow"] minVersion
[ QtExport $ ExportClass c_QPaintDeviceWindow
]
c_QPaintDeviceWindow =
addReqIncludes [includeStd "QPaintDeviceWindow"] $
classSetEntityPrefix "" $
makeClass (ident "QPaintDeviceWindow") Nothing [c_QWindow, c_QPaintDevice]
[ mkMethod' "update" "update" [] voidT
, mkMethod' "update" "updateRect" [objT c_QRect] voidT
, mkMethod' "update" "updateRegion" [objT c_QRegion] voidT
]
-- This file is part of Qtah.
--
-- Copyright 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.QRasterWindow (
aModule,
c_QRasterWindow,
) where
import Foreign.Hoppy.Generator.Spec (
Export (ExportClass),
addReqIncludes,
classSetEntityPrefix,
ident,
includeStd,
makeClass,
mkCtor,
)
import Foreign.Hoppy.Generator.Types (objT, ptrT)
import Graphics.UI.Qtah.Generator.Interface.Gui.QPaintDeviceWindow (c_QPaintDeviceWindow)
import Graphics.UI.Qtah.Generator.Interface.Gui.QWindow (c_QWindow)
import Graphics.UI.Qtah.Generator.Module (AModule (AQtModule), makeQtModuleWithMinVersion)
import Graphics.UI.Qtah.Generator.Types
{-# ANN module "HLint: ignore Use camelCase" #-}
minVersion = [5, 4]
aModule =
AQtModule $
makeQtModuleWithMinVersion ["Gui", "QRasterWindow"] minVersion $
[ QtExport $ ExportClass c_QRasterWindow ]
c_QRasterWindow =
addReqIncludes [includeStd "QRasterWindow"] $
classSetEntityPrefix "" $
makeClass (ident "QRasterWindow") Nothing [c_QPaintDeviceWindow]
[ mkCtor "new" []
, mkCtor "newWithParent" [ptrT $ objT c_QWindow]
]
-- This file is part of Qtah.
--
-- Copyright 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.QSurface (
aModule,
c_QSurface,
e_SurfaceType,
) where
import Foreign.Hoppy.Generator.Spec (
Export (ExportClass, ExportEnum),
addReqIncludes,
classSetEntityPrefix,
ident,
ident1,
includeStd,
makeClass,
mkConstMethod,
)
import Foreign.Hoppy.Generator.Types (boolT, enumT, objT)
import Foreign.Hoppy.Generator.Version (collect, just, test)
import Graphics.UI.Qtah.Generator.Flags (qtVersion)
import Graphics.UI.Qtah.Generator.Interface.Core.QSize (c_QSize)
import Graphics.UI.Qtah.Generator.Module (AModule (AQtModule), makeQtModuleWithMinVersion)
import Graphics.UI.Qtah.Generator.Types
{-# ANN module "HLint: ignore Use camelCase" #-}
minVersion = [5, 0]
aModule =
AQtModule $
makeQtModuleWithMinVersion ["Gui", "QSurface"] minVersion $
[ QtExport $ ExportClass c_QSurface
, QtExport $ ExportEnum e_SurfaceClass
, QtExport $ ExportEnum e_SurfaceType
]
c_QSurface =
addReqIncludes [includeStd "QSurface"] $
classSetEntityPrefix "" $
makeClass (ident "QSurface") Nothing [] $
collect
[ -- TODO mkConstMethod "surfaceFormat" $ objT c_QSurfaceFormat
just $ mkConstMethod "size" [] $ objT c_QSize
, test (qtVersion >= [5, 3]) $ mkConstMethod "supportsOpenGL" [] boolT
, just $ mkConstMethod "surfaceClass" [] $ enumT e_SurfaceClass
-- TODO mkConstMethod "surfaceHandle" [] $ ptrT $ objT c_QPlatformSurface
, just $ mkConstMethod "surfaceType" [] $ enumT e_SurfaceType
]
e_SurfaceClass =
makeQtEnum (ident1 "QSurface" "SurfaceClass") [includeStd "QSurface"]
[ (0, ["window"])
, (1, ["offscreen"])
]
e_SurfaceType =
makeQtEnum (ident1 "QSurface" "SurfaceType") [includeStd "QSurface"]
[ (0, ["raster", "surface"])
, (1, ["open", "g", "l", "surface"])
, (2, ["raster", "g", "l", "surface"])
]
-- This file is part of Qtah.
--
-- Copyright 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.QWindow (
minVersion,
aModule,
c_QWindow,
e_Visibility,
) where
import Foreign.Hoppy.Generator.Spec (
Export (ExportClass, ExportEnum),
addReqIncludes,
classSetEntityPrefix,
ident,
ident1,
includeStd,
makeClass,
mkBoolIsProp,
mkConstMethod,
mkConstMethod',
mkCtor,
mkMethod,
mkMethod',
mkProp,
)
import Foreign.Hoppy.Generator.Types (bitspaceT, boolT, enumT, intT, objT, ptrT, voidT)
import Foreign.Hoppy.Generator.Version (collect, just, test)
import Graphics.UI.Qtah.Generator.Flags (qtVersion)
import Graphics.UI.Qtah.Generator.Interface.Core.QMargins (c_QMargins)
import Graphics.UI.Qtah.Generator.Interface.Core.QObject (c_QObject)
import Graphics.UI.Qtah.Generator.Interface.Core.QPoint (c_QPoint)
import Graphics.UI.Qtah.Generator.Interface.Core.QRect (c_QRect)
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 (
bs_WindowFlags,
e_ScreenOrientation,
e_WindowModality,
e_WindowState,
e_WindowType,
qreal,
)
import Graphics.UI.Qtah.Generator.Interface.Gui.QRegion (c_QRegion)
import Graphics.UI.Qtah.Generator.Interface.Gui.QSurface (c_QSurface, e_SurfaceType)
import Graphics.UI.Qtah.Generator.Interface.Internal.Listener (