{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.Clipboard
(
#if defined(ENABLE_OVERLOADING)
ClipboardWaitForRichTextMethodInfo ,
#endif
Clipboard(..) ,
IsClipboard ,
toClipboard ,
#if defined(ENABLE_OVERLOADING)
ResolveClipboardMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
ClipboardClearMethodInfo ,
#endif
clipboardClear ,
clipboardGet ,
clipboardGetDefault ,
#if defined(ENABLE_OVERLOADING)
ClipboardGetDisplayMethodInfo ,
#endif
clipboardGetDisplay ,
clipboardGetForDisplay ,
#if defined(ENABLE_OVERLOADING)
ClipboardGetOwnerMethodInfo ,
#endif
clipboardGetOwner ,
#if defined(ENABLE_OVERLOADING)
ClipboardGetSelectionMethodInfo ,
#endif
clipboardGetSelection ,
#if defined(ENABLE_OVERLOADING)
ClipboardRequestContentsMethodInfo ,
#endif
clipboardRequestContents ,
#if defined(ENABLE_OVERLOADING)
ClipboardRequestImageMethodInfo ,
#endif
clipboardRequestImage ,
#if defined(ENABLE_OVERLOADING)
ClipboardRequestRichTextMethodInfo ,
#endif
clipboardRequestRichText ,
#if defined(ENABLE_OVERLOADING)
ClipboardRequestTargetsMethodInfo ,
#endif
clipboardRequestTargets ,
#if defined(ENABLE_OVERLOADING)
ClipboardRequestTextMethodInfo ,
#endif
clipboardRequestText ,
#if defined(ENABLE_OVERLOADING)
ClipboardRequestUrisMethodInfo ,
#endif
clipboardRequestUris ,
#if defined(ENABLE_OVERLOADING)
ClipboardSetCanStoreMethodInfo ,
#endif
clipboardSetCanStore ,
#if defined(ENABLE_OVERLOADING)
ClipboardSetImageMethodInfo ,
#endif
clipboardSetImage ,
#if defined(ENABLE_OVERLOADING)
ClipboardSetTextMethodInfo ,
#endif
clipboardSetText ,
#if defined(ENABLE_OVERLOADING)
ClipboardStoreMethodInfo ,
#endif
clipboardStore ,
#if defined(ENABLE_OVERLOADING)
ClipboardWaitForContentsMethodInfo ,
#endif
clipboardWaitForContents ,
#if defined(ENABLE_OVERLOADING)
ClipboardWaitForImageMethodInfo ,
#endif
clipboardWaitForImage ,
#if defined(ENABLE_OVERLOADING)
ClipboardWaitForTargetsMethodInfo ,
#endif
clipboardWaitForTargets ,
#if defined(ENABLE_OVERLOADING)
ClipboardWaitForTextMethodInfo ,
#endif
clipboardWaitForText ,
#if defined(ENABLE_OVERLOADING)
ClipboardWaitForUrisMethodInfo ,
#endif
clipboardWaitForUris ,
#if defined(ENABLE_OVERLOADING)
ClipboardWaitIsImageAvailableMethodInfo ,
#endif
clipboardWaitIsImageAvailable ,
#if defined(ENABLE_OVERLOADING)
ClipboardWaitIsRichTextAvailableMethodInfo,
#endif
clipboardWaitIsRichTextAvailable ,
#if defined(ENABLE_OVERLOADING)
ClipboardWaitIsTargetAvailableMethodInfo,
#endif
clipboardWaitIsTargetAvailable ,
#if defined(ENABLE_OVERLOADING)
ClipboardWaitIsTextAvailableMethodInfo ,
#endif
clipboardWaitIsTextAvailable ,
#if defined(ENABLE_OVERLOADING)
ClipboardWaitIsUrisAvailableMethodInfo ,
#endif
clipboardWaitIsUrisAvailable ,
ClipboardOwnerChangeCallback ,
#if defined(ENABLE_OVERLOADING)
ClipboardOwnerChangeSignalInfo ,
#endif
afterClipboardOwnerChange ,
onClipboardOwnerChange ,
) 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 GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gdk.Objects.Display as Gdk.Display
import qualified GI.Gdk.Structs.Atom as Gdk.Atom
import qualified GI.Gdk.Structs.EventOwnerChange as Gdk.EventOwnerChange
import qualified GI.GdkPixbuf.Objects.Pixbuf as GdkPixbuf.Pixbuf
import qualified GI.Gtk.Callbacks as Gtk.Callbacks
import {-# SOURCE #-} qualified GI.Gtk.Objects.TextBuffer as Gtk.TextBuffer
import {-# SOURCE #-} qualified GI.Gtk.Structs.SelectionData as Gtk.SelectionData
import {-# SOURCE #-} qualified GI.Gtk.Structs.TargetEntry as Gtk.TargetEntry
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 "gtk_clipboard_get_type"
c_gtk_clipboard_get_type :: IO B.Types.GType
instance B.Types.TypedObject Clipboard where
glibType :: IO GType
glibType = IO GType
c_gtk_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_gtk_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 :: DK.Type) :: DK.Type where
ResolveClipboardMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveClipboardMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveClipboardMethod "clear" o = ClipboardClearMethodInfo
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 "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveClipboardMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveClipboardMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveClipboardMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveClipboardMethod "requestContents" o = ClipboardRequestContentsMethodInfo
ResolveClipboardMethod "requestImage" o = ClipboardRequestImageMethodInfo
ResolveClipboardMethod "requestRichText" o = ClipboardRequestRichTextMethodInfo
ResolveClipboardMethod "requestTargets" o = ClipboardRequestTargetsMethodInfo
ResolveClipboardMethod "requestText" o = ClipboardRequestTextMethodInfo
ResolveClipboardMethod "requestUris" o = ClipboardRequestUrisMethodInfo
ResolveClipboardMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveClipboardMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveClipboardMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveClipboardMethod "store" o = ClipboardStoreMethodInfo
ResolveClipboardMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveClipboardMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveClipboardMethod "waitForContents" o = ClipboardWaitForContentsMethodInfo
ResolveClipboardMethod "waitForImage" o = ClipboardWaitForImageMethodInfo
ResolveClipboardMethod "waitForRichText" o = ClipboardWaitForRichTextMethodInfo
ResolveClipboardMethod "waitForTargets" o = ClipboardWaitForTargetsMethodInfo
ResolveClipboardMethod "waitForText" o = ClipboardWaitForTextMethodInfo
ResolveClipboardMethod "waitForUris" o = ClipboardWaitForUrisMethodInfo
ResolveClipboardMethod "waitIsImageAvailable" o = ClipboardWaitIsImageAvailableMethodInfo
ResolveClipboardMethod "waitIsRichTextAvailable" o = ClipboardWaitIsRichTextAvailableMethodInfo
ResolveClipboardMethod "waitIsTargetAvailable" o = ClipboardWaitIsTargetAvailableMethodInfo
ResolveClipboardMethod "waitIsTextAvailable" o = ClipboardWaitIsTextAvailableMethodInfo
ResolveClipboardMethod "waitIsUrisAvailable" o = ClipboardWaitIsUrisAvailableMethodInfo
ResolveClipboardMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveClipboardMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveClipboardMethod "getDisplay" o = ClipboardGetDisplayMethodInfo
ResolveClipboardMethod "getOwner" o = ClipboardGetOwnerMethodInfo
ResolveClipboardMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveClipboardMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveClipboardMethod "getSelection" o = ClipboardGetSelectionMethodInfo
ResolveClipboardMethod "setCanStore" o = ClipboardSetCanStoreMethodInfo
ResolveClipboardMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveClipboardMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveClipboardMethod "setImage" o = ClipboardSetImageMethodInfo
ResolveClipboardMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveClipboardMethod "setText" o = ClipboardSetTextMethodInfo
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 ClipboardOwnerChangeCallback =
Gdk.EventOwnerChange.EventOwnerChange
-> IO ()
type C_ClipboardOwnerChangeCallback =
Ptr Clipboard ->
Ptr Gdk.EventOwnerChange.EventOwnerChange ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_ClipboardOwnerChangeCallback :: C_ClipboardOwnerChangeCallback -> IO (FunPtr C_ClipboardOwnerChangeCallback)
wrap_ClipboardOwnerChangeCallback ::
GObject a => (a -> ClipboardOwnerChangeCallback) ->
C_ClipboardOwnerChangeCallback
wrap_ClipboardOwnerChangeCallback :: forall a.
GObject a =>
(a -> ClipboardOwnerChangeCallback)
-> C_ClipboardOwnerChangeCallback
wrap_ClipboardOwnerChangeCallback a -> ClipboardOwnerChangeCallback
gi'cb Ptr Clipboard
gi'selfPtr Ptr EventOwnerChange
event Ptr ()
_ = do
EventOwnerChange
event' <- ((ManagedPtr EventOwnerChange -> EventOwnerChange)
-> Ptr EventOwnerChange -> IO EventOwnerChange
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr EventOwnerChange -> EventOwnerChange
Gdk.EventOwnerChange.EventOwnerChange) Ptr EventOwnerChange
event
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 -> ClipboardOwnerChangeCallback
gi'cb (Clipboard -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Clipboard
gi'self) EventOwnerChange
event'
onClipboardOwnerChange :: (IsClipboard a, MonadIO m) => a -> ((?self :: a) => ClipboardOwnerChangeCallback) -> m SignalHandlerId
onClipboardOwnerChange :: forall a (m :: * -> *).
(IsClipboard a, MonadIO m) =>
a
-> ((?self::a) => ClipboardOwnerChangeCallback)
-> m SignalHandlerId
onClipboardOwnerChange a
obj (?self::a) => ClipboardOwnerChangeCallback
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 -> ClipboardOwnerChangeCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => ClipboardOwnerChangeCallback
ClipboardOwnerChangeCallback
cb
let wrapped' :: C_ClipboardOwnerChangeCallback
wrapped' = (a -> ClipboardOwnerChangeCallback)
-> C_ClipboardOwnerChangeCallback
forall a.
GObject a =>
(a -> ClipboardOwnerChangeCallback)
-> C_ClipboardOwnerChangeCallback
wrap_ClipboardOwnerChangeCallback a -> ClipboardOwnerChangeCallback
wrapped
FunPtr C_ClipboardOwnerChangeCallback
wrapped'' <- C_ClipboardOwnerChangeCallback
-> IO (FunPtr C_ClipboardOwnerChangeCallback)
mk_ClipboardOwnerChangeCallback C_ClipboardOwnerChangeCallback
wrapped'
a
-> Text
-> FunPtr C_ClipboardOwnerChangeCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"owner-change" FunPtr C_ClipboardOwnerChangeCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterClipboardOwnerChange :: (IsClipboard a, MonadIO m) => a -> ((?self :: a) => ClipboardOwnerChangeCallback) -> m SignalHandlerId
afterClipboardOwnerChange :: forall a (m :: * -> *).
(IsClipboard a, MonadIO m) =>
a
-> ((?self::a) => ClipboardOwnerChangeCallback)
-> m SignalHandlerId
afterClipboardOwnerChange a
obj (?self::a) => ClipboardOwnerChangeCallback
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 -> ClipboardOwnerChangeCallback
wrapped a
self = let ?self = a
?self::a
self in (?self::a) => ClipboardOwnerChangeCallback
ClipboardOwnerChangeCallback
cb
let wrapped' :: C_ClipboardOwnerChangeCallback
wrapped' = (a -> ClipboardOwnerChangeCallback)
-> C_ClipboardOwnerChangeCallback
forall a.
GObject a =>
(a -> ClipboardOwnerChangeCallback)
-> C_ClipboardOwnerChangeCallback
wrap_ClipboardOwnerChangeCallback a -> ClipboardOwnerChangeCallback
wrapped
FunPtr C_ClipboardOwnerChangeCallback
wrapped'' <- C_ClipboardOwnerChangeCallback
-> IO (FunPtr C_ClipboardOwnerChangeCallback)
mk_ClipboardOwnerChangeCallback C_ClipboardOwnerChangeCallback
wrapped'
a
-> Text
-> FunPtr C_ClipboardOwnerChangeCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"owner-change" FunPtr C_ClipboardOwnerChangeCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data ClipboardOwnerChangeSignalInfo
instance SignalInfo ClipboardOwnerChangeSignalInfo where
type HaskellCallbackType ClipboardOwnerChangeSignalInfo = ClipboardOwnerChangeCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_ClipboardOwnerChangeCallback cb
cb'' <- mk_ClipboardOwnerChangeCallback cb'
connectSignalFunPtr obj "owner-change" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard::owner-change"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#g:signal:ownerChange"})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Clipboard
type instance O.AttributeList Clipboard = ClipboardAttributeList
type ClipboardAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Clipboard = ClipboardSignalList
type ClipboardSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo), '("ownerChange", ClipboardOwnerChangeSignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "gtk_clipboard_clear" gtk_clipboard_clear ::
Ptr Clipboard ->
IO ()
clipboardClear ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> m ()
clipboardClear :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> m ()
clipboardClear a
clipboard = 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 Clipboard -> IO ()
gtk_clipboard_clear Ptr Clipboard
clipboard'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ClipboardClearMethodInfo
instance (signature ~ (m ()), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardClearMethodInfo a signature where
overloadedMethod = clipboardClear
instance O.OverloadedMethodInfo ClipboardClearMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardClear",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardClear"
})
#endif
foreign import ccall "gtk_clipboard_get_display" gtk_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)
gtk_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.Gtk.Objects.Clipboard.clipboardGetDisplay",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardGetDisplay"
})
#endif
foreign import ccall "gtk_clipboard_get_owner" gtk_clipboard_get_owner ::
Ptr Clipboard ->
IO (Ptr GObject.Object.Object)
clipboardGetOwner ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> m (Maybe GObject.Object.Object)
clipboardGetOwner :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> m (Maybe Object)
clipboardGetOwner a
clipboard = IO (Maybe Object) -> m (Maybe Object)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Object) -> m (Maybe Object))
-> IO (Maybe Object) -> m (Maybe Object)
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 Object
result <- Ptr Clipboard -> IO (Ptr Object)
gtk_clipboard_get_owner Ptr Clipboard
clipboard'
Maybe Object
maybeResult <- Ptr Object -> (Ptr Object -> IO Object) -> IO (Maybe Object)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Object
result ((Ptr Object -> IO Object) -> IO (Maybe Object))
-> (Ptr Object -> IO Object) -> IO (Maybe Object)
forall a b. (a -> b) -> a -> b
$ \Ptr Object
result' -> do
Object
result'' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
GObject.Object.Object) Ptr Object
result'
Object -> IO Object
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Object
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
Maybe Object -> IO (Maybe Object)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Object
maybeResult
#if defined(ENABLE_OVERLOADING)
data ClipboardGetOwnerMethodInfo
instance (signature ~ (m (Maybe GObject.Object.Object)), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardGetOwnerMethodInfo a signature where
overloadedMethod = clipboardGetOwner
instance O.OverloadedMethodInfo ClipboardGetOwnerMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardGetOwner",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardGetOwner"
})
#endif
foreign import ccall "gtk_clipboard_get_selection" gtk_clipboard_get_selection ::
Ptr Clipboard ->
IO (Ptr Gdk.Atom.Atom)
clipboardGetSelection ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> m Gdk.Atom.Atom
clipboardGetSelection :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> m Atom
clipboardGetSelection a
clipboard = IO Atom -> m Atom
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Atom -> m Atom) -> IO Atom -> m Atom
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 Atom
result <- Ptr Clipboard -> IO (Ptr Atom)
gtk_clipboard_get_selection Ptr Clipboard
clipboard'
Text -> Ptr Atom -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"clipboardGetSelection" Ptr Atom
result
Atom
result' <- ((ManagedPtr Atom -> Atom) -> Ptr Atom -> IO Atom
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr Atom -> Atom
Gdk.Atom.Atom) Ptr Atom
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
Atom -> IO Atom
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Atom
result'
#if defined(ENABLE_OVERLOADING)
data ClipboardGetSelectionMethodInfo
instance (signature ~ (m Gdk.Atom.Atom), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardGetSelectionMethodInfo a signature where
overloadedMethod = clipboardGetSelection
instance O.OverloadedMethodInfo ClipboardGetSelectionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardGetSelection",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardGetSelection"
})
#endif
foreign import ccall "gtk_clipboard_request_contents" gtk_clipboard_request_contents ::
Ptr Clipboard ->
Ptr Gdk.Atom.Atom ->
FunPtr Gtk.Callbacks.C_ClipboardReceivedFunc ->
Ptr () ->
IO ()
clipboardRequestContents ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> Gdk.Atom.Atom
-> Gtk.Callbacks.ClipboardReceivedFunc
-> m ()
clipboardRequestContents :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> Atom -> ClipboardReceivedFunc -> m ()
clipboardRequestContents a
clipboard Atom
target ClipboardReceivedFunc
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 Atom
target' <- Atom -> IO (Ptr Atom)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Atom
target
Ptr (FunPtr C_ClipboardReceivedFunc)
ptrcallback <- IO (Ptr (FunPtr C_ClipboardReceivedFunc))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gtk.Callbacks.C_ClipboardReceivedFunc))
FunPtr C_ClipboardReceivedFunc
callback' <- C_ClipboardReceivedFunc -> IO (FunPtr C_ClipboardReceivedFunc)
Gtk.Callbacks.mk_ClipboardReceivedFunc (Maybe (Ptr (FunPtr C_ClipboardReceivedFunc))
-> ClipboardReceivedFunc_WithClosures -> C_ClipboardReceivedFunc
Gtk.Callbacks.wrap_ClipboardReceivedFunc (Ptr (FunPtr C_ClipboardReceivedFunc)
-> Maybe (Ptr (FunPtr C_ClipboardReceivedFunc))
forall a. a -> Maybe a
Just Ptr (FunPtr C_ClipboardReceivedFunc)
ptrcallback) (ClipboardReceivedFunc -> ClipboardReceivedFunc_WithClosures
Gtk.Callbacks.drop_closures_ClipboardReceivedFunc ClipboardReceivedFunc
callback))
Ptr (FunPtr C_ClipboardReceivedFunc)
-> FunPtr C_ClipboardReceivedFunc -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_ClipboardReceivedFunc)
ptrcallback FunPtr C_ClipboardReceivedFunc
callback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Clipboard
-> Ptr Atom -> FunPtr C_ClipboardReceivedFunc -> Ptr () -> IO ()
gtk_clipboard_request_contents Ptr Clipboard
clipboard' Ptr Atom
target' FunPtr C_ClipboardReceivedFunc
callback' Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
Atom -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Atom
target
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ClipboardRequestContentsMethodInfo
instance (signature ~ (Gdk.Atom.Atom -> Gtk.Callbacks.ClipboardReceivedFunc -> m ()), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardRequestContentsMethodInfo a signature where
overloadedMethod = clipboardRequestContents
instance O.OverloadedMethodInfo ClipboardRequestContentsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardRequestContents",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardRequestContents"
})
#endif
foreign import ccall "gtk_clipboard_request_image" gtk_clipboard_request_image ::
Ptr Clipboard ->
FunPtr Gtk.Callbacks.C_ClipboardImageReceivedFunc ->
Ptr () ->
IO ()
clipboardRequestImage ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> Gtk.Callbacks.ClipboardImageReceivedFunc
-> m ()
clipboardRequestImage :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> ClipboardImageReceivedFunc -> m ()
clipboardRequestImage a
clipboard ClipboardImageReceivedFunc
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 (FunPtr C_ClipboardImageReceivedFunc)
ptrcallback <- IO (Ptr (FunPtr C_ClipboardImageReceivedFunc))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gtk.Callbacks.C_ClipboardImageReceivedFunc))
FunPtr C_ClipboardImageReceivedFunc
callback' <- C_ClipboardImageReceivedFunc
-> IO (FunPtr C_ClipboardImageReceivedFunc)
Gtk.Callbacks.mk_ClipboardImageReceivedFunc (Maybe (Ptr (FunPtr C_ClipboardImageReceivedFunc))
-> ClipboardImageReceivedFunc_WithClosures
-> C_ClipboardImageReceivedFunc
Gtk.Callbacks.wrap_ClipboardImageReceivedFunc (Ptr (FunPtr C_ClipboardImageReceivedFunc)
-> Maybe (Ptr (FunPtr C_ClipboardImageReceivedFunc))
forall a. a -> Maybe a
Just Ptr (FunPtr C_ClipboardImageReceivedFunc)
ptrcallback) (ClipboardImageReceivedFunc
-> ClipboardImageReceivedFunc_WithClosures
Gtk.Callbacks.drop_closures_ClipboardImageReceivedFunc ClipboardImageReceivedFunc
callback))
Ptr (FunPtr C_ClipboardImageReceivedFunc)
-> FunPtr C_ClipboardImageReceivedFunc -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_ClipboardImageReceivedFunc)
ptrcallback FunPtr C_ClipboardImageReceivedFunc
callback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Clipboard
-> FunPtr C_ClipboardImageReceivedFunc -> Ptr () -> IO ()
gtk_clipboard_request_image Ptr Clipboard
clipboard' FunPtr C_ClipboardImageReceivedFunc
callback' Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ClipboardRequestImageMethodInfo
instance (signature ~ (Gtk.Callbacks.ClipboardImageReceivedFunc -> m ()), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardRequestImageMethodInfo a signature where
overloadedMethod = clipboardRequestImage
instance O.OverloadedMethodInfo ClipboardRequestImageMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardRequestImage",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardRequestImage"
})
#endif
foreign import ccall "gtk_clipboard_request_rich_text" gtk_clipboard_request_rich_text ::
Ptr Clipboard ->
Ptr Gtk.TextBuffer.TextBuffer ->
FunPtr Gtk.Callbacks.C_ClipboardRichTextReceivedFunc ->
Ptr () ->
IO ()
clipboardRequestRichText ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a, Gtk.TextBuffer.IsTextBuffer b) =>
a
-> b
-> Gtk.Callbacks.ClipboardRichTextReceivedFunc
-> m ()
clipboardRequestRichText :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsClipboard a, IsTextBuffer b) =>
a -> b -> ClipboardRichTextReceivedFunc -> m ()
clipboardRequestRichText a
clipboard b
buffer ClipboardRichTextReceivedFunc
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 TextBuffer
buffer' <- b -> IO (Ptr TextBuffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
buffer
Ptr (FunPtr C_ClipboardRichTextReceivedFunc)
ptrcallback <- IO (Ptr (FunPtr C_ClipboardRichTextReceivedFunc))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gtk.Callbacks.C_ClipboardRichTextReceivedFunc))
FunPtr C_ClipboardRichTextReceivedFunc
callback' <- C_ClipboardRichTextReceivedFunc
-> IO (FunPtr C_ClipboardRichTextReceivedFunc)
Gtk.Callbacks.mk_ClipboardRichTextReceivedFunc (Maybe (Ptr (FunPtr C_ClipboardRichTextReceivedFunc))
-> ClipboardRichTextReceivedFunc_WithClosures
-> C_ClipboardRichTextReceivedFunc
Gtk.Callbacks.wrap_ClipboardRichTextReceivedFunc (Ptr (FunPtr C_ClipboardRichTextReceivedFunc)
-> Maybe (Ptr (FunPtr C_ClipboardRichTextReceivedFunc))
forall a. a -> Maybe a
Just Ptr (FunPtr C_ClipboardRichTextReceivedFunc)
ptrcallback) (ClipboardRichTextReceivedFunc
-> ClipboardRichTextReceivedFunc_WithClosures
Gtk.Callbacks.drop_closures_ClipboardRichTextReceivedFunc ClipboardRichTextReceivedFunc
callback))
Ptr (FunPtr C_ClipboardRichTextReceivedFunc)
-> FunPtr C_ClipboardRichTextReceivedFunc -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_ClipboardRichTextReceivedFunc)
ptrcallback FunPtr C_ClipboardRichTextReceivedFunc
callback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Clipboard
-> Ptr TextBuffer
-> FunPtr C_ClipboardRichTextReceivedFunc
-> Ptr ()
-> IO ()
gtk_clipboard_request_rich_text Ptr Clipboard
clipboard' Ptr TextBuffer
buffer' FunPtr C_ClipboardRichTextReceivedFunc
callback' Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
buffer
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ClipboardRequestRichTextMethodInfo
instance (signature ~ (b -> Gtk.Callbacks.ClipboardRichTextReceivedFunc -> m ()), MonadIO m, IsClipboard a, Gtk.TextBuffer.IsTextBuffer b) => O.OverloadedMethod ClipboardRequestRichTextMethodInfo a signature where
overloadedMethod = clipboardRequestRichText
instance O.OverloadedMethodInfo ClipboardRequestRichTextMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardRequestRichText",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardRequestRichText"
})
#endif
foreign import ccall "gtk_clipboard_request_targets" gtk_clipboard_request_targets ::
Ptr Clipboard ->
FunPtr Gtk.Callbacks.C_ClipboardTargetsReceivedFunc ->
Ptr () ->
IO ()
clipboardRequestTargets ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> Gtk.Callbacks.ClipboardTargetsReceivedFunc
-> m ()
clipboardRequestTargets :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> ClipboardTargetsReceivedFunc -> m ()
clipboardRequestTargets a
clipboard ClipboardTargetsReceivedFunc
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 (FunPtr C_ClipboardTargetsReceivedFunc)
ptrcallback <- IO (Ptr (FunPtr C_ClipboardTargetsReceivedFunc))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gtk.Callbacks.C_ClipboardTargetsReceivedFunc))
FunPtr C_ClipboardTargetsReceivedFunc
callback' <- C_ClipboardTargetsReceivedFunc
-> IO (FunPtr C_ClipboardTargetsReceivedFunc)
Gtk.Callbacks.mk_ClipboardTargetsReceivedFunc (Maybe (Ptr (FunPtr C_ClipboardTargetsReceivedFunc))
-> ClipboardTargetsReceivedFunc_WithClosures
-> C_ClipboardTargetsReceivedFunc
Gtk.Callbacks.wrap_ClipboardTargetsReceivedFunc (Ptr (FunPtr C_ClipboardTargetsReceivedFunc)
-> Maybe (Ptr (FunPtr C_ClipboardTargetsReceivedFunc))
forall a. a -> Maybe a
Just Ptr (FunPtr C_ClipboardTargetsReceivedFunc)
ptrcallback) (ClipboardTargetsReceivedFunc
-> ClipboardTargetsReceivedFunc_WithClosures
Gtk.Callbacks.drop_closures_ClipboardTargetsReceivedFunc ClipboardTargetsReceivedFunc
callback))
Ptr (FunPtr C_ClipboardTargetsReceivedFunc)
-> FunPtr C_ClipboardTargetsReceivedFunc -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_ClipboardTargetsReceivedFunc)
ptrcallback FunPtr C_ClipboardTargetsReceivedFunc
callback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Clipboard
-> FunPtr C_ClipboardTargetsReceivedFunc -> Ptr () -> IO ()
gtk_clipboard_request_targets Ptr Clipboard
clipboard' FunPtr C_ClipboardTargetsReceivedFunc
callback' Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ClipboardRequestTargetsMethodInfo
instance (signature ~ (Gtk.Callbacks.ClipboardTargetsReceivedFunc -> m ()), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardRequestTargetsMethodInfo a signature where
overloadedMethod = clipboardRequestTargets
instance O.OverloadedMethodInfo ClipboardRequestTargetsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardRequestTargets",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardRequestTargets"
})
#endif
foreign import ccall "gtk_clipboard_request_text" gtk_clipboard_request_text ::
Ptr Clipboard ->
FunPtr Gtk.Callbacks.C_ClipboardTextReceivedFunc ->
Ptr () ->
IO ()
clipboardRequestText ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> Gtk.Callbacks.ClipboardTextReceivedFunc
-> m ()
clipboardRequestText :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> ClipboardTextReceivedFunc -> m ()
clipboardRequestText a
clipboard ClipboardTextReceivedFunc
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 (FunPtr C_ClipboardTextReceivedFunc)
ptrcallback <- IO (Ptr (FunPtr C_ClipboardTextReceivedFunc))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gtk.Callbacks.C_ClipboardTextReceivedFunc))
FunPtr C_ClipboardTextReceivedFunc
callback' <- C_ClipboardTextReceivedFunc
-> IO (FunPtr C_ClipboardTextReceivedFunc)
Gtk.Callbacks.mk_ClipboardTextReceivedFunc (Maybe (Ptr (FunPtr C_ClipboardTextReceivedFunc))
-> ClipboardTextReceivedFunc_WithClosures
-> C_ClipboardTextReceivedFunc
Gtk.Callbacks.wrap_ClipboardTextReceivedFunc (Ptr (FunPtr C_ClipboardTextReceivedFunc)
-> Maybe (Ptr (FunPtr C_ClipboardTextReceivedFunc))
forall a. a -> Maybe a
Just Ptr (FunPtr C_ClipboardTextReceivedFunc)
ptrcallback) (ClipboardTextReceivedFunc -> ClipboardTextReceivedFunc_WithClosures
Gtk.Callbacks.drop_closures_ClipboardTextReceivedFunc ClipboardTextReceivedFunc
callback))
Ptr (FunPtr C_ClipboardTextReceivedFunc)
-> FunPtr C_ClipboardTextReceivedFunc -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_ClipboardTextReceivedFunc)
ptrcallback FunPtr C_ClipboardTextReceivedFunc
callback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Clipboard
-> FunPtr C_ClipboardTextReceivedFunc -> Ptr () -> IO ()
gtk_clipboard_request_text Ptr Clipboard
clipboard' FunPtr C_ClipboardTextReceivedFunc
callback' Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ClipboardRequestTextMethodInfo
instance (signature ~ (Gtk.Callbacks.ClipboardTextReceivedFunc -> m ()), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardRequestTextMethodInfo a signature where
overloadedMethod = clipboardRequestText
instance O.OverloadedMethodInfo ClipboardRequestTextMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardRequestText",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardRequestText"
})
#endif
foreign import ccall "gtk_clipboard_request_uris" gtk_clipboard_request_uris ::
Ptr Clipboard ->
FunPtr Gtk.Callbacks.C_ClipboardURIReceivedFunc ->
Ptr () ->
IO ()
clipboardRequestUris ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> Gtk.Callbacks.ClipboardURIReceivedFunc
-> m ()
clipboardRequestUris :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> ClipboardURIReceivedFunc -> m ()
clipboardRequestUris a
clipboard ClipboardURIReceivedFunc
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 (FunPtr C_ClipboardURIReceivedFunc)
ptrcallback <- IO (Ptr (FunPtr C_ClipboardURIReceivedFunc))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gtk.Callbacks.C_ClipboardURIReceivedFunc))
FunPtr C_ClipboardURIReceivedFunc
callback' <- C_ClipboardURIReceivedFunc
-> IO (FunPtr C_ClipboardURIReceivedFunc)
Gtk.Callbacks.mk_ClipboardURIReceivedFunc (Maybe (Ptr (FunPtr C_ClipboardURIReceivedFunc))
-> ClipboardURIReceivedFunc_WithClosures
-> C_ClipboardURIReceivedFunc
Gtk.Callbacks.wrap_ClipboardURIReceivedFunc (Ptr (FunPtr C_ClipboardURIReceivedFunc)
-> Maybe (Ptr (FunPtr C_ClipboardURIReceivedFunc))
forall a. a -> Maybe a
Just Ptr (FunPtr C_ClipboardURIReceivedFunc)
ptrcallback) (ClipboardURIReceivedFunc -> ClipboardURIReceivedFunc_WithClosures
Gtk.Callbacks.drop_closures_ClipboardURIReceivedFunc ClipboardURIReceivedFunc
callback))
Ptr (FunPtr C_ClipboardURIReceivedFunc)
-> FunPtr C_ClipboardURIReceivedFunc -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_ClipboardURIReceivedFunc)
ptrcallback FunPtr C_ClipboardURIReceivedFunc
callback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Clipboard
-> FunPtr C_ClipboardURIReceivedFunc -> Ptr () -> IO ()
gtk_clipboard_request_uris Ptr Clipboard
clipboard' FunPtr C_ClipboardURIReceivedFunc
callback' Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ClipboardRequestUrisMethodInfo
instance (signature ~ (Gtk.Callbacks.ClipboardURIReceivedFunc -> m ()), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardRequestUrisMethodInfo a signature where
overloadedMethod = clipboardRequestUris
instance O.OverloadedMethodInfo ClipboardRequestUrisMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardRequestUris",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardRequestUris"
})
#endif
foreign import ccall "gtk_clipboard_set_can_store" gtk_clipboard_set_can_store ::
Ptr Clipboard ->
Ptr Gtk.TargetEntry.TargetEntry ->
Int32 ->
IO ()
clipboardSetCanStore ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> Maybe ([Gtk.TargetEntry.TargetEntry])
-> m ()
clipboardSetCanStore :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> Maybe [TargetEntry] -> m ()
clipboardSetCanStore a
clipboard Maybe [TargetEntry]
targets = 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
let nTargets :: Int32
nTargets = case Maybe [TargetEntry]
targets of
Maybe [TargetEntry]
Nothing -> Int32
0
Just [TargetEntry]
jTargets -> Int -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int32) -> Int -> Int32
forall a b. (a -> b) -> a -> b
$ [TargetEntry] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [TargetEntry]
jTargets
Ptr Clipboard
clipboard' <- a -> IO (Ptr Clipboard)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clipboard
Ptr TargetEntry
maybeTargets <- case Maybe [TargetEntry]
targets of
Maybe [TargetEntry]
Nothing -> Ptr TargetEntry -> IO (Ptr TargetEntry)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TargetEntry
forall a. Ptr a
nullPtr
Just [TargetEntry]
jTargets -> do
[Ptr TargetEntry]
jTargets' <- (TargetEntry -> IO (Ptr TargetEntry))
-> [TargetEntry] -> IO [Ptr TargetEntry]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM TargetEntry -> IO (Ptr TargetEntry)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [TargetEntry]
jTargets
Ptr TargetEntry
jTargets'' <- Int -> [Ptr TargetEntry] -> IO (Ptr TargetEntry)
forall a. Int -> [Ptr a] -> IO (Ptr a)
packBlockArray Int
16 [Ptr TargetEntry]
jTargets'
Ptr TargetEntry -> IO (Ptr TargetEntry)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TargetEntry
jTargets''
Ptr Clipboard -> Ptr TargetEntry -> Int32 -> IO ()
gtk_clipboard_set_can_store Ptr Clipboard
clipboard' Ptr TargetEntry
maybeTargets Int32
nTargets
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
Maybe [TargetEntry] -> ([TargetEntry] -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe [TargetEntry]
targets ((TargetEntry -> IO ()) -> [TargetEntry] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ TargetEntry -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr)
Ptr TargetEntry -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr TargetEntry
maybeTargets
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ClipboardSetCanStoreMethodInfo
instance (signature ~ (Maybe ([Gtk.TargetEntry.TargetEntry]) -> m ()), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardSetCanStoreMethodInfo a signature where
overloadedMethod = clipboardSetCanStore
instance O.OverloadedMethodInfo ClipboardSetCanStoreMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardSetCanStore",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardSetCanStore"
})
#endif
foreign import ccall "gtk_clipboard_set_image" gtk_clipboard_set_image ::
Ptr Clipboard ->
Ptr GdkPixbuf.Pixbuf.Pixbuf ->
IO ()
clipboardSetImage ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a, GdkPixbuf.Pixbuf.IsPixbuf b) =>
a
-> b
-> m ()
clipboardSetImage :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsClipboard a, IsPixbuf b) =>
a -> b -> m ()
clipboardSetImage a
clipboard b
pixbuf = 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 Pixbuf
pixbuf' <- b -> IO (Ptr Pixbuf)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
pixbuf
Ptr Clipboard -> Ptr Pixbuf -> IO ()
gtk_clipboard_set_image Ptr Clipboard
clipboard' Ptr Pixbuf
pixbuf'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
pixbuf
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ClipboardSetImageMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsClipboard a, GdkPixbuf.Pixbuf.IsPixbuf b) => O.OverloadedMethod ClipboardSetImageMethodInfo a signature where
overloadedMethod = clipboardSetImage
instance O.OverloadedMethodInfo ClipboardSetImageMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardSetImage",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardSetImage"
})
#endif
foreign import ccall "gtk_clipboard_set_text" gtk_clipboard_set_text ::
Ptr Clipboard ->
CString ->
Int32 ->
IO ()
clipboardSetText ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> T.Text
-> Int32
-> m ()
clipboardSetText :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> Text -> Int32 -> m ()
clipboardSetText a
clipboard Text
text Int32
len = 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
CString
text' <- Text -> IO CString
textToCString Text
text
Ptr Clipboard -> CString -> Int32 -> IO ()
gtk_clipboard_set_text Ptr Clipboard
clipboard' CString
text' Int32
len
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
text'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ClipboardSetTextMethodInfo
instance (signature ~ (T.Text -> Int32 -> m ()), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardSetTextMethodInfo a signature where
overloadedMethod = clipboardSetText
instance O.OverloadedMethodInfo ClipboardSetTextMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardSetText",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardSetText"
})
#endif
foreign import ccall "gtk_clipboard_store" gtk_clipboard_store ::
Ptr Clipboard ->
IO ()
clipboardStore ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> m ()
clipboardStore :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> m ()
clipboardStore a
clipboard = 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 Clipboard -> IO ()
gtk_clipboard_store Ptr Clipboard
clipboard'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ClipboardStoreMethodInfo
instance (signature ~ (m ()), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardStoreMethodInfo a signature where
overloadedMethod = clipboardStore
instance O.OverloadedMethodInfo ClipboardStoreMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardStore",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardStore"
})
#endif
foreign import ccall "gtk_clipboard_wait_for_contents" gtk_clipboard_wait_for_contents ::
Ptr Clipboard ->
Ptr Gdk.Atom.Atom ->
IO (Ptr Gtk.SelectionData.SelectionData)
clipboardWaitForContents ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> Gdk.Atom.Atom
-> m (Maybe Gtk.SelectionData.SelectionData)
clipboardWaitForContents :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> Atom -> m (Maybe SelectionData)
clipboardWaitForContents a
clipboard Atom
target = IO (Maybe SelectionData) -> m (Maybe SelectionData)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe SelectionData) -> m (Maybe SelectionData))
-> IO (Maybe SelectionData) -> m (Maybe SelectionData)
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 Atom
target' <- Atom -> IO (Ptr Atom)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Atom
target
Ptr SelectionData
result <- Ptr Clipboard -> Ptr Atom -> IO (Ptr SelectionData)
gtk_clipboard_wait_for_contents Ptr Clipboard
clipboard' Ptr Atom
target'
Maybe SelectionData
maybeResult <- Ptr SelectionData
-> (Ptr SelectionData -> IO SelectionData)
-> IO (Maybe SelectionData)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr SelectionData
result ((Ptr SelectionData -> IO SelectionData)
-> IO (Maybe SelectionData))
-> (Ptr SelectionData -> IO SelectionData)
-> IO (Maybe SelectionData)
forall a b. (a -> b) -> a -> b
$ \Ptr SelectionData
result' -> do
SelectionData
result'' <- ((ManagedPtr SelectionData -> SelectionData)
-> Ptr SelectionData -> IO SelectionData
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr SelectionData -> SelectionData
Gtk.SelectionData.SelectionData) Ptr SelectionData
result'
SelectionData -> IO SelectionData
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return SelectionData
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
Atom -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Atom
target
Maybe SelectionData -> IO (Maybe SelectionData)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe SelectionData
maybeResult
#if defined(ENABLE_OVERLOADING)
data ClipboardWaitForContentsMethodInfo
instance (signature ~ (Gdk.Atom.Atom -> m (Maybe Gtk.SelectionData.SelectionData)), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardWaitForContentsMethodInfo a signature where
overloadedMethod = clipboardWaitForContents
instance O.OverloadedMethodInfo ClipboardWaitForContentsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardWaitForContents",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardWaitForContents"
})
#endif
foreign import ccall "gtk_clipboard_wait_for_image" gtk_clipboard_wait_for_image ::
Ptr Clipboard ->
IO (Ptr GdkPixbuf.Pixbuf.Pixbuf)
clipboardWaitForImage ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> m (Maybe GdkPixbuf.Pixbuf.Pixbuf)
clipboardWaitForImage :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> m (Maybe Pixbuf)
clipboardWaitForImage a
clipboard = IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Pixbuf) -> m (Maybe Pixbuf))
-> IO (Maybe Pixbuf) -> m (Maybe Pixbuf)
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 Pixbuf
result <- Ptr Clipboard -> IO (Ptr Pixbuf)
gtk_clipboard_wait_for_image Ptr Clipboard
clipboard'
Maybe Pixbuf
maybeResult <- Ptr Pixbuf -> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Pixbuf
result ((Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf))
-> (Ptr Pixbuf -> IO Pixbuf) -> IO (Maybe Pixbuf)
forall a b. (a -> b) -> a -> b
$ \Ptr Pixbuf
result' -> do
Pixbuf
result'' <- ((ManagedPtr Pixbuf -> Pixbuf) -> Ptr Pixbuf -> IO Pixbuf
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Pixbuf -> Pixbuf
GdkPixbuf.Pixbuf.Pixbuf) Ptr Pixbuf
result'
Pixbuf -> IO Pixbuf
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Pixbuf
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
Maybe Pixbuf -> IO (Maybe Pixbuf)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Pixbuf
maybeResult
#if defined(ENABLE_OVERLOADING)
data ClipboardWaitForImageMethodInfo
instance (signature ~ (m (Maybe GdkPixbuf.Pixbuf.Pixbuf)), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardWaitForImageMethodInfo a signature where
overloadedMethod = clipboardWaitForImage
instance O.OverloadedMethodInfo ClipboardWaitForImageMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardWaitForImage",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardWaitForImage"
})
#endif
#if defined(ENABLE_OVERLOADING)
data ClipboardWaitForRichTextMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "waitForRichText" Clipboard) => O.OverloadedMethod ClipboardWaitForRichTextMethodInfo o p where
overloadedMethod = undefined
instance (o ~ O.UnsupportedMethodError "waitForRichText" Clipboard) => O.OverloadedMethodInfo ClipboardWaitForRichTextMethodInfo o where
overloadedMethodInfo = undefined
#endif
foreign import ccall "gtk_clipboard_wait_for_targets" gtk_clipboard_wait_for_targets ::
Ptr Clipboard ->
Ptr (Ptr (Ptr Gdk.Atom.Atom)) ->
Ptr Int32 ->
IO CInt
clipboardWaitForTargets ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> m ((Bool, [Gdk.Atom.Atom]))
clipboardWaitForTargets :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> m (Bool, [Atom])
clipboardWaitForTargets a
clipboard = IO (Bool, [Atom]) -> m (Bool, [Atom])
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, [Atom]) -> m (Bool, [Atom]))
-> IO (Bool, [Atom]) -> m (Bool, [Atom])
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 (Ptr (Ptr Atom))
targets <- IO (Ptr (Ptr (Ptr Atom)))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr (Ptr Gdk.Atom.Atom)))
Ptr Int32
nTargets <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
CInt
result <- Ptr Clipboard -> Ptr (Ptr (Ptr Atom)) -> Ptr Int32 -> IO CInt
gtk_clipboard_wait_for_targets Ptr Clipboard
clipboard' Ptr (Ptr (Ptr Atom))
targets Ptr Int32
nTargets
Int32
nTargets' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
nTargets
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Ptr (Ptr Atom)
targets' <- Ptr (Ptr (Ptr Atom)) -> IO (Ptr (Ptr Atom))
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr (Ptr Atom))
targets
[Ptr Atom]
targets'' <- (Int32 -> Ptr (Ptr Atom) -> IO [Ptr Atom]
forall a b. Integral a => a -> Ptr (Ptr b) -> IO [Ptr b]
unpackPtrArrayWithLength Int32
nTargets') Ptr (Ptr Atom)
targets'
[Atom]
targets''' <- (Ptr Atom -> IO Atom) -> [Ptr Atom] -> IO [Atom]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM ((ManagedPtr Atom -> Atom) -> Ptr Atom -> IO Atom
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr Atom -> Atom
Gdk.Atom.Atom) [Ptr Atom]
targets''
Ptr (Ptr Atom) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Atom)
targets'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clipboard
Ptr (Ptr (Ptr Atom)) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr (Ptr Atom))
targets
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
nTargets
(Bool, [Atom]) -> IO (Bool, [Atom])
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', [Atom]
targets''')
#if defined(ENABLE_OVERLOADING)
data ClipboardWaitForTargetsMethodInfo
instance (signature ~ (m ((Bool, [Gdk.Atom.Atom]))), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardWaitForTargetsMethodInfo a signature where
overloadedMethod = clipboardWaitForTargets
instance O.OverloadedMethodInfo ClipboardWaitForTargetsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardWaitForTargets",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardWaitForTargets"
})
#endif
foreign import ccall "gtk_clipboard_wait_for_text" gtk_clipboard_wait_for_text ::
Ptr Clipboard ->
IO CString
clipboardWaitForText ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> m (Maybe T.Text)
clipboardWaitForText :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> m (Maybe Text)
clipboardWaitForText a
clipboard = 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
CString
result <- Ptr Clipboard -> IO CString
gtk_clipboard_wait_for_text Ptr Clipboard
clipboard'
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
Maybe Text -> IO (Maybe Text)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data ClipboardWaitForTextMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardWaitForTextMethodInfo a signature where
overloadedMethod = clipboardWaitForText
instance O.OverloadedMethodInfo ClipboardWaitForTextMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardWaitForText",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardWaitForText"
})
#endif
foreign import ccall "gtk_clipboard_wait_for_uris" gtk_clipboard_wait_for_uris ::
Ptr Clipboard ->
IO (Ptr CString)
clipboardWaitForUris ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> m (Maybe [T.Text])
clipboardWaitForUris :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> m (Maybe [Text])
clipboardWaitForUris a
clipboard = 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 CString
result <- Ptr Clipboard -> IO (Ptr CString)
gtk_clipboard_wait_for_uris Ptr Clipboard
clipboard'
Maybe [Text]
maybeResult <- Ptr CString -> (Ptr CString -> IO [Text]) -> IO (Maybe [Text])
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr CString
result ((Ptr CString -> IO [Text]) -> IO (Maybe [Text]))
-> (Ptr CString -> IO [Text]) -> IO (Maybe [Text])
forall a b. (a -> b) -> a -> b
$ \Ptr CString
result' -> do
[Text]
result'' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result'
(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
result'
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr 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
Maybe [Text] -> IO (Maybe [Text])
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe [Text]
maybeResult
#if defined(ENABLE_OVERLOADING)
data ClipboardWaitForUrisMethodInfo
instance (signature ~ (m (Maybe [T.Text])), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardWaitForUrisMethodInfo a signature where
overloadedMethod = clipboardWaitForUris
instance O.OverloadedMethodInfo ClipboardWaitForUrisMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardWaitForUris",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardWaitForUris"
})
#endif
foreign import ccall "gtk_clipboard_wait_is_image_available" gtk_clipboard_wait_is_image_available ::
Ptr Clipboard ->
IO CInt
clipboardWaitIsImageAvailable ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> m Bool
clipboardWaitIsImageAvailable :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> m Bool
clipboardWaitIsImageAvailable 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
gtk_clipboard_wait_is_image_available 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 ClipboardWaitIsImageAvailableMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardWaitIsImageAvailableMethodInfo a signature where
overloadedMethod = clipboardWaitIsImageAvailable
instance O.OverloadedMethodInfo ClipboardWaitIsImageAvailableMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardWaitIsImageAvailable",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardWaitIsImageAvailable"
})
#endif
foreign import ccall "gtk_clipboard_wait_is_rich_text_available" gtk_clipboard_wait_is_rich_text_available ::
Ptr Clipboard ->
Ptr Gtk.TextBuffer.TextBuffer ->
IO CInt
clipboardWaitIsRichTextAvailable ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a, Gtk.TextBuffer.IsTextBuffer b) =>
a
-> b
-> m Bool
clipboardWaitIsRichTextAvailable :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsClipboard a, IsTextBuffer b) =>
a -> b -> m Bool
clipboardWaitIsRichTextAvailable a
clipboard b
buffer = 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 TextBuffer
buffer' <- b -> IO (Ptr TextBuffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
buffer
CInt
result <- Ptr Clipboard -> Ptr TextBuffer -> IO CInt
gtk_clipboard_wait_is_rich_text_available Ptr Clipboard
clipboard' Ptr TextBuffer
buffer'
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
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
buffer
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ClipboardWaitIsRichTextAvailableMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsClipboard a, Gtk.TextBuffer.IsTextBuffer b) => O.OverloadedMethod ClipboardWaitIsRichTextAvailableMethodInfo a signature where
overloadedMethod = clipboardWaitIsRichTextAvailable
instance O.OverloadedMethodInfo ClipboardWaitIsRichTextAvailableMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardWaitIsRichTextAvailable",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardWaitIsRichTextAvailable"
})
#endif
foreign import ccall "gtk_clipboard_wait_is_target_available" gtk_clipboard_wait_is_target_available ::
Ptr Clipboard ->
Ptr Gdk.Atom.Atom ->
IO CInt
clipboardWaitIsTargetAvailable ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> Gdk.Atom.Atom
-> m Bool
clipboardWaitIsTargetAvailable :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> Atom -> m Bool
clipboardWaitIsTargetAvailable a
clipboard Atom
target = 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 Atom
target' <- Atom -> IO (Ptr Atom)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Atom
target
CInt
result <- Ptr Clipboard -> Ptr Atom -> IO CInt
gtk_clipboard_wait_is_target_available Ptr Clipboard
clipboard' Ptr Atom
target'
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
Atom -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Atom
target
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ClipboardWaitIsTargetAvailableMethodInfo
instance (signature ~ (Gdk.Atom.Atom -> m Bool), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardWaitIsTargetAvailableMethodInfo a signature where
overloadedMethod = clipboardWaitIsTargetAvailable
instance O.OverloadedMethodInfo ClipboardWaitIsTargetAvailableMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardWaitIsTargetAvailable",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardWaitIsTargetAvailable"
})
#endif
foreign import ccall "gtk_clipboard_wait_is_text_available" gtk_clipboard_wait_is_text_available ::
Ptr Clipboard ->
IO CInt
clipboardWaitIsTextAvailable ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> m Bool
clipboardWaitIsTextAvailable :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> m Bool
clipboardWaitIsTextAvailable 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
gtk_clipboard_wait_is_text_available 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 ClipboardWaitIsTextAvailableMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardWaitIsTextAvailableMethodInfo a signature where
overloadedMethod = clipboardWaitIsTextAvailable
instance O.OverloadedMethodInfo ClipboardWaitIsTextAvailableMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardWaitIsTextAvailable",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardWaitIsTextAvailable"
})
#endif
foreign import ccall "gtk_clipboard_wait_is_uris_available" gtk_clipboard_wait_is_uris_available ::
Ptr Clipboard ->
IO CInt
clipboardWaitIsUrisAvailable ::
(B.CallStack.HasCallStack, MonadIO m, IsClipboard a) =>
a
-> m Bool
clipboardWaitIsUrisAvailable :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClipboard a) =>
a -> m Bool
clipboardWaitIsUrisAvailable 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
gtk_clipboard_wait_is_uris_available 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 ClipboardWaitIsUrisAvailableMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsClipboard a) => O.OverloadedMethod ClipboardWaitIsUrisAvailableMethodInfo a signature where
overloadedMethod = clipboardWaitIsUrisAvailable
instance O.OverloadedMethodInfo ClipboardWaitIsUrisAvailableMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.Clipboard.clipboardWaitIsUrisAvailable",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-Clipboard.html#v:clipboardWaitIsUrisAvailable"
})
#endif
foreign import ccall "gtk_clipboard_get" gtk_clipboard_get ::
Ptr Gdk.Atom.Atom ->
IO (Ptr Clipboard)
clipboardGet ::
(B.CallStack.HasCallStack, MonadIO m) =>
Gdk.Atom.Atom
-> m Clipboard
clipboardGet :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Atom -> m Clipboard
clipboardGet Atom
selection = IO Clipboard -> m Clipboard
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Clipboard -> m Clipboard) -> IO Clipboard -> m Clipboard
forall a b. (a -> b) -> a -> b
$ do
Ptr Atom
selection' <- Atom -> IO (Ptr Atom)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Atom
selection
Ptr Clipboard
result <- Ptr Atom -> IO (Ptr Clipboard)
gtk_clipboard_get Ptr Atom
selection'
Text -> Ptr Clipboard -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"clipboardGet" Ptr Clipboard
result
Clipboard
result' <- ((ManagedPtr Clipboard -> Clipboard)
-> Ptr Clipboard -> IO Clipboard
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Clipboard -> Clipboard
Clipboard) Ptr Clipboard
result
Atom -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Atom
selection
Clipboard -> IO Clipboard
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Clipboard
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_clipboard_get_default" gtk_clipboard_get_default ::
Ptr Gdk.Display.Display ->
IO (Ptr Clipboard)
clipboardGetDefault ::
(B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a) =>
a
-> m Clipboard
clipboardGetDefault :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDisplay a) =>
a -> m Clipboard
clipboardGetDefault a
display = IO Clipboard -> m Clipboard
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Clipboard -> m Clipboard) -> IO Clipboard -> m Clipboard
forall a b. (a -> b) -> a -> b
$ do
Ptr Display
display' <- a -> IO (Ptr Display)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
display
Ptr Clipboard
result <- Ptr Display -> IO (Ptr Clipboard)
gtk_clipboard_get_default Ptr Display
display'
Text -> Ptr Clipboard -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"clipboardGetDefault" Ptr Clipboard
result
Clipboard
result' <- ((ManagedPtr Clipboard -> Clipboard)
-> Ptr Clipboard -> IO Clipboard
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Clipboard -> Clipboard
Clipboard) Ptr Clipboard
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
display
Clipboard -> IO Clipboard
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Clipboard
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_clipboard_get_for_display" gtk_clipboard_get_for_display ::
Ptr Gdk.Display.Display ->
Ptr Gdk.Atom.Atom ->
IO (Ptr Clipboard)
clipboardGetForDisplay ::
(B.CallStack.HasCallStack, MonadIO m, Gdk.Display.IsDisplay a) =>
a
-> Gdk.Atom.Atom
-> m Clipboard
clipboardGetForDisplay :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDisplay a) =>
a -> Atom -> m Clipboard
clipboardGetForDisplay a
display Atom
selection = IO Clipboard -> m Clipboard
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Clipboard -> m Clipboard) -> IO Clipboard -> m Clipboard
forall a b. (a -> b) -> a -> b
$ do
Ptr Display
display' <- a -> IO (Ptr Display)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
display
Ptr Atom
selection' <- Atom -> IO (Ptr Atom)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Atom
selection
Ptr Clipboard
result <- Ptr Display -> Ptr Atom -> IO (Ptr Clipboard)
gtk_clipboard_get_for_display Ptr Display
display' Ptr Atom
selection'
Text -> Ptr Clipboard -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"clipboardGetForDisplay" Ptr Clipboard
result
Clipboard
result' <- ((ManagedPtr Clipboard -> Clipboard)
-> Ptr Clipboard -> IO Clipboard
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Clipboard -> Clipboard
Clipboard) Ptr Clipboard
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
display
Atom -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Atom
selection
Clipboard -> IO Clipboard
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Clipboard
result'
#if defined(ENABLE_OVERLOADING)
#endif