#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Structs.FileAttributeInfoList
(
FileAttributeInfoList(..) ,
newZeroFileAttributeInfoList ,
noFileAttributeInfoList ,
#if ENABLE_OVERLOADING
FileAttributeInfoListAddMethodInfo ,
#endif
fileAttributeInfoListAdd ,
#if ENABLE_OVERLOADING
FileAttributeInfoListDupMethodInfo ,
#endif
fileAttributeInfoListDup ,
#if ENABLE_OVERLOADING
FileAttributeInfoListLookupMethodInfo ,
#endif
fileAttributeInfoListLookup ,
fileAttributeInfoListNew ,
#if ENABLE_OVERLOADING
FileAttributeInfoListRefMethodInfo ,
#endif
fileAttributeInfoListRef ,
#if ENABLE_OVERLOADING
FileAttributeInfoListUnrefMethodInfo ,
#endif
fileAttributeInfoListUnref ,
clearFileAttributeInfoListInfos ,
#if ENABLE_OVERLOADING
fileAttributeInfoList_infos ,
#endif
getFileAttributeInfoListInfos ,
setFileAttributeInfoListInfos ,
#if ENABLE_OVERLOADING
fileAttributeInfoList_nInfos ,
#endif
getFileAttributeInfoListNInfos ,
setFileAttributeInfoListNInfos ,
) 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.GClosure as B.GClosure
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.GI.Base.Properties as B.Properties
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 {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
import {-# SOURCE #-} qualified GI.Gio.Structs.FileAttributeInfo as Gio.FileAttributeInfo
newtype FileAttributeInfoList = FileAttributeInfoList (ManagedPtr FileAttributeInfoList)
foreign import ccall "g_file_attribute_info_list_get_type" c_g_file_attribute_info_list_get_type ::
IO GType
instance BoxedObject FileAttributeInfoList where
boxedType _ = c_g_file_attribute_info_list_get_type
newZeroFileAttributeInfoList :: MonadIO m => m FileAttributeInfoList
newZeroFileAttributeInfoList = liftIO $ callocBoxedBytes 16 >>= wrapBoxed FileAttributeInfoList
instance tag ~ 'AttrSet => Constructible FileAttributeInfoList tag where
new _ attrs = do
o <- newZeroFileAttributeInfoList
GI.Attributes.set o attrs
return o
noFileAttributeInfoList :: Maybe FileAttributeInfoList
noFileAttributeInfoList = Nothing
getFileAttributeInfoListInfos :: MonadIO m => FileAttributeInfoList -> m (Maybe Gio.FileAttributeInfo.FileAttributeInfo)
getFileAttributeInfoListInfos s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO (Ptr Gio.FileAttributeInfo.FileAttributeInfo)
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- (newPtr Gio.FileAttributeInfo.FileAttributeInfo) val'
return val''
return result
setFileAttributeInfoListInfos :: MonadIO m => FileAttributeInfoList -> Ptr Gio.FileAttributeInfo.FileAttributeInfo -> m ()
setFileAttributeInfoListInfos s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (val :: Ptr Gio.FileAttributeInfo.FileAttributeInfo)
clearFileAttributeInfoListInfos :: MonadIO m => FileAttributeInfoList -> m ()
clearFileAttributeInfoListInfos s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (FP.nullPtr :: Ptr Gio.FileAttributeInfo.FileAttributeInfo)
#if ENABLE_OVERLOADING
data FileAttributeInfoListInfosFieldInfo
instance AttrInfo FileAttributeInfoListInfosFieldInfo where
type AttrAllowedOps FileAttributeInfoListInfosFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint FileAttributeInfoListInfosFieldInfo = (~) (Ptr Gio.FileAttributeInfo.FileAttributeInfo)
type AttrBaseTypeConstraint FileAttributeInfoListInfosFieldInfo = (~) FileAttributeInfoList
type AttrGetType FileAttributeInfoListInfosFieldInfo = Maybe Gio.FileAttributeInfo.FileAttributeInfo
type AttrLabel FileAttributeInfoListInfosFieldInfo = "infos"
type AttrOrigin FileAttributeInfoListInfosFieldInfo = FileAttributeInfoList
attrGet _ = getFileAttributeInfoListInfos
attrSet _ = setFileAttributeInfoListInfos
attrConstruct = undefined
attrClear _ = clearFileAttributeInfoListInfos
fileAttributeInfoList_infos :: AttrLabelProxy "infos"
fileAttributeInfoList_infos = AttrLabelProxy
#endif
getFileAttributeInfoListNInfos :: MonadIO m => FileAttributeInfoList -> m Int32
getFileAttributeInfoListNInfos s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO Int32
return val
setFileAttributeInfoListNInfos :: MonadIO m => FileAttributeInfoList -> Int32 -> m ()
setFileAttributeInfoListNInfos s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: Int32)
#if ENABLE_OVERLOADING
data FileAttributeInfoListNInfosFieldInfo
instance AttrInfo FileAttributeInfoListNInfosFieldInfo where
type AttrAllowedOps FileAttributeInfoListNInfosFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint FileAttributeInfoListNInfosFieldInfo = (~) Int32
type AttrBaseTypeConstraint FileAttributeInfoListNInfosFieldInfo = (~) FileAttributeInfoList
type AttrGetType FileAttributeInfoListNInfosFieldInfo = Int32
type AttrLabel FileAttributeInfoListNInfosFieldInfo = "n_infos"
type AttrOrigin FileAttributeInfoListNInfosFieldInfo = FileAttributeInfoList
attrGet _ = getFileAttributeInfoListNInfos
attrSet _ = setFileAttributeInfoListNInfos
attrConstruct = undefined
attrClear _ = undefined
fileAttributeInfoList_nInfos :: AttrLabelProxy "nInfos"
fileAttributeInfoList_nInfos = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList FileAttributeInfoList
type instance O.AttributeList FileAttributeInfoList = FileAttributeInfoListAttributeList
type FileAttributeInfoListAttributeList = ('[ '("infos", FileAttributeInfoListInfosFieldInfo), '("nInfos", FileAttributeInfoListNInfosFieldInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_file_attribute_info_list_new" g_file_attribute_info_list_new ::
IO (Ptr FileAttributeInfoList)
fileAttributeInfoListNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m FileAttributeInfoList
fileAttributeInfoListNew = liftIO $ do
result <- g_file_attribute_info_list_new
checkUnexpectedReturnNULL "fileAttributeInfoListNew" result
result' <- (wrapBoxed FileAttributeInfoList) result
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "g_file_attribute_info_list_add" g_file_attribute_info_list_add ::
Ptr FileAttributeInfoList ->
CString ->
CUInt ->
CUInt ->
IO ()
fileAttributeInfoListAdd ::
(B.CallStack.HasCallStack, MonadIO m) =>
FileAttributeInfoList
-> T.Text
-> Gio.Enums.FileAttributeType
-> [Gio.Flags.FileAttributeInfoFlags]
-> m ()
fileAttributeInfoListAdd list name type_ flags = liftIO $ do
list' <- unsafeManagedPtrGetPtr list
name' <- textToCString name
let type_' = (fromIntegral . fromEnum) type_
let flags' = gflagsToWord flags
g_file_attribute_info_list_add list' name' type_' flags'
touchManagedPtr list
freeMem name'
return ()
#if ENABLE_OVERLOADING
data FileAttributeInfoListAddMethodInfo
instance (signature ~ (T.Text -> Gio.Enums.FileAttributeType -> [Gio.Flags.FileAttributeInfoFlags] -> m ()), MonadIO m) => O.MethodInfo FileAttributeInfoListAddMethodInfo FileAttributeInfoList signature where
overloadedMethod _ = fileAttributeInfoListAdd
#endif
foreign import ccall "g_file_attribute_info_list_dup" g_file_attribute_info_list_dup ::
Ptr FileAttributeInfoList ->
IO (Ptr FileAttributeInfoList)
fileAttributeInfoListDup ::
(B.CallStack.HasCallStack, MonadIO m) =>
FileAttributeInfoList
-> m FileAttributeInfoList
fileAttributeInfoListDup list = liftIO $ do
list' <- unsafeManagedPtrGetPtr list
result <- g_file_attribute_info_list_dup list'
checkUnexpectedReturnNULL "fileAttributeInfoListDup" result
result' <- (wrapBoxed FileAttributeInfoList) result
touchManagedPtr list
return result'
#if ENABLE_OVERLOADING
data FileAttributeInfoListDupMethodInfo
instance (signature ~ (m FileAttributeInfoList), MonadIO m) => O.MethodInfo FileAttributeInfoListDupMethodInfo FileAttributeInfoList signature where
overloadedMethod _ = fileAttributeInfoListDup
#endif
foreign import ccall "g_file_attribute_info_list_lookup" g_file_attribute_info_list_lookup ::
Ptr FileAttributeInfoList ->
CString ->
IO (Ptr Gio.FileAttributeInfo.FileAttributeInfo)
fileAttributeInfoListLookup ::
(B.CallStack.HasCallStack, MonadIO m) =>
FileAttributeInfoList
-> T.Text
-> m Gio.FileAttributeInfo.FileAttributeInfo
fileAttributeInfoListLookup list name = liftIO $ do
list' <- unsafeManagedPtrGetPtr list
name' <- textToCString name
result <- g_file_attribute_info_list_lookup list' name'
checkUnexpectedReturnNULL "fileAttributeInfoListLookup" result
result' <- (newPtr Gio.FileAttributeInfo.FileAttributeInfo) result
touchManagedPtr list
freeMem name'
return result'
#if ENABLE_OVERLOADING
data FileAttributeInfoListLookupMethodInfo
instance (signature ~ (T.Text -> m Gio.FileAttributeInfo.FileAttributeInfo), MonadIO m) => O.MethodInfo FileAttributeInfoListLookupMethodInfo FileAttributeInfoList signature where
overloadedMethod _ = fileAttributeInfoListLookup
#endif
foreign import ccall "g_file_attribute_info_list_ref" g_file_attribute_info_list_ref ::
Ptr FileAttributeInfoList ->
IO (Ptr FileAttributeInfoList)
fileAttributeInfoListRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
FileAttributeInfoList
-> m FileAttributeInfoList
fileAttributeInfoListRef list = liftIO $ do
list' <- unsafeManagedPtrGetPtr list
result <- g_file_attribute_info_list_ref list'
checkUnexpectedReturnNULL "fileAttributeInfoListRef" result
result' <- (wrapBoxed FileAttributeInfoList) result
touchManagedPtr list
return result'
#if ENABLE_OVERLOADING
data FileAttributeInfoListRefMethodInfo
instance (signature ~ (m FileAttributeInfoList), MonadIO m) => O.MethodInfo FileAttributeInfoListRefMethodInfo FileAttributeInfoList signature where
overloadedMethod _ = fileAttributeInfoListRef
#endif
foreign import ccall "g_file_attribute_info_list_unref" g_file_attribute_info_list_unref ::
Ptr FileAttributeInfoList ->
IO ()
fileAttributeInfoListUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
FileAttributeInfoList
-> m ()
fileAttributeInfoListUnref list = liftIO $ do
list' <- unsafeManagedPtrGetPtr list
g_file_attribute_info_list_unref list'
touchManagedPtr list
return ()
#if ENABLE_OVERLOADING
data FileAttributeInfoListUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo FileAttributeInfoListUnrefMethodInfo FileAttributeInfoList signature where
overloadedMethod _ = fileAttributeInfoListUnref
#endif
#if ENABLE_OVERLOADING
type family ResolveFileAttributeInfoListMethod (t :: Symbol) (o :: *) :: * where
ResolveFileAttributeInfoListMethod "add" o = FileAttributeInfoListAddMethodInfo
ResolveFileAttributeInfoListMethod "dup" o = FileAttributeInfoListDupMethodInfo
ResolveFileAttributeInfoListMethod "lookup" o = FileAttributeInfoListLookupMethodInfo
ResolveFileAttributeInfoListMethod "ref" o = FileAttributeInfoListRefMethodInfo
ResolveFileAttributeInfoListMethod "unref" o = FileAttributeInfoListUnrefMethodInfo
ResolveFileAttributeInfoListMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveFileAttributeInfoListMethod t FileAttributeInfoList, O.MethodInfo info FileAttributeInfoList p) => OL.IsLabel t (FileAttributeInfoList -> 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