#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Vte.Callbacks
(
C_SelectionFunc ,
SelectionFunc ,
SelectionFunc_WithClosures ,
drop_closures_SelectionFunc ,
dynamic_SelectionFunc ,
genClosure_SelectionFunc ,
mk_SelectionFunc ,
noSelectionFunc ,
noSelectionFunc_WithClosures ,
wrap_SelectionFunc ,
C_TerminalSpawnAsyncCallback ,
TerminalSpawnAsyncCallback ,
TerminalSpawnAsyncCallback_WithClosures ,
drop_closures_TerminalSpawnAsyncCallback,
dynamic_TerminalSpawnAsyncCallback ,
genClosure_TerminalSpawnAsyncCallback ,
mk_TerminalSpawnAsyncCallback ,
noTerminalSpawnAsyncCallback ,
noTerminalSpawnAsyncCallback_WithClosures,
wrap_TerminalSpawnAsyncCallback ,
) 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.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
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.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
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 GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.Atk.Interfaces.ImplementorIface as Atk.ImplementorIface
import qualified GI.Cairo.Structs.FontOptions as Cairo.FontOptions
import qualified GI.Cairo.Structs.Surface as Cairo.Surface
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Flags as GLib.Flags
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.Regex as GLib.Regex
import qualified GI.GLib.Structs.Uri as GLib.Uri
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gdk.Enums as Gdk.Enums
import qualified GI.Gdk.Objects.Cursor as Gdk.Cursor
import qualified GI.Gdk.Structs.Geometry as Gdk.Geometry
import qualified GI.Gdk.Structs.RGBA as Gdk.RGBA
import qualified GI.Gdk.Structs.Rectangle as Gdk.Rectangle
import qualified GI.Gdk.Unions.Event as Gdk.Event
import qualified GI.GdkPixbuf.Objects.Pixbuf as GdkPixbuf.Pixbuf
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.MenuModel as Gio.MenuModel
import qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
import qualified GI.Gtk.Interfaces.Buildable as Gtk.Buildable
import qualified GI.Gtk.Interfaces.Scrollable as Gtk.Scrollable
import qualified GI.Gtk.Objects.Menu as Gtk.Menu
import qualified GI.Gtk.Objects.Widget as Gtk.Widget
import qualified GI.Gtk.Objects.Window as Gtk.Window
import qualified GI.Pango.Structs.FontDescription as Pango.FontDescription
import {-# SOURCE #-} qualified GI.Vte.Enums as Vte.Enums
import {-# SOURCE #-} qualified GI.Vte.Flags as Vte.Flags
import {-# SOURCE #-} qualified GI.Vte.Objects.Pty as Vte.Pty
import {-# SOURCE #-} qualified GI.Vte.Objects.Terminal as Vte.Terminal
import {-# SOURCE #-} qualified GI.Vte.Structs.CharAttributes as Vte.CharAttributes
import {-# SOURCE #-} qualified GI.Vte.Structs.EventContext as Vte.EventContext
import {-# SOURCE #-} qualified GI.Vte.Structs.Regex as Vte.Regex
import {-# SOURCE #-} qualified GI.Vte.Structs.Uuid as Vte.Uuid
#else
import {-# SOURCE #-} qualified GI.Vte.Objects.Terminal as Vte.Terminal
#endif
type C_TerminalSpawnAsyncCallback =
Ptr Vte.Terminal.Terminal ->
Int32 ->
Ptr GError ->
Ptr () ->
IO ()
foreign import ccall "dynamic" __dynamic_C_TerminalSpawnAsyncCallback :: FunPtr C_TerminalSpawnAsyncCallback -> C_TerminalSpawnAsyncCallback
dynamic_TerminalSpawnAsyncCallback ::
(B.CallStack.HasCallStack, MonadIO m, Vte.Terminal.IsTerminal a) =>
FunPtr C_TerminalSpawnAsyncCallback
-> a
-> Int32
-> Maybe (GError)
-> Ptr ()
-> m ()
dynamic_TerminalSpawnAsyncCallback :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTerminal a) =>
FunPtr C_TerminalSpawnAsyncCallback
-> a -> Int32 -> Maybe GError -> Ptr () -> m ()
dynamic_TerminalSpawnAsyncCallback FunPtr C_TerminalSpawnAsyncCallback
__funPtr a
terminal Int32
pid Maybe GError
error_ Ptr ()
userData = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
terminal' <- a -> IO (Ptr Terminal)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
terminal
maybeError_ <- case error_ of
Maybe GError
Nothing -> Ptr GError -> IO (Ptr GError)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr GError
forall a. Ptr a
FP.nullPtr
Just GError
jError_ -> do
jError_' <- GError -> IO (Ptr GError)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GError
jError_
return jError_'
(__dynamic_C_TerminalSpawnAsyncCallback __funPtr) terminal' pid maybeError_ userData
touchManagedPtr terminal
whenJust error_ touchManagedPtr
return ()
foreign import ccall "wrapper"
mk_TerminalSpawnAsyncCallback :: C_TerminalSpawnAsyncCallback -> IO (FunPtr C_TerminalSpawnAsyncCallback)
type TerminalSpawnAsyncCallback =
Vte.Terminal.Terminal
-> Int32
-> Maybe GError
-> IO ()
noTerminalSpawnAsyncCallback :: Maybe TerminalSpawnAsyncCallback
noTerminalSpawnAsyncCallback :: Maybe TerminalSpawnAsyncCallback
noTerminalSpawnAsyncCallback = Maybe TerminalSpawnAsyncCallback
forall a. Maybe a
Nothing
type TerminalSpawnAsyncCallback_WithClosures =
Vte.Terminal.Terminal
-> Int32
-> Maybe GError
-> Ptr ()
-> IO ()
noTerminalSpawnAsyncCallback_WithClosures :: Maybe TerminalSpawnAsyncCallback_WithClosures
noTerminalSpawnAsyncCallback_WithClosures :: Maybe TerminalSpawnAsyncCallback_WithClosures
noTerminalSpawnAsyncCallback_WithClosures = Maybe TerminalSpawnAsyncCallback_WithClosures
forall a. Maybe a
Nothing
drop_closures_TerminalSpawnAsyncCallback :: TerminalSpawnAsyncCallback -> TerminalSpawnAsyncCallback_WithClosures
drop_closures_TerminalSpawnAsyncCallback :: TerminalSpawnAsyncCallback
-> TerminalSpawnAsyncCallback_WithClosures
drop_closures_TerminalSpawnAsyncCallback TerminalSpawnAsyncCallback
_f Terminal
terminal Int32
pid Maybe GError
error_ Ptr ()
_ = TerminalSpawnAsyncCallback
_f Terminal
terminal Int32
pid Maybe GError
error_
genClosure_TerminalSpawnAsyncCallback :: MonadIO m => TerminalSpawnAsyncCallback -> m (GClosure C_TerminalSpawnAsyncCallback)
genClosure_TerminalSpawnAsyncCallback :: forall (m :: * -> *).
MonadIO m =>
TerminalSpawnAsyncCallback
-> m (GClosure C_TerminalSpawnAsyncCallback)
genClosure_TerminalSpawnAsyncCallback TerminalSpawnAsyncCallback
cb = IO (GClosure C_TerminalSpawnAsyncCallback)
-> m (GClosure C_TerminalSpawnAsyncCallback)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TerminalSpawnAsyncCallback)
-> m (GClosure C_TerminalSpawnAsyncCallback))
-> IO (GClosure C_TerminalSpawnAsyncCallback)
-> m (GClosure C_TerminalSpawnAsyncCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: TerminalSpawnAsyncCallback_WithClosures
cb' = TerminalSpawnAsyncCallback
-> TerminalSpawnAsyncCallback_WithClosures
drop_closures_TerminalSpawnAsyncCallback TerminalSpawnAsyncCallback
cb
let cb'' :: C_TerminalSpawnAsyncCallback
cb'' = Maybe (Ptr (FunPtr C_TerminalSpawnAsyncCallback))
-> TerminalSpawnAsyncCallback_WithClosures
-> C_TerminalSpawnAsyncCallback
wrap_TerminalSpawnAsyncCallback Maybe (Ptr (FunPtr C_TerminalSpawnAsyncCallback))
forall a. Maybe a
Nothing TerminalSpawnAsyncCallback_WithClosures
cb'
C_TerminalSpawnAsyncCallback
-> IO (FunPtr C_TerminalSpawnAsyncCallback)
mk_TerminalSpawnAsyncCallback C_TerminalSpawnAsyncCallback
cb'' IO (FunPtr C_TerminalSpawnAsyncCallback)
-> (FunPtr C_TerminalSpawnAsyncCallback
-> IO (GClosure C_TerminalSpawnAsyncCallback))
-> IO (GClosure C_TerminalSpawnAsyncCallback)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TerminalSpawnAsyncCallback
-> IO (GClosure C_TerminalSpawnAsyncCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_TerminalSpawnAsyncCallback ::
Maybe (Ptr (FunPtr C_TerminalSpawnAsyncCallback)) ->
TerminalSpawnAsyncCallback_WithClosures ->
C_TerminalSpawnAsyncCallback
wrap_TerminalSpawnAsyncCallback :: Maybe (Ptr (FunPtr C_TerminalSpawnAsyncCallback))
-> TerminalSpawnAsyncCallback_WithClosures
-> C_TerminalSpawnAsyncCallback
wrap_TerminalSpawnAsyncCallback Maybe (Ptr (FunPtr C_TerminalSpawnAsyncCallback))
gi'funptrptr TerminalSpawnAsyncCallback_WithClosures
gi'cb Ptr Terminal
terminal Int32
pid Ptr GError
error_ Ptr ()
userData = do
terminal' <- ((ManagedPtr Terminal -> Terminal) -> Ptr Terminal -> IO Terminal
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Terminal -> Terminal
Vte.Terminal.Terminal) Ptr Terminal
terminal
maybeError_ <-
if error_ == FP.nullPtr
then return Nothing
else do
error_' <- (newBoxed GError) error_
return $ Just error_'
gi'cb terminal' pid maybeError_ userData
maybeReleaseFunPtr gi'funptrptr
type C_SelectionFunc =
Ptr Vte.Terminal.Terminal ->
FCT.CLong ->
FCT.CLong ->
Ptr () ->
IO CInt
foreign import ccall "dynamic" __dynamic_C_SelectionFunc :: FunPtr C_SelectionFunc -> C_SelectionFunc
dynamic_SelectionFunc ::
(B.CallStack.HasCallStack, MonadIO m, Vte.Terminal.IsTerminal a) =>
FunPtr C_SelectionFunc
-> a
-> FCT.CLong
-> FCT.CLong
-> Ptr ()
-> m Bool
dynamic_SelectionFunc :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTerminal a) =>
FunPtr C_SelectionFunc -> a -> CLong -> CLong -> Ptr () -> m Bool
dynamic_SelectionFunc FunPtr C_SelectionFunc
__funPtr a
terminal CLong
column CLong
row Ptr ()
data_ = IO Bool -> m Bool
forall a. IO a -> m a
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
terminal' <- a -> IO (Ptr Terminal)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
terminal
result <- (__dynamic_C_SelectionFunc __funPtr) terminal' column row data_
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr terminal
return result'
foreign import ccall "wrapper"
mk_SelectionFunc :: C_SelectionFunc -> IO (FunPtr C_SelectionFunc)
{-# DEPRECATED SelectionFunc ["(Since version 0.76)"] #-}
type SelectionFunc =
Vte.Terminal.Terminal
-> FCT.CLong
-> FCT.CLong
-> IO Bool
noSelectionFunc :: Maybe SelectionFunc
noSelectionFunc :: Maybe SelectionFunc
noSelectionFunc = Maybe SelectionFunc
forall a. Maybe a
Nothing
type SelectionFunc_WithClosures =
Vte.Terminal.Terminal
-> FCT.CLong
-> FCT.CLong
-> Ptr ()
-> IO Bool
noSelectionFunc_WithClosures :: Maybe SelectionFunc_WithClosures
noSelectionFunc_WithClosures :: Maybe SelectionFunc_WithClosures
noSelectionFunc_WithClosures = Maybe SelectionFunc_WithClosures
forall a. Maybe a
Nothing
drop_closures_SelectionFunc :: SelectionFunc -> SelectionFunc_WithClosures
drop_closures_SelectionFunc :: SelectionFunc -> SelectionFunc_WithClosures
drop_closures_SelectionFunc SelectionFunc
_f Terminal
terminal CLong
column CLong
row Ptr ()
_ = SelectionFunc
_f Terminal
terminal CLong
column CLong
row
genClosure_SelectionFunc :: MonadIO m => SelectionFunc -> m (GClosure C_SelectionFunc)
genClosure_SelectionFunc :: forall (m :: * -> *).
MonadIO m =>
SelectionFunc -> m (GClosure C_SelectionFunc)
genClosure_SelectionFunc SelectionFunc
cb = IO (GClosure C_SelectionFunc) -> m (GClosure C_SelectionFunc)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_SelectionFunc) -> m (GClosure C_SelectionFunc))
-> IO (GClosure C_SelectionFunc) -> m (GClosure C_SelectionFunc)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: SelectionFunc_WithClosures
cb' = SelectionFunc -> SelectionFunc_WithClosures
drop_closures_SelectionFunc SelectionFunc
cb
let cb'' :: C_SelectionFunc
cb'' = Maybe (Ptr (FunPtr C_SelectionFunc))
-> SelectionFunc_WithClosures -> C_SelectionFunc
wrap_SelectionFunc Maybe (Ptr (FunPtr C_SelectionFunc))
forall a. Maybe a
Nothing SelectionFunc_WithClosures
cb'
C_SelectionFunc -> IO (FunPtr C_SelectionFunc)
mk_SelectionFunc C_SelectionFunc
cb'' IO (FunPtr C_SelectionFunc)
-> (FunPtr C_SelectionFunc -> IO (GClosure C_SelectionFunc))
-> IO (GClosure C_SelectionFunc)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_SelectionFunc -> IO (GClosure C_SelectionFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_SelectionFunc ::
Maybe (Ptr (FunPtr C_SelectionFunc)) ->
SelectionFunc_WithClosures ->
C_SelectionFunc
wrap_SelectionFunc :: Maybe (Ptr (FunPtr C_SelectionFunc))
-> SelectionFunc_WithClosures -> C_SelectionFunc
wrap_SelectionFunc Maybe (Ptr (FunPtr C_SelectionFunc))
gi'funptrptr SelectionFunc_WithClosures
gi'cb Ptr Terminal
terminal CLong
column CLong
row Ptr ()
data_ = do
terminal' <- ((ManagedPtr Terminal -> Terminal) -> Ptr Terminal -> IO Terminal
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Terminal -> Terminal
Vte.Terminal.Terminal) Ptr Terminal
terminal
result <- gi'cb terminal' column row data_
maybeReleaseFunPtr gi'funptrptr
let result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.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
P.fromEnum) Bool
result
return result'