module GI.Gio.Structs.IOExtension
(
IOExtension(..) ,
noIOExtension ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
IOExtensionGetNameMethodInfo ,
#endif
iOExtensionGetName ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
IOExtensionGetPriorityMethodInfo ,
#endif
iOExtensionGetPriority ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
IOExtensionGetTypeMethodInfo ,
#endif
iOExtensionGetType ,
) 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.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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
newtype IOExtension = IOExtension (ManagedPtr IOExtension)
instance WrappedPtr IOExtension where
wrappedPtrCalloc = return nullPtr
wrappedPtrCopy = return
wrappedPtrFree = Nothing
noIOExtension :: Maybe IOExtension
noIOExtension = Nothing
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList IOExtension
type instance O.AttributeList IOExtension = IOExtensionAttributeList
type IOExtensionAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "g_io_extension_get_name" g_io_extension_get_name ::
Ptr IOExtension ->
IO CString
iOExtensionGetName ::
(B.CallStack.HasCallStack, MonadIO m) =>
IOExtension
-> m T.Text
iOExtensionGetName extension = liftIO $ do
extension' <- unsafeManagedPtrGetPtr extension
result <- g_io_extension_get_name extension'
checkUnexpectedReturnNULL "iOExtensionGetName" result
result' <- cstringToText result
touchManagedPtr extension
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data IOExtensionGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo IOExtensionGetNameMethodInfo IOExtension signature where
overloadedMethod _ = iOExtensionGetName
#endif
foreign import ccall "g_io_extension_get_priority" g_io_extension_get_priority ::
Ptr IOExtension ->
IO Int32
iOExtensionGetPriority ::
(B.CallStack.HasCallStack, MonadIO m) =>
IOExtension
-> m Int32
iOExtensionGetPriority extension = liftIO $ do
extension' <- unsafeManagedPtrGetPtr extension
result <- g_io_extension_get_priority extension'
touchManagedPtr extension
return result
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data IOExtensionGetPriorityMethodInfo
instance (signature ~ (m Int32), MonadIO m) => O.MethodInfo IOExtensionGetPriorityMethodInfo IOExtension signature where
overloadedMethod _ = iOExtensionGetPriority
#endif
foreign import ccall "g_io_extension_get_type" g_io_extension_get_type ::
Ptr IOExtension ->
IO CGType
iOExtensionGetType ::
(B.CallStack.HasCallStack, MonadIO m) =>
IOExtension
-> m GType
iOExtensionGetType extension = liftIO $ do
extension' <- unsafeManagedPtrGetPtr extension
result <- g_io_extension_get_type extension'
let result' = GType result
touchManagedPtr extension
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data IOExtensionGetTypeMethodInfo
instance (signature ~ (m GType), MonadIO m) => O.MethodInfo IOExtensionGetTypeMethodInfo IOExtension signature where
overloadedMethod _ = iOExtensionGetType
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveIOExtensionMethod (t :: Symbol) (o :: *) :: * where
ResolveIOExtensionMethod "getName" o = IOExtensionGetNameMethodInfo
ResolveIOExtensionMethod "getPriority" o = IOExtensionGetPriorityMethodInfo
ResolveIOExtensionMethod "getType" o = IOExtensionGetTypeMethodInfo
ResolveIOExtensionMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveIOExtensionMethod t IOExtension, O.MethodInfo info IOExtension p) => O.IsLabelProxy t (IOExtension -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveIOExtensionMethod t IOExtension, O.MethodInfo info IOExtension p) => O.IsLabel t (IOExtension -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#endif