#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gtk.Structs.RecentData
(
RecentData(..) ,
newZeroRecentData ,
noRecentData ,
clearRecentDataAppExec ,
getRecentDataAppExec ,
#if ENABLE_OVERLOADING
recentData_appExec ,
#endif
setRecentDataAppExec ,
clearRecentDataAppName ,
getRecentDataAppName ,
#if ENABLE_OVERLOADING
recentData_appName ,
#endif
setRecentDataAppName ,
clearRecentDataDescription ,
getRecentDataDescription ,
#if ENABLE_OVERLOADING
recentData_description ,
#endif
setRecentDataDescription ,
clearRecentDataDisplayName ,
getRecentDataDisplayName ,
#if ENABLE_OVERLOADING
recentData_displayName ,
#endif
setRecentDataDisplayName ,
clearRecentDataGroups ,
getRecentDataGroups ,
#if ENABLE_OVERLOADING
recentData_groups ,
#endif
setRecentDataGroups ,
getRecentDataIsPrivate ,
#if ENABLE_OVERLOADING
recentData_isPrivate ,
#endif
setRecentDataIsPrivate ,
clearRecentDataMimeType ,
getRecentDataMimeType ,
#if ENABLE_OVERLOADING
recentData_mimeType ,
#endif
setRecentDataMimeType ,
) 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
newtype RecentData = RecentData (ManagedPtr RecentData)
instance WrappedPtr RecentData where
wrappedPtrCalloc = callocBytes 56
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 56 >=> wrapPtr RecentData)
wrappedPtrFree = Just ptr_to_g_free
newZeroRecentData :: MonadIO m => m RecentData
newZeroRecentData = liftIO $ wrappedPtrCalloc >>= wrapPtr RecentData
instance tag ~ 'AttrSet => Constructible RecentData tag where
new _ attrs = do
o <- newZeroRecentData
GI.Attributes.set o attrs
return o
noRecentData :: Maybe RecentData
noRecentData = Nothing
getRecentDataDisplayName :: MonadIO m => RecentData -> m (Maybe T.Text)
getRecentDataDisplayName s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setRecentDataDisplayName :: MonadIO m => RecentData -> CString -> m ()
setRecentDataDisplayName s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (val :: CString)
clearRecentDataDisplayName :: MonadIO m => RecentData -> m ()
clearRecentDataDisplayName s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data RecentDataDisplayNameFieldInfo
instance AttrInfo RecentDataDisplayNameFieldInfo where
type AttrAllowedOps RecentDataDisplayNameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint RecentDataDisplayNameFieldInfo = (~) CString
type AttrBaseTypeConstraint RecentDataDisplayNameFieldInfo = (~) RecentData
type AttrGetType RecentDataDisplayNameFieldInfo = Maybe T.Text
type AttrLabel RecentDataDisplayNameFieldInfo = "display_name"
type AttrOrigin RecentDataDisplayNameFieldInfo = RecentData
attrGet _ = getRecentDataDisplayName
attrSet _ = setRecentDataDisplayName
attrConstruct = undefined
attrClear _ = clearRecentDataDisplayName
recentData_displayName :: AttrLabelProxy "displayName"
recentData_displayName = AttrLabelProxy
#endif
getRecentDataDescription :: MonadIO m => RecentData -> m (Maybe T.Text)
getRecentDataDescription s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setRecentDataDescription :: MonadIO m => RecentData -> CString -> m ()
setRecentDataDescription s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: CString)
clearRecentDataDescription :: MonadIO m => RecentData -> m ()
clearRecentDataDescription s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data RecentDataDescriptionFieldInfo
instance AttrInfo RecentDataDescriptionFieldInfo where
type AttrAllowedOps RecentDataDescriptionFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint RecentDataDescriptionFieldInfo = (~) CString
type AttrBaseTypeConstraint RecentDataDescriptionFieldInfo = (~) RecentData
type AttrGetType RecentDataDescriptionFieldInfo = Maybe T.Text
type AttrLabel RecentDataDescriptionFieldInfo = "description"
type AttrOrigin RecentDataDescriptionFieldInfo = RecentData
attrGet _ = getRecentDataDescription
attrSet _ = setRecentDataDescription
attrConstruct = undefined
attrClear _ = clearRecentDataDescription
recentData_description :: AttrLabelProxy "description"
recentData_description = AttrLabelProxy
#endif
getRecentDataMimeType :: MonadIO m => RecentData -> m (Maybe T.Text)
getRecentDataMimeType s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setRecentDataMimeType :: MonadIO m => RecentData -> CString -> m ()
setRecentDataMimeType s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: CString)
clearRecentDataMimeType :: MonadIO m => RecentData -> m ()
clearRecentDataMimeType s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data RecentDataMimeTypeFieldInfo
instance AttrInfo RecentDataMimeTypeFieldInfo where
type AttrAllowedOps RecentDataMimeTypeFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint RecentDataMimeTypeFieldInfo = (~) CString
type AttrBaseTypeConstraint RecentDataMimeTypeFieldInfo = (~) RecentData
type AttrGetType RecentDataMimeTypeFieldInfo = Maybe T.Text
type AttrLabel RecentDataMimeTypeFieldInfo = "mime_type"
type AttrOrigin RecentDataMimeTypeFieldInfo = RecentData
attrGet _ = getRecentDataMimeType
attrSet _ = setRecentDataMimeType
attrConstruct = undefined
attrClear _ = clearRecentDataMimeType
recentData_mimeType :: AttrLabelProxy "mimeType"
recentData_mimeType = AttrLabelProxy
#endif
getRecentDataAppName :: MonadIO m => RecentData -> m (Maybe T.Text)
getRecentDataAppName s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 24) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setRecentDataAppName :: MonadIO m => RecentData -> CString -> m ()
setRecentDataAppName s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (val :: CString)
clearRecentDataAppName :: MonadIO m => RecentData -> m ()
clearRecentDataAppName s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data RecentDataAppNameFieldInfo
instance AttrInfo RecentDataAppNameFieldInfo where
type AttrAllowedOps RecentDataAppNameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint RecentDataAppNameFieldInfo = (~) CString
type AttrBaseTypeConstraint RecentDataAppNameFieldInfo = (~) RecentData
type AttrGetType RecentDataAppNameFieldInfo = Maybe T.Text
type AttrLabel RecentDataAppNameFieldInfo = "app_name"
type AttrOrigin RecentDataAppNameFieldInfo = RecentData
attrGet _ = getRecentDataAppName
attrSet _ = setRecentDataAppName
attrConstruct = undefined
attrClear _ = clearRecentDataAppName
recentData_appName :: AttrLabelProxy "appName"
recentData_appName = AttrLabelProxy
#endif
getRecentDataAppExec :: MonadIO m => RecentData -> m (Maybe T.Text)
getRecentDataAppExec s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 32) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setRecentDataAppExec :: MonadIO m => RecentData -> CString -> m ()
setRecentDataAppExec s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 32) (val :: CString)
clearRecentDataAppExec :: MonadIO m => RecentData -> m ()
clearRecentDataAppExec s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 32) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data RecentDataAppExecFieldInfo
instance AttrInfo RecentDataAppExecFieldInfo where
type AttrAllowedOps RecentDataAppExecFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint RecentDataAppExecFieldInfo = (~) CString
type AttrBaseTypeConstraint RecentDataAppExecFieldInfo = (~) RecentData
type AttrGetType RecentDataAppExecFieldInfo = Maybe T.Text
type AttrLabel RecentDataAppExecFieldInfo = "app_exec"
type AttrOrigin RecentDataAppExecFieldInfo = RecentData
attrGet _ = getRecentDataAppExec
attrSet _ = setRecentDataAppExec
attrConstruct = undefined
attrClear _ = clearRecentDataAppExec
recentData_appExec :: AttrLabelProxy "appExec"
recentData_appExec = AttrLabelProxy
#endif
getRecentDataGroups :: MonadIO m => RecentData -> m (Maybe [T.Text])
getRecentDataGroups s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 40) :: IO (Ptr CString)
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- unpackZeroTerminatedUTF8CArray val'
return val''
return result
setRecentDataGroups :: MonadIO m => RecentData -> Ptr CString -> m ()
setRecentDataGroups s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 40) (val :: Ptr CString)
clearRecentDataGroups :: MonadIO m => RecentData -> m ()
clearRecentDataGroups s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 40) (FP.nullPtr :: Ptr CString)
#if ENABLE_OVERLOADING
data RecentDataGroupsFieldInfo
instance AttrInfo RecentDataGroupsFieldInfo where
type AttrAllowedOps RecentDataGroupsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint RecentDataGroupsFieldInfo = (~) (Ptr CString)
type AttrBaseTypeConstraint RecentDataGroupsFieldInfo = (~) RecentData
type AttrGetType RecentDataGroupsFieldInfo = Maybe [T.Text]
type AttrLabel RecentDataGroupsFieldInfo = "groups"
type AttrOrigin RecentDataGroupsFieldInfo = RecentData
attrGet _ = getRecentDataGroups
attrSet _ = setRecentDataGroups
attrConstruct = undefined
attrClear _ = clearRecentDataGroups
recentData_groups :: AttrLabelProxy "groups"
recentData_groups = AttrLabelProxy
#endif
getRecentDataIsPrivate :: MonadIO m => RecentData -> m Bool
getRecentDataIsPrivate s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 48) :: IO CInt
let val' = (/= 0) val
return val'
setRecentDataIsPrivate :: MonadIO m => RecentData -> Bool -> m ()
setRecentDataIsPrivate s val = liftIO $ withManagedPtr s $ \ptr -> do
let val' = (fromIntegral . fromEnum) val
poke (ptr `plusPtr` 48) (val' :: CInt)
#if ENABLE_OVERLOADING
data RecentDataIsPrivateFieldInfo
instance AttrInfo RecentDataIsPrivateFieldInfo where
type AttrAllowedOps RecentDataIsPrivateFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint RecentDataIsPrivateFieldInfo = (~) Bool
type AttrBaseTypeConstraint RecentDataIsPrivateFieldInfo = (~) RecentData
type AttrGetType RecentDataIsPrivateFieldInfo = Bool
type AttrLabel RecentDataIsPrivateFieldInfo = "is_private"
type AttrOrigin RecentDataIsPrivateFieldInfo = RecentData
attrGet _ = getRecentDataIsPrivate
attrSet _ = setRecentDataIsPrivate
attrConstruct = undefined
attrClear _ = undefined
recentData_isPrivate :: AttrLabelProxy "isPrivate"
recentData_isPrivate = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList RecentData
type instance O.AttributeList RecentData = RecentDataAttributeList
type RecentDataAttributeList = ('[ '("displayName", RecentDataDisplayNameFieldInfo), '("description", RecentDataDescriptionFieldInfo), '("mimeType", RecentDataMimeTypeFieldInfo), '("appName", RecentDataAppNameFieldInfo), '("appExec", RecentDataAppExecFieldInfo), '("groups", RecentDataGroupsFieldInfo), '("isPrivate", RecentDataIsPrivateFieldInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
type family ResolveRecentDataMethod (t :: Symbol) (o :: *) :: * where
ResolveRecentDataMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveRecentDataMethod t RecentData, O.MethodInfo info RecentData p) => OL.IsLabel t (RecentData -> 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