{-# 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 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 TargetList where
toGValue :: TargetList -> IO GValue
toGValue TargetList
o = do
GType
gtype <- IO GType
c_gtk_target_list_get_type
TargetList -> (Ptr TargetList -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr TargetList
o (GType
-> (GValue -> Ptr TargetList -> IO ())
-> Ptr TargetList
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr TargetList -> IO ()
forall a. GValue -> Ptr a -> IO ()
B.GValue.set_boxed)
fromGValue :: GValue -> IO TargetList
fromGValue GValue
gv = do
Ptr TargetList
ptr <- GValue -> IO (Ptr TargetList)
forall b. GValue -> IO (Ptr b)
B.GValue.get_boxed GValue
gv :: IO (Ptr TargetList)
(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
#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 :: 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 :: 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.MethodInfo TargetListAddMethodInfo TargetList signature where
overloadedMethod = 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 :: 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.MethodInfo TargetListAddImageTargetsMethodInfo TargetList signature where
overloadedMethod = 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 :: 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.MethodInfo TargetListAddRichTextTargetsMethodInfo TargetList signature where
overloadedMethod = 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 :: 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.MethodInfo TargetListAddTableMethodInfo TargetList signature where
overloadedMethod = 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 :: 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.MethodInfo TargetListAddTextTargetsMethodInfo TargetList signature where
overloadedMethod = 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 :: 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.MethodInfo TargetListAddUriTargetsMethodInfo TargetList signature where
overloadedMethod = 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 :: 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.MethodInfo TargetListFindMethodInfo TargetList signature where
overloadedMethod = 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 :: 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.MethodInfo TargetListRefMethodInfo TargetList signature where
overloadedMethod = 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 :: 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.MethodInfo TargetListRemoveMethodInfo TargetList signature where
overloadedMethod = 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 :: 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.MethodInfo TargetListUnrefMethodInfo TargetList signature where
overloadedMethod = 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.MethodInfo 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
#endif