#define ENABLE_OVERLOADING \
(!defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.ZlibDecompressor
(
ZlibDecompressor(..) ,
IsZlibDecompressor ,
toZlibDecompressor ,
noZlibDecompressor ,
#if ENABLE_OVERLOADING
ZlibDecompressorGetFileInfoMethodInfo ,
#endif
zlibDecompressorGetFileInfo ,
zlibDecompressorNew ,
#if ENABLE_OVERLOADING
ZlibDecompressorFileInfoPropertyInfo ,
#endif
getZlibDecompressorFileInfo ,
#if ENABLE_OVERLOADING
zlibDecompressorFileInfo ,
#endif
#if ENABLE_OVERLOADING
ZlibDecompressorFormatPropertyInfo ,
#endif
constructZlibDecompressorFormat ,
getZlibDecompressorFormat ,
#if ENABLE_OVERLOADING
zlibDecompressorFormat ,
#endif
) 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.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.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Converter as Gio.Converter
import {-# SOURCE #-} qualified GI.Gio.Objects.FileInfo as Gio.FileInfo
newtype ZlibDecompressor = ZlibDecompressor (ManagedPtr ZlibDecompressor)
foreign import ccall "g_zlib_decompressor_get_type"
c_g_zlib_decompressor_get_type :: IO GType
instance GObject ZlibDecompressor where
gobjectType :: ZlibDecompressor -> IO GType
gobjectType _ = IO GType
c_g_zlib_decompressor_get_type
class GObject o => IsZlibDecompressor o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError ZlibDecompressor a) =>
IsZlibDecompressor a
#endif
instance IsZlibDecompressor ZlibDecompressor
instance GObject.Object.IsObject ZlibDecompressor
instance Gio.Converter.IsConverter ZlibDecompressor
toZlibDecompressor :: (MonadIO m, IsZlibDecompressor o) => o -> m ZlibDecompressor
toZlibDecompressor :: o -> m ZlibDecompressor
toZlibDecompressor = IO ZlibDecompressor -> m ZlibDecompressor
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ZlibDecompressor -> m ZlibDecompressor)
-> (o -> IO ZlibDecompressor) -> o -> m ZlibDecompressor
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr ZlibDecompressor -> ZlibDecompressor)
-> o -> IO ZlibDecompressor
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr ZlibDecompressor -> ZlibDecompressor
ZlibDecompressor
noZlibDecompressor :: Maybe ZlibDecompressor
noZlibDecompressor :: Maybe ZlibDecompressor
noZlibDecompressor = Maybe ZlibDecompressor
forall a. Maybe a
Nothing
#if ENABLE_OVERLOADING
type family ResolveZlibDecompressorMethod (t :: Symbol) (o :: *) :: * where
ResolveZlibDecompressorMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveZlibDecompressorMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveZlibDecompressorMethod "convert" o = Gio.Converter.ConverterConvertMethodInfo
ResolveZlibDecompressorMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveZlibDecompressorMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveZlibDecompressorMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveZlibDecompressorMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveZlibDecompressorMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveZlibDecompressorMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveZlibDecompressorMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveZlibDecompressorMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveZlibDecompressorMethod "reset" o = Gio.Converter.ConverterResetMethodInfo
ResolveZlibDecompressorMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveZlibDecompressorMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveZlibDecompressorMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveZlibDecompressorMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveZlibDecompressorMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveZlibDecompressorMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveZlibDecompressorMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveZlibDecompressorMethod "getFileInfo" o = ZlibDecompressorGetFileInfoMethodInfo
ResolveZlibDecompressorMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveZlibDecompressorMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveZlibDecompressorMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveZlibDecompressorMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveZlibDecompressorMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveZlibDecompressorMethod t ZlibDecompressor, O.MethodInfo info ZlibDecompressor p) => O.IsLabelProxy t (ZlibDecompressor -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveZlibDecompressorMethod t ZlibDecompressor, O.MethodInfo info ZlibDecompressor p) => O.IsLabel t (ZlibDecompressor -> 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
getZlibDecompressorFileInfo :: (MonadIO m, IsZlibDecompressor o) => o -> m Gio.FileInfo.FileInfo
getZlibDecompressorFileInfo :: o -> m FileInfo
getZlibDecompressorFileInfo obj :: o
obj = IO FileInfo -> m FileInfo
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FileInfo -> m FileInfo) -> IO FileInfo -> m FileInfo
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe FileInfo) -> IO FileInfo
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getZlibDecompressorFileInfo" (IO (Maybe FileInfo) -> IO FileInfo)
-> IO (Maybe FileInfo) -> IO FileInfo
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr FileInfo -> FileInfo)
-> IO (Maybe FileInfo)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
getObjectPropertyObject o
obj "file-info" ManagedPtr FileInfo -> FileInfo
Gio.FileInfo.FileInfo
#if ENABLE_OVERLOADING
data ZlibDecompressorFileInfoPropertyInfo
instance AttrInfo ZlibDecompressorFileInfoPropertyInfo where
type AttrAllowedOps ZlibDecompressorFileInfoPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ZlibDecompressorFileInfoPropertyInfo = (~) ()
type AttrBaseTypeConstraint ZlibDecompressorFileInfoPropertyInfo = IsZlibDecompressor
type AttrGetType ZlibDecompressorFileInfoPropertyInfo = Gio.FileInfo.FileInfo
type AttrLabel ZlibDecompressorFileInfoPropertyInfo = "file-info"
type AttrOrigin ZlibDecompressorFileInfoPropertyInfo = ZlibDecompressor
attrGet _ = getZlibDecompressorFileInfo
attrSet _ = undefined
attrConstruct _ = undefined
attrClear _ = undefined
#endif
getZlibDecompressorFormat :: (MonadIO m, IsZlibDecompressor o) => o -> m Gio.Enums.ZlibCompressorFormat
getZlibDecompressorFormat :: o -> m ZlibCompressorFormat
getZlibDecompressorFormat obj :: o
obj = IO ZlibCompressorFormat -> m ZlibCompressorFormat
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ZlibCompressorFormat -> m ZlibCompressorFormat)
-> IO ZlibCompressorFormat -> m ZlibCompressorFormat
forall a b. (a -> b) -> a -> b
$ o -> String -> IO ZlibCompressorFormat
forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
getObjectPropertyEnum o
obj "format"
constructZlibDecompressorFormat :: (IsZlibDecompressor o) => Gio.Enums.ZlibCompressorFormat -> IO (GValueConstruct o)
constructZlibDecompressorFormat :: ZlibCompressorFormat -> IO (GValueConstruct o)
constructZlibDecompressorFormat val :: ZlibCompressorFormat
val = String -> ZlibCompressorFormat -> IO (GValueConstruct o)
forall a o.
(Enum a, BoxedEnum a) =>
String -> a -> IO (GValueConstruct o)
constructObjectPropertyEnum "format" ZlibCompressorFormat
val
#if ENABLE_OVERLOADING
data ZlibDecompressorFormatPropertyInfo
instance AttrInfo ZlibDecompressorFormatPropertyInfo where
type AttrAllowedOps ZlibDecompressorFormatPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint ZlibDecompressorFormatPropertyInfo = (~) Gio.Enums.ZlibCompressorFormat
type AttrBaseTypeConstraint ZlibDecompressorFormatPropertyInfo = IsZlibDecompressor
type AttrGetType ZlibDecompressorFormatPropertyInfo = Gio.Enums.ZlibCompressorFormat
type AttrLabel ZlibDecompressorFormatPropertyInfo = "format"
type AttrOrigin ZlibDecompressorFormatPropertyInfo = ZlibDecompressor
attrGet _ = getZlibDecompressorFormat
attrSet _ = undefined
attrConstruct _ = constructZlibDecompressorFormat
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList ZlibDecompressor
type instance O.AttributeList ZlibDecompressor = ZlibDecompressorAttributeList
type ZlibDecompressorAttributeList = ('[ '("fileInfo", ZlibDecompressorFileInfoPropertyInfo), '("format", ZlibDecompressorFormatPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
zlibDecompressorFileInfo :: AttrLabelProxy "fileInfo"
zlibDecompressorFileInfo = AttrLabelProxy
zlibDecompressorFormat :: AttrLabelProxy "format"
zlibDecompressorFormat = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList ZlibDecompressor = ZlibDecompressorSignalList
type ZlibDecompressorSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_zlib_decompressor_new" g_zlib_decompressor_new ::
CUInt ->
IO (Ptr ZlibDecompressor)
zlibDecompressorNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
Gio.Enums.ZlibCompressorFormat
-> m ZlibDecompressor
zlibDecompressorNew :: ZlibCompressorFormat -> m ZlibDecompressor
zlibDecompressorNew format :: ZlibCompressorFormat
format = IO ZlibDecompressor -> m ZlibDecompressor
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ZlibDecompressor -> m ZlibDecompressor)
-> IO ZlibDecompressor -> m ZlibDecompressor
forall a b. (a -> b) -> a -> b
$ do
let format' :: CUInt
format' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (ZlibCompressorFormat -> Int) -> ZlibCompressorFormat -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ZlibCompressorFormat -> Int
forall a. Enum a => a -> Int
fromEnum) ZlibCompressorFormat
format
Ptr ZlibDecompressor
result <- CUInt -> IO (Ptr ZlibDecompressor)
g_zlib_decompressor_new CUInt
format'
Text -> Ptr ZlibDecompressor -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "zlibDecompressorNew" Ptr ZlibDecompressor
result
ZlibDecompressor
result' <- ((ManagedPtr ZlibDecompressor -> ZlibDecompressor)
-> Ptr ZlibDecompressor -> IO ZlibDecompressor
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr ZlibDecompressor -> ZlibDecompressor
ZlibDecompressor) Ptr ZlibDecompressor
result
ZlibDecompressor -> IO ZlibDecompressor
forall (m :: * -> *) a. Monad m => a -> m a
return ZlibDecompressor
result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_zlib_decompressor_get_file_info" g_zlib_decompressor_get_file_info ::
Ptr ZlibDecompressor ->
IO (Ptr Gio.FileInfo.FileInfo)
zlibDecompressorGetFileInfo ::
(B.CallStack.HasCallStack, MonadIO m, IsZlibDecompressor a) =>
a
-> m Gio.FileInfo.FileInfo
zlibDecompressorGetFileInfo :: a -> m FileInfo
zlibDecompressorGetFileInfo decompressor :: a
decompressor = IO FileInfo -> m FileInfo
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FileInfo -> m FileInfo) -> IO FileInfo -> m FileInfo
forall a b. (a -> b) -> a -> b
$ do
Ptr ZlibDecompressor
decompressor' <- a -> IO (Ptr ZlibDecompressor)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
decompressor
Ptr FileInfo
result <- Ptr ZlibDecompressor -> IO (Ptr FileInfo)
g_zlib_decompressor_get_file_info Ptr ZlibDecompressor
decompressor'
Text -> Ptr FileInfo -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "zlibDecompressorGetFileInfo" Ptr FileInfo
result
FileInfo
result' <- ((ManagedPtr FileInfo -> FileInfo) -> Ptr FileInfo -> IO FileInfo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr FileInfo -> FileInfo
Gio.FileInfo.FileInfo) Ptr FileInfo
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
decompressor
FileInfo -> IO FileInfo
forall (m :: * -> *) a. Monad m => a -> m a
return FileInfo
result'
#if ENABLE_OVERLOADING
data ZlibDecompressorGetFileInfoMethodInfo
instance (signature ~ (m Gio.FileInfo.FileInfo), MonadIO m, IsZlibDecompressor a) => O.MethodInfo ZlibDecompressorGetFileInfoMethodInfo a signature where
overloadedMethod _ = zlibDecompressorGetFileInfo
#endif