gi-gdk-0.3.18.13: GI/Gdk/Structs/EventTouchpadPinch.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 during touchpad swipe gestures.
-}
module GI.Gdk.Structs.EventTouchpadPinch
(
-- * Exported types
EventTouchpadPinch(..) ,
newZeroEventTouchpadPinch ,
noEventTouchpadPinch ,
-- * Properties
-- ** AngleDelta
eventTouchpadPinchReadAngleDelta ,
-- ** Dx
eventTouchpadPinchReadDx ,
-- ** Dy
eventTouchpadPinchReadDy ,
-- ** NFingers
eventTouchpadPinchReadNFingers ,
-- ** Phase
eventTouchpadPinchReadPhase ,
-- ** Scale
eventTouchpadPinchReadScale ,
-- ** SendEvent
eventTouchpadPinchReadSendEvent ,
-- ** State
eventTouchpadPinchReadState ,
-- ** Time
eventTouchpadPinchReadTime ,
-- ** Type
eventTouchpadPinchReadType ,
-- ** Window
eventTouchpadPinchReadWindow ,
-- ** X
eventTouchpadPinchReadX ,
-- ** XRoot
eventTouchpadPinchReadXRoot ,
-- ** Y
eventTouchpadPinchReadY ,
-- ** YRoot
eventTouchpadPinchReadYRoot ,
) 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 EventTouchpadPinch = EventTouchpadPinch (ForeignPtr EventTouchpadPinch)
-- | Construct a `EventTouchpadPinch` struct initialized to zero.
newZeroEventTouchpadPinch :: MonadIO m => m EventTouchpadPinch
newZeroEventTouchpadPinch = liftIO $ callocBytes 104 >>= wrapPtr EventTouchpadPinch
noEventTouchpadPinch :: Maybe EventTouchpadPinch
noEventTouchpadPinch = Nothing
eventTouchpadPinchReadType :: EventTouchpadPinch -> IO EventType
eventTouchpadPinchReadType s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO CUInt
let val' = (toEnum . fromIntegral) val
return val'
eventTouchpadPinchReadWindow :: EventTouchpadPinch -> IO Window
eventTouchpadPinchReadWindow s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO (Ptr Window)
val' <- (newObject Window) val
return val'
eventTouchpadPinchReadSendEvent :: EventTouchpadPinch -> IO Int8
eventTouchpadPinchReadSendEvent s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO Int8
return val
eventTouchpadPinchReadPhase :: EventTouchpadPinch -> IO TouchpadGesturePhase
eventTouchpadPinchReadPhase s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 20) :: IO CUInt
let val' = (toEnum . fromIntegral) val
return val'
eventTouchpadPinchReadNFingers :: EventTouchpadPinch -> IO Int8
eventTouchpadPinchReadNFingers s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 24) :: IO Int8
return val
eventTouchpadPinchReadTime :: EventTouchpadPinch -> IO Word32
eventTouchpadPinchReadTime s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 28) :: IO Word32
return val
eventTouchpadPinchReadX :: EventTouchpadPinch -> IO Double
eventTouchpadPinchReadX s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 32) :: IO CDouble
let val' = realToFrac val
return val'
eventTouchpadPinchReadY :: EventTouchpadPinch -> IO Double
eventTouchpadPinchReadY s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 40) :: IO CDouble
let val' = realToFrac val
return val'
eventTouchpadPinchReadDx :: EventTouchpadPinch -> IO Double
eventTouchpadPinchReadDx s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 48) :: IO CDouble
let val' = realToFrac val
return val'
eventTouchpadPinchReadDy :: EventTouchpadPinch -> IO Double
eventTouchpadPinchReadDy s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 56) :: IO CDouble
let val' = realToFrac val
return val'
eventTouchpadPinchReadAngleDelta :: EventTouchpadPinch -> IO Double
eventTouchpadPinchReadAngleDelta s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 64) :: IO CDouble
let val' = realToFrac val
return val'
eventTouchpadPinchReadScale :: EventTouchpadPinch -> IO Double
eventTouchpadPinchReadScale s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 72) :: IO CDouble
let val' = realToFrac val
return val'
eventTouchpadPinchReadXRoot :: EventTouchpadPinch -> IO Double
eventTouchpadPinchReadXRoot s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 80) :: IO CDouble
let val' = realToFrac val
return val'
eventTouchpadPinchReadYRoot :: EventTouchpadPinch -> IO Double
eventTouchpadPinchReadYRoot s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 88) :: IO CDouble
let val' = realToFrac val
return val'
eventTouchpadPinchReadState :: EventTouchpadPinch -> IO [ModifierType]
eventTouchpadPinchReadState s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 96) :: IO CUInt
let val' = wordToGFlags val
return val'
type family ResolveEventTouchpadPinchMethod (t :: Symbol) (o :: *) :: * where
ResolveEventTouchpadPinchMethod l o = MethodResolutionFailed l o
instance (info ~ ResolveEventTouchpadPinchMethod t EventTouchpadPinch, MethodInfo info EventTouchpadPinch p) => IsLabelProxy t (EventTouchpadPinch -> p) where
fromLabelProxy _ = overloadedMethod (MethodProxy :: MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveEventTouchpadPinchMethod t EventTouchpadPinch, MethodInfo info EventTouchpadPinch p) => IsLabel t (EventTouchpadPinch -> p) where
fromLabel _ = overloadedMethod (MethodProxy :: MethodProxy info)
#endif