{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gdk.Objects.ContentProvider
(
ContentProvider(..) ,
IsContentProvider ,
toContentProvider ,
#if defined(ENABLE_OVERLOADING)
ResolveContentProviderMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
ContentProviderContentChangedMethodInfo ,
#endif
contentProviderContentChanged ,
#if defined(ENABLE_OVERLOADING)
ContentProviderGetValueMethodInfo ,
#endif
contentProviderGetValue ,
contentProviderNewForBytes ,
contentProviderNewForValue ,
contentProviderNewUnion ,
#if defined(ENABLE_OVERLOADING)
ContentProviderRefFormatsMethodInfo ,
#endif
contentProviderRefFormats ,
#if defined(ENABLE_OVERLOADING)
ContentProviderRefStorableFormatsMethodInfo,
#endif
contentProviderRefStorableFormats ,
#if defined(ENABLE_OVERLOADING)
ContentProviderWriteMimeTypeAsyncMethodInfo,
#endif
contentProviderWriteMimeTypeAsync ,
#if defined(ENABLE_OVERLOADING)
ContentProviderWriteMimeTypeFinishMethodInfo,
#endif
contentProviderWriteMimeTypeFinish ,
#if defined(ENABLE_OVERLOADING)
ContentProviderFormatsPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
contentProviderFormats ,
#endif
getContentProviderFormats ,
#if defined(ENABLE_OVERLOADING)
ContentProviderStorableFormatsPropertyInfo,
#endif
#if defined(ENABLE_OVERLOADING)
contentProviderStorableFormats ,
#endif
getContentProviderStorableFormats ,
ContentProviderContentChangedCallback ,
#if defined(ENABLE_OVERLOADING)
ContentProviderContentChangedSignalInfo ,
#endif
afterContentProviderContentChanged ,
onContentProviderContentChanged ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GObject.Objects.Object as GObject.Object
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.OutputStream as Gio.OutputStream
newtype ContentProvider = ContentProvider (SP.ManagedPtr ContentProvider)
deriving (ContentProvider -> ContentProvider -> Bool
(ContentProvider -> ContentProvider -> Bool)
-> (ContentProvider -> ContentProvider -> Bool)
-> Eq ContentProvider
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ContentProvider -> ContentProvider -> Bool
== :: ContentProvider -> ContentProvider -> Bool
$c/= :: ContentProvider -> ContentProvider -> Bool
/= :: ContentProvider -> ContentProvider -> Bool
Eq)
instance SP.ManagedPtrNewtype ContentProvider where
toManagedPtr :: ContentProvider -> ManagedPtr ContentProvider
toManagedPtr (ContentProvider ManagedPtr ContentProvider
p) = ManagedPtr ContentProvider
p
foreign import ccall "gdk_content_provider_get_type"
c_gdk_content_provider_get_type :: IO B.Types.GType
instance B.Types.TypedObject ContentProvider where
glibType :: IO GType
glibType = IO GType
c_gdk_content_provider_get_type
instance B.Types.GObject ContentProvider
class (SP.GObject o, O.IsDescendantOf ContentProvider o) => IsContentProvider o
instance (SP.GObject o, O.IsDescendantOf ContentProvider o) => IsContentProvider o
instance O.HasParentTypes ContentProvider
type instance O.ParentTypes ContentProvider = '[GObject.Object.Object]
toContentProvider :: (MIO.MonadIO m, IsContentProvider o) => o -> m ContentProvider
toContentProvider :: forall (m :: * -> *) o.
(MonadIO m, IsContentProvider o) =>
o -> m ContentProvider
toContentProvider = IO ContentProvider -> m ContentProvider
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO ContentProvider -> m ContentProvider)
-> (o -> IO ContentProvider) -> o -> m ContentProvider
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr ContentProvider -> ContentProvider)
-> o -> IO ContentProvider
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr ContentProvider -> ContentProvider
ContentProvider
instance B.GValue.IsGValue (Maybe ContentProvider) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gdk_content_provider_get_type
gvalueSet_ :: Ptr GValue -> Maybe ContentProvider -> IO ()
gvalueSet_ Ptr GValue
gv Maybe ContentProvider
P.Nothing = Ptr GValue -> Ptr ContentProvider -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr ContentProvider
forall a. Ptr a
FP.nullPtr :: FP.Ptr ContentProvider)
gvalueSet_ Ptr GValue
gv (P.Just ContentProvider
obj) = ContentProvider -> (Ptr ContentProvider -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr ContentProvider
obj (Ptr GValue -> Ptr ContentProvider -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe ContentProvider)
gvalueGet_ Ptr GValue
gv = do
Ptr ContentProvider
ptr <- Ptr GValue -> IO (Ptr ContentProvider)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr ContentProvider)
if Ptr ContentProvider
ptr Ptr ContentProvider -> Ptr ContentProvider -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr ContentProvider
forall a. Ptr a
FP.nullPtr
then ContentProvider -> Maybe ContentProvider
forall a. a -> Maybe a
P.Just (ContentProvider -> Maybe ContentProvider)
-> IO ContentProvider -> IO (Maybe ContentProvider)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr ContentProvider -> ContentProvider)
-> Ptr ContentProvider -> IO ContentProvider
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr ContentProvider -> ContentProvider
ContentProvider Ptr ContentProvider
ptr
else Maybe ContentProvider -> IO (Maybe ContentProvider)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe ContentProvider
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveContentProviderMethod (t :: Symbol) (o :: *) :: * where
ResolveContentProviderMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveContentProviderMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveContentProviderMethod "contentChanged" o = ContentProviderContentChangedMethodInfo
ResolveContentProviderMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveContentProviderMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveContentProviderMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveContentProviderMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveContentProviderMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveContentProviderMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveContentProviderMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveContentProviderMethod "refFormats" o = ContentProviderRefFormatsMethodInfo
ResolveContentProviderMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveContentProviderMethod "refStorableFormats" o = ContentProviderRefStorableFormatsMethodInfo
ResolveContentProviderMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveContentProviderMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveContentProviderMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveContentProviderMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveContentProviderMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveContentProviderMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveContentProviderMethod "writeMimeTypeAsync" o = ContentProviderWriteMimeTypeAsyncMethodInfo
ResolveContentProviderMethod "writeMimeTypeFinish" o = ContentProviderWriteMimeTypeFinishMethodInfo
ResolveContentProviderMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveContentProviderMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveContentProviderMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveContentProviderMethod "getValue" o = ContentProviderGetValueMethodInfo
ResolveContentProviderMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveContentProviderMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveContentProviderMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveContentProviderMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveContentProviderMethod t ContentProvider, O.OverloadedMethod info ContentProvider p) => OL.IsLabel t (ContentProvider -> 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 ~ ResolveContentProviderMethod t ContentProvider, O.OverloadedMethod info ContentProvider p, R.HasField t ContentProvider p) => R.HasField t ContentProvider p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveContentProviderMethod t ContentProvider, O.OverloadedMethodInfo info ContentProvider) => OL.IsLabel t (O.MethodProxy info ContentProvider) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type ContentProviderContentChangedCallback =
IO ()
type C_ContentProviderContentChangedCallback =
Ptr ContentProvider ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_ContentProviderContentChangedCallback :: C_ContentProviderContentChangedCallback -> IO (FunPtr C_ContentProviderContentChangedCallback)
wrap_ContentProviderContentChangedCallback ::
GObject a => (a -> ContentProviderContentChangedCallback) ->
C_ContentProviderContentChangedCallback
wrap_ContentProviderContentChangedCallback :: forall a.
GObject a =>
(a -> IO ()) -> C_ContentProviderContentChangedCallback
wrap_ContentProviderContentChangedCallback a -> IO ()
gi'cb Ptr ContentProvider
gi'selfPtr Ptr ()
_ = do
Ptr ContentProvider -> (ContentProvider -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr ContentProvider
gi'selfPtr ((ContentProvider -> IO ()) -> IO ())
-> (ContentProvider -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ContentProvider
gi'self -> a -> IO ()
gi'cb (ContentProvider -> a
forall a b. Coercible a b => a -> b
Coerce.coerce ContentProvider
gi'self)
onContentProviderContentChanged :: (IsContentProvider a, MonadIO m) => a -> ((?self :: a) => ContentProviderContentChangedCallback) -> m SignalHandlerId
onContentProviderContentChanged :: forall a (m :: * -> *).
(IsContentProvider a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onContentProviderContentChanged 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_ContentProviderContentChangedCallback
wrapped' = (a -> IO ()) -> C_ContentProviderContentChangedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_ContentProviderContentChangedCallback
wrap_ContentProviderContentChangedCallback a -> IO ()
wrapped
FunPtr C_ContentProviderContentChangedCallback
wrapped'' <- C_ContentProviderContentChangedCallback
-> IO (FunPtr C_ContentProviderContentChangedCallback)
mk_ContentProviderContentChangedCallback C_ContentProviderContentChangedCallback
wrapped'
a
-> Text
-> FunPtr C_ContentProviderContentChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"content-changed" FunPtr C_ContentProviderContentChangedCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterContentProviderContentChanged :: (IsContentProvider a, MonadIO m) => a -> ((?self :: a) => ContentProviderContentChangedCallback) -> m SignalHandlerId
afterContentProviderContentChanged :: forall a (m :: * -> *).
(IsContentProvider a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterContentProviderContentChanged 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_ContentProviderContentChangedCallback
wrapped' = (a -> IO ()) -> C_ContentProviderContentChangedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_ContentProviderContentChangedCallback
wrap_ContentProviderContentChangedCallback a -> IO ()
wrapped
FunPtr C_ContentProviderContentChangedCallback
wrapped'' <- C_ContentProviderContentChangedCallback
-> IO (FunPtr C_ContentProviderContentChangedCallback)
mk_ContentProviderContentChangedCallback C_ContentProviderContentChangedCallback
wrapped'
a
-> Text
-> FunPtr C_ContentProviderContentChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"content-changed" FunPtr C_ContentProviderContentChangedCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data ContentProviderContentChangedSignalInfo
instance SignalInfo ContentProviderContentChangedSignalInfo where
type HaskellCallbackType ContentProviderContentChangedSignalInfo = ContentProviderContentChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_ContentProviderContentChangedCallback cb
cb'' <- mk_ContentProviderContentChangedCallback cb'
connectSignalFunPtr obj "content-changed" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.ContentProvider::content-changed"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-ContentProvider.html#g:signal:contentChanged"})
#endif
getContentProviderFormats :: (MonadIO m, IsContentProvider o) => o -> m (Maybe Gdk.ContentFormats.ContentFormats)
getContentProviderFormats :: forall (m :: * -> *) o.
(MonadIO m, IsContentProvider o) =>
o -> m (Maybe ContentFormats)
getContentProviderFormats o
obj = IO (Maybe ContentFormats) -> m (Maybe ContentFormats)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe ContentFormats) -> m (Maybe ContentFormats))
-> IO (Maybe ContentFormats) -> m (Maybe 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 ContentProviderFormatsPropertyInfo
instance AttrInfo ContentProviderFormatsPropertyInfo where
type AttrAllowedOps ContentProviderFormatsPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint ContentProviderFormatsPropertyInfo = IsContentProvider
type AttrSetTypeConstraint ContentProviderFormatsPropertyInfo = (~) ()
type AttrTransferTypeConstraint ContentProviderFormatsPropertyInfo = (~) ()
type AttrTransferType ContentProviderFormatsPropertyInfo = ()
type AttrGetType ContentProviderFormatsPropertyInfo = (Maybe Gdk.ContentFormats.ContentFormats)
type AttrLabel ContentProviderFormatsPropertyInfo = "formats"
type AttrOrigin ContentProviderFormatsPropertyInfo = ContentProvider
attrGet = getContentProviderFormats
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.ContentProvider.formats"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-ContentProvider.html#g:attr:formats"
})
#endif
getContentProviderStorableFormats :: (MonadIO m, IsContentProvider o) => o -> m (Maybe Gdk.ContentFormats.ContentFormats)
getContentProviderStorableFormats :: forall (m :: * -> *) o.
(MonadIO m, IsContentProvider o) =>
o -> m (Maybe ContentFormats)
getContentProviderStorableFormats o
obj = IO (Maybe ContentFormats) -> m (Maybe ContentFormats)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe ContentFormats) -> m (Maybe ContentFormats))
-> IO (Maybe ContentFormats) -> m (Maybe 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
"storable-formats" ManagedPtr ContentFormats -> ContentFormats
Gdk.ContentFormats.ContentFormats
#if defined(ENABLE_OVERLOADING)
data ContentProviderStorableFormatsPropertyInfo
instance AttrInfo ContentProviderStorableFormatsPropertyInfo where
type AttrAllowedOps ContentProviderStorableFormatsPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint ContentProviderStorableFormatsPropertyInfo = IsContentProvider
type AttrSetTypeConstraint ContentProviderStorableFormatsPropertyInfo = (~) ()
type AttrTransferTypeConstraint ContentProviderStorableFormatsPropertyInfo = (~) ()
type AttrTransferType ContentProviderStorableFormatsPropertyInfo = ()
type AttrGetType ContentProviderStorableFormatsPropertyInfo = (Maybe Gdk.ContentFormats.ContentFormats)
type AttrLabel ContentProviderStorableFormatsPropertyInfo = "storable-formats"
type AttrOrigin ContentProviderStorableFormatsPropertyInfo = ContentProvider
attrGet = getContentProviderStorableFormats
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.ContentProvider.storableFormats"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-ContentProvider.html#g:attr:storableFormats"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList ContentProvider
type instance O.AttributeList ContentProvider = ContentProviderAttributeList
type ContentProviderAttributeList = ('[ '("formats", ContentProviderFormatsPropertyInfo), '("storableFormats", ContentProviderStorableFormatsPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
contentProviderFormats :: AttrLabelProxy "formats"
contentProviderFormats = AttrLabelProxy
contentProviderStorableFormats :: AttrLabelProxy "storableFormats"
contentProviderStorableFormats = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList ContentProvider = ContentProviderSignalList
type ContentProviderSignalList = ('[ '("contentChanged", ContentProviderContentChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gdk_content_provider_new_for_bytes" gdk_content_provider_new_for_bytes ::
CString ->
Ptr GLib.Bytes.Bytes ->
IO (Ptr ContentProvider)
contentProviderNewForBytes ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> GLib.Bytes.Bytes
-> m ContentProvider
contentProviderNewForBytes :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> Bytes -> m ContentProvider
contentProviderNewForBytes Text
mimeType Bytes
bytes = IO ContentProvider -> m ContentProvider
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContentProvider -> m ContentProvider)
-> IO ContentProvider -> m ContentProvider
forall a b. (a -> b) -> a -> b
$ do
CString
mimeType' <- Text -> IO CString
textToCString Text
mimeType
Ptr Bytes
bytes' <- Bytes -> IO (Ptr Bytes)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Bytes
bytes
Ptr ContentProvider
result <- CString -> Ptr Bytes -> IO (Ptr ContentProvider)
gdk_content_provider_new_for_bytes CString
mimeType' Ptr Bytes
bytes'
Text -> Ptr ContentProvider -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"contentProviderNewForBytes" Ptr ContentProvider
result
ContentProvider
result' <- ((ManagedPtr ContentProvider -> ContentProvider)
-> Ptr ContentProvider -> IO ContentProvider
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr ContentProvider -> ContentProvider
ContentProvider) Ptr ContentProvider
result
Bytes -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Bytes
bytes
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
mimeType'
ContentProvider -> IO ContentProvider
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ContentProvider
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_content_provider_new_for_value" gdk_content_provider_new_for_value ::
Ptr GValue ->
IO (Ptr ContentProvider)
contentProviderNewForValue ::
(B.CallStack.HasCallStack, MonadIO m) =>
GValue
-> m ContentProvider
contentProviderNewForValue :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GValue -> m ContentProvider
contentProviderNewForValue GValue
value = IO ContentProvider -> m ContentProvider
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContentProvider -> m ContentProvider)
-> IO ContentProvider -> m ContentProvider
forall a b. (a -> b) -> a -> b
$ do
Ptr GValue
value' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
value
Ptr ContentProvider
result <- Ptr GValue -> IO (Ptr ContentProvider)
gdk_content_provider_new_for_value Ptr GValue
value'
Text -> Ptr ContentProvider -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"contentProviderNewForValue" Ptr ContentProvider
result
ContentProvider
result' <- ((ManagedPtr ContentProvider -> ContentProvider)
-> Ptr ContentProvider -> IO ContentProvider
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr ContentProvider -> ContentProvider
ContentProvider) Ptr ContentProvider
result
GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
value
ContentProvider -> IO ContentProvider
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ContentProvider
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_content_provider_new_union" gdk_content_provider_new_union ::
Ptr (Ptr ContentProvider) ->
Word64 ->
IO (Ptr ContentProvider)
contentProviderNewUnion ::
(B.CallStack.HasCallStack, MonadIO m) =>
Maybe ([ContentProvider])
-> m ContentProvider
contentProviderNewUnion :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Maybe [ContentProvider] -> m ContentProvider
contentProviderNewUnion Maybe [ContentProvider]
providers = IO ContentProvider -> m ContentProvider
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContentProvider -> m ContentProvider)
-> IO ContentProvider -> m ContentProvider
forall a b. (a -> b) -> a -> b
$ do
let nProviders :: Word64
nProviders = case Maybe [ContentProvider]
providers of
Maybe [ContentProvider]
Nothing -> Word64
0
Just [ContentProvider]
jProviders -> Int -> Word64
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Word64) -> Int -> Word64
forall a b. (a -> b) -> a -> b
$ [ContentProvider] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
P.length [ContentProvider]
jProviders
Ptr (Ptr ContentProvider)
maybeProviders <- case Maybe [ContentProvider]
providers of
Maybe [ContentProvider]
Nothing -> Ptr (Ptr ContentProvider) -> IO (Ptr (Ptr ContentProvider))
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr (Ptr ContentProvider)
forall a. Ptr a
nullPtr
Just [ContentProvider]
jProviders -> do
[Ptr ContentProvider]
jProviders' <- (ContentProvider -> IO (Ptr ContentProvider))
-> [ContentProvider] -> IO [Ptr ContentProvider]
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 ContentProvider -> IO (Ptr ContentProvider)
forall a b. (HasCallStack, GObject a) => a -> IO (Ptr b)
B.ManagedPtr.disownObject [ContentProvider]
jProviders
Ptr (Ptr ContentProvider)
jProviders'' <- [Ptr ContentProvider] -> IO (Ptr (Ptr ContentProvider))
forall a. [Ptr a] -> IO (Ptr (Ptr a))
packPtrArray [Ptr ContentProvider]
jProviders'
Ptr (Ptr ContentProvider) -> IO (Ptr (Ptr ContentProvider))
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr (Ptr ContentProvider)
jProviders''
Ptr ContentProvider
result <- Ptr (Ptr ContentProvider) -> Word64 -> IO (Ptr ContentProvider)
gdk_content_provider_new_union Ptr (Ptr ContentProvider)
maybeProviders Word64
nProviders
Text -> Ptr ContentProvider -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"contentProviderNewUnion" Ptr ContentProvider
result
ContentProvider
result' <- ((ManagedPtr ContentProvider -> ContentProvider)
-> Ptr ContentProvider -> IO ContentProvider
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr ContentProvider -> ContentProvider
ContentProvider) Ptr ContentProvider
result
Maybe [ContentProvider] -> ([ContentProvider] -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe [ContentProvider]
providers ((ContentProvider -> IO ()) -> [ContentProvider] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ ContentProvider -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr)
ContentProvider -> IO ContentProvider
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ContentProvider
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gdk_content_provider_content_changed" gdk_content_provider_content_changed ::
Ptr ContentProvider ->
IO ()
contentProviderContentChanged ::
(B.CallStack.HasCallStack, MonadIO m, IsContentProvider a) =>
a
-> m ()
contentProviderContentChanged :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContentProvider a) =>
a -> m ()
contentProviderContentChanged a
provider = 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 ContentProvider
provider' <- a -> IO (Ptr ContentProvider)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
provider
Ptr ContentProvider -> IO ()
gdk_content_provider_content_changed Ptr ContentProvider
provider'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
provider
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ContentProviderContentChangedMethodInfo
instance (signature ~ (m ()), MonadIO m, IsContentProvider a) => O.OverloadedMethod ContentProviderContentChangedMethodInfo a signature where
overloadedMethod = contentProviderContentChanged
instance O.OverloadedMethodInfo ContentProviderContentChangedMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.ContentProvider.contentProviderContentChanged",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-ContentProvider.html#v:contentProviderContentChanged"
})
#endif
foreign import ccall "gdk_content_provider_get_value" gdk_content_provider_get_value ::
Ptr ContentProvider ->
Ptr GValue ->
Ptr (Ptr GError) ->
IO CInt
contentProviderGetValue ::
(B.CallStack.HasCallStack, MonadIO m, IsContentProvider a) =>
a
-> m (GValue)
contentProviderGetValue :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContentProvider a) =>
a -> m GValue
contentProviderGetValue a
provider = IO GValue -> m GValue
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GValue -> m GValue) -> IO GValue -> m GValue
forall a b. (a -> b) -> a -> b
$ do
Ptr ContentProvider
provider' <- a -> IO (Ptr ContentProvider)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
provider
Ptr GValue
value <- Int -> IO (Ptr GValue)
forall a. Int -> IO (Ptr a)
SP.callocBytes Int
24 :: IO (Ptr GValue)
IO GValue -> IO () -> IO GValue
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr ContentProvider -> Ptr GValue -> Ptr (Ptr GError) -> IO CInt
gdk_content_provider_get_value Ptr ContentProvider
provider' Ptr GValue
value
GValue
value' <- Ptr GValue -> IO GValue
B.GValue.wrapGValuePtr Ptr GValue
value
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
provider
GValue -> IO GValue
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return GValue
value'
) (do
Ptr GValue -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr GValue
value
)
#if defined(ENABLE_OVERLOADING)
data ContentProviderGetValueMethodInfo
instance (signature ~ (m (GValue)), MonadIO m, IsContentProvider a) => O.OverloadedMethod ContentProviderGetValueMethodInfo a signature where
overloadedMethod = contentProviderGetValue
instance O.OverloadedMethodInfo ContentProviderGetValueMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.ContentProvider.contentProviderGetValue",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-ContentProvider.html#v:contentProviderGetValue"
})
#endif
foreign import ccall "gdk_content_provider_ref_formats" gdk_content_provider_ref_formats ::
Ptr ContentProvider ->
IO (Ptr Gdk.ContentFormats.ContentFormats)
contentProviderRefFormats ::
(B.CallStack.HasCallStack, MonadIO m, IsContentProvider a) =>
a
-> m Gdk.ContentFormats.ContentFormats
contentProviderRefFormats :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContentProvider a) =>
a -> m ContentFormats
contentProviderRefFormats a
provider = IO ContentFormats -> m ContentFormats
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContentFormats -> m ContentFormats)
-> IO ContentFormats -> m ContentFormats
forall a b. (a -> b) -> a -> b
$ do
Ptr ContentProvider
provider' <- a -> IO (Ptr ContentProvider)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
provider
Ptr ContentFormats
result <- Ptr ContentProvider -> IO (Ptr ContentFormats)
gdk_content_provider_ref_formats Ptr ContentProvider
provider'
Text -> Ptr ContentFormats -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"contentProviderRefFormats" Ptr ContentFormats
result
ContentFormats
result' <- ((ManagedPtr ContentFormats -> ContentFormats)
-> Ptr ContentFormats -> IO ContentFormats
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ContentFormats -> ContentFormats
Gdk.ContentFormats.ContentFormats) Ptr ContentFormats
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
provider
ContentFormats -> IO ContentFormats
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ContentFormats
result'
#if defined(ENABLE_OVERLOADING)
data ContentProviderRefFormatsMethodInfo
instance (signature ~ (m Gdk.ContentFormats.ContentFormats), MonadIO m, IsContentProvider a) => O.OverloadedMethod ContentProviderRefFormatsMethodInfo a signature where
overloadedMethod = contentProviderRefFormats
instance O.OverloadedMethodInfo ContentProviderRefFormatsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.ContentProvider.contentProviderRefFormats",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-ContentProvider.html#v:contentProviderRefFormats"
})
#endif
foreign import ccall "gdk_content_provider_ref_storable_formats" gdk_content_provider_ref_storable_formats ::
Ptr ContentProvider ->
IO (Ptr Gdk.ContentFormats.ContentFormats)
contentProviderRefStorableFormats ::
(B.CallStack.HasCallStack, MonadIO m, IsContentProvider a) =>
a
-> m Gdk.ContentFormats.ContentFormats
contentProviderRefStorableFormats :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsContentProvider a) =>
a -> m ContentFormats
contentProviderRefStorableFormats a
provider = IO ContentFormats -> m ContentFormats
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ContentFormats -> m ContentFormats)
-> IO ContentFormats -> m ContentFormats
forall a b. (a -> b) -> a -> b
$ do
Ptr ContentProvider
provider' <- a -> IO (Ptr ContentProvider)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
provider
Ptr ContentFormats
result <- Ptr ContentProvider -> IO (Ptr ContentFormats)
gdk_content_provider_ref_storable_formats Ptr ContentProvider
provider'
Text -> Ptr ContentFormats -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"contentProviderRefStorableFormats" Ptr ContentFormats
result
ContentFormats
result' <- ((ManagedPtr ContentFormats -> ContentFormats)
-> Ptr ContentFormats -> IO ContentFormats
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr ContentFormats -> ContentFormats
Gdk.ContentFormats.ContentFormats) Ptr ContentFormats
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
provider
ContentFormats -> IO ContentFormats
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ContentFormats
result'
#if defined(ENABLE_OVERLOADING)
data ContentProviderRefStorableFormatsMethodInfo
instance (signature ~ (m Gdk.ContentFormats.ContentFormats), MonadIO m, IsContentProvider a) => O.OverloadedMethod ContentProviderRefStorableFormatsMethodInfo a signature where
overloadedMethod = contentProviderRefStorableFormats
instance O.OverloadedMethodInfo ContentProviderRefStorableFormatsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.ContentProvider.contentProviderRefStorableFormats",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-ContentProvider.html#v:contentProviderRefStorableFormats"
})
#endif
foreign import ccall "gdk_content_provider_write_mime_type_async" gdk_content_provider_write_mime_type_async ::
Ptr ContentProvider ->
CString ->
Ptr Gio.OutputStream.OutputStream ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
contentProviderWriteMimeTypeAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsContentProvider a, Gio.OutputStream.IsOutputStream b, Gio.Cancellable.IsCancellable c) =>
a
-> T.Text
-> b
-> Int32
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
contentProviderWriteMimeTypeAsync :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsContentProvider a, IsOutputStream b,
IsCancellable c) =>
a
-> Text
-> b
-> Int32
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
contentProviderWriteMimeTypeAsync a
provider Text
mimeType b
stream Int32
ioPriority Maybe c
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr ContentProvider
provider' <- a -> IO (Ptr ContentProvider)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
provider
CString
mimeType' <- Text -> IO CString
textToCString Text
mimeType
Ptr OutputStream
stream' <- b -> IO (Ptr OutputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
stream
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr ContentProvider
-> CString
-> Ptr OutputStream
-> Int32
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
gdk_content_provider_write_mime_type_async Ptr ContentProvider
provider' CString
mimeType' Ptr OutputStream
stream' Int32
ioPriority Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
provider
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
stream
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
mimeType'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ContentProviderWriteMimeTypeAsyncMethodInfo
instance (signature ~ (T.Text -> b -> Int32 -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsContentProvider a, Gio.OutputStream.IsOutputStream b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod ContentProviderWriteMimeTypeAsyncMethodInfo a signature where
overloadedMethod = contentProviderWriteMimeTypeAsync
instance O.OverloadedMethodInfo ContentProviderWriteMimeTypeAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.ContentProvider.contentProviderWriteMimeTypeAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-ContentProvider.html#v:contentProviderWriteMimeTypeAsync"
})
#endif
foreign import ccall "gdk_content_provider_write_mime_type_finish" gdk_content_provider_write_mime_type_finish ::
Ptr ContentProvider ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
contentProviderWriteMimeTypeFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsContentProvider a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
contentProviderWriteMimeTypeFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsContentProvider a, IsAsyncResult b) =>
a -> b -> m ()
contentProviderWriteMimeTypeFinish a
provider b
result_ = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr ContentProvider
provider' <- a -> IO (Ptr ContentProvider)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
provider
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr ContentProvider
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
gdk_content_provider_write_mime_type_finish Ptr ContentProvider
provider' Ptr AsyncResult
result_'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
provider
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data ContentProviderWriteMimeTypeFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsContentProvider a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod ContentProviderWriteMimeTypeFinishMethodInfo a signature where
overloadedMethod = contentProviderWriteMimeTypeFinish
instance O.OverloadedMethodInfo ContentProviderWriteMimeTypeFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gdk.Objects.ContentProvider.contentProviderWriteMimeTypeFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk-4.0.5/docs/GI-Gdk-Objects-ContentProvider.html#v:contentProviderWriteMimeTypeFinish"
})
#endif