gi-gdk-0.3.16.12: GI/Gdk/Structs/EventProximity.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)
Proximity events are generated when using GDK’s wrapper for the
XInput extension. The XInput extension is an add-on for standard X
that allows you to use nonstandard devices such as graphics tablets.
A proximity event indicates that the stylus has moved in or out of
contact with the tablet, or perhaps that the user’s finger has moved
in or out of contact with a touch screen.
This event type will be used pretty rarely. It only is important for
XInput aware programs that are drawing their own cursor.
-}
module GI.Gdk.Structs.EventProximity
(
-- * Exported types
EventProximity(..) ,
noEventProximity ,
-- * Properties
-- ** Device
eventProximityReadDevice ,
-- ** SendEvent
eventProximityReadSendEvent ,
-- ** Time
eventProximityReadTime ,
-- ** Type
eventProximityReadType ,
-- ** Window
eventProximityReadWindow ,
) 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 EventProximity = EventProximity (ForeignPtr EventProximity)
noEventProximity :: Maybe EventProximity
noEventProximity = Nothing
eventProximityReadType :: EventProximity -> IO EventType
eventProximityReadType s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO CUInt
let val' = (toEnum . fromIntegral) val
return val'
eventProximityReadWindow :: EventProximity -> IO Window
eventProximityReadWindow s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO (Ptr Window)
val' <- (newObject Window) val
return val'
eventProximityReadSendEvent :: EventProximity -> IO Int8
eventProximityReadSendEvent s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO Int8
return val
eventProximityReadTime :: EventProximity -> IO Word32
eventProximityReadTime s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 20) :: IO Word32
return val
eventProximityReadDevice :: EventProximity -> IO Device
eventProximityReadDevice s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 24) :: IO (Ptr Device)
val' <- (newObject Device) val
return val'