{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Structs.IOExtensionPoint
(
IOExtensionPoint(..) ,
#if defined(ENABLE_OVERLOADING)
ResolveIOExtensionPointMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
IOExtensionPointGetExtensionByNameMethodInfo,
#endif
iOExtensionPointGetExtensionByName ,
#if defined(ENABLE_OVERLOADING)
IOExtensionPointGetExtensionsMethodInfo ,
#endif
iOExtensionPointGetExtensions ,
#if defined(ENABLE_OVERLOADING)
IOExtensionPointGetRequiredTypeMethodInfo,
#endif
iOExtensionPointGetRequiredType ,
iOExtensionPointImplement ,
iOExtensionPointLookup ,
iOExtensionPointRegister ,
#if defined(ENABLE_OVERLOADING)
IOExtensionPointSetRequiredTypeMethodInfo,
#endif
iOExtensionPointSetRequiredType ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import {-# SOURCE #-} qualified GI.Gio.Structs.IOExtension as Gio.IOExtension
#else
import {-# SOURCE #-} qualified GI.Gio.Structs.IOExtension as Gio.IOExtension
#endif
newtype IOExtensionPoint = IOExtensionPoint (SP.ManagedPtr IOExtensionPoint)
deriving (IOExtensionPoint -> IOExtensionPoint -> Bool
(IOExtensionPoint -> IOExtensionPoint -> Bool)
-> (IOExtensionPoint -> IOExtensionPoint -> Bool)
-> Eq IOExtensionPoint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IOExtensionPoint -> IOExtensionPoint -> Bool
== :: IOExtensionPoint -> IOExtensionPoint -> Bool
$c/= :: IOExtensionPoint -> IOExtensionPoint -> Bool
/= :: IOExtensionPoint -> IOExtensionPoint -> Bool
Eq)
instance SP.ManagedPtrNewtype IOExtensionPoint where
toManagedPtr :: IOExtensionPoint -> ManagedPtr IOExtensionPoint
toManagedPtr (IOExtensionPoint ManagedPtr IOExtensionPoint
p) = ManagedPtr IOExtensionPoint
p
instance BoxedPtr IOExtensionPoint where
boxedPtrCopy :: IOExtensionPoint -> IO IOExtensionPoint
boxedPtrCopy = IOExtensionPoint -> IO IOExtensionPoint
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return
boxedPtrFree :: IOExtensionPoint -> IO ()
boxedPtrFree = \IOExtensionPoint
_x -> () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList IOExtensionPoint
type instance O.AttributeList IOExtensionPoint = IOExtensionPointAttributeList
type IOExtensionPointAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "g_io_extension_point_get_extension_by_name" g_io_extension_point_get_extension_by_name ::
Ptr IOExtensionPoint ->
CString ->
IO (Ptr Gio.IOExtension.IOExtension)
iOExtensionPointGetExtensionByName ::
(B.CallStack.HasCallStack, MonadIO m) =>
IOExtensionPoint
-> T.Text
-> m Gio.IOExtension.IOExtension
iOExtensionPointGetExtensionByName :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
IOExtensionPoint -> Text -> m IOExtension
iOExtensionPointGetExtensionByName IOExtensionPoint
extensionPoint Text
name = IO IOExtension -> m IOExtension
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO IOExtension -> m IOExtension)
-> IO IOExtension -> m IOExtension
forall a b. (a -> b) -> a -> b
$ do
extensionPoint' <- IOExtensionPoint -> IO (Ptr IOExtensionPoint)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr IOExtensionPoint
extensionPoint
name' <- textToCString name
result <- g_io_extension_point_get_extension_by_name extensionPoint' name'
checkUnexpectedReturnNULL "iOExtensionPointGetExtensionByName" result
result' <- (newPtr Gio.IOExtension.IOExtension) result
touchManagedPtr extensionPoint
freeMem name'
return result'
#if defined(ENABLE_OVERLOADING)
data IOExtensionPointGetExtensionByNameMethodInfo
instance (signature ~ (T.Text -> m Gio.IOExtension.IOExtension), MonadIO m) => O.OverloadedMethod IOExtensionPointGetExtensionByNameMethodInfo IOExtensionPoint signature where
overloadedMethod = iOExtensionPointGetExtensionByName
instance O.OverloadedMethodInfo IOExtensionPointGetExtensionByNameMethodInfo IOExtensionPoint where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Structs.IOExtensionPoint.iOExtensionPointGetExtensionByName",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Structs-IOExtensionPoint.html#v:iOExtensionPointGetExtensionByName"
})
#endif
foreign import ccall "g_io_extension_point_get_extensions" g_io_extension_point_get_extensions ::
Ptr IOExtensionPoint ->
IO (Ptr (GList (Ptr Gio.IOExtension.IOExtension)))
iOExtensionPointGetExtensions ::
(B.CallStack.HasCallStack, MonadIO m) =>
IOExtensionPoint
-> m [Gio.IOExtension.IOExtension]
iOExtensionPointGetExtensions :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
IOExtensionPoint -> m [IOExtension]
iOExtensionPointGetExtensions IOExtensionPoint
extensionPoint = IO [IOExtension] -> m [IOExtension]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [IOExtension] -> m [IOExtension])
-> IO [IOExtension] -> m [IOExtension]
forall a b. (a -> b) -> a -> b
$ do
extensionPoint' <- IOExtensionPoint -> IO (Ptr IOExtensionPoint)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr IOExtensionPoint
extensionPoint
result <- g_io_extension_point_get_extensions extensionPoint'
result' <- unpackGList result
result'' <- mapM (newPtr Gio.IOExtension.IOExtension) result'
touchManagedPtr extensionPoint
return result''
#if defined(ENABLE_OVERLOADING)
data IOExtensionPointGetExtensionsMethodInfo
instance (signature ~ (m [Gio.IOExtension.IOExtension]), MonadIO m) => O.OverloadedMethod IOExtensionPointGetExtensionsMethodInfo IOExtensionPoint signature where
overloadedMethod = iOExtensionPointGetExtensions
instance O.OverloadedMethodInfo IOExtensionPointGetExtensionsMethodInfo IOExtensionPoint where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Structs.IOExtensionPoint.iOExtensionPointGetExtensions",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Structs-IOExtensionPoint.html#v:iOExtensionPointGetExtensions"
})
#endif
foreign import ccall "g_io_extension_point_get_required_type" g_io_extension_point_get_required_type ::
Ptr IOExtensionPoint ->
IO CGType
iOExtensionPointGetRequiredType ::
(B.CallStack.HasCallStack, MonadIO m) =>
IOExtensionPoint
-> m GType
iOExtensionPointGetRequiredType :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
IOExtensionPoint -> m GType
iOExtensionPointGetRequiredType IOExtensionPoint
extensionPoint = IO GType -> m GType
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GType -> m GType) -> IO GType -> m GType
forall a b. (a -> b) -> a -> b
$ do
extensionPoint' <- IOExtensionPoint -> IO (Ptr IOExtensionPoint)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr IOExtensionPoint
extensionPoint
result <- g_io_extension_point_get_required_type extensionPoint'
let result' = CGType -> GType
GType CGType
result
touchManagedPtr extensionPoint
return result'
#if defined(ENABLE_OVERLOADING)
data IOExtensionPointGetRequiredTypeMethodInfo
instance (signature ~ (m GType), MonadIO m) => O.OverloadedMethod IOExtensionPointGetRequiredTypeMethodInfo IOExtensionPoint signature where
overloadedMethod = iOExtensionPointGetRequiredType
instance O.OverloadedMethodInfo IOExtensionPointGetRequiredTypeMethodInfo IOExtensionPoint where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Structs.IOExtensionPoint.iOExtensionPointGetRequiredType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Structs-IOExtensionPoint.html#v:iOExtensionPointGetRequiredType"
})
#endif
foreign import ccall "g_io_extension_point_set_required_type" g_io_extension_point_set_required_type ::
Ptr IOExtensionPoint ->
CGType ->
IO ()
iOExtensionPointSetRequiredType ::
(B.CallStack.HasCallStack, MonadIO m) =>
IOExtensionPoint
-> GType
-> m ()
iOExtensionPointSetRequiredType :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
IOExtensionPoint -> GType -> m ()
iOExtensionPointSetRequiredType IOExtensionPoint
extensionPoint GType
type_ = 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
extensionPoint' <- IOExtensionPoint -> IO (Ptr IOExtensionPoint)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr IOExtensionPoint
extensionPoint
let type_' = GType -> CGType
gtypeToCGType GType
type_
g_io_extension_point_set_required_type extensionPoint' type_'
touchManagedPtr extensionPoint
return ()
#if defined(ENABLE_OVERLOADING)
data IOExtensionPointSetRequiredTypeMethodInfo
instance (signature ~ (GType -> m ()), MonadIO m) => O.OverloadedMethod IOExtensionPointSetRequiredTypeMethodInfo IOExtensionPoint signature where
overloadedMethod = iOExtensionPointSetRequiredType
instance O.OverloadedMethodInfo IOExtensionPointSetRequiredTypeMethodInfo IOExtensionPoint where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Structs.IOExtensionPoint.iOExtensionPointSetRequiredType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Structs-IOExtensionPoint.html#v:iOExtensionPointSetRequiredType"
})
#endif
foreign import ccall "g_io_extension_point_implement" g_io_extension_point_implement ::
CString ->
CGType ->
CString ->
Int32 ->
IO (Ptr Gio.IOExtension.IOExtension)
iOExtensionPointImplement ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> GType
-> T.Text
-> Int32
-> m Gio.IOExtension.IOExtension
iOExtensionPointImplement :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> GType -> Text -> Int32 -> m IOExtension
iOExtensionPointImplement Text
extensionPointName GType
type_ Text
extensionName Int32
priority = IO IOExtension -> m IOExtension
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO IOExtension -> m IOExtension)
-> IO IOExtension -> m IOExtension
forall a b. (a -> b) -> a -> b
$ do
extensionPointName' <- Text -> IO CString
textToCString Text
extensionPointName
let type_' = GType -> CGType
gtypeToCGType GType
type_
extensionName' <- textToCString extensionName
result <- g_io_extension_point_implement extensionPointName' type_' extensionName' priority
checkUnexpectedReturnNULL "iOExtensionPointImplement" result
result' <- (newPtr Gio.IOExtension.IOExtension) result
freeMem extensionPointName'
freeMem extensionName'
return result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_io_extension_point_lookup" g_io_extension_point_lookup ::
CString ->
IO (Ptr IOExtensionPoint)
iOExtensionPointLookup ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m IOExtensionPoint
iOExtensionPointLookup :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m IOExtensionPoint
iOExtensionPointLookup Text
name = IO IOExtensionPoint -> m IOExtensionPoint
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO IOExtensionPoint -> m IOExtensionPoint)
-> IO IOExtensionPoint -> m IOExtensionPoint
forall a b. (a -> b) -> a -> b
$ do
name' <- Text -> IO CString
textToCString Text
name
result <- g_io_extension_point_lookup name'
checkUnexpectedReturnNULL "iOExtensionPointLookup" result
result' <- (newPtr IOExtensionPoint) result
freeMem name'
return result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_io_extension_point_register" g_io_extension_point_register ::
CString ->
IO (Ptr IOExtensionPoint)
iOExtensionPointRegister ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m IOExtensionPoint
iOExtensionPointRegister :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m IOExtensionPoint
iOExtensionPointRegister Text
name = IO IOExtensionPoint -> m IOExtensionPoint
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO IOExtensionPoint -> m IOExtensionPoint)
-> IO IOExtensionPoint -> m IOExtensionPoint
forall a b. (a -> b) -> a -> b
$ do
name' <- Text -> IO CString
textToCString Text
name
result <- g_io_extension_point_register name'
checkUnexpectedReturnNULL "iOExtensionPointRegister" result
result' <- (newPtr IOExtensionPoint) result
freeMem name'
return result'
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveIOExtensionPointMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveIOExtensionPointMethod "getExtensionByName" o = IOExtensionPointGetExtensionByNameMethodInfo
ResolveIOExtensionPointMethod "getExtensions" o = IOExtensionPointGetExtensionsMethodInfo
ResolveIOExtensionPointMethod "getRequiredType" o = IOExtensionPointGetRequiredTypeMethodInfo
ResolveIOExtensionPointMethod "setRequiredType" o = IOExtensionPointSetRequiredTypeMethodInfo
ResolveIOExtensionPointMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveIOExtensionPointMethod t IOExtensionPoint, O.OverloadedMethod info IOExtensionPoint p) => OL.IsLabel t (IOExtensionPoint -> 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 ~ ResolveIOExtensionPointMethod t IOExtensionPoint, O.OverloadedMethod info IOExtensionPoint p, R.HasField t IOExtensionPoint p) => R.HasField t IOExtensionPoint p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveIOExtensionPointMethod t IOExtensionPoint, O.OverloadedMethodInfo info IOExtensionPoint) => OL.IsLabel t (O.MethodProxy info IOExtensionPoint) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif