{-# 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.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.Cairo.Enums as Cairo.Enums
import qualified GI.Cairo.Structs.Context as Cairo.Context
import qualified GI.Cairo.Structs.Region as Cairo.Region
import qualified GI.Cairo.Structs.Surface as Cairo.Surface
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.String as GLib.String
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gdk.Enums as Gdk.Enums
import {-# SOURCE #-} qualified GI.Gdk.Flags as Gdk.Flags
import {-# SOURCE #-} qualified GI.Gdk.Interfaces.Paintable as Gdk.Paintable
import {-# SOURCE #-} qualified GI.Gdk.Objects.AppLaunchContext as Gdk.AppLaunchContext
import {-# SOURCE #-} qualified GI.Gdk.Objects.CairoContext as Gdk.CairoContext
import {-# SOURCE #-} qualified GI.Gdk.Objects.ContentProvider as Gdk.ContentProvider
import {-# SOURCE #-} qualified GI.Gdk.Objects.Cursor as Gdk.Cursor
import {-# SOURCE #-} qualified GI.Gdk.Objects.Device as Gdk.Device
import {-# SOURCE #-} qualified GI.Gdk.Objects.DeviceTool as Gdk.DeviceTool
import {-# SOURCE #-} qualified GI.Gdk.Objects.Display as Gdk.Display
import {-# SOURCE #-} qualified GI.Gdk.Objects.DrawContext as Gdk.DrawContext
import {-# SOURCE #-} qualified GI.Gdk.Objects.Event as Gdk.Event
import {-# SOURCE #-} qualified GI.Gdk.Objects.FrameClock as Gdk.FrameClock
import {-# SOURCE #-} qualified GI.Gdk.Objects.GLContext as Gdk.GLContext
import {-# SOURCE #-} qualified GI.Gdk.Objects.Monitor as Gdk.Monitor
import {-# SOURCE #-} qualified GI.Gdk.Objects.Seat as Gdk.Seat
import {-# SOURCE #-} qualified GI.Gdk.Objects.Snapshot as Gdk.Snapshot
import {-# SOURCE #-} qualified GI.Gdk.Objects.Surface as Gdk.Surface
import {-# SOURCE #-} qualified GI.Gdk.Objects.Texture as Gdk.Texture
import {-# SOURCE #-} qualified GI.Gdk.Objects.VulkanContext as Gdk.VulkanContext
import {-# SOURCE #-} qualified GI.Gdk.Structs.ContentFormats as Gdk.ContentFormats
import {-# SOURCE #-} qualified GI.Gdk.Structs.DmabufFormats as Gdk.DmabufFormats
import {-# SOURCE #-} qualified GI.Gdk.Structs.EventSequence as Gdk.EventSequence
import {-# SOURCE #-} qualified GI.Gdk.Structs.FrameTimings as Gdk.FrameTimings
import {-# SOURCE #-} qualified GI.Gdk.Structs.KeymapKey as Gdk.KeymapKey
import {-# SOURCE #-} qualified GI.Gdk.Structs.Rectangle as Gdk.Rectangle
import {-# SOURCE #-} qualified GI.Gdk.Structs.TimeCoord as Gdk.TimeCoord
import qualified GI.GdkPixbuf.Objects.Pixbuf as GdkPixbuf.Pixbuf
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Interfaces.Icon as Gio.Icon
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
import qualified GI.Gio.Interfaces.ListModel as Gio.ListModel
import qualified GI.Gio.Interfaces.LoadableIcon as Gio.LoadableIcon
import qualified GI.Gio.Objects.AppLaunchContext as Gio.AppLaunchContext
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
import qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
import qualified GI.Pango.Enums as Pango.Enums
#else
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
#endif
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 <- 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 /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject Clipboard ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveClipboardMethod (t :: Symbol) (o :: DK.Type) :: DK.Type 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 o b.
(HasCallStack, GObject o) =>
Ptr o -> (o -> IO b) -> IO b
B.ManagedPtr.withNewObject 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
wrapped'' <- C_ClipboardChangedCallback
-> IO (FunPtr C_ClipboardChangedCallback)
mk_ClipboardChangedCallback C_ClipboardChangedCallback
wrapped'
connectSignalFunPtr obj "changed" wrapped'' SignalConnectBefore 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
wrapped'' <- C_ClipboardChangedCallback
-> IO (FunPtr C_ClipboardChangedCallback)
mk_ClipboardChangedCallback C_ClipboardChangedCallback
wrapped'
connectSignalFunPtr obj "changed" wrapped'' SignalConnectAfter 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.9/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.9/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.9/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.9/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.9/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, DK.Type)])
#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, DK.Type)])
#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
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
result <- gdk_clipboard_get_content clipboard'
maybeResult <- convertIfNonNull result $ \Ptr ContentProvider
result' -> do
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'
return result''
touchManagedPtr clipboard
return 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.9/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
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
result <- gdk_clipboard_get_display clipboard'
checkUnexpectedReturnNULL "clipboardGetDisplay" result
result' <- (newObject Gdk.Display.Display) result
touchManagedPtr clipboard
return 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.9/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
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
result <- gdk_clipboard_get_formats clipboard'
checkUnexpectedReturnNULL "clipboardGetFormats" result
result' <- (newBoxed Gdk.ContentFormats.ContentFormats) result
touchManagedPtr clipboard
return 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.9/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
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
result <- gdk_clipboard_is_local clipboard'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr clipboard
return 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.9/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
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
mimeTypes' <- packZeroTerminatedUTF8CArray mimeTypes
maybeCancellable <- case 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
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
maybeCallback <- case 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 FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
gdk_clipboard_read_async clipboard' mimeTypes' ioPriority maybeCancellable maybeCallback userData
touchManagedPtr clipboard
whenJust cancellable touchManagedPtr
mapZeroTerminatedCArray freeMem mimeTypes'
freeMem mimeTypes'
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.9/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
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
result_' <- unsafeManagedPtrCastPtr result_
outMimeType <- callocMem :: IO (Ptr CString)
onException (do
result <- propagateGError $ gdk_clipboard_read_finish clipboard' result_' outMimeType
maybeResult <- convertIfNonNull result $ \Ptr InputStream
result' -> do
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'
return result''
outMimeType' <- peek outMimeType
outMimeType'' <- cstringToText outMimeType'
touchManagedPtr clipboard
touchManagedPtr result_
freeMem outMimeType
return (maybeResult, outMimeType'')
) (do
freeMem 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.9/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
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
maybeCancellable <- case 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
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
maybeCallback <- case 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 FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
gdk_clipboard_read_text_async clipboard' maybeCancellable maybeCallback userData
touchManagedPtr clipboard
whenJust cancellable touchManagedPtr
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.9/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
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ gdk_clipboard_read_text_finish clipboard' result_'
maybeResult <- convertIfNonNull result $ \CString
result' -> do
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
freeMem result'
return result''
touchManagedPtr clipboard
touchManagedPtr result_
return maybeResult
) (do
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.9/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
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
maybeCancellable <- case 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
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
maybeCallback <- case 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 FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
gdk_clipboard_read_texture_async clipboard' maybeCancellable maybeCallback userData
touchManagedPtr clipboard
whenJust cancellable touchManagedPtr
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.9/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
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ gdk_clipboard_read_texture_finish clipboard' result_'
maybeResult <- convertIfNonNull result $ \Ptr Texture
result' -> do
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'
return result''
touchManagedPtr clipboard
touchManagedPtr result_
return maybeResult
) (do
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.9/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
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
let type_' = GType -> CGType
gtypeToCGType GType
type_
maybeCancellable <- case 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
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
maybeCallback <- case 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 FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
gdk_clipboard_read_value_async clipboard' type_' ioPriority maybeCancellable maybeCallback userData
touchManagedPtr clipboard
whenJust cancellable touchManagedPtr
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.9/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
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ gdk_clipboard_read_value_finish clipboard' result_'
checkUnexpectedReturnNULL "clipboardReadValueFinish" result
result' <- B.GValue.newGValueFromPtr result
touchManagedPtr clipboard
touchManagedPtr result_
return result'
) (do
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.9/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
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
maybeProvider <- case 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
FP.nullPtr
Just b
jProvider -> do
jProvider' <- b -> IO (Ptr ContentProvider)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jProvider
return jProvider'
result <- gdk_clipboard_set_content clipboard' maybeProvider
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr clipboard
whenJust provider touchManagedPtr
return 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.9/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
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
value' <- unsafeManagedPtrGetPtr value
gdk_clipboard_set_value clipboard' value'
touchManagedPtr clipboard
touchManagedPtr value
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.9/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
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
maybeCancellable <- case 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
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
maybeCallback <- case 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 FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
gdk_clipboard_store_async clipboard' ioPriority maybeCancellable maybeCallback userData
touchManagedPtr clipboard
whenJust cancellable touchManagedPtr
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.9/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
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ gdk_clipboard_store_finish clipboard' result_'
touchManagedPtr clipboard
touchManagedPtr result_
return ()
) (do
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.9/docs/GI-Gdk-Objects-Clipboard.html#v:clipboardStoreFinish"
})
#endif