{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Structs.RecentData
(
RecentData(..) ,
newZeroRecentData ,
#if defined(ENABLE_OVERLOADING)
ResolveRecentDataMethod ,
#endif
clearRecentDataAppExec ,
getRecentDataAppExec ,
#if defined(ENABLE_OVERLOADING)
recentData_appExec ,
#endif
setRecentDataAppExec ,
clearRecentDataAppName ,
getRecentDataAppName ,
#if defined(ENABLE_OVERLOADING)
recentData_appName ,
#endif
setRecentDataAppName ,
clearRecentDataDescription ,
getRecentDataDescription ,
#if defined(ENABLE_OVERLOADING)
recentData_description ,
#endif
setRecentDataDescription ,
clearRecentDataDisplayName ,
getRecentDataDisplayName ,
#if defined(ENABLE_OVERLOADING)
recentData_displayName ,
#endif
setRecentDataDisplayName ,
clearRecentDataGroups ,
getRecentDataGroups ,
#if defined(ENABLE_OVERLOADING)
recentData_groups ,
#endif
setRecentDataGroups ,
getRecentDataIsPrivate ,
#if defined(ENABLE_OVERLOADING)
recentData_isPrivate ,
#endif
setRecentDataIsPrivate ,
clearRecentDataMimeType ,
getRecentDataMimeType ,
#if defined(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.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
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.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
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 qualified GHC.Records as R
newtype RecentData = RecentData (SP.ManagedPtr RecentData)
deriving (RecentData -> RecentData -> Bool
(RecentData -> RecentData -> Bool)
-> (RecentData -> RecentData -> Bool) -> Eq RecentData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecentData -> RecentData -> Bool
$c/= :: RecentData -> RecentData -> Bool
== :: RecentData -> RecentData -> Bool
$c== :: RecentData -> RecentData -> Bool
Eq)
instance SP.ManagedPtrNewtype RecentData where
toManagedPtr :: RecentData -> ManagedPtr RecentData
toManagedPtr (RecentData ManagedPtr RecentData
p) = ManagedPtr RecentData
p
instance BoxedPtr RecentData where
boxedPtrCopy :: RecentData -> IO RecentData
boxedPtrCopy = \RecentData
p -> RecentData -> (Ptr RecentData -> IO RecentData) -> IO RecentData
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr RecentData
p (Int -> Ptr RecentData -> IO (Ptr RecentData)
forall a. (HasCallStack, CallocPtr a) => Int -> Ptr a -> IO (Ptr a)
copyBytes Int
56 (Ptr RecentData -> IO (Ptr RecentData))
-> (Ptr RecentData -> IO RecentData)
-> Ptr RecentData
-> IO RecentData
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> (ManagedPtr RecentData -> RecentData)
-> Ptr RecentData -> IO RecentData
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.wrapPtr ManagedPtr RecentData -> RecentData
RecentData)
boxedPtrFree :: RecentData -> IO ()
boxedPtrFree = \RecentData
x -> RecentData -> (Ptr RecentData -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
SP.withManagedPtr RecentData
x Ptr RecentData -> IO ()
forall a. Ptr a -> IO ()
SP.freeMem
instance CallocPtr RecentData where
boxedPtrCalloc :: IO (Ptr RecentData)
boxedPtrCalloc = Int -> IO (Ptr RecentData)
forall a. Int -> IO (Ptr a)
callocBytes Int
56
newZeroRecentData :: MonadIO m => m RecentData
newZeroRecentData :: forall (m :: * -> *). MonadIO m => m RecentData
newZeroRecentData = IO RecentData -> m RecentData
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RecentData -> m RecentData) -> IO RecentData -> m RecentData
forall a b. (a -> b) -> a -> b
$ IO (Ptr RecentData)
forall a. CallocPtr a => IO (Ptr a)
boxedPtrCalloc IO (Ptr RecentData)
-> (Ptr RecentData -> IO RecentData) -> IO RecentData
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr RecentData -> RecentData)
-> Ptr RecentData -> IO RecentData
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr RecentData -> RecentData
RecentData
instance tag ~ 'AttrSet => Constructible RecentData tag where
new :: forall (m :: * -> *).
MonadIO m =>
(ManagedPtr RecentData -> RecentData)
-> [AttrOp RecentData tag] -> m RecentData
new ManagedPtr RecentData -> RecentData
_ [AttrOp RecentData tag]
attrs = do
RecentData
o <- m RecentData
forall (m :: * -> *). MonadIO m => m RecentData
newZeroRecentData
RecentData -> [AttrOp RecentData 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set RecentData
o [AttrOp RecentData tag]
[AttrOp RecentData 'AttrSet]
attrs
RecentData -> m RecentData
forall (m :: * -> *) a. Monad m => a -> m a
return RecentData
o
getRecentDataDisplayName :: MonadIO m => RecentData -> m (Maybe T.Text)
getRecentDataDisplayName :: forall (m :: * -> *). MonadIO m => RecentData -> m (Maybe Text)
getRecentDataDisplayName RecentData
s = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ RecentData
-> (Ptr RecentData -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr RecentData
s ((Ptr RecentData -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr RecentData -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr RecentData
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr RecentData
ptr Ptr RecentData -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO CString
Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setRecentDataDisplayName :: MonadIO m => RecentData -> CString -> m ()
setRecentDataDisplayName :: forall (m :: * -> *). MonadIO m => RecentData -> CString -> m ()
setRecentDataDisplayName RecentData
s CString
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ RecentData -> (Ptr RecentData -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr RecentData
s ((Ptr RecentData -> IO ()) -> IO ())
-> (Ptr RecentData -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RecentData
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr RecentData
ptr Ptr RecentData -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CString
val :: CString)
clearRecentDataDisplayName :: MonadIO m => RecentData -> m ()
clearRecentDataDisplayName :: forall (m :: * -> *). MonadIO m => RecentData -> m ()
clearRecentDataDisplayName RecentData
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ RecentData -> (Ptr RecentData -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr RecentData
s ((Ptr RecentData -> IO ()) -> IO ())
-> (Ptr RecentData -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RecentData
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr RecentData
ptr Ptr RecentData -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data RecentDataDisplayNameFieldInfo
instance AttrInfo RecentDataDisplayNameFieldInfo where
type AttrBaseTypeConstraint RecentDataDisplayNameFieldInfo = (~) RecentData
type AttrAllowedOps RecentDataDisplayNameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint RecentDataDisplayNameFieldInfo = (~) CString
type AttrTransferTypeConstraint RecentDataDisplayNameFieldInfo = (~)CString
type AttrTransferType RecentDataDisplayNameFieldInfo = CString
type AttrGetType RecentDataDisplayNameFieldInfo = Maybe T.Text
type AttrLabel RecentDataDisplayNameFieldInfo = "display_name"
type AttrOrigin RecentDataDisplayNameFieldInfo = RecentData
attrGet = getRecentDataDisplayName
attrSet = setRecentDataDisplayName
attrConstruct = undefined
attrClear = clearRecentDataDisplayName
attrTransfer _ v = do
return v
recentData_displayName :: AttrLabelProxy "displayName"
recentData_displayName = AttrLabelProxy
#endif
getRecentDataDescription :: MonadIO m => RecentData -> m (Maybe T.Text)
getRecentDataDescription :: forall (m :: * -> *). MonadIO m => RecentData -> m (Maybe Text)
getRecentDataDescription RecentData
s = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ RecentData
-> (Ptr RecentData -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr RecentData
s ((Ptr RecentData -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr RecentData -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr RecentData
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr RecentData
ptr Ptr RecentData -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) :: IO CString
Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setRecentDataDescription :: MonadIO m => RecentData -> CString -> m ()
setRecentDataDescription :: forall (m :: * -> *). MonadIO m => RecentData -> CString -> m ()
setRecentDataDescription RecentData
s CString
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ RecentData -> (Ptr RecentData -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr RecentData
s ((Ptr RecentData -> IO ()) -> IO ())
-> (Ptr RecentData -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RecentData
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr RecentData
ptr Ptr RecentData -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (CString
val :: CString)
clearRecentDataDescription :: MonadIO m => RecentData -> m ()
clearRecentDataDescription :: forall (m :: * -> *). MonadIO m => RecentData -> m ()
clearRecentDataDescription RecentData
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ RecentData -> (Ptr RecentData -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr RecentData
s ((Ptr RecentData -> IO ()) -> IO ())
-> (Ptr RecentData -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RecentData
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr RecentData
ptr Ptr RecentData -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data RecentDataDescriptionFieldInfo
instance AttrInfo RecentDataDescriptionFieldInfo where
type AttrBaseTypeConstraint RecentDataDescriptionFieldInfo = (~) RecentData
type AttrAllowedOps RecentDataDescriptionFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint RecentDataDescriptionFieldInfo = (~) CString
type AttrTransferTypeConstraint RecentDataDescriptionFieldInfo = (~)CString
type AttrTransferType RecentDataDescriptionFieldInfo = CString
type AttrGetType RecentDataDescriptionFieldInfo = Maybe T.Text
type AttrLabel RecentDataDescriptionFieldInfo = "description"
type AttrOrigin RecentDataDescriptionFieldInfo = RecentData
attrGet = getRecentDataDescription
attrSet = setRecentDataDescription
attrConstruct = undefined
attrClear = clearRecentDataDescription
attrTransfer _ v = do
return v
recentData_description :: AttrLabelProxy "description"
recentData_description = AttrLabelProxy
#endif
getRecentDataMimeType :: MonadIO m => RecentData -> m (Maybe T.Text)
getRecentDataMimeType :: forall (m :: * -> *). MonadIO m => RecentData -> m (Maybe Text)
getRecentDataMimeType RecentData
s = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ RecentData
-> (Ptr RecentData -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr RecentData
s ((Ptr RecentData -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr RecentData -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr RecentData
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr RecentData
ptr Ptr RecentData -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) :: IO CString
Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setRecentDataMimeType :: MonadIO m => RecentData -> CString -> m ()
setRecentDataMimeType :: forall (m :: * -> *). MonadIO m => RecentData -> CString -> m ()
setRecentDataMimeType RecentData
s CString
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ RecentData -> (Ptr RecentData -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr RecentData
s ((Ptr RecentData -> IO ()) -> IO ())
-> (Ptr RecentData -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RecentData
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr RecentData
ptr Ptr RecentData -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (CString
val :: CString)
clearRecentDataMimeType :: MonadIO m => RecentData -> m ()
clearRecentDataMimeType :: forall (m :: * -> *). MonadIO m => RecentData -> m ()
clearRecentDataMimeType RecentData
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ RecentData -> (Ptr RecentData -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr RecentData
s ((Ptr RecentData -> IO ()) -> IO ())
-> (Ptr RecentData -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RecentData
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr RecentData
ptr Ptr RecentData -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data RecentDataMimeTypeFieldInfo
instance AttrInfo RecentDataMimeTypeFieldInfo where
type AttrBaseTypeConstraint RecentDataMimeTypeFieldInfo = (~) RecentData
type AttrAllowedOps RecentDataMimeTypeFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint RecentDataMimeTypeFieldInfo = (~) CString
type AttrTransferTypeConstraint RecentDataMimeTypeFieldInfo = (~)CString
type AttrTransferType RecentDataMimeTypeFieldInfo = CString
type AttrGetType RecentDataMimeTypeFieldInfo = Maybe T.Text
type AttrLabel RecentDataMimeTypeFieldInfo = "mime_type"
type AttrOrigin RecentDataMimeTypeFieldInfo = RecentData
attrGet = getRecentDataMimeType
attrSet = setRecentDataMimeType
attrConstruct = undefined
attrClear = clearRecentDataMimeType
attrTransfer _ v = do
return v
recentData_mimeType :: AttrLabelProxy "mimeType"
recentData_mimeType = AttrLabelProxy
#endif
getRecentDataAppName :: MonadIO m => RecentData -> m (Maybe T.Text)
getRecentDataAppName :: forall (m :: * -> *). MonadIO m => RecentData -> m (Maybe Text)
getRecentDataAppName RecentData
s = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ RecentData
-> (Ptr RecentData -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr RecentData
s ((Ptr RecentData -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr RecentData -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr RecentData
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr RecentData
ptr Ptr RecentData -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) :: IO CString
Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setRecentDataAppName :: MonadIO m => RecentData -> CString -> m ()
setRecentDataAppName :: forall (m :: * -> *). MonadIO m => RecentData -> CString -> m ()
setRecentDataAppName RecentData
s CString
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ RecentData -> (Ptr RecentData -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr RecentData
s ((Ptr RecentData -> IO ()) -> IO ())
-> (Ptr RecentData -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RecentData
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr RecentData
ptr Ptr RecentData -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (CString
val :: CString)
clearRecentDataAppName :: MonadIO m => RecentData -> m ()
clearRecentDataAppName :: forall (m :: * -> *). MonadIO m => RecentData -> m ()
clearRecentDataAppName RecentData
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ RecentData -> (Ptr RecentData -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr RecentData
s ((Ptr RecentData -> IO ()) -> IO ())
-> (Ptr RecentData -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RecentData
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr RecentData
ptr Ptr RecentData -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data RecentDataAppNameFieldInfo
instance AttrInfo RecentDataAppNameFieldInfo where
type AttrBaseTypeConstraint RecentDataAppNameFieldInfo = (~) RecentData
type AttrAllowedOps RecentDataAppNameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint RecentDataAppNameFieldInfo = (~) CString
type AttrTransferTypeConstraint RecentDataAppNameFieldInfo = (~)CString
type AttrTransferType RecentDataAppNameFieldInfo = CString
type AttrGetType RecentDataAppNameFieldInfo = Maybe T.Text
type AttrLabel RecentDataAppNameFieldInfo = "app_name"
type AttrOrigin RecentDataAppNameFieldInfo = RecentData
attrGet = getRecentDataAppName
attrSet = setRecentDataAppName
attrConstruct = undefined
attrClear = clearRecentDataAppName
attrTransfer _ v = do
return v
recentData_appName :: AttrLabelProxy "appName"
recentData_appName = AttrLabelProxy
#endif
getRecentDataAppExec :: MonadIO m => RecentData -> m (Maybe T.Text)
getRecentDataAppExec :: forall (m :: * -> *). MonadIO m => RecentData -> m (Maybe Text)
getRecentDataAppExec RecentData
s = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ RecentData
-> (Ptr RecentData -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr RecentData
s ((Ptr RecentData -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr RecentData -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr RecentData
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr RecentData
ptr Ptr RecentData -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) :: IO CString
Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setRecentDataAppExec :: MonadIO m => RecentData -> CString -> m ()
setRecentDataAppExec :: forall (m :: * -> *). MonadIO m => RecentData -> CString -> m ()
setRecentDataAppExec RecentData
s CString
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ RecentData -> (Ptr RecentData -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr RecentData
s ((Ptr RecentData -> IO ()) -> IO ())
-> (Ptr RecentData -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RecentData
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr RecentData
ptr Ptr RecentData -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) (CString
val :: CString)
clearRecentDataAppExec :: MonadIO m => RecentData -> m ()
clearRecentDataAppExec :: forall (m :: * -> *). MonadIO m => RecentData -> m ()
clearRecentDataAppExec RecentData
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ RecentData -> (Ptr RecentData -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr RecentData
s ((Ptr RecentData -> IO ()) -> IO ())
-> (Ptr RecentData -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RecentData
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr RecentData
ptr Ptr RecentData -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data RecentDataAppExecFieldInfo
instance AttrInfo RecentDataAppExecFieldInfo where
type AttrBaseTypeConstraint RecentDataAppExecFieldInfo = (~) RecentData
type AttrAllowedOps RecentDataAppExecFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint RecentDataAppExecFieldInfo = (~) CString
type AttrTransferTypeConstraint RecentDataAppExecFieldInfo = (~)CString
type AttrTransferType RecentDataAppExecFieldInfo = CString
type AttrGetType RecentDataAppExecFieldInfo = Maybe T.Text
type AttrLabel RecentDataAppExecFieldInfo = "app_exec"
type AttrOrigin RecentDataAppExecFieldInfo = RecentData
attrGet = getRecentDataAppExec
attrSet = setRecentDataAppExec
attrConstruct = undefined
attrClear = clearRecentDataAppExec
attrTransfer _ v = do
return v
recentData_appExec :: AttrLabelProxy "appExec"
recentData_appExec = AttrLabelProxy
#endif
getRecentDataGroups :: MonadIO m => RecentData -> m (Maybe [T.Text])
getRecentDataGroups :: forall (m :: * -> *). MonadIO m => RecentData -> m (Maybe [Text])
getRecentDataGroups RecentData
s = IO (Maybe [Text]) -> m (Maybe [Text])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe [Text]) -> m (Maybe [Text]))
-> IO (Maybe [Text]) -> m (Maybe [Text])
forall a b. (a -> b) -> a -> b
$ RecentData
-> (Ptr RecentData -> IO (Maybe [Text])) -> IO (Maybe [Text])
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr RecentData
s ((Ptr RecentData -> IO (Maybe [Text])) -> IO (Maybe [Text]))
-> (Ptr RecentData -> IO (Maybe [Text])) -> IO (Maybe [Text])
forall a b. (a -> b) -> a -> b
$ \Ptr RecentData
ptr -> do
Ptr CString
val <- Ptr (Ptr CString) -> IO (Ptr CString)
forall a. Storable a => Ptr a -> IO a
peek (Ptr RecentData
ptr Ptr RecentData -> Int -> Ptr (Ptr CString)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40) :: IO (Ptr CString)
Maybe [Text]
result <- Ptr CString -> (Ptr CString -> IO [Text]) -> IO (Maybe [Text])
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull Ptr CString
val ((Ptr CString -> IO [Text]) -> IO (Maybe [Text]))
-> (Ptr CString -> IO [Text]) -> IO (Maybe [Text])
forall a b. (a -> b) -> a -> b
$ \Ptr CString
val' -> do
[Text]
val'' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
val'
[Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
val''
Maybe [Text] -> IO (Maybe [Text])
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe [Text]
result
setRecentDataGroups :: MonadIO m => RecentData -> Ptr CString -> m ()
setRecentDataGroups :: forall (m :: * -> *).
MonadIO m =>
RecentData -> Ptr CString -> m ()
setRecentDataGroups RecentData
s Ptr CString
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ RecentData -> (Ptr RecentData -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr RecentData
s ((Ptr RecentData -> IO ()) -> IO ())
-> (Ptr RecentData -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RecentData
ptr -> do
Ptr (Ptr CString) -> Ptr CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr RecentData
ptr Ptr RecentData -> Int -> Ptr (Ptr CString)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40) (Ptr CString
val :: Ptr CString)
clearRecentDataGroups :: MonadIO m => RecentData -> m ()
clearRecentDataGroups :: forall (m :: * -> *). MonadIO m => RecentData -> m ()
clearRecentDataGroups RecentData
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ RecentData -> (Ptr RecentData -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr RecentData
s ((Ptr RecentData -> IO ()) -> IO ())
-> (Ptr RecentData -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RecentData
ptr -> do
Ptr (Ptr CString) -> Ptr CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr RecentData
ptr Ptr RecentData -> Int -> Ptr (Ptr CString)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40) (Ptr CString
forall a. Ptr a
FP.nullPtr :: Ptr CString)
#if defined(ENABLE_OVERLOADING)
data RecentDataGroupsFieldInfo
instance AttrInfo RecentDataGroupsFieldInfo where
type AttrBaseTypeConstraint RecentDataGroupsFieldInfo = (~) RecentData
type AttrAllowedOps RecentDataGroupsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint RecentDataGroupsFieldInfo = (~) (Ptr CString)
type AttrTransferTypeConstraint RecentDataGroupsFieldInfo = (~)(Ptr CString)
type AttrTransferType RecentDataGroupsFieldInfo = (Ptr CString)
type AttrGetType RecentDataGroupsFieldInfo = Maybe [T.Text]
type AttrLabel RecentDataGroupsFieldInfo = "groups"
type AttrOrigin RecentDataGroupsFieldInfo = RecentData
attrGet = getRecentDataGroups
attrSet = setRecentDataGroups
attrConstruct = undefined
attrClear = clearRecentDataGroups
attrTransfer _ v = do
return v
recentData_groups :: AttrLabelProxy "groups"
recentData_groups = AttrLabelProxy
#endif
getRecentDataIsPrivate :: MonadIO m => RecentData -> m Bool
getRecentDataIsPrivate :: forall (m :: * -> *). MonadIO m => RecentData -> m Bool
getRecentDataIsPrivate RecentData
s = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ RecentData -> (Ptr RecentData -> IO Bool) -> IO Bool
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr RecentData
s ((Ptr RecentData -> IO Bool) -> IO Bool)
-> (Ptr RecentData -> IO Bool) -> IO Bool
forall a b. (a -> b) -> a -> b
$ \Ptr RecentData
ptr -> do
CInt
val <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek (Ptr RecentData
ptr Ptr RecentData -> Int -> Ptr CInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48) :: IO CInt
let val' :: Bool
val' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
val
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
val'
setRecentDataIsPrivate :: MonadIO m => RecentData -> Bool -> m ()
setRecentDataIsPrivate :: forall (m :: * -> *). MonadIO m => RecentData -> Bool -> m ()
setRecentDataIsPrivate RecentData
s Bool
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ RecentData -> (Ptr RecentData -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr RecentData
s ((Ptr RecentData -> IO ()) -> IO ())
-> (Ptr RecentData -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr RecentData
ptr -> do
let val' :: CInt
val' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
val
Ptr CInt -> CInt -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr RecentData
ptr Ptr RecentData -> Int -> Ptr CInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48) (CInt
val' :: CInt)
#if defined(ENABLE_OVERLOADING)
data RecentDataIsPrivateFieldInfo
instance AttrInfo RecentDataIsPrivateFieldInfo where
type AttrBaseTypeConstraint RecentDataIsPrivateFieldInfo = (~) RecentData
type AttrAllowedOps RecentDataIsPrivateFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint RecentDataIsPrivateFieldInfo = (~) Bool
type AttrTransferTypeConstraint RecentDataIsPrivateFieldInfo = (~)Bool
type AttrTransferType RecentDataIsPrivateFieldInfo = Bool
type AttrGetType RecentDataIsPrivateFieldInfo = Bool
type AttrLabel RecentDataIsPrivateFieldInfo = "is_private"
type AttrOrigin RecentDataIsPrivateFieldInfo = RecentData
attrGet = getRecentDataIsPrivate
attrSet = setRecentDataIsPrivate
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
recentData_isPrivate :: AttrLabelProxy "isPrivate"
recentData_isPrivate = AttrLabelProxy
#endif
#if defined(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 defined(ENABLE_OVERLOADING)
type family ResolveRecentDataMethod (t :: Symbol) (o :: *) :: * where
ResolveRecentDataMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveRecentDataMethod t RecentData, O.OverloadedMethod info RecentData p) => OL.IsLabel t (RecentData -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveRecentDataMethod t RecentData, O.OverloadedMethod info RecentData p, R.HasField t RecentData p) => R.HasField t RecentData p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveRecentDataMethod t RecentData, O.OverloadedMethodInfo info RecentData) => OL.IsLabel t (O.MethodProxy info RecentData) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif