{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Structs.TargetList
(
TargetList(..) ,
#if defined(ENABLE_OVERLOADING)
ResolveTargetListMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
TargetListAddMethodInfo ,
#endif
targetListAdd ,
#if defined(ENABLE_OVERLOADING)
TargetListAddImageTargetsMethodInfo ,
#endif
targetListAddImageTargets ,
#if defined(ENABLE_OVERLOADING)
TargetListAddRichTextTargetsMethodInfo ,
#endif
targetListAddRichTextTargets ,
#if defined(ENABLE_OVERLOADING)
TargetListAddTableMethodInfo ,
#endif
targetListAddTable ,
#if defined(ENABLE_OVERLOADING)
TargetListAddTextTargetsMethodInfo ,
#endif
targetListAddTextTargets ,
#if defined(ENABLE_OVERLOADING)
TargetListAddUriTargetsMethodInfo ,
#endif
targetListAddUriTargets ,
#if defined(ENABLE_OVERLOADING)
TargetListFindMethodInfo ,
#endif
targetListFind ,
targetListNew ,
#if defined(ENABLE_OVERLOADING)
TargetListRefMethodInfo ,
#endif
targetListRef ,
#if defined(ENABLE_OVERLOADING)
TargetListRemoveMethodInfo ,
#endif
targetListRemove ,
#if defined(ENABLE_OVERLOADING)
TargetListUnrefMethodInfo ,
#endif
targetListUnref ,
) 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.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 GHC.Records as R
import qualified GI.Gdk.Structs.Atom as Gdk.Atom
import {-# SOURCE #-} qualified GI.Gtk.Objects.TextBuffer as Gtk.TextBuffer
import {-# SOURCE #-} qualified GI.Gtk.Structs.TargetEntry as Gtk.TargetEntry
newtype TargetList = TargetList (SP.ManagedPtr TargetList)
deriving (TargetList -> TargetList -> Bool
(TargetList -> TargetList -> Bool)
-> (TargetList -> TargetList -> Bool) -> Eq TargetList
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TargetList -> TargetList -> Bool
$c/= :: TargetList -> TargetList -> Bool
== :: TargetList -> TargetList -> Bool
$c== :: TargetList -> TargetList -> Bool
Eq)
instance SP.ManagedPtrNewtype TargetList where
toManagedPtr :: TargetList -> ManagedPtr TargetList
toManagedPtr (TargetList ManagedPtr TargetList
p) = ManagedPtr TargetList
p
foreign import ccall "gtk_target_list_get_type" c_gtk_target_list_get_type ::
IO GType
type instance O.ParentTypes TargetList = '[]
instance O.HasParentTypes TargetList
instance B.Types.TypedObject TargetList where
glibType :: IO GType
glibType = IO GType
c_gtk_target_list_get_type
instance B.Types.GBoxed TargetList
instance B.GValue.IsGValue (Maybe TargetList) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_target_list_get_type
gvalueSet_ :: Ptr GValue -> Maybe TargetList -> IO ()
gvalueSet_ Ptr GValue
gv Maybe TargetList
P.Nothing = Ptr GValue -> Ptr TargetList -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv (Ptr TargetList
forall a. Ptr a
FP.nullPtr :: FP.Ptr TargetList)
gvalueSet_ Ptr GValue
gv (P.Just TargetList
obj) = TargetList -> (Ptr TargetList -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr TargetList
obj (Ptr GValue -> Ptr TargetList -> IO ()
forall a. Ptr GValue -> Ptr a -> IO ()
B.GValue.set_boxed Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe TargetList)
gvalueGet_ Ptr GValue
gv = do
Ptr TargetList
ptr <- Ptr GValue -> IO (Ptr TargetList)
forall b. Ptr GValue -> IO (Ptr b)
B.GValue.get_boxed Ptr GValue
gv :: IO (Ptr TargetList)
if Ptr TargetList
ptr Ptr TargetList -> Ptr TargetList -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr TargetList
forall a. Ptr a
FP.nullPtr
then TargetList -> Maybe TargetList
forall a. a -> Maybe a
P.Just (TargetList -> Maybe TargetList)
-> IO TargetList -> IO (Maybe TargetList)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr TargetList -> TargetList)
-> Ptr TargetList -> IO TargetList
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr TargetList -> TargetList
TargetList Ptr TargetList
ptr
else Maybe TargetList -> IO (Maybe TargetList)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe TargetList
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList TargetList
type instance O.AttributeList TargetList = TargetListAttributeList
type TargetListAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_target_list_new" gtk_target_list_new ::
Ptr Gtk.TargetEntry.TargetEntry ->
Word32 ->
IO (Ptr TargetList)
targetListNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
Maybe ([Gtk.TargetEntry.TargetEntry])
-> m TargetList
targetListNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Maybe [TargetEntry] -> m TargetList
targetListNew Maybe [TargetEntry]
targets = IO TargetList -> m TargetList
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TargetList -> m TargetList) -> IO TargetList -> m TargetList
forall a b. (a -> b) -> a -> b
$ do
let ntargets :: Word32
ntargets = case Maybe [TargetEntry]
targets of
Maybe [TargetEntry]
Nothing -> Word32
0
Just [TargetEntry]
jTargets -> Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [TargetEntry] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [TargetEntry]
jTargets
Ptr TargetEntry
maybeTargets <- case Maybe [TargetEntry]
targets of
Maybe [TargetEntry]
Nothing -> Ptr TargetEntry -> IO (Ptr TargetEntry)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TargetEntry
forall a. Ptr a
nullPtr
Just [TargetEntry]
jTargets -> do
[Ptr TargetEntry]
jTargets' <- (TargetEntry -> IO (Ptr TargetEntry))
-> [TargetEntry] -> IO [Ptr TargetEntry]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM TargetEntry -> IO (Ptr TargetEntry)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [TargetEntry]
jTargets
Ptr TargetEntry
jTargets'' <- Int -> [Ptr TargetEntry] -> IO (Ptr TargetEntry)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
16 [Ptr TargetEntry]
jTargets'
Ptr TargetEntry -> IO (Ptr TargetEntry)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TargetEntry
jTargets''
Ptr TargetList
result <- Ptr TargetEntry -> Word32 -> IO (Ptr TargetList)
gtk_target_list_new Ptr TargetEntry
maybeTargets Word32
ntargets
Text -> Ptr TargetList -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"targetListNew" Ptr TargetList
result
TargetList
result' <- ((ManagedPtr TargetList -> TargetList)
-> Ptr TargetList -> IO TargetList
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TargetList -> TargetList
TargetList) Ptr TargetList
result
Maybe [TargetEntry] -> ([TargetEntry] -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe [TargetEntry]
targets ((TargetEntry -> IO ()) -> [TargetEntry] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ TargetEntry -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr)
Ptr TargetEntry -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr TargetEntry
maybeTargets
TargetList -> IO TargetList
forall (m :: * -> *) a. Monad m => a -> m a
return TargetList
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_target_list_add" gtk_target_list_add ::
Ptr TargetList ->
Ptr Gdk.Atom.Atom ->
Word32 ->
Word32 ->
IO ()
targetListAdd ::
(B.CallStack.HasCallStack, MonadIO m) =>
TargetList
-> Gdk.Atom.Atom
-> Word32
-> Word32
-> m ()
targetListAdd :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TargetList -> Atom -> Word32 -> Word32 -> m ()
targetListAdd TargetList
list Atom
target Word32
flags Word32
info = 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 TargetList
list' <- TargetList -> IO (Ptr TargetList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TargetList
list
Ptr Atom
target' <- Atom -> IO (Ptr Atom)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Atom
target
Ptr TargetList -> Ptr Atom -> Word32 -> Word32 -> IO ()
gtk_target_list_add Ptr TargetList
list' Ptr Atom
target' Word32
flags Word32
info
TargetList -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TargetList
list
Atom -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Atom
target
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TargetListAddMethodInfo
instance (signature ~ (Gdk.Atom.Atom -> Word32 -> Word32 -> m ()), MonadIO m) => O.OverloadedMethod TargetListAddMethodInfo TargetList signature where
overloadedMethod = targetListAdd
instance O.OverloadedMethodInfo TargetListAddMethodInfo TargetList where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Structs.TargetList.targetListAdd",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Structs-TargetList.html#v:targetListAdd"
}
#endif
foreign import ccall "gtk_target_list_add_image_targets" gtk_target_list_add_image_targets ::
Ptr TargetList ->
Word32 ->
CInt ->
IO ()
targetListAddImageTargets ::
(B.CallStack.HasCallStack, MonadIO m) =>
TargetList
-> Word32
-> Bool
-> m ()
targetListAddImageTargets :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TargetList -> Word32 -> Bool -> m ()
targetListAddImageTargets TargetList
list Word32
info Bool
writable = 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 TargetList
list' <- TargetList -> IO (Ptr TargetList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TargetList
list
let writable' :: CInt
writable' = (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
writable
Ptr TargetList -> Word32 -> CInt -> IO ()
gtk_target_list_add_image_targets Ptr TargetList
list' Word32
info CInt
writable'
TargetList -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TargetList
list
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TargetListAddImageTargetsMethodInfo
instance (signature ~ (Word32 -> Bool -> m ()), MonadIO m) => O.OverloadedMethod TargetListAddImageTargetsMethodInfo TargetList signature where
overloadedMethod = targetListAddImageTargets
instance O.OverloadedMethodInfo TargetListAddImageTargetsMethodInfo TargetList where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Structs.TargetList.targetListAddImageTargets",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Structs-TargetList.html#v:targetListAddImageTargets"
}
#endif
foreign import ccall "gtk_target_list_add_rich_text_targets" gtk_target_list_add_rich_text_targets ::
Ptr TargetList ->
Word32 ->
CInt ->
Ptr Gtk.TextBuffer.TextBuffer ->
IO ()
targetListAddRichTextTargets ::
(B.CallStack.HasCallStack, MonadIO m, Gtk.TextBuffer.IsTextBuffer a) =>
TargetList
-> Word32
-> Bool
-> a
-> m ()
targetListAddRichTextTargets :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsTextBuffer a) =>
TargetList -> Word32 -> Bool -> a -> m ()
targetListAddRichTextTargets TargetList
list Word32
info Bool
deserializable a
buffer = 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 TargetList
list' <- TargetList -> IO (Ptr TargetList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TargetList
list
let deserializable' :: CInt
deserializable' = (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
deserializable
Ptr TextBuffer
buffer' <- a -> IO (Ptr TextBuffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
Ptr TargetList -> Word32 -> CInt -> Ptr TextBuffer -> IO ()
gtk_target_list_add_rich_text_targets Ptr TargetList
list' Word32
info CInt
deserializable' Ptr TextBuffer
buffer'
TargetList -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TargetList
list
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TargetListAddRichTextTargetsMethodInfo
instance (signature ~ (Word32 -> Bool -> a -> m ()), MonadIO m, Gtk.TextBuffer.IsTextBuffer a) => O.OverloadedMethod TargetListAddRichTextTargetsMethodInfo TargetList signature where
overloadedMethod = targetListAddRichTextTargets
instance O.OverloadedMethodInfo TargetListAddRichTextTargetsMethodInfo TargetList where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Structs.TargetList.targetListAddRichTextTargets",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Structs-TargetList.html#v:targetListAddRichTextTargets"
}
#endif
foreign import ccall "gtk_target_list_add_table" gtk_target_list_add_table ::
Ptr TargetList ->
Ptr Gtk.TargetEntry.TargetEntry ->
Word32 ->
IO ()
targetListAddTable ::
(B.CallStack.HasCallStack, MonadIO m) =>
TargetList
-> [Gtk.TargetEntry.TargetEntry]
-> m ()
targetListAddTable :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TargetList -> [TargetEntry] -> m ()
targetListAddTable TargetList
list [TargetEntry]
targets = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
let ntargets :: Word32
ntargets = Int -> Word32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word32) -> Int -> Word32
forall a b. (a -> b) -> a -> b
$ [TargetEntry] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [TargetEntry]
targets
Ptr TargetList
list' <- TargetList -> IO (Ptr TargetList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TargetList
list
[Ptr TargetEntry]
targets' <- (TargetEntry -> IO (Ptr TargetEntry))
-> [TargetEntry] -> IO [Ptr TargetEntry]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM TargetEntry -> IO (Ptr TargetEntry)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [TargetEntry]
targets
Ptr TargetEntry
targets'' <- Int -> [Ptr TargetEntry] -> IO (Ptr TargetEntry)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
16 [Ptr TargetEntry]
targets'
Ptr TargetList -> Ptr TargetEntry -> Word32 -> IO ()
gtk_target_list_add_table Ptr TargetList
list' Ptr TargetEntry
targets'' Word32
ntargets
TargetList -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TargetList
list
(TargetEntry -> IO ()) -> [TargetEntry] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ TargetEntry -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [TargetEntry]
targets
Ptr TargetEntry -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr TargetEntry
targets''
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TargetListAddTableMethodInfo
instance (signature ~ ([Gtk.TargetEntry.TargetEntry] -> m ()), MonadIO m) => O.OverloadedMethod TargetListAddTableMethodInfo TargetList signature where
overloadedMethod = targetListAddTable
instance O.OverloadedMethodInfo TargetListAddTableMethodInfo TargetList where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Structs.TargetList.targetListAddTable",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Structs-TargetList.html#v:targetListAddTable"
}
#endif
foreign import ccall "gtk_target_list_add_text_targets" gtk_target_list_add_text_targets ::
Ptr TargetList ->
Word32 ->
IO ()
targetListAddTextTargets ::
(B.CallStack.HasCallStack, MonadIO m) =>
TargetList
-> Word32
-> m ()
targetListAddTextTargets :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TargetList -> Word32 -> m ()
targetListAddTextTargets TargetList
list Word32
info = 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 TargetList
list' <- TargetList -> IO (Ptr TargetList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TargetList
list
Ptr TargetList -> Word32 -> IO ()
gtk_target_list_add_text_targets Ptr TargetList
list' Word32
info
TargetList -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TargetList
list
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TargetListAddTextTargetsMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m) => O.OverloadedMethod TargetListAddTextTargetsMethodInfo TargetList signature where
overloadedMethod = targetListAddTextTargets
instance O.OverloadedMethodInfo TargetListAddTextTargetsMethodInfo TargetList where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Structs.TargetList.targetListAddTextTargets",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Structs-TargetList.html#v:targetListAddTextTargets"
}
#endif
foreign import ccall "gtk_target_list_add_uri_targets" gtk_target_list_add_uri_targets ::
Ptr TargetList ->
Word32 ->
IO ()
targetListAddUriTargets ::
(B.CallStack.HasCallStack, MonadIO m) =>
TargetList
-> Word32
-> m ()
targetListAddUriTargets :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TargetList -> Word32 -> m ()
targetListAddUriTargets TargetList
list Word32
info = 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 TargetList
list' <- TargetList -> IO (Ptr TargetList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TargetList
list
Ptr TargetList -> Word32 -> IO ()
gtk_target_list_add_uri_targets Ptr TargetList
list' Word32
info
TargetList -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TargetList
list
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TargetListAddUriTargetsMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m) => O.OverloadedMethod TargetListAddUriTargetsMethodInfo TargetList signature where
overloadedMethod = targetListAddUriTargets
instance O.OverloadedMethodInfo TargetListAddUriTargetsMethodInfo TargetList where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Structs.TargetList.targetListAddUriTargets",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Structs-TargetList.html#v:targetListAddUriTargets"
}
#endif
foreign import ccall "gtk_target_list_find" gtk_target_list_find ::
Ptr TargetList ->
Ptr Gdk.Atom.Atom ->
Ptr Word32 ->
IO CInt
targetListFind ::
(B.CallStack.HasCallStack, MonadIO m) =>
TargetList
-> Gdk.Atom.Atom
-> m ((Bool, Word32))
targetListFind :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TargetList -> Atom -> m (Bool, Word32)
targetListFind TargetList
list Atom
target = IO (Bool, Word32) -> m (Bool, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word32) -> m (Bool, Word32))
-> IO (Bool, Word32) -> m (Bool, Word32)
forall a b. (a -> b) -> a -> b
$ do
Ptr TargetList
list' <- TargetList -> IO (Ptr TargetList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TargetList
list
Ptr Atom
target' <- Atom -> IO (Ptr Atom)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Atom
target
Ptr Word32
info <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
CInt
result <- Ptr TargetList -> Ptr Atom -> Ptr Word32 -> IO CInt
gtk_target_list_find Ptr TargetList
list' Ptr Atom
target' Ptr Word32
info
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Word32
info' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
info
TargetList -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TargetList
list
Atom -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Atom
target
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
info
(Bool, Word32) -> IO (Bool, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word32
info')
#if defined(ENABLE_OVERLOADING)
data TargetListFindMethodInfo
instance (signature ~ (Gdk.Atom.Atom -> m ((Bool, Word32))), MonadIO m) => O.OverloadedMethod TargetListFindMethodInfo TargetList signature where
overloadedMethod = targetListFind
instance O.OverloadedMethodInfo TargetListFindMethodInfo TargetList where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Structs.TargetList.targetListFind",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Structs-TargetList.html#v:targetListFind"
}
#endif
foreign import ccall "gtk_target_list_ref" gtk_target_list_ref ::
Ptr TargetList ->
IO (Ptr TargetList)
targetListRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
TargetList
-> m TargetList
targetListRef :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TargetList -> m TargetList
targetListRef TargetList
list = IO TargetList -> m TargetList
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TargetList -> m TargetList) -> IO TargetList -> m TargetList
forall a b. (a -> b) -> a -> b
$ do
Ptr TargetList
list' <- TargetList -> IO (Ptr TargetList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TargetList
list
Ptr TargetList
result <- Ptr TargetList -> IO (Ptr TargetList)
gtk_target_list_ref Ptr TargetList
list'
Text -> Ptr TargetList -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"targetListRef" Ptr TargetList
result
TargetList
result' <- ((ManagedPtr TargetList -> TargetList)
-> Ptr TargetList -> IO TargetList
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr TargetList -> TargetList
TargetList) Ptr TargetList
result
TargetList -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TargetList
list
TargetList -> IO TargetList
forall (m :: * -> *) a. Monad m => a -> m a
return TargetList
result'
#if defined(ENABLE_OVERLOADING)
data TargetListRefMethodInfo
instance (signature ~ (m TargetList), MonadIO m) => O.OverloadedMethod TargetListRefMethodInfo TargetList signature where
overloadedMethod = targetListRef
instance O.OverloadedMethodInfo TargetListRefMethodInfo TargetList where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Structs.TargetList.targetListRef",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Structs-TargetList.html#v:targetListRef"
}
#endif
foreign import ccall "gtk_target_list_remove" gtk_target_list_remove ::
Ptr TargetList ->
Ptr Gdk.Atom.Atom ->
IO ()
targetListRemove ::
(B.CallStack.HasCallStack, MonadIO m) =>
TargetList
-> Gdk.Atom.Atom
-> m ()
targetListRemove :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TargetList -> Atom -> m ()
targetListRemove TargetList
list Atom
target = 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 TargetList
list' <- TargetList -> IO (Ptr TargetList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TargetList
list
Ptr Atom
target' <- Atom -> IO (Ptr Atom)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Atom
target
Ptr TargetList -> Ptr Atom -> IO ()
gtk_target_list_remove Ptr TargetList
list' Ptr Atom
target'
TargetList -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TargetList
list
Atom -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Atom
target
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TargetListRemoveMethodInfo
instance (signature ~ (Gdk.Atom.Atom -> m ()), MonadIO m) => O.OverloadedMethod TargetListRemoveMethodInfo TargetList signature where
overloadedMethod = targetListRemove
instance O.OverloadedMethodInfo TargetListRemoveMethodInfo TargetList where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Structs.TargetList.targetListRemove",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Structs-TargetList.html#v:targetListRemove"
}
#endif
foreign import ccall "gtk_target_list_unref" gtk_target_list_unref ::
Ptr TargetList ->
IO ()
targetListUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
TargetList
-> m ()
targetListUnref :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
TargetList -> m ()
targetListUnref TargetList
list = 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 TargetList
list' <- TargetList -> IO (Ptr TargetList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TargetList
list
Ptr TargetList -> IO ()
gtk_target_list_unref Ptr TargetList
list'
TargetList -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TargetList
list
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TargetListUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod TargetListUnrefMethodInfo TargetList signature where
overloadedMethod = targetListUnref
instance O.OverloadedMethodInfo TargetListUnrefMethodInfo TargetList where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Structs.TargetList.targetListUnref",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Structs-TargetList.html#v:targetListUnref"
}
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveTargetListMethod (t :: Symbol) (o :: *) :: * where
ResolveTargetListMethod "add" o = TargetListAddMethodInfo
ResolveTargetListMethod "addImageTargets" o = TargetListAddImageTargetsMethodInfo
ResolveTargetListMethod "addRichTextTargets" o = TargetListAddRichTextTargetsMethodInfo
ResolveTargetListMethod "addTable" o = TargetListAddTableMethodInfo
ResolveTargetListMethod "addTextTargets" o = TargetListAddTextTargetsMethodInfo
ResolveTargetListMethod "addUriTargets" o = TargetListAddUriTargetsMethodInfo
ResolveTargetListMethod "find" o = TargetListFindMethodInfo
ResolveTargetListMethod "ref" o = TargetListRefMethodInfo
ResolveTargetListMethod "remove" o = TargetListRemoveMethodInfo
ResolveTargetListMethod "unref" o = TargetListUnrefMethodInfo
ResolveTargetListMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveTargetListMethod t TargetList, O.OverloadedMethod info TargetList p) => OL.IsLabel t (TargetList -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveTargetListMethod t TargetList, O.OverloadedMethod info TargetList p, R.HasField t TargetList p) => R.HasField t TargetList p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveTargetListMethod t TargetList, O.OverloadedMethodInfo info TargetList) => OL.IsLabel t (O.MethodProxy info TargetList) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif