gi-gdk-0.3.18.13: GI/Gdk/Structs/EventConfigure.hs
{- |
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 a window size or position has changed.
-}
module GI.Gdk.Structs.EventConfigure
(
-- * Exported types
EventConfigure(..) ,
newZeroEventConfigure ,
noEventConfigure ,
-- * Properties
-- ** Height
eventConfigureReadHeight ,
-- ** SendEvent
eventConfigureReadSendEvent ,
-- ** Type
eventConfigureReadType ,
-- ** Width
eventConfigureReadWidth ,
-- ** Window
eventConfigureReadWindow ,
-- ** X
eventConfigureReadX ,
-- ** Y
eventConfigureReadY ,
) 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 EventConfigure = EventConfigure (ForeignPtr EventConfigure)
-- | Construct a `EventConfigure` struct initialized to zero.
newZeroEventConfigure :: MonadIO m => m EventConfigure
newZeroEventConfigure = liftIO $ callocBytes 40 >>= wrapPtr EventConfigure
noEventConfigure :: Maybe EventConfigure
noEventConfigure = Nothing
eventConfigureReadType :: EventConfigure -> IO EventType
eventConfigureReadType s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO CUInt
let val' = (toEnum . fromIntegral) val
return val'
eventConfigureReadWindow :: EventConfigure -> IO Window
eventConfigureReadWindow s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO (Ptr Window)
val' <- (newObject Window) val
return val'
eventConfigureReadSendEvent :: EventConfigure -> IO Int8
eventConfigureReadSendEvent s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO Int8
return val
eventConfigureReadX :: EventConfigure -> IO Int32
eventConfigureReadX s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 20) :: IO Int32
return val
eventConfigureReadY :: EventConfigure -> IO Int32
eventConfigureReadY s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 24) :: IO Int32
return val
eventConfigureReadWidth :: EventConfigure -> IO Int32
eventConfigureReadWidth s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 28) :: IO Int32
return val
eventConfigureReadHeight :: EventConfigure -> IO Int32
eventConfigureReadHeight s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 32) :: IO Int32
return val
type family ResolveEventConfigureMethod (t :: Symbol) (o :: *) :: * where
ResolveEventConfigureMethod l o = MethodResolutionFailed l o
instance (info ~ ResolveEventConfigureMethod t EventConfigure, MethodInfo info EventConfigure p) => IsLabelProxy t (EventConfigure -> p) where
fromLabelProxy _ = overloadedMethod (MethodProxy :: MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveEventConfigureMethod t EventConfigure, MethodInfo info EventConfigure p) => IsLabel t (EventConfigure -> p) where
fromLabel _ = overloadedMethod (MethodProxy :: MethodProxy info)
#endif