add file headers
[hs-pgms.git] / src / GUI / Common.hs
blobb5b005952fc416aaafc4f8f579bd2fb2c2c6c697
1 -- |
2 -- Module : GUI.Common
3 -- Copyright : (c) 2008 Bertram Felgenhauer
4 -- License : BSD3
5 --
6 -- Maintainer : Bertram Felgenhauer <int-e@gmx.de>
7 -- Stability : experimental
8 -- Portability : portable
9 --
10 -- This module is part of Haskell PGMS.
13 module GUI.Common (
14 Globals (..),
15 State (..),
16 initState,
17 maxSize,
18 ) where
20 import Mine
22 import qualified Graphics.UI.Gtk as G
23 import Data.IORef
25 maxSize :: Pos
26 maxSize = Pos 30 16
28 data Globals = Globals {
29 gBoard :: G.DrawingArea,
30 gStatusbar :: G.Statusbar,
31 gState :: IORef State
34 data State = State {
35 sConfig :: Config,
36 sStrategy :: Strategy,
37 sBoard :: Maybe Board,
38 sStop :: Maybe (IO ()),
39 sPreviousConfigItem :: Maybe G.RadioMenuItem
42 initState strats = State {
43 sConfig = beginner,
44 sStrategy = head strats,
45 sBoard = Nothing,
46 sStop = Nothing,
47 sPreviousConfigItem = Nothing