#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.ZlibCompressor
(
ZlibCompressor(..) ,
IsZlibCompressor ,
toZlibCompressor ,
noZlibCompressor ,
#if ENABLE_OVERLOADING
ZlibCompressorGetFileInfoMethodInfo ,
#endif
zlibCompressorGetFileInfo ,
zlibCompressorNew ,
#if ENABLE_OVERLOADING
ZlibCompressorSetFileInfoMethodInfo ,
#endif
zlibCompressorSetFileInfo ,
#if ENABLE_OVERLOADING
ZlibCompressorFileInfoPropertyInfo ,
#endif
clearZlibCompressorFileInfo ,
constructZlibCompressorFileInfo ,
getZlibCompressorFileInfo ,
setZlibCompressorFileInfo ,
#if ENABLE_OVERLOADING
zlibCompressorFileInfo ,
#endif
#if ENABLE_OVERLOADING
ZlibCompressorFormatPropertyInfo ,
#endif
constructZlibCompressorFormat ,
getZlibCompressorFormat ,
#if ENABLE_OVERLOADING
zlibCompressorFormat ,
#endif
#if ENABLE_OVERLOADING
ZlibCompressorLevelPropertyInfo ,
#endif
constructZlibCompressorLevel ,
getZlibCompressorLevel ,
#if ENABLE_OVERLOADING
zlibCompressorLevel ,
#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 ZlibCompressor = ZlibCompressor (ManagedPtr ZlibCompressor)
foreign import ccall "g_zlib_compressor_get_type"
c_g_zlib_compressor_get_type :: IO GType
instance GObject ZlibCompressor where
gobjectType _ = c_g_zlib_compressor_get_type
class GObject o => IsZlibCompressor o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError ZlibCompressor a) =>
IsZlibCompressor a
#endif
instance IsZlibCompressor ZlibCompressor
instance GObject.Object.IsObject ZlibCompressor
instance Gio.Converter.IsConverter ZlibCompressor
toZlibCompressor :: (MonadIO m, IsZlibCompressor o) => o -> m ZlibCompressor
toZlibCompressor = liftIO . unsafeCastTo ZlibCompressor
noZlibCompressor :: Maybe ZlibCompressor
noZlibCompressor = Nothing
#if ENABLE_OVERLOADING
type family ResolveZlibCompressorMethod (t :: Symbol) (o :: *) :: * where
ResolveZlibCompressorMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveZlibCompressorMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveZlibCompressorMethod "convert" o = Gio.Converter.ConverterConvertMethodInfo
ResolveZlibCompressorMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveZlibCompressorMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveZlibCompressorMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveZlibCompressorMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveZlibCompressorMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveZlibCompressorMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveZlibCompressorMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveZlibCompressorMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveZlibCompressorMethod "reset" o = Gio.Converter.ConverterResetMethodInfo
ResolveZlibCompressorMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveZlibCompressorMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveZlibCompressorMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveZlibCompressorMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveZlibCompressorMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveZlibCompressorMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveZlibCompressorMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveZlibCompressorMethod "getFileInfo" o = ZlibCompressorGetFileInfoMethodInfo
ResolveZlibCompressorMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveZlibCompressorMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveZlibCompressorMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveZlibCompressorMethod "setFileInfo" o = ZlibCompressorSetFileInfoMethodInfo
ResolveZlibCompressorMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveZlibCompressorMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveZlibCompressorMethod t ZlibCompressor, O.MethodInfo info ZlibCompressor p) => O.IsLabelProxy t (ZlibCompressor -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveZlibCompressorMethod t ZlibCompressor, O.MethodInfo info ZlibCompressor p) => O.IsLabel t (ZlibCompressor -> 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
getZlibCompressorFileInfo :: (MonadIO m, IsZlibCompressor o) => o -> m Gio.FileInfo.FileInfo
getZlibCompressorFileInfo obj = liftIO $ checkUnexpectedNothing "getZlibCompressorFileInfo" $ getObjectPropertyObject obj "file-info" Gio.FileInfo.FileInfo
setZlibCompressorFileInfo :: (MonadIO m, IsZlibCompressor o, Gio.FileInfo.IsFileInfo a) => o -> a -> m ()
setZlibCompressorFileInfo obj val = liftIO $ setObjectPropertyObject obj "file-info" (Just val)
constructZlibCompressorFileInfo :: (IsZlibCompressor o, Gio.FileInfo.IsFileInfo a) => a -> IO (GValueConstruct o)
constructZlibCompressorFileInfo val = constructObjectPropertyObject "file-info" (Just val)
clearZlibCompressorFileInfo :: (MonadIO m, IsZlibCompressor o) => o -> m ()
clearZlibCompressorFileInfo obj = liftIO $ setObjectPropertyObject obj "file-info" (Nothing :: Maybe Gio.FileInfo.FileInfo)
#if ENABLE_OVERLOADING
data ZlibCompressorFileInfoPropertyInfo
instance AttrInfo ZlibCompressorFileInfoPropertyInfo where
type AttrAllowedOps ZlibCompressorFileInfoPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ZlibCompressorFileInfoPropertyInfo = Gio.FileInfo.IsFileInfo
type AttrBaseTypeConstraint ZlibCompressorFileInfoPropertyInfo = IsZlibCompressor
type AttrGetType ZlibCompressorFileInfoPropertyInfo = Gio.FileInfo.FileInfo
type AttrLabel ZlibCompressorFileInfoPropertyInfo = "file-info"
type AttrOrigin ZlibCompressorFileInfoPropertyInfo = ZlibCompressor
attrGet _ = getZlibCompressorFileInfo
attrSet _ = setZlibCompressorFileInfo
attrConstruct _ = constructZlibCompressorFileInfo
attrClear _ = clearZlibCompressorFileInfo
#endif
getZlibCompressorFormat :: (MonadIO m, IsZlibCompressor o) => o -> m Gio.Enums.ZlibCompressorFormat
getZlibCompressorFormat obj = liftIO $ getObjectPropertyEnum obj "format"
constructZlibCompressorFormat :: (IsZlibCompressor o) => Gio.Enums.ZlibCompressorFormat -> IO (GValueConstruct o)
constructZlibCompressorFormat val = constructObjectPropertyEnum "format" val
#if ENABLE_OVERLOADING
data ZlibCompressorFormatPropertyInfo
instance AttrInfo ZlibCompressorFormatPropertyInfo where
type AttrAllowedOps ZlibCompressorFormatPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint ZlibCompressorFormatPropertyInfo = (~) Gio.Enums.ZlibCompressorFormat
type AttrBaseTypeConstraint ZlibCompressorFormatPropertyInfo = IsZlibCompressor
type AttrGetType ZlibCompressorFormatPropertyInfo = Gio.Enums.ZlibCompressorFormat
type AttrLabel ZlibCompressorFormatPropertyInfo = "format"
type AttrOrigin ZlibCompressorFormatPropertyInfo = ZlibCompressor
attrGet _ = getZlibCompressorFormat
attrSet _ = undefined
attrConstruct _ = constructZlibCompressorFormat
attrClear _ = undefined
#endif
getZlibCompressorLevel :: (MonadIO m, IsZlibCompressor o) => o -> m Int32
getZlibCompressorLevel obj = liftIO $ getObjectPropertyInt32 obj "level"
constructZlibCompressorLevel :: (IsZlibCompressor o) => Int32 -> IO (GValueConstruct o)
constructZlibCompressorLevel val = constructObjectPropertyInt32 "level" val
#if ENABLE_OVERLOADING
data ZlibCompressorLevelPropertyInfo
instance AttrInfo ZlibCompressorLevelPropertyInfo where
type AttrAllowedOps ZlibCompressorLevelPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint ZlibCompressorLevelPropertyInfo = (~) Int32
type AttrBaseTypeConstraint ZlibCompressorLevelPropertyInfo = IsZlibCompressor
type AttrGetType ZlibCompressorLevelPropertyInfo = Int32
type AttrLabel ZlibCompressorLevelPropertyInfo = "level"
type AttrOrigin ZlibCompressorLevelPropertyInfo = ZlibCompressor
attrGet _ = getZlibCompressorLevel
attrSet _ = undefined
attrConstruct _ = constructZlibCompressorLevel
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList ZlibCompressor
type instance O.AttributeList ZlibCompressor = ZlibCompressorAttributeList
type ZlibCompressorAttributeList = ('[ '("fileInfo", ZlibCompressorFileInfoPropertyInfo), '("format", ZlibCompressorFormatPropertyInfo), '("level", ZlibCompressorLevelPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
zlibCompressorFileInfo :: AttrLabelProxy "fileInfo"
zlibCompressorFileInfo = AttrLabelProxy
zlibCompressorFormat :: AttrLabelProxy "format"
zlibCompressorFormat = AttrLabelProxy
zlibCompressorLevel :: AttrLabelProxy "level"
zlibCompressorLevel = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList ZlibCompressor = ZlibCompressorSignalList
type ZlibCompressorSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_zlib_compressor_new" g_zlib_compressor_new ::
CUInt ->
Int32 ->
IO (Ptr ZlibCompressor)
zlibCompressorNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
Gio.Enums.ZlibCompressorFormat
-> Int32
-> m ZlibCompressor
zlibCompressorNew format level = liftIO $ do
let format' = (fromIntegral . fromEnum) format
result <- g_zlib_compressor_new format' level
checkUnexpectedReturnNULL "zlibCompressorNew" result
result' <- (wrapObject ZlibCompressor) result
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_zlib_compressor_get_file_info" g_zlib_compressor_get_file_info ::
Ptr ZlibCompressor ->
IO (Ptr Gio.FileInfo.FileInfo)
zlibCompressorGetFileInfo ::
(B.CallStack.HasCallStack, MonadIO m, IsZlibCompressor a) =>
a
-> m Gio.FileInfo.FileInfo
zlibCompressorGetFileInfo compressor = liftIO $ do
compressor' <- unsafeManagedPtrCastPtr compressor
result <- g_zlib_compressor_get_file_info compressor'
checkUnexpectedReturnNULL "zlibCompressorGetFileInfo" result
result' <- (newObject Gio.FileInfo.FileInfo) result
touchManagedPtr compressor
return result'
#if ENABLE_OVERLOADING
data ZlibCompressorGetFileInfoMethodInfo
instance (signature ~ (m Gio.FileInfo.FileInfo), MonadIO m, IsZlibCompressor a) => O.MethodInfo ZlibCompressorGetFileInfoMethodInfo a signature where
overloadedMethod _ = zlibCompressorGetFileInfo
#endif
foreign import ccall "g_zlib_compressor_set_file_info" g_zlib_compressor_set_file_info ::
Ptr ZlibCompressor ->
Ptr Gio.FileInfo.FileInfo ->
IO ()
zlibCompressorSetFileInfo ::
(B.CallStack.HasCallStack, MonadIO m, IsZlibCompressor a, Gio.FileInfo.IsFileInfo b) =>
a
-> Maybe (b)
-> m ()
zlibCompressorSetFileInfo compressor fileInfo = liftIO $ do
compressor' <- unsafeManagedPtrCastPtr compressor
maybeFileInfo <- case fileInfo of
Nothing -> return nullPtr
Just jFileInfo -> do
jFileInfo' <- unsafeManagedPtrCastPtr jFileInfo
return jFileInfo'
g_zlib_compressor_set_file_info compressor' maybeFileInfo
touchManagedPtr compressor
whenJust fileInfo touchManagedPtr
return ()
#if ENABLE_OVERLOADING
data ZlibCompressorSetFileInfoMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsZlibCompressor a, Gio.FileInfo.IsFileInfo b) => O.MethodInfo ZlibCompressorSetFileInfoMethodInfo a signature where
overloadedMethod _ = zlibCompressorSetFileInfo
#endif