#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Callbacks
(
C_EventFunc ,
EventFunc ,
EventFunc_WithClosures ,
drop_closures_EventFunc ,
dynamic_EventFunc ,
genClosure_EventFunc ,
mk_EventFunc ,
noEventFunc ,
noEventFunc_WithClosures ,
wrap_EventFunc ,
C_FilterFunc ,
FilterFunc ,
FilterFunc_WithClosures ,
drop_closures_FilterFunc ,
dynamic_FilterFunc ,
genClosure_FilterFunc ,
mk_FilterFunc ,
noFilterFunc ,
noFilterFunc_WithClosures ,
wrap_FilterFunc ,
C_SeatGrabPrepareFunc ,
SeatGrabPrepareFunc ,
SeatGrabPrepareFunc_WithClosures ,
drop_closures_SeatGrabPrepareFunc ,
dynamic_SeatGrabPrepareFunc ,
genClosure_SeatGrabPrepareFunc ,
mk_SeatGrabPrepareFunc ,
noSeatGrabPrepareFunc ,
noSeatGrabPrepareFunc_WithClosures ,
wrap_SeatGrabPrepareFunc ,
C_WindowChildFunc ,
WindowChildFunc ,
WindowChildFunc_WithClosures ,
drop_closures_WindowChildFunc ,
dynamic_WindowChildFunc ,
genClosure_WindowChildFunc ,
mk_WindowChildFunc ,
noWindowChildFunc ,
noWindowChildFunc_WithClosures ,
wrap_WindowChildFunc ,
C_WindowInvalidateHandlerFunc ,
WindowInvalidateHandlerFunc ,
dynamic_WindowInvalidateHandlerFunc ,
genClosure_WindowInvalidateHandlerFunc ,
mk_WindowInvalidateHandlerFunc ,
noWindowInvalidateHandlerFunc ,
wrap_WindowInvalidateHandlerFunc ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.Cairo.Structs.Region as Cairo.Region
import {-# SOURCE #-} qualified GI.Gdk.Enums as Gdk.Enums
import {-# SOURCE #-} qualified GI.Gdk.Objects.Seat as Gdk.Seat
import {-# SOURCE #-} qualified GI.Gdk.Objects.Window as Gdk.Window
import {-# SOURCE #-} qualified GI.Gdk.Unions.Event as Gdk.Event
type C_WindowInvalidateHandlerFunc =
Ptr Gdk.Window.Window ->
Ptr Cairo.Region.Region ->
IO ()
foreign import ccall "dynamic" __dynamic_C_WindowInvalidateHandlerFunc :: FunPtr C_WindowInvalidateHandlerFunc -> C_WindowInvalidateHandlerFunc
dynamic_WindowInvalidateHandlerFunc ::
(B.CallStack.HasCallStack, MonadIO m, Gdk.Window.IsWindow a) =>
FunPtr C_WindowInvalidateHandlerFunc
-> a
-> Cairo.Region.Region
-> m ()
dynamic_WindowInvalidateHandlerFunc :: FunPtr C_WindowInvalidateHandlerFunc -> a -> Region -> m ()
dynamic_WindowInvalidateHandlerFunc FunPtr C_WindowInvalidateHandlerFunc
__funPtr a
window Region
region = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
Ptr Region
region' <- Region -> IO (Ptr Region)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Region
region
(FunPtr C_WindowInvalidateHandlerFunc
-> C_WindowInvalidateHandlerFunc
__dynamic_C_WindowInvalidateHandlerFunc FunPtr C_WindowInvalidateHandlerFunc
__funPtr) Ptr Window
window' Ptr Region
region'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
window
Region -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Region
region
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "wrapper"
mk_WindowInvalidateHandlerFunc :: C_WindowInvalidateHandlerFunc -> IO (FunPtr C_WindowInvalidateHandlerFunc)
type WindowInvalidateHandlerFunc =
Gdk.Window.Window
-> Cairo.Region.Region
-> IO ()
noWindowInvalidateHandlerFunc :: Maybe WindowInvalidateHandlerFunc
noWindowInvalidateHandlerFunc :: Maybe WindowInvalidateHandlerFunc
noWindowInvalidateHandlerFunc = Maybe WindowInvalidateHandlerFunc
forall a. Maybe a
Nothing
genClosure_WindowInvalidateHandlerFunc :: MonadIO m => WindowInvalidateHandlerFunc -> m (GClosure C_WindowInvalidateHandlerFunc)
genClosure_WindowInvalidateHandlerFunc :: WindowInvalidateHandlerFunc
-> m (GClosure C_WindowInvalidateHandlerFunc)
genClosure_WindowInvalidateHandlerFunc WindowInvalidateHandlerFunc
cb = IO (GClosure C_WindowInvalidateHandlerFunc)
-> m (GClosure C_WindowInvalidateHandlerFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_WindowInvalidateHandlerFunc)
-> m (GClosure C_WindowInvalidateHandlerFunc))
-> IO (GClosure C_WindowInvalidateHandlerFunc)
-> m (GClosure C_WindowInvalidateHandlerFunc)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_WindowInvalidateHandlerFunc
cb' = Maybe (Ptr (FunPtr C_WindowInvalidateHandlerFunc))
-> WindowInvalidateHandlerFunc -> C_WindowInvalidateHandlerFunc
wrap_WindowInvalidateHandlerFunc Maybe (Ptr (FunPtr C_WindowInvalidateHandlerFunc))
forall a. Maybe a
Nothing WindowInvalidateHandlerFunc
cb
C_WindowInvalidateHandlerFunc
-> IO (FunPtr C_WindowInvalidateHandlerFunc)
mk_WindowInvalidateHandlerFunc C_WindowInvalidateHandlerFunc
cb' IO (FunPtr C_WindowInvalidateHandlerFunc)
-> (FunPtr C_WindowInvalidateHandlerFunc
-> IO (GClosure C_WindowInvalidateHandlerFunc))
-> IO (GClosure C_WindowInvalidateHandlerFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_WindowInvalidateHandlerFunc
-> IO (GClosure C_WindowInvalidateHandlerFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_WindowInvalidateHandlerFunc ::
Maybe (Ptr (FunPtr C_WindowInvalidateHandlerFunc)) ->
WindowInvalidateHandlerFunc ->
C_WindowInvalidateHandlerFunc
wrap_WindowInvalidateHandlerFunc :: Maybe (Ptr (FunPtr C_WindowInvalidateHandlerFunc))
-> WindowInvalidateHandlerFunc -> C_WindowInvalidateHandlerFunc
wrap_WindowInvalidateHandlerFunc Maybe (Ptr (FunPtr C_WindowInvalidateHandlerFunc))
funptrptr WindowInvalidateHandlerFunc
_cb Ptr Window
window Ptr Region
region = do
Window
window' <- ((ManagedPtr Window -> Window) -> Ptr Window -> IO Window
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Window -> Window
Gdk.Window.Window) Ptr Window
window
(ManagedPtr Region -> Region)
-> Ptr Region -> (Region -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Region -> Region
Cairo.Region.Region Ptr Region
region ((Region -> IO ()) -> IO ()) -> (Region -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Region
region' -> do
WindowInvalidateHandlerFunc
_cb Window
window' Region
region'
Maybe (Ptr (FunPtr C_WindowInvalidateHandlerFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_WindowInvalidateHandlerFunc))
funptrptr
type C_WindowChildFunc =
Ptr Gdk.Window.Window ->
Ptr () ->
IO CInt
foreign import ccall "dynamic" __dynamic_C_WindowChildFunc :: FunPtr C_WindowChildFunc -> C_WindowChildFunc
dynamic_WindowChildFunc ::
(B.CallStack.HasCallStack, MonadIO m, Gdk.Window.IsWindow a) =>
FunPtr C_WindowChildFunc
-> a
-> Ptr ()
-> m Bool
dynamic_WindowChildFunc :: FunPtr C_WindowChildFunc -> a -> Ptr () -> m Bool
dynamic_WindowChildFunc FunPtr C_WindowChildFunc
__funPtr a
window Ptr ()
userData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr Window
window' <- a -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
window
CInt
result <- (FunPtr C_WindowChildFunc -> C_WindowChildFunc
__dynamic_C_WindowChildFunc FunPtr C_WindowChildFunc
__funPtr) Ptr Window
window' Ptr ()
userData
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
window
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
foreign import ccall "wrapper"
mk_WindowChildFunc :: C_WindowChildFunc -> IO (FunPtr C_WindowChildFunc)
type WindowChildFunc =
Gdk.Window.Window
-> IO Bool
noWindowChildFunc :: Maybe WindowChildFunc
noWindowChildFunc :: Maybe WindowChildFunc
noWindowChildFunc = Maybe WindowChildFunc
forall a. Maybe a
Nothing
type WindowChildFunc_WithClosures =
Gdk.Window.Window
-> Ptr ()
-> IO Bool
noWindowChildFunc_WithClosures :: Maybe WindowChildFunc_WithClosures
noWindowChildFunc_WithClosures :: Maybe WindowChildFunc_WithClosures
noWindowChildFunc_WithClosures = Maybe WindowChildFunc_WithClosures
forall a. Maybe a
Nothing
drop_closures_WindowChildFunc :: WindowChildFunc -> WindowChildFunc_WithClosures
drop_closures_WindowChildFunc :: WindowChildFunc -> WindowChildFunc_WithClosures
drop_closures_WindowChildFunc WindowChildFunc
_f Window
window Ptr ()
_ = WindowChildFunc
_f Window
window
genClosure_WindowChildFunc :: MonadIO m => WindowChildFunc -> m (GClosure C_WindowChildFunc)
genClosure_WindowChildFunc :: WindowChildFunc -> m (GClosure C_WindowChildFunc)
genClosure_WindowChildFunc WindowChildFunc
cb = IO (GClosure C_WindowChildFunc) -> m (GClosure C_WindowChildFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_WindowChildFunc) -> m (GClosure C_WindowChildFunc))
-> IO (GClosure C_WindowChildFunc)
-> m (GClosure C_WindowChildFunc)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: WindowChildFunc_WithClosures
cb' = WindowChildFunc -> WindowChildFunc_WithClosures
drop_closures_WindowChildFunc WindowChildFunc
cb
let cb'' :: C_WindowChildFunc
cb'' = Maybe (Ptr (FunPtr C_WindowChildFunc))
-> WindowChildFunc_WithClosures -> C_WindowChildFunc
wrap_WindowChildFunc Maybe (Ptr (FunPtr C_WindowChildFunc))
forall a. Maybe a
Nothing WindowChildFunc_WithClosures
cb'
C_WindowChildFunc -> IO (FunPtr C_WindowChildFunc)
mk_WindowChildFunc C_WindowChildFunc
cb'' IO (FunPtr C_WindowChildFunc)
-> (FunPtr C_WindowChildFunc -> IO (GClosure C_WindowChildFunc))
-> IO (GClosure C_WindowChildFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_WindowChildFunc -> IO (GClosure C_WindowChildFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_WindowChildFunc ::
Maybe (Ptr (FunPtr C_WindowChildFunc)) ->
WindowChildFunc_WithClosures ->
C_WindowChildFunc
wrap_WindowChildFunc :: Maybe (Ptr (FunPtr C_WindowChildFunc))
-> WindowChildFunc_WithClosures -> C_WindowChildFunc
wrap_WindowChildFunc Maybe (Ptr (FunPtr C_WindowChildFunc))
funptrptr WindowChildFunc_WithClosures
_cb Ptr Window
window Ptr ()
userData = do
Window
window' <- ((ManagedPtr Window -> Window) -> Ptr Window -> IO Window
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Window -> Window
Gdk.Window.Window) Ptr Window
window
Bool
result <- WindowChildFunc_WithClosures
_cb Window
window' Ptr ()
userData
Maybe (Ptr (FunPtr C_WindowChildFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_WindowChildFunc))
funptrptr
let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'
type C_SeatGrabPrepareFunc =
Ptr Gdk.Seat.Seat ->
Ptr Gdk.Window.Window ->
Ptr () ->
IO ()
foreign import ccall "dynamic" __dynamic_C_SeatGrabPrepareFunc :: FunPtr C_SeatGrabPrepareFunc -> C_SeatGrabPrepareFunc
dynamic_SeatGrabPrepareFunc ::
(B.CallStack.HasCallStack, MonadIO m, Gdk.Seat.IsSeat a, Gdk.Window.IsWindow b) =>
FunPtr C_SeatGrabPrepareFunc
-> a
-> b
-> Ptr ()
-> m ()
dynamic_SeatGrabPrepareFunc :: FunPtr C_SeatGrabPrepareFunc -> a -> b -> Ptr () -> m ()
dynamic_SeatGrabPrepareFunc FunPtr C_SeatGrabPrepareFunc
__funPtr a
seat b
window Ptr ()
userData = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Seat
seat' <- a -> IO (Ptr Seat)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
seat
Ptr Window
window' <- b -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
window
(FunPtr C_SeatGrabPrepareFunc -> C_SeatGrabPrepareFunc
__dynamic_C_SeatGrabPrepareFunc FunPtr C_SeatGrabPrepareFunc
__funPtr) Ptr Seat
seat' Ptr Window
window' Ptr ()
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
seat
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
window
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "wrapper"
mk_SeatGrabPrepareFunc :: C_SeatGrabPrepareFunc -> IO (FunPtr C_SeatGrabPrepareFunc)
type SeatGrabPrepareFunc =
Gdk.Seat.Seat
-> Gdk.Window.Window
-> IO ()
noSeatGrabPrepareFunc :: Maybe SeatGrabPrepareFunc
noSeatGrabPrepareFunc :: Maybe SeatGrabPrepareFunc
noSeatGrabPrepareFunc = Maybe SeatGrabPrepareFunc
forall a. Maybe a
Nothing
type SeatGrabPrepareFunc_WithClosures =
Gdk.Seat.Seat
-> Gdk.Window.Window
-> Ptr ()
-> IO ()
noSeatGrabPrepareFunc_WithClosures :: Maybe SeatGrabPrepareFunc_WithClosures
noSeatGrabPrepareFunc_WithClosures :: Maybe SeatGrabPrepareFunc_WithClosures
noSeatGrabPrepareFunc_WithClosures = Maybe SeatGrabPrepareFunc_WithClosures
forall a. Maybe a
Nothing
drop_closures_SeatGrabPrepareFunc :: SeatGrabPrepareFunc -> SeatGrabPrepareFunc_WithClosures
drop_closures_SeatGrabPrepareFunc :: SeatGrabPrepareFunc -> SeatGrabPrepareFunc_WithClosures
drop_closures_SeatGrabPrepareFunc SeatGrabPrepareFunc
_f Seat
seat Window
window Ptr ()
_ = SeatGrabPrepareFunc
_f Seat
seat Window
window
genClosure_SeatGrabPrepareFunc :: MonadIO m => SeatGrabPrepareFunc -> m (GClosure C_SeatGrabPrepareFunc)
genClosure_SeatGrabPrepareFunc :: SeatGrabPrepareFunc -> m (GClosure C_SeatGrabPrepareFunc)
genClosure_SeatGrabPrepareFunc SeatGrabPrepareFunc
cb = IO (GClosure C_SeatGrabPrepareFunc)
-> m (GClosure C_SeatGrabPrepareFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SeatGrabPrepareFunc)
-> m (GClosure C_SeatGrabPrepareFunc))
-> IO (GClosure C_SeatGrabPrepareFunc)
-> m (GClosure C_SeatGrabPrepareFunc)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: SeatGrabPrepareFunc_WithClosures
cb' = SeatGrabPrepareFunc -> SeatGrabPrepareFunc_WithClosures
drop_closures_SeatGrabPrepareFunc SeatGrabPrepareFunc
cb
let cb'' :: C_SeatGrabPrepareFunc
cb'' = Maybe (Ptr (FunPtr C_SeatGrabPrepareFunc))
-> SeatGrabPrepareFunc_WithClosures -> C_SeatGrabPrepareFunc
wrap_SeatGrabPrepareFunc Maybe (Ptr (FunPtr C_SeatGrabPrepareFunc))
forall a. Maybe a
Nothing SeatGrabPrepareFunc_WithClosures
cb'
C_SeatGrabPrepareFunc -> IO (FunPtr C_SeatGrabPrepareFunc)
mk_SeatGrabPrepareFunc C_SeatGrabPrepareFunc
cb'' IO (FunPtr C_SeatGrabPrepareFunc)
-> (FunPtr C_SeatGrabPrepareFunc
-> IO (GClosure C_SeatGrabPrepareFunc))
-> IO (GClosure C_SeatGrabPrepareFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SeatGrabPrepareFunc -> IO (GClosure C_SeatGrabPrepareFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_SeatGrabPrepareFunc ::
Maybe (Ptr (FunPtr C_SeatGrabPrepareFunc)) ->
SeatGrabPrepareFunc_WithClosures ->
C_SeatGrabPrepareFunc
wrap_SeatGrabPrepareFunc :: Maybe (Ptr (FunPtr C_SeatGrabPrepareFunc))
-> SeatGrabPrepareFunc_WithClosures -> C_SeatGrabPrepareFunc
wrap_SeatGrabPrepareFunc Maybe (Ptr (FunPtr C_SeatGrabPrepareFunc))
funptrptr SeatGrabPrepareFunc_WithClosures
_cb Ptr Seat
seat Ptr Window
window Ptr ()
userData = do
Seat
seat' <- ((ManagedPtr Seat -> Seat) -> Ptr Seat -> IO Seat
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Seat -> Seat
Gdk.Seat.Seat) Ptr Seat
seat
Window
window' <- ((ManagedPtr Window -> Window) -> Ptr Window -> IO Window
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Window -> Window
Gdk.Window.Window) Ptr Window
window
SeatGrabPrepareFunc_WithClosures
_cb Seat
seat' Window
window' Ptr ()
userData
Maybe (Ptr (FunPtr C_SeatGrabPrepareFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_SeatGrabPrepareFunc))
funptrptr
type C_FilterFunc =
Ptr () ->
Ptr Gdk.Event.Event ->
Ptr () ->
IO CUInt
foreign import ccall "dynamic" __dynamic_C_FilterFunc :: FunPtr C_FilterFunc -> C_FilterFunc
dynamic_FilterFunc ::
(B.CallStack.HasCallStack, MonadIO m) =>
FunPtr C_FilterFunc
-> Ptr ()
-> Gdk.Event.Event
-> Ptr ()
-> m Gdk.Enums.FilterReturn
dynamic_FilterFunc :: FunPtr C_FilterFunc -> Ptr () -> Event -> Ptr () -> m FilterReturn
dynamic_FilterFunc FunPtr C_FilterFunc
__funPtr Ptr ()
xevent Event
event Ptr ()
data_ = IO FilterReturn -> m FilterReturn
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FilterReturn -> m FilterReturn)
-> IO FilterReturn -> m FilterReturn
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
event
CUInt
result <- (FunPtr C_FilterFunc -> C_FilterFunc
__dynamic_C_FilterFunc FunPtr C_FilterFunc
__funPtr) Ptr ()
xevent Ptr Event
event' Ptr ()
data_
let result' :: FilterReturn
result' = (Int -> FilterReturn
forall a. Enum a => Int -> a
toEnum (Int -> FilterReturn) -> (CUInt -> Int) -> CUInt -> FilterReturn
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
event
FilterReturn -> IO FilterReturn
forall (m :: * -> *) a. Monad m => a -> m a
return FilterReturn
result'
foreign import ccall "wrapper"
mk_FilterFunc :: C_FilterFunc -> IO (FunPtr C_FilterFunc)
type FilterFunc =
Ptr ()
-> Gdk.Event.Event
-> IO Gdk.Enums.FilterReturn
noFilterFunc :: Maybe FilterFunc
noFilterFunc :: Maybe FilterFunc
noFilterFunc = Maybe FilterFunc
forall a. Maybe a
Nothing
type FilterFunc_WithClosures =
Ptr ()
-> Gdk.Event.Event
-> Ptr ()
-> IO Gdk.Enums.FilterReturn
noFilterFunc_WithClosures :: Maybe FilterFunc_WithClosures
noFilterFunc_WithClosures :: Maybe FilterFunc_WithClosures
noFilterFunc_WithClosures = Maybe FilterFunc_WithClosures
forall a. Maybe a
Nothing
drop_closures_FilterFunc :: FilterFunc -> FilterFunc_WithClosures
drop_closures_FilterFunc :: FilterFunc -> FilterFunc_WithClosures
drop_closures_FilterFunc FilterFunc
_f Ptr ()
xevent Event
event Ptr ()
_ = FilterFunc
_f Ptr ()
xevent Event
event
genClosure_FilterFunc :: MonadIO m => FilterFunc -> m (GClosure C_FilterFunc)
genClosure_FilterFunc :: FilterFunc -> m (GClosure C_FilterFunc)
genClosure_FilterFunc FilterFunc
cb = IO (GClosure C_FilterFunc) -> m (GClosure C_FilterFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_FilterFunc) -> m (GClosure C_FilterFunc))
-> IO (GClosure C_FilterFunc) -> m (GClosure C_FilterFunc)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: FilterFunc_WithClosures
cb' = FilterFunc -> FilterFunc_WithClosures
drop_closures_FilterFunc FilterFunc
cb
let cb'' :: C_FilterFunc
cb'' = Maybe (Ptr (FunPtr C_FilterFunc))
-> FilterFunc_WithClosures -> C_FilterFunc
wrap_FilterFunc Maybe (Ptr (FunPtr C_FilterFunc))
forall a. Maybe a
Nothing FilterFunc_WithClosures
cb'
C_FilterFunc -> IO (FunPtr C_FilterFunc)
mk_FilterFunc C_FilterFunc
cb'' IO (FunPtr C_FilterFunc)
-> (FunPtr C_FilterFunc -> IO (GClosure C_FilterFunc))
-> IO (GClosure C_FilterFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_FilterFunc -> IO (GClosure C_FilterFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_FilterFunc ::
Maybe (Ptr (FunPtr C_FilterFunc)) ->
FilterFunc_WithClosures ->
C_FilterFunc
wrap_FilterFunc :: Maybe (Ptr (FunPtr C_FilterFunc))
-> FilterFunc_WithClosures -> C_FilterFunc
wrap_FilterFunc Maybe (Ptr (FunPtr C_FilterFunc))
funptrptr FilterFunc_WithClosures
_cb Ptr ()
xevent Ptr Event
event Ptr ()
data_ = do
(ManagedPtr Event -> Event)
-> Ptr Event -> (Event -> IO CUInt) -> IO CUInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Event -> Event
Gdk.Event.Event Ptr Event
event ((Event -> IO CUInt) -> IO CUInt)
-> (Event -> IO CUInt) -> IO CUInt
forall a b. (a -> b) -> a -> b
$ \Event
event' -> do
FilterReturn
result <- FilterFunc_WithClosures
_cb Ptr ()
xevent Event
event' Ptr ()
data_
Maybe (Ptr (FunPtr C_FilterFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FilterFunc))
funptrptr
let result' :: CUInt
result' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (FilterReturn -> Int) -> FilterReturn -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FilterReturn -> Int
forall a. Enum a => a -> Int
fromEnum) FilterReturn
result
CUInt -> IO CUInt
forall (m :: * -> *) a. Monad m => a -> m a
return CUInt
result'
type C_EventFunc =
Ptr Gdk.Event.Event ->
Ptr () ->
IO ()
foreign import ccall "dynamic" __dynamic_C_EventFunc :: FunPtr C_EventFunc -> C_EventFunc
dynamic_EventFunc ::
(B.CallStack.HasCallStack, MonadIO m) =>
FunPtr C_EventFunc
-> Gdk.Event.Event
-> Ptr ()
-> m ()
dynamic_EventFunc :: FunPtr C_EventFunc -> Event -> Ptr () -> m ()
dynamic_EventFunc FunPtr C_EventFunc
__funPtr Event
event Ptr ()
data_ = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Event
event' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
event
(FunPtr C_EventFunc -> C_EventFunc
__dynamic_C_EventFunc FunPtr C_EventFunc
__funPtr) Ptr Event
event' Ptr ()
data_
Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
event
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
foreign import ccall "wrapper"
mk_EventFunc :: C_EventFunc -> IO (FunPtr C_EventFunc)
type EventFunc =
Gdk.Event.Event
-> IO ()
noEventFunc :: Maybe EventFunc
noEventFunc :: Maybe (Event -> IO ())
noEventFunc = Maybe (Event -> IO ())
forall a. Maybe a
Nothing
type EventFunc_WithClosures =
Gdk.Event.Event
-> Ptr ()
-> IO ()
noEventFunc_WithClosures :: Maybe EventFunc_WithClosures
noEventFunc_WithClosures :: Maybe EventFunc_WithClosures
noEventFunc_WithClosures = Maybe EventFunc_WithClosures
forall a. Maybe a
Nothing
drop_closures_EventFunc :: EventFunc -> EventFunc_WithClosures
drop_closures_EventFunc :: (Event -> IO ()) -> EventFunc_WithClosures
drop_closures_EventFunc Event -> IO ()
_f Event
event Ptr ()
_ = Event -> IO ()
_f Event
event
genClosure_EventFunc :: MonadIO m => EventFunc -> m (GClosure C_EventFunc)
genClosure_EventFunc :: (Event -> IO ()) -> m (GClosure C_EventFunc)
genClosure_EventFunc Event -> IO ()
cb = IO (GClosure C_EventFunc) -> m (GClosure C_EventFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_EventFunc) -> m (GClosure C_EventFunc))
-> IO (GClosure C_EventFunc) -> m (GClosure C_EventFunc)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: EventFunc_WithClosures
cb' = (Event -> IO ()) -> EventFunc_WithClosures
drop_closures_EventFunc Event -> IO ()
cb
let cb'' :: C_EventFunc
cb'' = Maybe (Ptr (FunPtr C_EventFunc))
-> EventFunc_WithClosures -> C_EventFunc
wrap_EventFunc Maybe (Ptr (FunPtr C_EventFunc))
forall a. Maybe a
Nothing EventFunc_WithClosures
cb'
C_EventFunc -> IO (FunPtr C_EventFunc)
mk_EventFunc C_EventFunc
cb'' IO (FunPtr C_EventFunc)
-> (FunPtr C_EventFunc -> IO (GClosure C_EventFunc))
-> IO (GClosure C_EventFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_EventFunc -> IO (GClosure C_EventFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_EventFunc ::
Maybe (Ptr (FunPtr C_EventFunc)) ->
EventFunc_WithClosures ->
C_EventFunc
wrap_EventFunc :: Maybe (Ptr (FunPtr C_EventFunc))
-> EventFunc_WithClosures -> C_EventFunc
wrap_EventFunc Maybe (Ptr (FunPtr C_EventFunc))
funptrptr EventFunc_WithClosures
_cb Ptr Event
event Ptr ()
data_ = do
(ManagedPtr Event -> Event)
-> Ptr Event -> (Event -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Event -> Event
Gdk.Event.Event Ptr Event
event ((Event -> IO ()) -> IO ()) -> (Event -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Event
event' -> do
EventFunc_WithClosures
_cb Event
event' Ptr ()
data_
Maybe (Ptr (FunPtr C_EventFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_EventFunc))
funptrptr