    {-# LANGUAGE CPP #-}
    {-# LANGUAGE DeriveDataTypeable #-}
    {-# LANGUAGE DeriveGeneric #-}
    {-# LANGUAGE MultiParamTypeClasses #-}
    {-# LANGUAGE OverloadedStrings #-}
    {-# LANGUAGE PatternSynonyms #-}

    module SDL.Input.Mouse
      ( -- * Relative Mouse Mode
        LocationMode(..)
      , setMouseLocationMode
      , getMouseLocationMode

        -- * Mouse and Touch Input
      , MouseButton(..)
      , MouseDevice(..)
      , MouseScrollDirection(..)

        -- * Mouse State
      , getModalMouseLocation
      , getAbsoluteMouseLocation
      , getRelativeMouseLocation
      , getMouseButtons

        -- * Warping the Mouse
      , WarpMouseOrigin(..)
      , warpMouse

        -- * Cursor Visibility
      , cursorVisible

        -- * Cursor Shape
      , Cursor
      , activeCursor
      , createCursor
      , freeCursor
      , createColorCursor
      ) where

    import Control.Monad (void)
    import Control.Monad.IO.Class (MonadIO, liftIO)
    import Data.Bits
    import Data.Bool
    import Data.Data (Data)
    import Data.StateVar
    import Data.Typeable
    import Data.Word
    import Foreign.C
    import Foreign.Marshal.Alloc
    import Foreign.Ptr
    import Foreign.Storable
    import GHC.Generics (Generic)
    import SDL.Vect
    import SDL.Internal.Exception
    import SDL.Internal.Numbered
    import SDL.Internal.Types (Window(Window))
    import SDL.Video.Renderer (Surface(Surface))
    import qualified Data.Vector.Storable as V
    import qualified SDL.Raw.Enum as Raw
    import qualified SDL.Raw.Event as Raw
    import qualified SDL.Raw.Types as Raw

    #if !MIN_VERSION_base(4,8,0)
    import Control.Applicative
    #endif

    data LocationMode
      = AbsoluteLocation
      | RelativeLocation
      deriving (LocationMode
    LocationMode -> LocationMode -> Bounded LocationMode
    forall a. a -> a -> Bounded a
    maxBound :: LocationMode
    $cmaxBound :: LocationMode
    minBound :: LocationMode
    $cminBound :: LocationMode
    Bounded, Typeable LocationMode
    Constr
    DataType
    Typeable LocationMode =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> LocationMode -> c LocationMode)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c LocationMode)
    -> (LocationMode -> Constr)
    -> (LocationMode -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c LocationMode))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e))
        -> Maybe (c LocationMode))
    -> ((forall b. Data b => b -> b) -> LocationMode -> LocationMode)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> LocationMode -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> LocationMode -> r)
    -> (forall u. (forall d. Data d => d -> u) -> LocationMode -> [u])
    -> (forall u.
        Int -> (forall d. Data d => d -> u) -> LocationMode -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> LocationMode -> m LocationMode)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> LocationMode -> m LocationMode)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> LocationMode -> m LocationMode)
    -> Data LocationMode
    LocationMode -> Constr
    LocationMode -> DataType
    (forall b. Data b => b -> b) -> LocationMode -> LocationMode
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> LocationMode -> c LocationMode
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c LocationMode
    forall a.
    Typeable a =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> LocationMode -> u
    forall u. (forall d. Data d => d -> u) -> LocationMode -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> LocationMode -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> LocationMode -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> LocationMode -> m LocationMode
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> LocationMode -> m LocationMode
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c LocationMode
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> LocationMode -> c LocationMode
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c LocationMode)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c LocationMode)
    $cRelativeLocation :: Constr
    $cAbsoluteLocation :: Constr
    $tLocationMode :: DataType
    gmapMo :: (forall d. Data d => d -> m d) -> LocationMode -> m LocationMode
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> LocationMode -> m LocationMode
    gmapMp :: (forall d. Data d => d -> m d) -> LocationMode -> m LocationMode
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> LocationMode -> m LocationMode
    gmapM :: (forall d. Data d => d -> m d) -> LocationMode -> m LocationMode
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> LocationMode -> m LocationMode
    gmapQi :: Int -> (forall d. Data d => d -> u) -> LocationMode -> u
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> LocationMode -> u
    gmapQ :: (forall d. Data d => d -> u) -> LocationMode -> [u]
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> LocationMode -> [u]
    gmapQr :: (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> LocationMode -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> LocationMode -> r
    gmapQl :: (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> LocationMode -> r
    $cgmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> LocationMode -> r
    gmapT :: (forall b. Data b => b -> b) -> LocationMode -> LocationMode
    $cgmapT :: (forall b. Data b => b -> b) -> LocationMode -> LocationMode
    dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c LocationMode)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c LocationMode)
    dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c LocationMode)
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c LocationMode)
    dataTypeOf :: LocationMode -> DataType
    $cdataTypeOf :: LocationMode -> DataType
    toConstr :: LocationMode -> Constr
    $ctoConstr :: LocationMode -> Constr
    gunfold :: (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c LocationMode
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c LocationMode
    gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> LocationMode -> c LocationMode
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> LocationMode -> c LocationMode
    $cp1Data :: Typeable LocationMode
    Data, LocationMode -> LocationMode -> Bool
    (LocationMode -> LocationMode -> Bool)
    -> (LocationMode -> LocationMode -> Bool) -> Eq LocationMode
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    /= :: LocationMode -> LocationMode -> Bool
    $c/= :: LocationMode -> LocationMode -> Bool
    == :: LocationMode -> LocationMode -> Bool
    $c== :: LocationMode -> LocationMode -> Bool
    Eq, Int -> LocationMode
    LocationMode -> Int
    LocationMode -> [LocationMode]
    LocationMode -> LocationMode
    LocationMode -> LocationMode -> [LocationMode]
    LocationMode -> LocationMode -> LocationMode -> [LocationMode]
    (LocationMode -> LocationMode)
    -> (LocationMode -> LocationMode)
    -> (Int -> LocationMode)
    -> (LocationMode -> Int)
    -> (LocationMode -> [LocationMode])
    -> (LocationMode -> LocationMode -> [LocationMode])
    -> (LocationMode -> LocationMode -> [LocationMode])
    -> (LocationMode -> LocationMode -> LocationMode -> [LocationMode])
    -> Enum LocationMode
    forall a.
    (a -> a)
    -> (a -> a)
    -> (Int -> a)
    -> (a -> Int)
    -> (a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> a -> [a])
    -> Enum a
    enumFromThenTo :: LocationMode -> LocationMode -> LocationMode -> [LocationMode]
    $cenumFromThenTo :: LocationMode -> LocationMode -> LocationMode -> [LocationMode]
    enumFromTo :: LocationMode -> LocationMode -> [LocationMode]
    $cenumFromTo :: LocationMode -> LocationMode -> [LocationMode]
    enumFromThen :: LocationMode -> LocationMode -> [LocationMode]
    $cenumFromThen :: LocationMode -> LocationMode -> [LocationMode]
    enumFrom :: LocationMode -> [LocationMode]
    $cenumFrom :: LocationMode -> [LocationMode]
    fromEnum :: LocationMode -> Int
    $cfromEnum :: LocationMode -> Int
    toEnum :: Int -> LocationMode
    $ctoEnum :: Int -> LocationMode
    pred :: LocationMode -> LocationMode
    $cpred :: LocationMode -> LocationMode
    succ :: LocationMode -> LocationMode
    $csucc :: LocationMode -> LocationMode
    Enum, (forall x. LocationMode -> Rep LocationMode x)
    -> (forall x. Rep LocationMode x -> LocationMode)
    -> Generic LocationMode
    forall x. Rep LocationMode x -> LocationMode
    forall x. LocationMode -> Rep LocationMode x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cto :: forall x. Rep LocationMode x -> LocationMode
    $cfrom :: forall x. LocationMode -> Rep LocationMode x
    Generic, Eq LocationMode
    Eq LocationMode =>
    (LocationMode -> LocationMode -> Ordering)
    -> (LocationMode -> LocationMode -> Bool)
    -> (LocationMode -> LocationMode -> Bool)
    -> (LocationMode -> LocationMode -> Bool)
    -> (LocationMode -> LocationMode -> Bool)
    -> (LocationMode -> LocationMode -> LocationMode)
    -> (LocationMode -> LocationMode -> LocationMode)
    -> Ord LocationMode
    LocationMode -> LocationMode -> Bool
    LocationMode -> LocationMode -> Ordering
    LocationMode -> LocationMode -> LocationMode
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    min :: LocationMode -> LocationMode -> LocationMode
    $cmin :: LocationMode -> LocationMode -> LocationMode
    max :: LocationMode -> LocationMode -> LocationMode
    $cmax :: LocationMode -> LocationMode -> LocationMode
    >= :: LocationMode -> LocationMode -> Bool
    $c>= :: LocationMode -> LocationMode -> Bool
    > :: LocationMode -> LocationMode -> Bool
    $c> :: LocationMode -> LocationMode -> Bool
    <= :: LocationMode -> LocationMode -> Bool
    $c<= :: LocationMode -> LocationMode -> Bool
    < :: LocationMode -> LocationMode -> Bool
    $c< :: LocationMode -> LocationMode -> Bool
    compare :: LocationMode -> LocationMode -> Ordering
    $ccompare :: LocationMode -> LocationMode -> Ordering
    $cp1Ord :: Eq LocationMode
    Ord, ReadPrec [LocationMode]
    ReadPrec LocationMode
    Int -> ReadS LocationMode
    ReadS [LocationMode]
    (Int -> ReadS LocationMode)
    -> ReadS [LocationMode]
    -> ReadPrec LocationMode
    -> ReadPrec [LocationMode]
    -> Read LocationMode
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    readListPrec :: ReadPrec [LocationMode]
    $creadListPrec :: ReadPrec [LocationMode]
    readPrec :: ReadPrec LocationMode
    $creadPrec :: ReadPrec LocationMode
    readList :: ReadS [LocationMode]
    $creadList :: ReadS [LocationMode]
    readsPrec :: Int -> ReadS LocationMode
    $creadsPrec :: Int -> ReadS LocationMode
    Read, Int -> LocationMode -> ShowS
    [LocationMode] -> ShowS
    LocationMode -> String
    (Int -> LocationMode -> ShowS)
    -> (LocationMode -> String)
    -> ([LocationMode] -> ShowS)
    -> Show LocationMode
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    showList :: [LocationMode] -> ShowS
    $cshowList :: [LocationMode] -> ShowS
    show :: LocationMode -> String
    $cshow :: LocationMode -> String
    showsPrec :: Int -> LocationMode -> ShowS
    $cshowsPrec :: Int -> LocationMode -> ShowS
    Show, Typeable)

    -- | Sets the current relative mouse mode.
    --
    -- When relative mouse mode is enabled, cursor is hidden and mouse position
    -- will not change. However, you will be delivered relative mouse position
    -- change events.
    setMouseLocationMode :: (Functor m, MonadIO m) => LocationMode -> m LocationMode
    setMouseLocationMode :: LocationMode -> m LocationMode
    setMouseLocationMode mode :: LocationMode
    mode =
      Bool -> m CInt
    forall (m :: * -> *). MonadIO m => Bool -> m CInt
    Raw.setRelativeMouseMode (LocationMode
    mode LocationMode -> LocationMode -> Bool
    forall a. Eq a => a -> a -> Bool
    == LocationMode
    RelativeLocation) m CInt -> m LocationMode -> m LocationMode
    forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
    >> m LocationMode
    forall (m :: * -> *). MonadIO m => m LocationMode
    getMouseLocationMode

    -- | Check which mouse location mode is currently active.
    getMouseLocationMode :: MonadIO m => m LocationMode
    getMouseLocationMode :: m LocationMode
    getMouseLocationMode = do
      Bool
    relativeMode <- m Bool
    forall (m :: * -> *). MonadIO m => m Bool
    Raw.getRelativeMouseMode
      LocationMode -> m LocationMode
    forall (m :: * -> *) a. Monad m => a -> m a
    return (LocationMode -> m LocationMode) -> LocationMode -> m LocationMode
    forall a b. (a -> b) -> a -> b
    $ if Bool
    relativeMode then LocationMode
    RelativeLocation else LocationMode
    AbsoluteLocation

    data ModalLocation
      = AbsoluteModalLocation (Point V2 CInt)
      | RelativeModalLocation (V2 CInt)
      deriving (ModalLocation -> ModalLocation -> Bool
    (ModalLocation -> ModalLocation -> Bool)
    -> (ModalLocation -> ModalLocation -> Bool) -> Eq ModalLocation
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    /= :: ModalLocation -> ModalLocation -> Bool
    $c/= :: ModalLocation -> ModalLocation -> Bool
    == :: ModalLocation -> ModalLocation -> Bool
    $c== :: ModalLocation -> ModalLocation -> Bool
    Eq, (forall x. ModalLocation -> Rep ModalLocation x)
    -> (forall x. Rep ModalLocation x -> ModalLocation)
    -> Generic ModalLocation
    forall x. Rep ModalLocation x -> ModalLocation
    forall x. ModalLocation -> Rep ModalLocation x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cto :: forall x. Rep ModalLocation x -> ModalLocation
    $cfrom :: forall x. ModalLocation -> Rep ModalLocation x
    Generic, Eq ModalLocation
    Eq ModalLocation =>
    (ModalLocation -> ModalLocation -> Ordering)
    -> (ModalLocation -> ModalLocation -> Bool)
    -> (ModalLocation -> ModalLocation -> Bool)
    -> (ModalLocation -> ModalLocation -> Bool)
    -> (ModalLocation -> ModalLocation -> Bool)
    -> (ModalLocation -> ModalLocation -> ModalLocation)
    -> (ModalLocation -> ModalLocation -> ModalLocation)
    -> Ord ModalLocation
    ModalLocation -> ModalLocation -> Bool
    ModalLocation -> ModalLocation -> Ordering
    ModalLocation -> ModalLocation -> ModalLocation
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    min :: ModalLocation -> ModalLocation -> ModalLocation
    $cmin :: ModalLocation -> ModalLocation -> ModalLocation
    max :: ModalLocation -> ModalLocation -> ModalLocation
    $cmax :: ModalLocation -> ModalLocation -> ModalLocation
    >= :: ModalLocation -> ModalLocation -> Bool
    $c>= :: ModalLocation -> ModalLocation -> Bool
    > :: ModalLocation -> ModalLocation -> Bool
    $c> :: ModalLocation -> ModalLocation -> Bool
    <= :: ModalLocation -> ModalLocation -> Bool
    $c<= :: ModalLocation -> ModalLocation -> Bool
    < :: ModalLocation -> ModalLocation -> Bool
    $c< :: ModalLocation -> ModalLocation -> Bool
    compare :: ModalLocation -> ModalLocation -> Ordering
    $ccompare :: ModalLocation -> ModalLocation -> Ordering
    $cp1Ord :: Eq ModalLocation
    Ord, ReadPrec [ModalLocation]
    ReadPrec ModalLocation
    Int -> ReadS ModalLocation
    ReadS [ModalLocation]
    (Int -> ReadS ModalLocation)
    -> ReadS [ModalLocation]
    -> ReadPrec ModalLocation
    -> ReadPrec [ModalLocation]
    -> Read ModalLocation
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    readListPrec :: ReadPrec [ModalLocation]
    $creadListPrec :: ReadPrec [ModalLocation]
    readPrec :: ReadPrec ModalLocation
    $creadPrec :: ReadPrec ModalLocation
    readList :: ReadS [ModalLocation]
    $creadList :: ReadS [ModalLocation]
    readsPrec :: Int -> ReadS ModalLocation
    $creadsPrec :: Int -> ReadS ModalLocation
    Read, Int -> ModalLocation -> ShowS
    [ModalLocation] -> ShowS
    ModalLocation -> String
    (Int -> ModalLocation -> ShowS)
    -> (ModalLocation -> String)
    -> ([ModalLocation] -> ShowS)
    -> Show ModalLocation
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    showList :: [ModalLocation] -> ShowS
    $cshowList :: [ModalLocation] -> ShowS
    show :: ModalLocation -> String
    $cshow :: ModalLocation -> String
    showsPrec :: Int -> ModalLocation -> ShowS
    $cshowsPrec :: Int -> ModalLocation -> ShowS
    Show, Typeable)

    -- | Return proper mouse location depending on mouse mode
    getModalMouseLocation :: MonadIO m => m ModalLocation
    getModalMouseLocation :: m ModalLocation
    getModalMouseLocation = do
      LocationMode
    mode <- m LocationMode
    forall (m :: * -> *). MonadIO m => m LocationMode
    getMouseLocationMode
      case LocationMode
    mode of
        AbsoluteLocation -> do
          Point V2 CInt
    location <- m (Point V2 CInt)
    forall (m :: * -> *). MonadIO m => m (Point V2 CInt)
    getAbsoluteMouseLocation
          ModalLocation -> m ModalLocation
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Point V2 CInt -> ModalLocation
    AbsoluteModalLocation Point V2 CInt
    location)
        RelativeLocation -> do
          V2 CInt
    location <- m (V2 CInt)
    forall (m :: * -> *). MonadIO m => m (V2 CInt)
    getRelativeMouseLocation
          ModalLocation -> m ModalLocation
    forall (m :: * -> *) a. Monad m => a -> m a
    return (V2 CInt -> ModalLocation
    RelativeModalLocation V2 CInt
    location)

    data MouseButton
      = ButtonLeft
      | ButtonMiddle
      | ButtonRight
      | ButtonX1
      | ButtonX2
      | ButtonExtra !Int -- ^ An unknown mouse button.
      deriving (Typeable MouseButton
    Constr
    DataType
    Typeable MouseButton =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> MouseButton -> c MouseButton)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c MouseButton)
    -> (MouseButton -> Constr)
    -> (MouseButton -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c MouseButton))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e))
        -> Maybe (c MouseButton))
    -> ((forall b. Data b => b -> b) -> MouseButton -> MouseButton)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> MouseButton -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> MouseButton -> r)
    -> (forall u. (forall d. Data d => d -> u) -> MouseButton -> [u])
    -> (forall u.
        Int -> (forall d. Data d => d -> u) -> MouseButton -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> MouseButton -> m MouseButton)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> MouseButton -> m MouseButton)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> MouseButton -> m MouseButton)
    -> Data MouseButton
    MouseButton -> Constr
    MouseButton -> DataType
    (forall b. Data b => b -> b) -> MouseButton -> MouseButton
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> MouseButton -> c MouseButton
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c MouseButton
    forall a.
    Typeable a =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> MouseButton -> u
    forall u. (forall d. Data d => d -> u) -> MouseButton -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> MouseButton -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> MouseButton -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> MouseButton -> m MouseButton
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> MouseButton -> m MouseButton
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c MouseButton
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> MouseButton -> c MouseButton
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c MouseButton)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c MouseButton)
    $cButtonExtra :: Constr
    $cButtonX2 :: Constr
    $cButtonX1 :: Constr
    $cButtonRight :: Constr
    $cButtonMiddle :: Constr
    $cButtonLeft :: Constr
    $tMouseButton :: DataType
    gmapMo :: (forall d. Data d => d -> m d) -> MouseButton -> m MouseButton
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> MouseButton -> m MouseButton
    gmapMp :: (forall d. Data d => d -> m d) -> MouseButton -> m MouseButton
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> MouseButton -> m MouseButton
    gmapM :: (forall d. Data d => d -> m d) -> MouseButton -> m MouseButton
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> MouseButton -> m MouseButton
    gmapQi :: Int -> (forall d. Data d => d -> u) -> MouseButton -> u
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> MouseButton -> u
    gmapQ :: (forall d. Data d => d -> u) -> MouseButton -> [u]
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> MouseButton -> [u]
    gmapQr :: (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> MouseButton -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> MouseButton -> r
    gmapQl :: (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> MouseButton -> r
    $cgmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> MouseButton -> r
    gmapT :: (forall b. Data b => b -> b) -> MouseButton -> MouseButton
    $cgmapT :: (forall b. Data b => b -> b) -> MouseButton -> MouseButton
    dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c MouseButton)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c MouseButton)
    dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c MouseButton)
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c MouseButton)
    dataTypeOf :: MouseButton -> DataType
    $cdataTypeOf :: MouseButton -> DataType
    toConstr :: MouseButton -> Constr
    $ctoConstr :: MouseButton -> Constr
    gunfold :: (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c MouseButton
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c MouseButton
    gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> MouseButton -> c MouseButton
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> MouseButton -> c MouseButton
    $cp1Data :: Typeable MouseButton
    Data, MouseButton -> MouseButton -> Bool
    (MouseButton -> MouseButton -> Bool)
    -> (MouseButton -> MouseButton -> Bool) -> Eq MouseButton
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    /= :: MouseButton -> MouseButton -> Bool
    $c/= :: MouseButton -> MouseButton -> Bool
    == :: MouseButton -> MouseButton -> Bool
    $c== :: MouseButton -> MouseButton -> Bool
    Eq, (forall x. MouseButton -> Rep MouseButton x)
    -> (forall x. Rep MouseButton x -> MouseButton)
    -> Generic MouseButton
    forall x. Rep MouseButton x -> MouseButton
    forall x. MouseButton -> Rep MouseButton x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cto :: forall x. Rep MouseButton x -> MouseButton
    $cfrom :: forall x. MouseButton -> Rep MouseButton x
    Generic, Eq MouseButton
    Eq MouseButton =>
    (MouseButton -> MouseButton -> Ordering)
    -> (MouseButton -> MouseButton -> Bool)
    -> (MouseButton -> MouseButton -> Bool)
    -> (MouseButton -> MouseButton -> Bool)
    -> (MouseButton -> MouseButton -> Bool)
    -> (MouseButton -> MouseButton -> MouseButton)
    -> (MouseButton -> MouseButton -> MouseButton)
    -> Ord MouseButton
    MouseButton -> MouseButton -> Bool
    MouseButton -> MouseButton -> Ordering
    MouseButton -> MouseButton -> MouseButton
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    min :: MouseButton -> MouseButton -> MouseButton
    $cmin :: MouseButton -> MouseButton -> MouseButton
    max :: MouseButton -> MouseButton -> MouseButton
    $cmax :: MouseButton -> MouseButton -> MouseButton
    >= :: MouseButton -> MouseButton -> Bool
    $c>= :: MouseButton -> MouseButton -> Bool
    > :: MouseButton -> MouseButton -> Bool
    $c> :: MouseButton -> MouseButton -> Bool
    <= :: MouseButton -> MouseButton -> Bool
    $c<= :: MouseButton -> MouseButton -> Bool
    < :: MouseButton -> MouseButton -> Bool
    $c< :: MouseButton -> MouseButton -> Bool
    compare :: MouseButton -> MouseButton -> Ordering
    $ccompare :: MouseButton -> MouseButton -> Ordering
    $cp1Ord :: Eq MouseButton
    Ord, ReadPrec [MouseButton]
    ReadPrec MouseButton
    Int -> ReadS MouseButton
    ReadS [MouseButton]
    (Int -> ReadS MouseButton)
    -> ReadS [MouseButton]
    -> ReadPrec MouseButton
    -> ReadPrec [MouseButton]
    -> Read MouseButton
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    readListPrec :: ReadPrec [MouseButton]
    $creadListPrec :: ReadPrec [MouseButton]
    readPrec :: ReadPrec MouseButton
    $creadPrec :: ReadPrec MouseButton
    readList :: ReadS [MouseButton]
    $creadList :: ReadS [MouseButton]
    readsPrec :: Int -> ReadS MouseButton
    $creadsPrec :: Int -> ReadS MouseButton
    Read, Int -> MouseButton -> ShowS
    [MouseButton] -> ShowS
    MouseButton -> String
    (Int -> MouseButton -> ShowS)
    -> (MouseButton -> String)
    -> ([MouseButton] -> ShowS)
    -> Show MouseButton
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    showList :: [MouseButton] -> ShowS
    $cshowList :: [MouseButton] -> ShowS
    show :: MouseButton -> String
    $cshow :: MouseButton -> String
    showsPrec :: Int -> MouseButton -> ShowS
    $cshowsPrec :: Int -> MouseButton -> ShowS
    Show, Typeable)

    instance FromNumber MouseButton Word8 where
      fromNumber :: Word8 -> MouseButton
    fromNumber Raw.SDL_BUTTON_LEFT   = MouseButton
    ButtonLeft
      fromNumber Raw.SDL_BUTTON_MIDDLE = MouseButton
    ButtonMiddle
      fromNumber Raw.SDL_BUTTON_RIGHT  = MouseButton
    ButtonRight
      fromNumber Raw.SDL_BUTTON_X1     = MouseButton
    ButtonX1
      fromNumber Raw.SDL_BUTTON_X2     = MouseButton
    ButtonX2
      fromNumber buttonCode :: Word8
    buttonCode            = Int -> MouseButton
    ButtonExtra (Int -> MouseButton) -> Int -> MouseButton
    forall a b. (a -> b) -> a -> b
    $ Word8 -> Int
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral Word8
    buttonCode

    instance ToNumber MouseButton Word8 where
      toNumber :: MouseButton -> Word8
    toNumber ButtonLeft      = Word8
    forall a. (Eq a, Num a) => a
    Raw.SDL_BUTTON_LEFT
      toNumber ButtonMiddle    = Word8
    forall a. (Eq a, Num a) => a
    Raw.SDL_BUTTON_MIDDLE
      toNumber ButtonRight     = Word8
    forall a. (Eq a, Num a) => a
    Raw.SDL_BUTTON_RIGHT
      toNumber ButtonX1        = Word8
    forall a. (Eq a, Num a) => a
    Raw.SDL_BUTTON_X1
      toNumber ButtonX2        = Word8
    forall a. (Eq a, Num a) => a
    Raw.SDL_BUTTON_X2
      toNumber (ButtonExtra i :: Int
    i) = Int -> Word8
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral Int
    i

    -- | Identifies what kind of mouse-like device this is.
    data MouseDevice
      = Mouse !Int -- ^ An actual mouse. The number identifies which mouse.
      | Touch      -- ^ Some sort of touch device.
      deriving (Typeable MouseDevice
    Constr
    DataType
    Typeable MouseDevice =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> MouseDevice -> c MouseDevice)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c MouseDevice)
    -> (MouseDevice -> Constr)
    -> (MouseDevice -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c MouseDevice))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e))
        -> Maybe (c MouseDevice))
    -> ((forall b. Data b => b -> b) -> MouseDevice -> MouseDevice)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> MouseDevice -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> MouseDevice -> r)
    -> (forall u. (forall d. Data d => d -> u) -> MouseDevice -> [u])
    -> (forall u.
        Int -> (forall d. Data d => d -> u) -> MouseDevice -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> MouseDevice -> m MouseDevice)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> MouseDevice -> m MouseDevice)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> MouseDevice -> m MouseDevice)
    -> Data MouseDevice
    MouseDevice -> Constr
    MouseDevice -> DataType
    (forall b. Data b => b -> b) -> MouseDevice -> MouseDevice
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> MouseDevice -> c MouseDevice
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c MouseDevice
    forall a.
    Typeable a =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> MouseDevice -> u
    forall u. (forall d. Data d => d -> u) -> MouseDevice -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> MouseDevice -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> MouseDevice -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> MouseDevice -> m MouseDevice
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> MouseDevice -> m MouseDevice
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c MouseDevice
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> MouseDevice -> c MouseDevice
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c MouseDevice)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c MouseDevice)
    $cTouch :: Constr
    $cMouse :: Constr
    $tMouseDevice :: DataType
    gmapMo :: (forall d. Data d => d -> m d) -> MouseDevice -> m MouseDevice
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> MouseDevice -> m MouseDevice
    gmapMp :: (forall d. Data d => d -> m d) -> MouseDevice -> m MouseDevice
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> MouseDevice -> m MouseDevice
    gmapM :: (forall d. Data d => d -> m d) -> MouseDevice -> m MouseDevice
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> MouseDevice -> m MouseDevice
    gmapQi :: Int -> (forall d. Data d => d -> u) -> MouseDevice -> u
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> MouseDevice -> u
    gmapQ :: (forall d. Data d => d -> u) -> MouseDevice -> [u]
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> MouseDevice -> [u]
    gmapQr :: (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> MouseDevice -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> MouseDevice -> r
    gmapQl :: (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> MouseDevice -> r
    $cgmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> MouseDevice -> r
    gmapT :: (forall b. Data b => b -> b) -> MouseDevice -> MouseDevice
    $cgmapT :: (forall b. Data b => b -> b) -> MouseDevice -> MouseDevice
    dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c MouseDevice)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c MouseDevice)
    dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c MouseDevice)
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c MouseDevice)
    dataTypeOf :: MouseDevice -> DataType
    $cdataTypeOf :: MouseDevice -> DataType
    toConstr :: MouseDevice -> Constr
    $ctoConstr :: MouseDevice -> Constr
    gunfold :: (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c MouseDevice
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c MouseDevice
    gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> MouseDevice -> c MouseDevice
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> MouseDevice -> c MouseDevice
    $cp1Data :: Typeable MouseDevice
    Data, MouseDevice -> MouseDevice -> Bool
    (MouseDevice -> MouseDevice -> Bool)
    -> (MouseDevice -> MouseDevice -> Bool) -> Eq MouseDevice
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    /= :: MouseDevice -> MouseDevice -> Bool
    $c/= :: MouseDevice -> MouseDevice -> Bool
    == :: MouseDevice -> MouseDevice -> Bool
    $c== :: MouseDevice -> MouseDevice -> Bool
    Eq, (forall x. MouseDevice -> Rep MouseDevice x)
    -> (forall x. Rep MouseDevice x -> MouseDevice)
    -> Generic MouseDevice
    forall x. Rep MouseDevice x -> MouseDevice
    forall x. MouseDevice -> Rep MouseDevice x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cto :: forall x. Rep MouseDevice x -> MouseDevice
    $cfrom :: forall x. MouseDevice -> Rep MouseDevice x
    Generic, Eq MouseDevice
    Eq MouseDevice =>
    (MouseDevice -> MouseDevice -> Ordering)
    -> (MouseDevice -> MouseDevice -> Bool)
    -> (MouseDevice -> MouseDevice -> Bool)
    -> (MouseDevice -> MouseDevice -> Bool)
    -> (MouseDevice -> MouseDevice -> Bool)
    -> (MouseDevice -> MouseDevice -> MouseDevice)
    -> (MouseDevice -> MouseDevice -> MouseDevice)
    -> Ord MouseDevice
    MouseDevice -> MouseDevice -> Bool
    MouseDevice -> MouseDevice -> Ordering
    MouseDevice -> MouseDevice -> MouseDevice
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    min :: MouseDevice -> MouseDevice -> MouseDevice
    $cmin :: MouseDevice -> MouseDevice -> MouseDevice
    max :: MouseDevice -> MouseDevice -> MouseDevice
    $cmax :: MouseDevice -> MouseDevice -> MouseDevice
    >= :: MouseDevice -> MouseDevice -> Bool
    $c>= :: MouseDevice -> MouseDevice -> Bool
    > :: MouseDevice -> MouseDevice -> Bool
    $c> :: MouseDevice -> MouseDevice -> Bool
    <= :: MouseDevice -> MouseDevice -> Bool
    $c<= :: MouseDevice -> MouseDevice -> Bool
    < :: MouseDevice -> MouseDevice -> Bool
    $c< :: MouseDevice -> MouseDevice -> Bool
    compare :: MouseDevice -> MouseDevice -> Ordering
    $ccompare :: MouseDevice -> MouseDevice -> Ordering
    $cp1Ord :: Eq MouseDevice
    Ord, ReadPrec [MouseDevice]
    ReadPrec MouseDevice
    Int -> ReadS MouseDevice
    ReadS [MouseDevice]
    (Int -> ReadS MouseDevice)
    -> ReadS [MouseDevice]
    -> ReadPrec MouseDevice
    -> ReadPrec [MouseDevice]
    -> Read MouseDevice
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    readListPrec :: ReadPrec [MouseDevice]
    $creadListPrec :: ReadPrec [MouseDevice]
    readPrec :: ReadPrec MouseDevice
    $creadPrec :: ReadPrec MouseDevice
    readList :: ReadS [MouseDevice]
    $creadList :: ReadS [MouseDevice]
    readsPrec :: Int -> ReadS MouseDevice
    $creadsPrec :: Int -> ReadS MouseDevice
    Read, Int -> MouseDevice -> ShowS
    [MouseDevice] -> ShowS
    MouseDevice -> String
    (Int -> MouseDevice -> ShowS)
    -> (MouseDevice -> String)
    -> ([MouseDevice] -> ShowS)
    -> Show MouseDevice
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    showList :: [MouseDevice] -> ShowS
    $cshowList :: [MouseDevice] -> ShowS
    show :: MouseDevice -> String
    $cshow :: MouseDevice -> String
    showsPrec :: Int -> MouseDevice -> ShowS
    $cshowsPrec :: Int -> MouseDevice -> ShowS
    Show, Typeable)

    instance FromNumber MouseDevice Word32 where
      fromNumber :: Word32 -> MouseDevice
    fromNumber n' :: Word32
    n' = case Word32
    n' of
        Raw.SDL_TOUCH_MOUSEID -> MouseDevice
    Touch
        n :: Word32
    n -> Int -> MouseDevice
    Mouse (Int -> MouseDevice) -> Int -> MouseDevice
    forall a b. (a -> b) -> a -> b
    $ Word32 -> Int
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral Word32
    n

    -- | Identifies mouse scroll direction.
    data MouseScrollDirection
      = ScrollNormal
      | ScrollFlipped
      deriving (MouseScrollDirection
    MouseScrollDirection
    -> MouseScrollDirection -> Bounded MouseScrollDirection
    forall a. a -> a -> Bounded a
    maxBound :: MouseScrollDirection
    $cmaxBound :: MouseScrollDirection
    minBound :: MouseScrollDirection
    $cminBound :: MouseScrollDirection
    Bounded, Typeable MouseScrollDirection
    Constr
    DataType
    Typeable MouseScrollDirection =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g)
     -> MouseScrollDirection
     -> c MouseScrollDirection)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c MouseScrollDirection)
    -> (MouseScrollDirection -> Constr)
    -> (MouseScrollDirection -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c MouseScrollDirection))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e))
        -> Maybe (c MouseScrollDirection))
    -> ((forall b. Data b => b -> b)
        -> MouseScrollDirection -> MouseScrollDirection)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> MouseScrollDirection -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> MouseScrollDirection -> r)
    -> (forall u.
        (forall d. Data d => d -> u) -> MouseScrollDirection -> [u])
    -> (forall u.
        Int -> (forall d. Data d => d -> u) -> MouseScrollDirection -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d)
        -> MouseScrollDirection -> m MouseScrollDirection)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d)
        -> MouseScrollDirection -> m MouseScrollDirection)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d)
        -> MouseScrollDirection -> m MouseScrollDirection)
    -> Data MouseScrollDirection
    MouseScrollDirection -> Constr
    MouseScrollDirection -> DataType
    (forall b. Data b => b -> b)
    -> MouseScrollDirection -> MouseScrollDirection
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g)
    -> MouseScrollDirection
    -> c MouseScrollDirection
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c MouseScrollDirection
    forall a.
    Typeable a =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u.
    Int -> (forall d. Data d => d -> u) -> MouseScrollDirection -> u
    forall u.
    (forall d. Data d => d -> u) -> MouseScrollDirection -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> MouseScrollDirection -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> MouseScrollDirection -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> MouseScrollDirection -> m MouseScrollDirection
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> MouseScrollDirection -> m MouseScrollDirection
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c MouseScrollDirection
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g)
    -> MouseScrollDirection
    -> c MouseScrollDirection
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c MouseScrollDirection)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c MouseScrollDirection)
    $cScrollFlipped :: Constr
    $cScrollNormal :: Constr
    $tMouseScrollDirection :: DataType
    gmapMo :: (forall d. Data d => d -> m d)
    -> MouseScrollDirection -> m MouseScrollDirection
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> MouseScrollDirection -> m MouseScrollDirection
    gmapMp :: (forall d. Data d => d -> m d)
    -> MouseScrollDirection -> m MouseScrollDirection
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> MouseScrollDirection -> m MouseScrollDirection
    gmapM :: (forall d. Data d => d -> m d)
    -> MouseScrollDirection -> m MouseScrollDirection
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> MouseScrollDirection -> m MouseScrollDirection
    gmapQi :: Int -> (forall d. Data d => d -> u) -> MouseScrollDirection -> u
    $cgmapQi :: forall u.
    Int -> (forall d. Data d => d -> u) -> MouseScrollDirection -> u
    gmapQ :: (forall d. Data d => d -> u) -> MouseScrollDirection -> [u]
    $cgmapQ :: forall u.
    (forall d. Data d => d -> u) -> MouseScrollDirection -> [u]
    gmapQr :: (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> MouseScrollDirection -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> MouseScrollDirection -> r
    gmapQl :: (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> MouseScrollDirection -> r
    $cgmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> MouseScrollDirection -> r
    gmapT :: (forall b. Data b => b -> b)
    -> MouseScrollDirection -> MouseScrollDirection
    $cgmapT :: (forall b. Data b => b -> b)
    -> MouseScrollDirection -> MouseScrollDirection
    dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c MouseScrollDirection)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c MouseScrollDirection)
    dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c MouseScrollDirection)
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c MouseScrollDirection)
    dataTypeOf :: MouseScrollDirection -> DataType
    $cdataTypeOf :: MouseScrollDirection -> DataType
    toConstr :: MouseScrollDirection -> Constr
    $ctoConstr :: MouseScrollDirection -> Constr
    gunfold :: (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c MouseScrollDirection
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c MouseScrollDirection
    gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g)
    -> MouseScrollDirection
    -> c MouseScrollDirection
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g)
    -> MouseScrollDirection
    -> c MouseScrollDirection
    $cp1Data :: Typeable MouseScrollDirection
    Data, MouseScrollDirection -> MouseScrollDirection -> Bool
    (MouseScrollDirection -> MouseScrollDirection -> Bool)
    -> (MouseScrollDirection -> MouseScrollDirection -> Bool)
    -> Eq MouseScrollDirection
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    /= :: MouseScrollDirection -> MouseScrollDirection -> Bool
    $c/= :: MouseScrollDirection -> MouseScrollDirection -> Bool
    == :: MouseScrollDirection -> MouseScrollDirection -> Bool
    $c== :: MouseScrollDirection -> MouseScrollDirection -> Bool
    Eq, Int -> MouseScrollDirection
    MouseScrollDirection -> Int
    MouseScrollDirection -> [MouseScrollDirection]
    MouseScrollDirection -> MouseScrollDirection
    MouseScrollDirection
    -> MouseScrollDirection -> [MouseScrollDirection]
    MouseScrollDirection
    -> MouseScrollDirection
    -> MouseScrollDirection
    -> [MouseScrollDirection]
    (MouseScrollDirection -> MouseScrollDirection)
    -> (MouseScrollDirection -> MouseScrollDirection)
    -> (Int -> MouseScrollDirection)
    -> (MouseScrollDirection -> Int)
    -> (MouseScrollDirection -> [MouseScrollDirection])
    -> (MouseScrollDirection
        -> MouseScrollDirection -> [MouseScrollDirection])
    -> (MouseScrollDirection
        -> MouseScrollDirection -> [MouseScrollDirection])
    -> (MouseScrollDirection
        -> MouseScrollDirection
        -> MouseScrollDirection
        -> [MouseScrollDirection])
    -> Enum MouseScrollDirection
    forall a.
    (a -> a)
    -> (a -> a)
    -> (Int -> a)
    -> (a -> Int)
    -> (a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> [a])
    -> (a -> a -> a -> [a])
    -> Enum a
    enumFromThenTo :: MouseScrollDirection
    -> MouseScrollDirection
    -> MouseScrollDirection
    -> [MouseScrollDirection]
    $cenumFromThenTo :: MouseScrollDirection
    -> MouseScrollDirection
    -> MouseScrollDirection
    -> [MouseScrollDirection]
    enumFromTo :: MouseScrollDirection
    -> MouseScrollDirection -> [MouseScrollDirection]
    $cenumFromTo :: MouseScrollDirection
    -> MouseScrollDirection -> [MouseScrollDirection]
    enumFromThen :: MouseScrollDirection
    -> MouseScrollDirection -> [MouseScrollDirection]
    $cenumFromThen :: MouseScrollDirection
    -> MouseScrollDirection -> [MouseScrollDirection]
    enumFrom :: MouseScrollDirection -> [MouseScrollDirection]
    $cenumFrom :: MouseScrollDirection -> [MouseScrollDirection]
    fromEnum :: MouseScrollDirection -> Int
    $cfromEnum :: MouseScrollDirection -> Int
    toEnum :: Int -> MouseScrollDirection
    $ctoEnum :: Int -> MouseScrollDirection
    pred :: MouseScrollDirection -> MouseScrollDirection
    $cpred :: MouseScrollDirection -> MouseScrollDirection
    succ :: MouseScrollDirection -> MouseScrollDirection
    $csucc :: MouseScrollDirection -> MouseScrollDirection
    Enum, (forall x. MouseScrollDirection -> Rep MouseScrollDirection x)
    -> (forall x. Rep MouseScrollDirection x -> MouseScrollDirection)
    -> Generic MouseScrollDirection
    forall x. Rep MouseScrollDirection x -> MouseScrollDirection
    forall x. MouseScrollDirection -> Rep MouseScrollDirection x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cto :: forall x. Rep MouseScrollDirection x -> MouseScrollDirection
    $cfrom :: forall x. MouseScrollDirection -> Rep MouseScrollDirection x
    Generic, Eq MouseScrollDirection
    Eq MouseScrollDirection =>
    (MouseScrollDirection -> MouseScrollDirection -> Ordering)
    -> (MouseScrollDirection -> MouseScrollDirection -> Bool)
    -> (MouseScrollDirection -> MouseScrollDirection -> Bool)
    -> (MouseScrollDirection -> MouseScrollDirection -> Bool)
    -> (MouseScrollDirection -> MouseScrollDirection -> Bool)
    -> (MouseScrollDirection
        -> MouseScrollDirection -> MouseScrollDirection)
    -> (MouseScrollDirection
        -> MouseScrollDirection -> MouseScrollDirection)
    -> Ord MouseScrollDirection
    MouseScrollDirection -> MouseScrollDirection -> Bool
    MouseScrollDirection -> MouseScrollDirection -> Ordering
    MouseScrollDirection
    -> MouseScrollDirection -> MouseScrollDirection
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    min :: MouseScrollDirection
    -> MouseScrollDirection -> MouseScrollDirection
    $cmin :: MouseScrollDirection
    -> MouseScrollDirection -> MouseScrollDirection
    max :: MouseScrollDirection
    -> MouseScrollDirection -> MouseScrollDirection
    $cmax :: MouseScrollDirection
    -> MouseScrollDirection -> MouseScrollDirection
    >= :: MouseScrollDirection -> MouseScrollDirection -> Bool
    $c>= :: MouseScrollDirection -> MouseScrollDirection -> Bool
    > :: MouseScrollDirection -> MouseScrollDirection -> Bool
    $c> :: MouseScrollDirection -> MouseScrollDirection -> Bool
    <= :: MouseScrollDirection -> MouseScrollDirection -> Bool
    $c<= :: MouseScrollDirection -> MouseScrollDirection -> Bool
    < :: MouseScrollDirection -> MouseScrollDirection -> Bool
    $c< :: MouseScrollDirection -> MouseScrollDirection -> Bool
    compare :: MouseScrollDirection -> MouseScrollDirection -> Ordering
    $ccompare :: MouseScrollDirection -> MouseScrollDirection -> Ordering
    $cp1Ord :: Eq MouseScrollDirection
    Ord, ReadPrec [MouseScrollDirection]
    ReadPrec MouseScrollDirection
    Int -> ReadS MouseScrollDirection
    ReadS [MouseScrollDirection]
    (Int -> ReadS MouseScrollDirection)
    -> ReadS [MouseScrollDirection]
    -> ReadPrec MouseScrollDirection
    -> ReadPrec [MouseScrollDirection]
    -> Read MouseScrollDirection
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    readListPrec :: ReadPrec [MouseScrollDirection]
    $creadListPrec :: ReadPrec [MouseScrollDirection]
    readPrec :: ReadPrec MouseScrollDirection
    $creadPrec :: ReadPrec MouseScrollDirection
    readList :: ReadS [MouseScrollDirection]
    $creadList :: ReadS [MouseScrollDirection]
    readsPrec :: Int -> ReadS MouseScrollDirection
    $creadsPrec :: Int -> ReadS MouseScrollDirection
    Read, Int -> MouseScrollDirection -> ShowS
    [MouseScrollDirection] -> ShowS
    MouseScrollDirection -> String
    (Int -> MouseScrollDirection -> ShowS)
    -> (MouseScrollDirection -> String)
    -> ([MouseScrollDirection] -> ShowS)
    -> Show MouseScrollDirection
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    showList :: [MouseScrollDirection] -> ShowS
    $cshowList :: [MouseScrollDirection] -> ShowS
    show :: MouseScrollDirection -> String
    $cshow :: MouseScrollDirection -> String
    showsPrec :: Int -> MouseScrollDirection -> ShowS
    $cshowsPrec :: Int -> MouseScrollDirection -> ShowS
    Show, Typeable)

    instance FromNumber MouseScrollDirection Word32 where
      fromNumber :: Word32 -> MouseScrollDirection
    fromNumber n' :: Word32
    n' = case Word32
    n' of
        Raw.SDL_MOUSEWHEEL_NORMAL -> MouseScrollDirection
    ScrollNormal
        Raw.SDL_MOUSEWHEEL_FLIPPED -> MouseScrollDirection
    ScrollFlipped
        _ -> MouseScrollDirection
    ScrollNormal

    data WarpMouseOrigin
      = WarpInWindow Window
        -- ^ Move the mouse pointer within a given 'Window'.
      | WarpCurrentFocus
        -- ^ Move the mouse pointer within whichever 'Window' currently has focus.
      | WarpGlobal
        -- ^ Move the mouse pointer in global screen space.
      deriving (Typeable WarpMouseOrigin
    Constr
    DataType
    Typeable WarpMouseOrigin =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> WarpMouseOrigin -> c WarpMouseOrigin)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c WarpMouseOrigin)
    -> (WarpMouseOrigin -> Constr)
    -> (WarpMouseOrigin -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c WarpMouseOrigin))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e))
        -> Maybe (c WarpMouseOrigin))
    -> ((forall b. Data b => b -> b)
        -> WarpMouseOrigin -> WarpMouseOrigin)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> WarpMouseOrigin -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> WarpMouseOrigin -> r)
    -> (forall u.
        (forall d. Data d => d -> u) -> WarpMouseOrigin -> [u])
    -> (forall u.
        Int -> (forall d. Data d => d -> u) -> WarpMouseOrigin -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d)
        -> WarpMouseOrigin -> m WarpMouseOrigin)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d)
        -> WarpMouseOrigin -> m WarpMouseOrigin)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d)
        -> WarpMouseOrigin -> m WarpMouseOrigin)
    -> Data WarpMouseOrigin
    WarpMouseOrigin -> Constr
    WarpMouseOrigin -> DataType
    (forall b. Data b => b -> b) -> WarpMouseOrigin -> WarpMouseOrigin
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> WarpMouseOrigin -> c WarpMouseOrigin
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c WarpMouseOrigin
    forall a.
    Typeable a =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u.
    Int -> (forall d. Data d => d -> u) -> WarpMouseOrigin -> u
    forall u. (forall d. Data d => d -> u) -> WarpMouseOrigin -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> WarpMouseOrigin -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> WarpMouseOrigin -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> WarpMouseOrigin -> m WarpMouseOrigin
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> WarpMouseOrigin -> m WarpMouseOrigin
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c WarpMouseOrigin
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> WarpMouseOrigin -> c WarpMouseOrigin
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c WarpMouseOrigin)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c WarpMouseOrigin)
    $cWarpGlobal :: Constr
    $cWarpCurrentFocus :: Constr
    $cWarpInWindow :: Constr
    $tWarpMouseOrigin :: DataType
    gmapMo :: (forall d. Data d => d -> m d)
    -> WarpMouseOrigin -> m WarpMouseOrigin
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> WarpMouseOrigin -> m WarpMouseOrigin
    gmapMp :: (forall d. Data d => d -> m d)
    -> WarpMouseOrigin -> m WarpMouseOrigin
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> WarpMouseOrigin -> m WarpMouseOrigin
    gmapM :: (forall d. Data d => d -> m d)
    -> WarpMouseOrigin -> m WarpMouseOrigin
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> WarpMouseOrigin -> m WarpMouseOrigin
    gmapQi :: Int -> (forall d. Data d => d -> u) -> WarpMouseOrigin -> u
    $cgmapQi :: forall u.
    Int -> (forall d. Data d => d -> u) -> WarpMouseOrigin -> u
    gmapQ :: (forall d. Data d => d -> u) -> WarpMouseOrigin -> [u]
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> WarpMouseOrigin -> [u]
    gmapQr :: (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> WarpMouseOrigin -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> WarpMouseOrigin -> r
    gmapQl :: (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> WarpMouseOrigin -> r
    $cgmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> WarpMouseOrigin -> r
    gmapT :: (forall b. Data b => b -> b) -> WarpMouseOrigin -> WarpMouseOrigin
    $cgmapT :: (forall b. Data b => b -> b) -> WarpMouseOrigin -> WarpMouseOrigin
    dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c WarpMouseOrigin)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c WarpMouseOrigin)
    dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c WarpMouseOrigin)
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c WarpMouseOrigin)
    dataTypeOf :: WarpMouseOrigin -> DataType
    $cdataTypeOf :: WarpMouseOrigin -> DataType
    toConstr :: WarpMouseOrigin -> Constr
    $ctoConstr :: WarpMouseOrigin -> Constr
    gunfold :: (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c WarpMouseOrigin
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c WarpMouseOrigin
    gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> WarpMouseOrigin -> c WarpMouseOrigin
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> WarpMouseOrigin -> c WarpMouseOrigin
    $cp1Data :: Typeable WarpMouseOrigin
    Data, WarpMouseOrigin -> WarpMouseOrigin -> Bool
    (WarpMouseOrigin -> WarpMouseOrigin -> Bool)
    -> (WarpMouseOrigin -> WarpMouseOrigin -> Bool)
    -> Eq WarpMouseOrigin
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    /= :: WarpMouseOrigin -> WarpMouseOrigin -> Bool
    $c/= :: WarpMouseOrigin -> WarpMouseOrigin -> Bool
    == :: WarpMouseOrigin -> WarpMouseOrigin -> Bool
    $c== :: WarpMouseOrigin -> WarpMouseOrigin -> Bool
    Eq, (forall x. WarpMouseOrigin -> Rep WarpMouseOrigin x)
    -> (forall x. Rep WarpMouseOrigin x -> WarpMouseOrigin)
    -> Generic WarpMouseOrigin
    forall x. Rep WarpMouseOrigin x -> WarpMouseOrigin
    forall x. WarpMouseOrigin -> Rep WarpMouseOrigin x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cto :: forall x. Rep WarpMouseOrigin x -> WarpMouseOrigin
    $cfrom :: forall x. WarpMouseOrigin -> Rep WarpMouseOrigin x
    Generic, Eq WarpMouseOrigin
    Eq WarpMouseOrigin =>
    (WarpMouseOrigin -> WarpMouseOrigin -> Ordering)
    -> (WarpMouseOrigin -> WarpMouseOrigin -> Bool)
    -> (WarpMouseOrigin -> WarpMouseOrigin -> Bool)
    -> (WarpMouseOrigin -> WarpMouseOrigin -> Bool)
    -> (WarpMouseOrigin -> WarpMouseOrigin -> Bool)
    -> (WarpMouseOrigin -> WarpMouseOrigin -> WarpMouseOrigin)
    -> (WarpMouseOrigin -> WarpMouseOrigin -> WarpMouseOrigin)
    -> Ord WarpMouseOrigin
    WarpMouseOrigin -> WarpMouseOrigin -> Bool
    WarpMouseOrigin -> WarpMouseOrigin -> Ordering
    WarpMouseOrigin -> WarpMouseOrigin -> WarpMouseOrigin
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    min :: WarpMouseOrigin -> WarpMouseOrigin -> WarpMouseOrigin
    $cmin :: WarpMouseOrigin -> WarpMouseOrigin -> WarpMouseOrigin
    max :: WarpMouseOrigin -> WarpMouseOrigin -> WarpMouseOrigin
    $cmax :: WarpMouseOrigin -> WarpMouseOrigin -> WarpMouseOrigin
    >= :: WarpMouseOrigin -> WarpMouseOrigin -> Bool
    $c>= :: WarpMouseOrigin -> WarpMouseOrigin -> Bool
    > :: WarpMouseOrigin -> WarpMouseOrigin -> Bool
    $c> :: WarpMouseOrigin -> WarpMouseOrigin -> Bool
    <= :: WarpMouseOrigin -> WarpMouseOrigin -> Bool
    $c<= :: WarpMouseOrigin -> WarpMouseOrigin -> Bool
    < :: WarpMouseOrigin -> WarpMouseOrigin -> Bool
    $c< :: WarpMouseOrigin -> WarpMouseOrigin -> Bool
    compare :: WarpMouseOrigin -> WarpMouseOrigin -> Ordering
    $ccompare :: WarpMouseOrigin -> WarpMouseOrigin -> Ordering
    $cp1Ord :: Eq WarpMouseOrigin
    Ord, Int -> WarpMouseOrigin -> ShowS
    [WarpMouseOrigin] -> ShowS
    WarpMouseOrigin -> String
    (Int -> WarpMouseOrigin -> ShowS)
    -> (WarpMouseOrigin -> String)
    -> ([WarpMouseOrigin] -> ShowS)
    -> Show WarpMouseOrigin
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    showList :: [WarpMouseOrigin] -> ShowS
    $cshowList :: [WarpMouseOrigin] -> ShowS
    show :: WarpMouseOrigin -> String
    $cshow :: WarpMouseOrigin -> String
    showsPrec :: Int -> WarpMouseOrigin -> ShowS
    $cshowsPrec :: Int -> WarpMouseOrigin -> ShowS
    Show, Typeable)

    -- | Move the current location of a mouse pointer. The 'WarpMouseOrigin' specifies the origin for the given warp coordinates.
    warpMouse :: MonadIO m => WarpMouseOrigin -> Point V2 CInt -> m ()
    warpMouse :: WarpMouseOrigin -> Point V2 CInt -> m ()
    warpMouse (WarpInWindow (Window w :: Window
    w)) (P (V2 x :: CInt
    x y :: CInt
    y)) = Window -> CInt -> CInt -> m ()
    forall (m :: * -> *). MonadIO m => Window -> CInt -> CInt -> m ()
    Raw.warpMouseInWindow Window
    w CInt
    x CInt
    y
    warpMouse WarpCurrentFocus (P (V2 x :: CInt
    x y :: CInt
    y)) = Window -> CInt -> CInt -> m ()
    forall (m :: * -> *). MonadIO m => Window -> CInt -> CInt -> m ()
    Raw.warpMouseInWindow Window
    forall a. Ptr a
    nullPtr CInt
    x CInt
    y
    warpMouse WarpGlobal (P (V2 x :: CInt
    x y :: CInt
    y)) = Text -> Text -> m CInt -> m ()
    forall (m :: * -> *) a.
    (MonadIO m, Num a, Ord a) =>
    Text -> Text -> m a -> m ()
    throwIfNeg_ "SDL.Mouse.warpMouse" "SDL_WarpMouseGlobal" (m CInt -> m ()) -> m CInt -> m ()
    forall a b. (a -> b) -> a -> b
    $
      CInt -> CInt -> m CInt
    forall (m :: * -> *). MonadIO m => CInt -> CInt -> m CInt
    Raw.warpMouseGlobal CInt
    x CInt
    y

    -- | Get or set whether the cursor is currently visible.
    --
    -- This 'StateVar' can be modified using '$=' and the current value retrieved with 'get'.
    --
    -- See @<https://wiki.libsdl.org/SDL_ShowCursor SDL_ShowCursor>@ and @<https://wiki.libsdl.org/SDL_HideCursor SDL_HideCursor>@ for C documentation.
    cursorVisible :: StateVar Bool
    cursorVisible :: StateVar Bool
    cursorVisible = IO Bool -> (Bool -> IO ()) -> StateVar Bool
    forall a. IO a -> (a -> IO ()) -> StateVar a
    makeStateVar IO Bool
    forall (m :: * -> *). (Functor m, MonadIO m) => m Bool
    getCursorVisible Bool -> IO ()
    forall (m :: * -> *). (Functor m, MonadIO m) => Bool -> m ()
    setCursorVisible
      where
      -- The usage of 'void' is OK here - Raw.showCursor just returns the old state.
      setCursorVisible :: (Functor m, MonadIO m) => Bool -> m ()
      setCursorVisible :: Bool -> m ()
    setCursorVisible True = m CInt -> m ()
    forall (f :: * -> *) a. Functor f => f a -> f ()
    void (m CInt -> m ()) -> m CInt -> m ()
    forall a b. (a -> b) -> a -> b
    $ CInt -> m CInt
    forall (m :: * -> *). MonadIO m => CInt -> m CInt
    Raw.showCursor 1
      setCursorVisible False = m CInt -> m ()
    forall (f :: * -> *) a. Functor f => f a -> f ()
    void (m CInt -> m ()) -> m CInt -> m ()
    forall a b. (a -> b) -> a -> b
    $ CInt -> m CInt
    forall (m :: * -> *). MonadIO m => CInt -> m CInt
    Raw.showCursor 0

      getCursorVisible :: (Functor m, MonadIO m) => m Bool
      getCursorVisible :: m Bool
    getCursorVisible = (CInt -> CInt -> Bool
    forall a. Eq a => a -> a -> Bool
    == 1) (CInt -> Bool) -> m CInt -> m Bool
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> CInt -> m CInt
    forall (m :: * -> *). MonadIO m => CInt -> m CInt
    Raw.showCursor (-1)

    -- | Retrieve the current location of the mouse, relative to the currently focused window.
    getAbsoluteMouseLocation :: MonadIO m => m (Point V2 CInt)
    getAbsoluteMouseLocation :: m (Point V2 CInt)
    getAbsoluteMouseLocation = IO (Point V2 CInt) -> m (Point V2 CInt)
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO (Point V2 CInt) -> m (Point V2 CInt))
    -> IO (Point V2 CInt) -> m (Point V2 CInt)
    forall a b. (a -> b) -> a -> b
    $
      (Ptr CInt -> IO (Point V2 CInt)) -> IO (Point V2 CInt)
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr CInt -> IO (Point V2 CInt)) -> IO (Point V2 CInt))
    -> (Ptr CInt -> IO (Point V2 CInt)) -> IO (Point V2 CInt)
    forall a b. (a -> b) -> a -> b
    $ \x :: Ptr CInt
    x ->
      (Ptr CInt -> IO (Point V2 CInt)) -> IO (Point V2 CInt)
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr CInt -> IO (Point V2 CInt)) -> IO (Point V2 CInt))
    -> (Ptr CInt -> IO (Point V2 CInt)) -> IO (Point V2 CInt)
    forall a b. (a -> b) -> a -> b
    $ \y :: Ptr CInt
    y -> do
        Word32
    _ <- Ptr CInt -> Ptr CInt -> IO Word32
    forall (m :: * -> *). MonadIO m => Ptr CInt -> Ptr CInt -> m Word32
    Raw.getMouseState Ptr CInt
    x Ptr CInt
    y -- We don't deal with button states here
        V2 CInt -> Point V2 CInt
    forall (f :: * -> *) a. f a -> Point f a
    P (V2 CInt -> Point V2 CInt) -> IO (V2 CInt) -> IO (Point V2 CInt)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (CInt -> CInt -> V2 CInt
    forall a. a -> a -> V2 a
    V2 (CInt -> CInt -> V2 CInt) -> IO CInt -> IO (CInt -> V2 CInt)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr CInt -> IO CInt
    forall a. Storable a => Ptr a -> IO a
    peek Ptr CInt
    x IO (CInt -> V2 CInt) -> IO CInt -> IO (V2 CInt)
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> Ptr CInt -> IO CInt
    forall a. Storable a => Ptr a -> IO a
    peek Ptr CInt
    y)

    -- | Retrieve mouse motion
    getRelativeMouseLocation :: MonadIO m => m (V2 CInt)
    getRelativeMouseLocation :: m (V2 CInt)
    getRelativeMouseLocation = IO (V2 CInt) -> m (V2 CInt)
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO (V2 CInt) -> m (V2 CInt)) -> IO (V2 CInt) -> m (V2 CInt)
    forall a b. (a -> b) -> a -> b
    $
      (Ptr CInt -> IO (V2 CInt)) -> IO (V2 CInt)
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr CInt -> IO (V2 CInt)) -> IO (V2 CInt))
    -> (Ptr CInt -> IO (V2 CInt)) -> IO (V2 CInt)
    forall a b. (a -> b) -> a -> b
    $ \x :: Ptr CInt
    x ->
      (Ptr CInt -> IO (V2 CInt)) -> IO (V2 CInt)
    forall a b. Storable a => (Ptr a -> IO b) -> IO b
    alloca ((Ptr CInt -> IO (V2 CInt)) -> IO (V2 CInt))
    -> (Ptr CInt -> IO (V2 CInt)) -> IO (V2 CInt)
    forall a b. (a -> b) -> a -> b
    $ \y :: Ptr CInt
    y -> do
        Word32
    _ <- Ptr CInt -> Ptr CInt -> IO Word32
    forall (m :: * -> *). MonadIO m => Ptr CInt -> Ptr CInt -> m Word32
    Raw.getRelativeMouseState Ptr CInt
    x Ptr CInt
    y
        CInt -> CInt -> V2 CInt
    forall a. a -> a -> V2 a
    V2 (CInt -> CInt -> V2 CInt) -> IO CInt -> IO (CInt -> V2 CInt)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr CInt -> IO CInt
    forall a. Storable a => Ptr a -> IO a
    peek Ptr CInt
    x IO (CInt -> V2 CInt) -> IO CInt -> IO (V2 CInt)
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> Ptr CInt -> IO CInt
    forall a. Storable a => Ptr a -> IO a
    peek Ptr CInt
    y

    -- | Retrieve a mapping of which buttons are currently held down.
    getMouseButtons :: MonadIO m => m (MouseButton -> Bool)
    getMouseButtons :: m (MouseButton -> Bool)
    getMouseButtons = IO (MouseButton -> Bool) -> m (MouseButton -> Bool)
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO (MouseButton -> Bool) -> m (MouseButton -> Bool))
    -> IO (MouseButton -> Bool) -> m (MouseButton -> Bool)
    forall a b. (a -> b) -> a -> b
    $
      Word32 -> MouseButton -> Bool
    forall a a a. (Bits a, ToNumber a a) => a -> a -> Bool
    convert (Word32 -> MouseButton -> Bool)
    -> IO Word32 -> IO (MouseButton -> Bool)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Ptr CInt -> Ptr CInt -> IO Word32
    forall (m :: * -> *). MonadIO m => Ptr CInt -> Ptr CInt -> m Word32
    Raw.getMouseState Ptr CInt
    forall a. Ptr a
    nullPtr Ptr CInt
    forall a. Ptr a
    nullPtr
      where
        convert :: a -> a -> Bool
    convert w :: a
    w b :: a
    b = a
    w a -> Int -> Bool
    forall a. Bits a => a -> Int -> Bool
    `testBit` a -> Int
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (a -> a
    forall a b. ToNumber a b => a -> b
    toNumber a
    b a -> a -> a
    forall a. Num a => a -> a -> a
    - 1)

    newtype Cursor = Cursor { Cursor -> Window
    unwrapCursor :: Raw.Cursor }
        deriving (Cursor -> Cursor -> Bool
    (Cursor -> Cursor -> Bool)
    -> (Cursor -> Cursor -> Bool) -> Eq Cursor
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    /= :: Cursor -> Cursor -> Bool
    $c/= :: Cursor -> Cursor -> Bool
    == :: Cursor -> Cursor -> Bool
    $c== :: Cursor -> Cursor -> Bool
    Eq, Typeable)

    -- | Get or set the currently active cursor. You can create new 'Cursor's with 'createCursor'.
    --
    -- This 'StateVar' can be modified using '$=' and the current value retrieved with 'get'.
    --
    -- See @<https://wiki.libsdl.org/SDL_SetCursor SDL_SetCursor>@ and @<https://wiki.libsdl.org/SDL_GetCursor SDL_GetCursor>@ for C documentation.
    activeCursor :: StateVar Cursor
    activeCursor :: StateVar Cursor
    activeCursor = IO Cursor -> (Cursor -> IO ()) -> StateVar Cursor
    forall a. IO a -> (a -> IO ()) -> StateVar a
    makeStateVar IO Cursor
    forall (m :: * -> *). MonadIO m => m Cursor
    getCursor Cursor -> IO ()
    forall (m :: * -> *). MonadIO m => Cursor -> m ()
    setCursor
      where
      getCursor :: MonadIO m => m Cursor
      getCursor :: m Cursor
    getCursor = IO Cursor -> m Cursor
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Cursor -> m Cursor)
    -> (IO Window -> IO Cursor) -> IO Window -> m Cursor
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (Window -> Cursor) -> IO Window -> IO Cursor
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap Window -> Cursor
    Cursor (IO Window -> m Cursor) -> IO Window -> m Cursor
    forall a b. (a -> b) -> a -> b
    $
          Text -> Text -> IO Window -> IO Window
    forall (m :: * -> *) a.
    MonadIO m =>
    Text -> Text -> m (Ptr a) -> m (Ptr a)
    throwIfNull "SDL.Input.Mouse.getCursor" "SDL_getCursor"
              IO Window
    forall (m :: * -> *). MonadIO m => m Window
    Raw.getCursor

      setCursor :: MonadIO m => Cursor -> m ()
      setCursor :: Cursor -> m ()
    setCursor = Window -> m ()
    forall (m :: * -> *). MonadIO m => Window -> m ()
    Raw.setCursor (Window -> m ()) -> (Cursor -> Window) -> Cursor -> m ()
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Cursor -> Window
    unwrapCursor

    -- | Create a cursor using the specified bitmap data and mask (in MSB format).
    --
    --
    createCursor :: MonadIO m
                 => V.Vector Bool -- ^ Whether this part of the cursor is black. Use 'False' for white and 'True' for black.
                 -> V.Vector Bool -- ^ Whether or not pixels are visible. Use 'True' for visible and 'False' for transparent.
                 -> V2 CInt -- ^ The width and height of the cursor.
                 -> Point V2 CInt -- ^ The X- and Y-axis location of the upper left corner of the cursor relative to the actual mouse position
                 -> m Cursor
    createCursor :: Vector Bool -> Vector Bool -> V2 CInt -> Point V2 CInt -> m Cursor
    createCursor dta :: Vector Bool
    dta msk :: Vector Bool
    msk (V2 w :: CInt
    w h :: CInt
    h) (P (V2 hx :: CInt
    hx hy :: CInt
    hy)) =
        IO Cursor -> m Cursor
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Cursor -> m Cursor)
    -> (IO Window -> IO Cursor) -> IO Window -> m Cursor
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (Window -> Cursor) -> IO Window -> IO Cursor
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap Window -> Cursor
    Cursor (IO Window -> m Cursor) -> IO Window -> m Cursor
    forall a b. (a -> b) -> a -> b
    $
            Text -> Text -> IO Window -> IO Window
    forall (m :: * -> *) a.
    MonadIO m =>
    Text -> Text -> m (Ptr a) -> m (Ptr a)
    throwIfNull "SDL.Input.Mouse.createCursor" "SDL_createCursor" (IO Window -> IO Window) -> IO Window -> IO Window
    forall a b. (a -> b) -> a -> b
    $
                Vector Word8 -> (Ptr Word8 -> IO Window) -> IO Window
    forall a b. Storable a => Vector a -> (Ptr a -> IO b) -> IO b
    V.unsafeWith ((Bool -> Word8) -> Vector Bool -> Vector Word8
    forall a b.
    (Storable a, Storable b) =>
    (a -> b) -> Vector a -> Vector b
    V.map (Word8 -> Word8 -> Bool -> Word8
    forall a. a -> a -> Bool -> a
    bool 0 1) Vector Bool
    dta) ((Ptr Word8 -> IO Window) -> IO Window)
    -> (Ptr Word8 -> IO Window) -> IO Window
    forall a b. (a -> b) -> a -> b
    $ \unsafeDta :: Ptr Word8
    unsafeDta ->
                Vector Word8 -> (Ptr Word8 -> IO Window) -> IO Window
    forall a b. Storable a => Vector a -> (Ptr a -> IO b) -> IO b
    V.unsafeWith ((Bool -> Word8) -> Vector Bool -> Vector Word8
    forall a b.
    (Storable a, Storable b) =>
    (a -> b) -> Vector a -> Vector b
    V.map (Word8 -> Word8 -> Bool -> Word8
    forall a. a -> a -> Bool -> a
    bool 0 1) Vector Bool
    msk) ((Ptr Word8 -> IO Window) -> IO Window)
    -> (Ptr Word8 -> IO Window) -> IO Window
    forall a b. (a -> b) -> a -> b
    $ \unsafeMsk :: Ptr Word8
    unsafeMsk ->
                    Ptr Word8 -> Ptr Word8 -> CInt -> CInt -> CInt -> CInt -> IO Window
    forall (m :: * -> *).
    MonadIO m =>
    Ptr Word8 -> Ptr Word8 -> CInt -> CInt -> CInt -> CInt -> m Window
    Raw.createCursor Ptr Word8
    unsafeDta Ptr Word8
    unsafeMsk CInt
    w CInt
    h CInt
    hx CInt
    hy

    -- | Free a cursor created with 'createCursor' and 'createColorCusor'.
    --
    -- See @<https://wiki.libsdl.org/SDL_FreeCursor SDL_FreeCursor>@ for C documentation.
    freeCursor :: MonadIO m => Cursor -> m ()
    freeCursor :: Cursor -> m ()
    freeCursor = Window -> m ()
    forall (m :: * -> *). MonadIO m => Window -> m ()
    Raw.freeCursor (Window -> m ()) -> (Cursor -> Window) -> Cursor -> m ()
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Cursor -> Window
    unwrapCursor

    -- | Create a color cursor.
    --
    -- See @<https://wiki.libsdl.org/SDL_CreateColorCursor SDL_CreateColorCursor>@ for C documentation.
    createColorCursor :: MonadIO m
                      => Surface
                      -> Point V2 CInt -- ^ The location of the cursor hot spot
                      -> m Cursor
    createColorCursor :: Surface -> Point V2 CInt -> m Cursor
    createColorCursor (Surface surfPtr :: Ptr Surface
    surfPtr _) (P (V2 hx :: CInt
    hx hy :: CInt
    hy)) =
        IO Cursor -> m Cursor
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Cursor -> m Cursor)
    -> (IO Window -> IO Cursor) -> IO Window -> m Cursor
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (Window -> Cursor) -> IO Window -> IO Cursor
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap Window -> Cursor
    Cursor (IO Window -> m Cursor) -> IO Window -> m Cursor
    forall a b. (a -> b) -> a -> b
    $
            Text -> Text -> IO Window -> IO Window
    forall (m :: * -> *) a.
    MonadIO m =>
    Text -> Text -> m (Ptr a) -> m (Ptr a)
    throwIfNull "SDL.Input.Mouse.createColorCursor" "SDL_createColorCursor" (IO Window -> IO Window) -> IO Window -> IO Window
    forall a b. (a -> b) -> a -> b
    $
                Ptr Surface -> CInt -> CInt -> IO Window
    forall (m :: * -> *).
    MonadIO m =>
    Ptr Surface -> CInt -> CInt -> m Window
    Raw.createColorCursor Ptr Surface
    surfPtr CInt
    hx CInt
    hy