{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)

Generated when the state of a toplevel window changes.
-}

module GI.Gdk.Structs.EventWindowState
    ( 

-- * Exported types
    EventWindowState(..)                    ,
    noEventWindowState                      ,


 -- * Properties
-- ** ChangedMask
    eventWindowStateReadChangedMask         ,


-- ** NewWindowState
    eventWindowStateReadNewWindowState      ,


-- ** SendEvent
    eventWindowStateReadSendEvent           ,


-- ** Type
    eventWindowStateReadType                ,


-- ** Window
    eventWindowStateReadWindow              ,




    ) where

import Prelude ()
import Data.GI.Base.ShortPrelude

import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map

import GI.Gdk.Types
import GI.Gdk.Callbacks

newtype EventWindowState = EventWindowState (ForeignPtr EventWindowState)
noEventWindowState :: Maybe EventWindowState
noEventWindowState = Nothing

eventWindowStateReadType :: EventWindowState -> IO EventType
eventWindowStateReadType s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 0) :: IO CUInt
    let val' = (toEnum . fromIntegral) val
    return val'

eventWindowStateReadWindow :: EventWindowState -> IO Window
eventWindowStateReadWindow s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 8) :: IO (Ptr Window)
    val' <- (newObject Window) val
    return val'

eventWindowStateReadSendEvent :: EventWindowState -> IO Int8
eventWindowStateReadSendEvent s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 16) :: IO Int8
    return val

eventWindowStateReadChangedMask :: EventWindowState -> IO [WindowState]
eventWindowStateReadChangedMask s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 20) :: IO CUInt
    let val' = wordToGFlags val
    return val'

eventWindowStateReadNewWindowState :: EventWindowState -> IO [WindowState]
eventWindowStateReadNewWindowState s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 24) :: IO CUInt
    let val' = wordToGFlags val
    return val'