{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Objects.Clipboard
(
Clipboard(..) ,
IsClipboard ,
toClipboard ,
#if defined(ENABLE_OVERLOADING)
ResolveClipboardMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
ClipboardGetContentMethodInfo ,
#endif
clipboardGetContent ,
#if defined(ENABLE_OVERLOADING)
ClipboardGetDisplayMethodInfo ,
#endif
clipboardGetDisplay ,
#if defined(ENABLE_OVERLOADING)
ClipboardGetFormatsMethodInfo ,
#endif
clipboardGetFormats ,
#if defined(ENABLE_OVERLOADING)
ClipboardIsLocalMethodInfo ,
#endif
clipboardIsLocal ,
#if defined(ENABLE_OVERLOADING)
ClipboardReadAsyncMethodInfo ,
#endif
clipboardReadAsync ,
#if defined(ENABLE_OVERLOADING)
ClipboardReadFinishMethodInfo ,
#endif
clipboardReadFinish ,
#if defined(ENABLE_OVERLOADING)
ClipboardReadTextAsyncMethodInfo ,
#endif
clipboardReadTextAsync ,
#if defined(ENABLE_OVERLOADING)
ClipboardReadTextFinishMethodInfo ,
#endif
clipboardReadTextFinish ,
#if defined(ENABLE_OVERLOADING)
ClipboardReadTextureAsyncMethodInfo ,
#endif
clipboardReadTextureAsync ,
#if defined(ENABLE_OVERLOADING)
ClipboardReadTextureFinishMethodInfo ,
#endif
clipboardReadTextureFinish ,
#if defined(ENABLE_OVERLOADING)
ClipboardReadValueAsyncMethodInfo ,
#endif
clipboardReadValueAsync ,
#if defined(ENABLE_OVERLOADING)
ClipboardReadValueFinishMethodInfo ,
#endif
clipboardReadValueFinish ,
#if defined(ENABLE_OVERLOADING)
ClipboardSetMethodInfo ,
#endif
clipboardSet ,
#if defined(ENABLE_OVERLOADING)
ClipboardSetContentMethodInfo ,
#endif
clipboardSetContent ,
#if defined(ENABLE_OVERLOADING)
ClipboardStoreAsyncMethodInfo ,
#endif
clipboardStoreAsync ,
#if defined(ENABLE_OVERLOADING)
ClipboardStoreFinishMethodInfo ,
#endif
clipboardStoreFinish ,
#if defined(ENABLE_OVERLOADING)
ClipboardContentPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
clipboardContent ,
#endif
getClipboardContent ,
#if defined(ENABLE_OVERLOADING)
ClipboardDisplayPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
clipboardDisplay ,
#endif
constructClipboardDisplay ,
getClipboardDisplay ,
#if defined(ENABLE_OVERLOADING)
ClipboardFormatsPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
clipboardFormats ,
#endif
getClipboardFormats ,
#if defined(ENABLE_OVERLOADING)
ClipboardLocalPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
clipboardLocal ,
#endif
getClipboardLocal ,
ClipboardChangedCallback ,
#if defined(ENABLE_OVERLOADING)
ClipboardChangedSignalInfo ,
#endif
afterClipboardChanged ,
onClipboardChanged ,
) 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.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.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gdk.Objects.ContentProvider as Gdk.ContentProvider
import {-# SOURCE #-} qualified GI.Gdk.Objects.Display as Gdk.Display
import {-# SOURCE #-} qualified GI.Gdk.Objects.Texture as Gdk.Texture
import {-# SOURCE #-} qualified GI.Gdk.Structs.ContentFormats as Gdk.ContentFormats
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
newtype Clipboard = Clipboard (SP.ManagedPtr Clipboard)
deriving (Clipboard -> Clipboard -> Bool
(Clipboard -> Clipboard -> Bool)
-> (Clipboard -> Clipboard -> Bool) -> Eq Clipboard
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Clipboard -> Clipboard -> Bool
== :: Clipboard -> Clipboard -> Bool
$c/= :: Clipboard -> Clipboard -> Bool
/= :: Clipboard -> Clipboard -> Bool
Eq)
instance SP.ManagedPtrNewtype Clipboard where
toManagedPtr :: Clipboard -> ManagedPtr Clipboard
toManagedPtr (Clipboard ManagedPtr Clipboard
p) = ManagedPtr Clipboard
p
foreign import ccall "gdk_clipboard_get_type"
c_gdk_clipboard_get_type :: IO B.Types.GType
instance B.Types.TypedObject Clipboard where
glibType :: IO GType
glibType = IO GType
c_gdk_clipboard_get_type
instance B.Types.GObject Clipboard
class (SP.GObject o, O.IsDescendantOf Clipboard o) => IsClipboard o
instance (SP.GObject o, O.IsDescendantOf Clipboard o) => IsClipboard o
instance O.HasParentTypes Clipboard
type instance O.ParentTypes Clipboard = '[GObject.Object.Object]
toClipboard :: (MIO.MonadIO m, IsClipboard o) => o -> m Clipboard
toClipboard :: forall (m :: * -> *) o.
(MonadIO m, IsClipboard o) =>
o -> m Clipboard
toClipboard = IO Clipboard -> m Clipboard
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Clipboard -> m Clipboard)
-> (o -> IO Clipboard) -> o -> m Clipboard
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Clipboard -> Clipboard) -> o -> IO Clipboard
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr Clipboard -> Clipboard
Clipboard
instance B.GValue.IsGValue (Maybe Clipboard) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gdk_clipboard_get_type
gvalueSet_ :: Ptr GValue -> Maybe Clipboard -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Clipboard
P.Nothing = Ptr GValue -> Ptr Clipboard -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Clipboard
forall a. Ptr a
FP.nullPtr :: FP.Ptr Clipboard)
gvalueSet_ Ptr GValue
gv (P.Just Clipboard
obj) = Clipboard -> (Ptr Clipboard -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Clipboard
obj (Ptr GValue -> Ptr Clipboard -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Clipboard)
gvalueGet_ Ptr GValue
gv = do
Ptr Clipboard
ptr <- Ptr GValue -> IO (Ptr Clipboard)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Clipboard)
if Ptr Clipboard
ptr Ptr Clipboard -> Ptr Clipboard -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Clipboard
forall a. Ptr a
FP.nullPtr
then Clipboard -> Maybe Clipboard
forall a. a -> Maybe a
P.Just (Clipboard -> Maybe Clipboard)
-> IO Clipboard -> IO (Maybe Clipboard)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Clipboard -> Clipboard)
-> Ptr Clipboard -> IO Clipboard
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Clipboard -> Clipboard
Clipboard Ptr Clipboard
ptr
else Maybe Clipboard -> IO (Maybe Clipboard)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Clipboard
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveClipboardMethod (t :: Symbol) (o :: *) :: * where
ResolveClipboardMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveClipboardMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveClipboardMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveClipboardMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveClipboardMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveClipboardMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveClipboardMethod "isLocal" o = ClipboardIsLocalMethodInfo
ResolveClipboardMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveClipboardMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveClipboardMethod "readAsync" o = ClipboardReadAsyncMethodInfo
ResolveClipboardMethod "readFinish" o = ClipboardReadFinishMethodInfo
ResolveClipboardMethod "readTextAsync" o = ClipboardReadTextAsyncMethodInfo
ResolveClipboardMethod "readTextFinish" o = ClipboardReadTextFinishMethodInfo
ResolveClipboardMethod "readTextureAsync" o = ClipboardReadTextureAsyncMethodInfo
ResolveClipboardMethod "readTextureFinish" o = ClipboardReadTextureFinishMethodInfo
ResolveClipboardMethod "readValueAsync" o = ClipboardReadValueAsyncMethodInfo
ResolveClipboardMethod "readValueFinish" o = ClipboardReadValueFinishMethodInfo
ResolveClipboardMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveClipboardMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveClipboardMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveClipboardMethod "set" o = ClipboardSetMethodInfo
ResolveClipboardMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveClipboardMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveClipboardMethod "storeAsync" o = ClipboardStoreAsyncMethodInfo
ResolveClipboardMethod "storeFinish" o = ClipboardStoreFinishMethodInfo
ResolveClipboardMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveClipboardMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveClipboardMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveClipboardMethod "getContent" o = ClipboardGetContentMethodInfo
ResolveClipboardMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveClipboardMethod "getDisplay" o = ClipboardGetDisplayMethodInfo
ResolveClipboardMethod "getFormats" o = ClipboardGetFormatsMethodInfo
ResolveClipboardMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveClipboardMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveClipboardMethod "setContent" o = ClipboardSetContentMethodInfo
ResolveClipboardMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveClipboardMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveClipboardMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveClipboardMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveClipboardMethod t Clipboard, O.OverloadedMethod info Clipboard p) => OL.IsLabel t (Clipboard -> 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 ~ ResolveClipboardMethod t Clipboard, O.OverloadedMethod info Clipboard p, R.HasField t Clipboard p) => R.HasField t Clipboard p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveClipboardMethod t Clipboard, O.OverloadedMethodInfo info Clipboard) => OL.IsLabel t (O.MethodProxy info Clipboard) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type ClipboardChangedCallback =
IO ()
type C_ClipboardChangedCallback =
Ptr Clipboard ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_ClipboardChangedCallback :: C_ClipboardChangedCallback -> IO (FunPtr C_ClipboardChangedCallback)
wrap_ClipboardChangedCallback ::
GObject a => (a -> ClipboardChangedCallback) ->
C_ClipboardChangedCallback
wrap_ClipboardChangedCallback :: forall a. GObject a => (a -> IO ()) -> C_ClipboardChangedCallback
wrap_ClipboardChangedCallback a -> IO ()
gi'cb Ptr Clipboard
gi'selfPtr Ptr ()
_ = do
Ptr Clipboard -> (Clipboard -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr Clipboard
gi'selfPtr ((Clipboard -> IO ()) -> IO ()) -> (Clipboard -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Clipboard
gi'self -> a -> IO ()
gi'cb (Clipboard -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Clipboard
gi'self)
onClipboardChanged :: (IsClipboard a, MonadIO m) => a -> ((?self :: a) => ClipboardChangedCallback) -> m SignalHandlerId
onClipboardChanged :: forall a (m :: * -> *).
(IsClipboard a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onClipboardChanged a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_ClipboardChangedCallback
wrapped' = (a -> IO ()) -> C_ClipboardChangedCallback
forall a. GObject a => (a -> IO ()) -> C_ClipboardChangedCallback
wrap_ClipboardChangedCallback a -> IO ()
wrapped
FunPtr C_ClipboardChangedCallback
wrapped'' <- C_ClipboardChangedCallback
-> IO (FunPtr C_ClipboardChangedCallback)
mk_ClipboardChangedCallback C_ClipboardChangedCallback
wrapped'
a
-> Text
-> FunPtr C_ClipboardChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"changed" FunPtr C_ClipboardChangedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterClipboardChanged :: (IsClipboard a, MonadIO m) => a -> ((?self :: a) => ClipboardChangedCallback) -> m SignalHandlerId
afterClipboardChanged :: forall a (m :: * -> *).
(IsClipboard a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterClipboardChanged a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_ClipboardChangedCallback
wrapped' = (a -> IO ()) -> C_ClipboardChangedCallback
forall a. GObject a => (a -> IO ()) -> C_ClipboardChangedCallback
wrap_ClipboardChangedCallback a -> IO ()
wrapped
FunPtr C_ClipboardChangedCallback
wrapped'' <- C_ClipboardChangedCallback
-> IO (FunPtr C_ClipboardChangedCallback)
mk_ClipboardChangedCallback C_ClipboardChangedCallback
wrapped'
a
-> Text
-> FunPtr C_ClipboardChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"changed" FunPtr C_ClipboardChangedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data ClipboardChangedSignalInfo
instance SignalInfo ClipboardChangedSignalInfo where
type HaskellCallbackType ClipboardChangedSignalInfo = ClipboardChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_ClipboardChangedCallback cb
cb'' <- mk_ClipboardChangedCallback cb'
connectSignalFunPtr obj "changed" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Clipboard::changed"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-Clipboard.html#g:signal:changed"})
#endif
getClipboardContent :: (MonadIO m, IsClipboard o) => o -> m (Maybe Gdk.ContentProvider.ContentProvider)
getClipboardContent :: forall (m :: * -> *) o.
(MonadIO m, IsClipboard o) =>
o -> m (Maybe ContentProvider)
getClipboardContent o
obj = IO (Maybe ContentProvider) -> m (Maybe ContentProvider)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe ContentProvider) -> m (Maybe ContentProvider))
-> IO (Maybe ContentProvider) -> m (Maybe ContentProvider)
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr ContentProvider -> ContentProvider)
-> IO (Maybe ContentProvider)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"content" ManagedPtr ContentProvider -> ContentProvider
Gdk.ContentProvider.ContentProvider
#if defined(ENABLE_OVERLOADING)
data ClipboardContentPropertyInfo
instance AttrInfo ClipboardContentPropertyInfo where
type AttrAllowedOps ClipboardContentPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint ClipboardContentPropertyInfo = IsClipboard
type AttrSetTypeConstraint ClipboardContentPropertyInfo = (~) ()
type AttrTransferTypeConstraint ClipboardContentPropertyInfo = (~) ()
type AttrTransferType ClipboardContentPropertyInfo = ()
type AttrGetType ClipboardContentPropertyInfo = (Maybe Gdk.ContentProvider.ContentProvider)
type AttrLabel ClipboardContentPropertyInfo = "content"
type AttrOrigin ClipboardContentPropertyInfo = Clipboard
attrGet = getClipboardContent
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Clipboard.content"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-Clipboard.html#g:attr:content"
})
#endif
getClipboardDisplay :: (MonadIO m, IsClipboard o) => o -> m Gdk.Display.Display
getClipboardDisplay :: forall (m :: * -> *) o.
(MonadIO m, IsClipboard o) =>
o -> m Display
getClipboardDisplay o
obj = IO Display -> m Display
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Display -> m Display) -> IO Display -> m Display
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Display) -> IO Display
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getClipboardDisplay" (IO (Maybe Display) -> IO Display)
-> IO (Maybe Display) -> IO Display
forall a b. (a -> b) -> a -> b
$ o
-> String -> (ManagedPtr Display -> Display) -> IO (Maybe Display)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"display" ManagedPtr Display -> Display
Gdk.Display.Display
constructClipboardDisplay :: (IsClipboard o, MIO.MonadIO m, Gdk.Display.IsDisplay a) => a -> m (GValueConstruct o)
constructClipboardDisplay :: forall o (m :: * -> *) a.
(IsClipboard o, MonadIO m, IsDisplay a) =>
a -> m (GValueConstruct o)
constructClipboardDisplay a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"display" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data ClipboardDisplayPropertyInfo
instance AttrInfo ClipboardDisplayPropertyInfo where
type AttrAllowedOps ClipboardDisplayPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint ClipboardDisplayPropertyInfo = IsClipboard
type AttrSetTypeConstraint ClipboardDisplayPropertyInfo = Gdk.Display.IsDisplay
type AttrTransferTypeConstraint ClipboardDisplayPropertyInfo = Gdk.Display.IsDisplay
type AttrTransferType ClipboardDisplayPropertyInfo = Gdk.Display.Display
type AttrGetType ClipboardDisplayPropertyInfo = Gdk.Display.Display
type AttrLabel ClipboardDisplayPropertyInfo = "display"
type AttrOrigin ClipboardDisplayPropertyInfo = Clipboard
attrGet = getClipboardDisplay
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gdk.Display.Display v
attrConstruct = constructClipboardDisplay
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Clipboard.display"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-Clipboard.html#g:attr:display"
})
#endif
getClipboardFormats :: (MonadIO m, IsClipboard o) => o -> m Gdk.ContentFormats.ContentFormats
getClipboardFormats :: forall (m :: * -> *) o.
(MonadIO m, IsClipboard o) =>
o -> m ContentFormats
getClipboardFormats o
obj = IO ContentFormats -> m ContentFormats
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO ContentFormats -> m ContentFormats)
-> IO ContentFormats -> m ContentFormats
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe ContentFormats) -> IO ContentFormats
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getClipboardFormats" (IO (Maybe ContentFormats) -> IO ContentFormats)
-> IO (Maybe ContentFormats) -> IO ContentFormats
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr ContentFormats -> ContentFormats)
-> IO (Maybe ContentFormats)
forall a b.
(GObject a, GBoxed b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyBoxed o
obj String
"formats" ManagedPtr ContentFormats -> ContentFormats
Gdk.ContentFormats.ContentFormats
#if defined(ENABLE_OVERLOADING)
data ClipboardFormatsPropertyInfo
instance AttrInfo ClipboardFormatsPropertyInfo where
type AttrAllowedOps ClipboardFormatsPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint ClipboardFormatsPropertyInfo = IsClipboard
type AttrSetTypeConstraint ClipboardFormatsPropertyInfo = (~) ()
type AttrTransferTypeConstraint ClipboardFormatsPropertyInfo = (~) ()
type AttrTransferType ClipboardFormatsPropertyInfo = ()
type AttrGetType ClipboardFormatsPropertyInfo = Gdk.ContentFormats.ContentFormats
type AttrLabel ClipboardFormatsPropertyInfo = "formats"
type AttrOrigin ClipboardFormatsPropertyInfo = Clipboard
attrGet = getClipboardFormats
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Clipboard.formats"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-Clipboard.html#g:attr:formats"
})
#endif
getClipboardLocal :: (MonadIO m, IsClipboard o) => o -> m Bool
getClipboardLocal :: forall (m :: * -> *) o. (MonadIO m, IsClipboard o) => o -> m Bool
getClipboardLocal o
obj = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj String
"local"
#if defined(ENABLE_OVERLOADING)
data ClipboardLocalPropertyInfo
instance AttrInfo ClipboardLocalPropertyInfo where
type AttrAllowedOps ClipboardLocalPropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint ClipboardLocalPropertyInfo = IsClipboard
type AttrSetTypeConstraint ClipboardLocalPropertyInfo = (~) ()
type AttrTransferTypeConstraint ClipboardLocalPropertyInfo = (~) ()
type AttrTransferType ClipboardLocalPropertyInfo = ()
type AttrGetType ClipboardLocalPropertyInfo = Bool
type AttrLabel ClipboardLocalPropertyInfo = "local"
type AttrOrigin ClipboardLocalPropertyInfo = Clipboard
attrGet = getClipboardLocal
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Clipboard.local"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-Clipboard.html#g:attr:local"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Clipboard
type instance O.AttributeList Clipboard = ClipboardAttributeList
type ClipboardAttributeList = ('[ '("content", ClipboardContentPropertyInfo), '("display", ClipboardDisplayPropertyInfo), '("formats", ClipboardFormatsPropertyInfo), '("local", ClipboardLocalPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
clipboardContent :: AttrLabelProxy "content"
clipboardContent = AttrLabelProxy
clipboardDisplay :: AttrLabelProxy "display"
clipboardDisplay = AttrLabelProxy
clipboardFormats :: AttrLabelProxy "formats"
clipboardFormats = AttrLabelProxy
clipboardLocal :: AttrLabelProxy "local"
clipboardLocal = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Clipboard = ClipboardSignalList
type ClipboardSignalList = ('[ '("changed", ClipboardChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gdk_clipboard_get_content" gdk_clipboard_get_content ::
Ptr Clipboard ->
IO (Ptr Gdk.ContentProvider.ContentProvider)
clipboardGetContent ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> m (Maybe Gdk.ContentProvider.ContentProvider)
clipboardGetContent :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> m (Maybe ContentProvider)
clipboardGetContent a
clipboard = IO (Maybe ContentProvider) -> m (Maybe ContentProvider)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe ContentProvider) -> m (Maybe ContentProvider))
-> IO (Maybe ContentProvider) -> m (Maybe ContentProvider)
forall a b. (a -> b) -> a -> b
$ do
Ptr Clipboard
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
Ptr ContentProvider
result <- Ptr Clipboard -> IO (Ptr ContentProvider)
gdk_clipboard_get_content Ptr Clipboard
clipboard'
Maybe ContentProvider
maybeResult <- Ptr ContentProvider
-> (Ptr ContentProvider -> IO ContentProvider)
-> IO (Maybe ContentProvider)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr ContentProvider
result ((Ptr ContentProvider -> IO ContentProvider)
-> IO (Maybe ContentProvider))
-> (Ptr ContentProvider -> IO ContentProvider)
-> IO (Maybe ContentProvider)
forall a b. (a -> b) -> a -> b
$ \Ptr ContentProvider
result' -> do
ContentProvider
result'' <- ((ManagedPtr ContentProvider -> ContentProvider)
-> Ptr ContentProvider -> IO ContentProvider
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr ContentProvider -> ContentProvider
Gdk.ContentProvider.ContentProvider) Ptr ContentProvider
result'
ContentProvider -> IO ContentProvider
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ContentProvider
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
Maybe ContentProvider -> IO (Maybe ContentProvider)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe ContentProvider
maybeResult
#if defined(ENABLE_OVERLOADING)
data ClipboardGetContentMethodInfo
instance (signature ~ (m (Maybe Gdk.ContentProvider.ContentProvider)), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardGetContentMethodInfo a signature where
overloadedMethod = clipboardGetContent
instance O.OverloadedMethodInfo ClipboardGetContentMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Clipboard.clipboardGetContent",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-Clipboard.html#v:clipboardGetContent"
})
#endif
foreign import ccall "gdk_clipboard_get_display" gdk_clipboard_get_display ::
Ptr Clipboard ->
IO (Ptr Gdk.Display.Display)
clipboardGetDisplay ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> m Gdk.Display.Display
clipboardGetDisplay :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> m Display
clipboardGetDisplay a
clipboard = IO Display -> m Display
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Display -> m Display) -> IO Display -> m Display
forall a b. (a -> b) -> a -> b
$ do
Ptr Clipboard
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
Ptr Display
result <- Ptr Clipboard -> IO (Ptr Display)
gdk_clipboard_get_display Ptr Clipboard
clipboard'
Text -> Ptr Display -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"clipboardGetDisplay" Ptr Display
result
Display
result' <- ((ManagedPtr Display -> Display) -> Ptr Display -> IO Display
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Display -> Display
Gdk.Display.Display) Ptr Display
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
Display -> IO Display
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Display
result'
#if defined(ENABLE_OVERLOADING)
data ClipboardGetDisplayMethodInfo
instance (signature ~ (m Gdk.Display.Display), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardGetDisplayMethodInfo a signature where
overloadedMethod = clipboardGetDisplay
instance O.OverloadedMethodInfo ClipboardGetDisplayMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Clipboard.clipboardGetDisplay",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-Clipboard.html#v:clipboardGetDisplay"
})
#endif
foreign import ccall "gdk_clipboard_get_formats" gdk_clipboard_get_formats ::
Ptr Clipboard ->
IO (Ptr Gdk.ContentFormats.ContentFormats)
clipboardGetFormats ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> m Gdk.ContentFormats.ContentFormats
clipboardGetFormats :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> m ContentFormats
clipboardGetFormats a
clipboard = IO ContentFormats -> m ContentFormats
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContentFormats -> m ContentFormats)
-> IO ContentFormats -> m ContentFormats
forall a b. (a -> b) -> a -> b
$ do
Ptr Clipboard
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
Ptr ContentFormats
result <- Ptr Clipboard -> IO (Ptr ContentFormats)
gdk_clipboard_get_formats Ptr Clipboard
clipboard'
Text -> Ptr ContentFormats -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"clipboardGetFormats" Ptr ContentFormats
result
ContentFormats
result' <- ((ManagedPtr ContentFormats -> ContentFormats)
-> Ptr ContentFormats -> IO ContentFormats
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr ContentFormats -> ContentFormats
Gdk.ContentFormats.ContentFormats) Ptr ContentFormats
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
ContentFormats -> IO ContentFormats
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ContentFormats
result'
#if defined(ENABLE_OVERLOADING)
data ClipboardGetFormatsMethodInfo
instance (signature ~ (m Gdk.ContentFormats.ContentFormats), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardGetFormatsMethodInfo a signature where
overloadedMethod = clipboardGetFormats
instance O.OverloadedMethodInfo ClipboardGetFormatsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Clipboard.clipboardGetFormats",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-Clipboard.html#v:clipboardGetFormats"
})
#endif
foreign import ccall "gdk_clipboard_is_local" gdk_clipboard_is_local ::
Ptr Clipboard ->
IO CInt
clipboardIsLocal ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> m Bool
clipboardIsLocal :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> m Bool
clipboardIsLocal a
clipboard = 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
Ptr Clipboard
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
CInt
result <- Ptr Clipboard -> IO CInt
gdk_clipboard_is_local Ptr Clipboard
clipboard'
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
clipboard
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ClipboardIsLocalMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardIsLocalMethodInfo a signature where
overloadedMethod = clipboardIsLocal
instance O.OverloadedMethodInfo ClipboardIsLocalMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Clipboard.clipboardIsLocal",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-Clipboard.html#v:clipboardIsLocal"
})
#endif
foreign import ccall "gdk_clipboard_read_async" gdk_clipboard_read_async ::
Ptr Clipboard ->
Ptr CString ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
clipboardReadAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a, Gio.Cancellable.IsCancellable b) =>
a
-> [T.Text]
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
clipboardReadAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsClipboard a, IsCancellable b) =>
a -> [Text] -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
clipboardReadAsync a
clipboard [Text]
mimeTypes Int32
ioPriority Maybe b
cancellable Maybe AsyncReadyCallback
callback = 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
Ptr Clipboard
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
Ptr CString
mimeTypes' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
mimeTypes
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Clipboard
-> Ptr CString
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
gdk_clipboard_read_async Ptr Clipboard
clipboard' Ptr CString
mimeTypes' Int32
ioPriority Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
mimeTypes'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
mimeTypes'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ClipboardReadAsyncMethodInfo
instance (signature ~ ([T.Text] -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsClipboard a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod ClipboardReadAsyncMethodInfo a signature where
overloadedMethod = clipboardReadAsync
instance O.OverloadedMethodInfo ClipboardReadAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Clipboard.clipboardReadAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-Clipboard.html#v:clipboardReadAsync"
})
#endif
foreign import ccall "gdk_clipboard_read_finish" gdk_clipboard_read_finish ::
Ptr Clipboard ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr CString ->
Ptr (Ptr GError) ->
IO (Ptr Gio.InputStream.InputStream)
clipboardReadFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ((Maybe Gio.InputStream.InputStream, T.Text))
clipboardReadFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsClipboard a, IsAsyncResult b) =>
a -> b -> m (Maybe InputStream, Text)
clipboardReadFinish a
clipboard b
result_ = IO (Maybe InputStream, Text) -> m (Maybe InputStream, Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe InputStream, Text) -> m (Maybe InputStream, Text))
-> IO (Maybe InputStream, Text) -> m (Maybe InputStream, Text)
forall a b. (a -> b) -> a -> b
$ do
Ptr Clipboard
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
Ptr CString
outMimeType <- IO (Ptr CString)
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr CString)
IO (Maybe InputStream, Text)
-> IO () -> IO (Maybe InputStream, Text)
forall a b. IO a -> IO b -> IO a
onException (do
Ptr InputStream
result <- (Ptr (Ptr GError) -> IO (Ptr InputStream)) -> IO (Ptr InputStream)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr InputStream))
-> IO (Ptr InputStream))
-> (Ptr (Ptr GError) -> IO (Ptr InputStream))
-> IO (Ptr InputStream)
forall a b. (a -> b) -> a -> b
$ Ptr Clipboard
-> Ptr AsyncResult
-> Ptr CString
-> Ptr (Ptr GError)
-> IO (Ptr InputStream)
gdk_clipboard_read_finish Ptr Clipboard
clipboard' Ptr AsyncResult
result_' Ptr CString
outMimeType
Maybe InputStream
maybeResult <- Ptr InputStream
-> (Ptr InputStream -> IO InputStream) -> IO (Maybe InputStream)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr InputStream
result ((Ptr InputStream -> IO InputStream) -> IO (Maybe InputStream))
-> (Ptr InputStream -> IO InputStream) -> IO (Maybe InputStream)
forall a b. (a -> b) -> a -> b
$ \Ptr InputStream
result' -> do
InputStream
result'' <- ((ManagedPtr InputStream -> InputStream)
-> Ptr InputStream -> IO InputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr InputStream -> InputStream
Gio.InputStream.InputStream) Ptr InputStream
result'
InputStream -> IO InputStream
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return InputStream
result''
CString
outMimeType' <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
outMimeType
Text
outMimeType'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
outMimeType'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outMimeType
(Maybe InputStream, Text) -> IO (Maybe InputStream, Text)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe InputStream
maybeResult, Text
outMimeType'')
) (do
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
outMimeType
)
#if defined(ENABLE_OVERLOADING)
data ClipboardReadFinishMethodInfo
instance (signature ~ (b -> m ((Maybe Gio.InputStream.InputStream, T.Text))), MonadIO m, IsClipboard a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod ClipboardReadFinishMethodInfo a signature where
overloadedMethod = clipboardReadFinish
instance O.OverloadedMethodInfo ClipboardReadFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Clipboard.clipboardReadFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-Clipboard.html#v:clipboardReadFinish"
})
#endif
foreign import ccall "gdk_clipboard_read_text_async" gdk_clipboard_read_text_async ::
Ptr Clipboard ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
clipboardReadTextAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
clipboardReadTextAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsClipboard a, IsCancellable b) =>
a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
clipboardReadTextAsync a
clipboard Maybe b
cancellable Maybe AsyncReadyCallback
callback = 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
Ptr Clipboard
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Clipboard
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
gdk_clipboard_read_text_async Ptr Clipboard
clipboard' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ClipboardReadTextAsyncMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsClipboard a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod ClipboardReadTextAsyncMethodInfo a signature where
overloadedMethod = clipboardReadTextAsync
instance O.OverloadedMethodInfo ClipboardReadTextAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Clipboard.clipboardReadTextAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-Clipboard.html#v:clipboardReadTextAsync"
})
#endif
foreign import ccall "gdk_clipboard_read_text_finish" gdk_clipboard_read_text_finish ::
Ptr Clipboard ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CString
clipboardReadTextFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m (Maybe T.Text)
clipboardReadTextFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsClipboard a, IsAsyncResult b) =>
a -> b -> m (Maybe Text)
clipboardReadTextFinish a
clipboard b
result_ = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
Ptr Clipboard
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO (Maybe Text) -> IO () -> IO (Maybe Text)
forall a b. IO a -> IO b -> IO a
onException (do
CString
result <- (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CString) -> IO CString)
-> (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ Ptr Clipboard -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CString
gdk_clipboard_read_text_finish Ptr Clipboard
clipboard' Ptr AsyncResult
result_'
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result'
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
Maybe Text -> IO (Maybe Text)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
) (do
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data ClipboardReadTextFinishMethodInfo
instance (signature ~ (b -> m (Maybe T.Text)), MonadIO m, IsClipboard a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod ClipboardReadTextFinishMethodInfo a signature where
overloadedMethod = clipboardReadTextFinish
instance O.OverloadedMethodInfo ClipboardReadTextFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Clipboard.clipboardReadTextFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-Clipboard.html#v:clipboardReadTextFinish"
})
#endif
foreign import ccall "gdk_clipboard_read_texture_async" gdk_clipboard_read_texture_async ::
Ptr Clipboard ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
clipboardReadTextureAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
clipboardReadTextureAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsClipboard a, IsCancellable b) =>
a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
clipboardReadTextureAsync a
clipboard Maybe b
cancellable Maybe AsyncReadyCallback
callback = 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
Ptr Clipboard
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Clipboard
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
gdk_clipboard_read_texture_async Ptr Clipboard
clipboard' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ClipboardReadTextureAsyncMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsClipboard a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod ClipboardReadTextureAsyncMethodInfo a signature where
overloadedMethod = clipboardReadTextureAsync
instance O.OverloadedMethodInfo ClipboardReadTextureAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Clipboard.clipboardReadTextureAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-Clipboard.html#v:clipboardReadTextureAsync"
})
#endif
foreign import ccall "gdk_clipboard_read_texture_finish" gdk_clipboard_read_texture_finish ::
Ptr Clipboard ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr Gdk.Texture.Texture)
clipboardReadTextureFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m (Maybe Gdk.Texture.Texture)
clipboardReadTextureFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsClipboard a, IsAsyncResult b) =>
a -> b -> m (Maybe Texture)
clipboardReadTextureFinish a
clipboard b
result_ = IO (Maybe Texture) -> m (Maybe Texture)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Texture) -> m (Maybe Texture))
-> IO (Maybe Texture) -> m (Maybe Texture)
forall a b. (a -> b) -> a -> b
$ do
Ptr Clipboard
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO (Maybe Texture) -> IO () -> IO (Maybe Texture)
forall a b. IO a -> IO b -> IO a
onException (do
Ptr Texture
result <- (Ptr (Ptr GError) -> IO (Ptr Texture)) -> IO (Ptr Texture)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr Texture)) -> IO (Ptr Texture))
-> (Ptr (Ptr GError) -> IO (Ptr Texture)) -> IO (Ptr Texture)
forall a b. (a -> b) -> a -> b
$ Ptr Clipboard
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr Texture)
gdk_clipboard_read_texture_finish Ptr Clipboard
clipboard' Ptr AsyncResult
result_'
Maybe Texture
maybeResult <- Ptr Texture -> (Ptr Texture -> IO Texture) -> IO (Maybe Texture)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Texture
result ((Ptr Texture -> IO Texture) -> IO (Maybe Texture))
-> (Ptr Texture -> IO Texture) -> IO (Maybe Texture)
forall a b. (a -> b) -> a -> b
$ \Ptr Texture
result' -> do
Texture
result'' <- ((ManagedPtr Texture -> Texture) -> Ptr Texture -> IO Texture
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Texture -> Texture
Gdk.Texture.Texture) Ptr Texture
result'
Texture -> IO Texture
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Texture
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
Maybe Texture -> IO (Maybe Texture)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Texture
maybeResult
) (do
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data ClipboardReadTextureFinishMethodInfo
instance (signature ~ (b -> m (Maybe Gdk.Texture.Texture)), MonadIO m, IsClipboard a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod ClipboardReadTextureFinishMethodInfo a signature where
overloadedMethod = clipboardReadTextureFinish
instance O.OverloadedMethodInfo ClipboardReadTextureFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Clipboard.clipboardReadTextureFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-Clipboard.html#v:clipboardReadTextureFinish"
})
#endif
foreign import ccall "gdk_clipboard_read_value_async" gdk_clipboard_read_value_async ::
Ptr Clipboard ->
CGType ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
clipboardReadValueAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a, Gio.Cancellable.IsCancellable b) =>
a
-> GType
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
clipboardReadValueAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsClipboard a, IsCancellable b) =>
a -> GType -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
clipboardReadValueAsync a
clipboard GType
type_ Int32
ioPriority Maybe b
cancellable Maybe AsyncReadyCallback
callback = 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
Ptr Clipboard
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
let type_' :: CGType
type_' = GType -> CGType
gtypeToCGType GType
type_
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Clipboard
-> CGType
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
gdk_clipboard_read_value_async Ptr Clipboard
clipboard' CGType
type_' Int32
ioPriority Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ClipboardReadValueAsyncMethodInfo
instance (signature ~ (GType -> Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsClipboard a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod ClipboardReadValueAsyncMethodInfo a signature where
overloadedMethod = clipboardReadValueAsync
instance O.OverloadedMethodInfo ClipboardReadValueAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Clipboard.clipboardReadValueAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-Clipboard.html#v:clipboardReadValueAsync"
})
#endif
foreign import ccall "gdk_clipboard_read_value_finish" gdk_clipboard_read_value_finish ::
Ptr Clipboard ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr GValue)
clipboardReadValueFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m GValue
clipboardReadValueFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsClipboard a, IsAsyncResult b) =>
a -> b -> m GValue
clipboardReadValueFinish a
clipboard b
result_ = IO GValue -> m GValue
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GValue -> m GValue) -> IO GValue -> m GValue
forall a b. (a -> b) -> a -> b
$ do
Ptr Clipboard
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO GValue -> IO () -> IO GValue
forall a b. IO a -> IO b -> IO a
onException (do
Ptr GValue
result <- (Ptr (Ptr GError) -> IO (Ptr GValue)) -> IO (Ptr GValue)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr GValue)) -> IO (Ptr GValue))
-> (Ptr (Ptr GError) -> IO (Ptr GValue)) -> IO (Ptr GValue)
forall a b. (a -> b) -> a -> b
$ Ptr Clipboard
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr GValue)
gdk_clipboard_read_value_finish Ptr Clipboard
clipboard' Ptr AsyncResult
result_'
Text -> Ptr GValue -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"clipboardReadValueFinish" Ptr GValue
result
GValue
result' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
GValue -> IO GValue
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return GValue
result'
) (do
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data ClipboardReadValueFinishMethodInfo
instance (signature ~ (b -> m GValue), MonadIO m, IsClipboard a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod ClipboardReadValueFinishMethodInfo a signature where
overloadedMethod = clipboardReadValueFinish
instance O.OverloadedMethodInfo ClipboardReadValueFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Clipboard.clipboardReadValueFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-Clipboard.html#v:clipboardReadValueFinish"
})
#endif
foreign import ccall "gdk_clipboard_set_content" gdk_clipboard_set_content ::
Ptr Clipboard ->
Ptr Gdk.ContentProvider.ContentProvider ->
IO CInt
clipboardSetContent ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a, Gdk.ContentProvider.IsContentProvider b) =>
a
-> Maybe (b)
-> m Bool
clipboardSetContent :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsClipboard a, IsContentProvider b) =>
a -> Maybe b -> m Bool
clipboardSetContent a
clipboard Maybe b
provider = 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
Ptr Clipboard
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
Ptr ContentProvider
maybeProvider <- case Maybe b
provider of
Maybe b
Nothing -> Ptr ContentProvider -> IO (Ptr ContentProvider)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ContentProvider
forall a. Ptr a
nullPtr
Just b
jProvider -> do
Ptr ContentProvider
jProvider' <- b -> IO (Ptr ContentProvider)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jProvider
Ptr ContentProvider -> IO (Ptr ContentProvider)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ContentProvider
jProvider'
CInt
result <- Ptr Clipboard -> Ptr ContentProvider -> IO CInt
gdk_clipboard_set_content Ptr Clipboard
clipboard' Ptr ContentProvider
maybeProvider
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
clipboard
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
provider b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ClipboardSetContentMethodInfo
instance (signature ~ (Maybe (b) -> m Bool), MonadIO m, IsClipboard a, Gdk.ContentProvider.IsContentProvider b) => O.OverloadedMethod ClipboardSetContentMethodInfo a signature where
overloadedMethod = clipboardSetContent
instance O.OverloadedMethodInfo ClipboardSetContentMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Clipboard.clipboardSetContent",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-Clipboard.html#v:clipboardSetContent"
})
#endif
foreign import ccall "gdk_clipboard_set_value" gdk_clipboard_set_value ::
Ptr Clipboard ->
Ptr GValue ->
IO ()
clipboardSet ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> GValue
-> m ()
clipboardSet :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> GValue -> m ()
clipboardSet a
clipboard GValue
value = 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
Ptr Clipboard
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
Ptr GValue
value' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
value
Ptr Clipboard -> Ptr GValue -> IO ()
gdk_clipboard_set_value Ptr Clipboard
clipboard' Ptr GValue
value'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
value
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ClipboardSetMethodInfo
instance (signature ~ (GValue -> m ()), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardSetMethodInfo a signature where
overloadedMethod = clipboardSet
instance O.OverloadedMethodInfo ClipboardSetMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Clipboard.clipboardSet",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-Clipboard.html#v:clipboardSet"
})
#endif
foreign import ccall "gdk_clipboard_store_async" gdk_clipboard_store_async ::
Ptr Clipboard ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
clipboardStoreAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
clipboardStoreAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsClipboard a, IsCancellable b) =>
a -> Int32 -> Maybe b -> Maybe AsyncReadyCallback -> m ()
clipboardStoreAsync a
clipboard Int32
ioPriority Maybe b
cancellable Maybe AsyncReadyCallback
callback = 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
Ptr Clipboard
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Clipboard
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
gdk_clipboard_store_async Ptr Clipboard
clipboard' Int32
ioPriority Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ClipboardStoreAsyncMethodInfo
instance (signature ~ (Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsClipboard a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod ClipboardStoreAsyncMethodInfo a signature where
overloadedMethod = clipboardStoreAsync
instance O.OverloadedMethodInfo ClipboardStoreAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Clipboard.clipboardStoreAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-Clipboard.html#v:clipboardStoreAsync"
})
#endif
foreign import ccall "gdk_clipboard_store_finish" gdk_clipboard_store_finish ::
Ptr Clipboard ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
clipboardStoreFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
clipboardStoreFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsClipboard a, IsAsyncResult b) =>
a -> b -> m ()
clipboardStoreFinish a
clipboard b
result_ = 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
Ptr Clipboard
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr Clipboard -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
gdk_clipboard_store_finish Ptr Clipboard
clipboard' Ptr AsyncResult
result_'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data ClipboardStoreFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsClipboard a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod ClipboardStoreFinishMethodInfo a signature where
overloadedMethod = clipboardStoreFinish
instance O.OverloadedMethodInfo ClipboardStoreFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.Clipboard.clipboardStoreFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-Clipboard.html#v:clipboardStoreFinish"
})
#endif