{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.RecentManager
(
RecentManager(..) ,
IsRecentManager ,
toRecentManager ,
#if defined(ENABLE_OVERLOADING)
ResolveRecentManagerMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
RecentManagerAddFullMethodInfo ,
#endif
recentManagerAddFull ,
#if defined(ENABLE_OVERLOADING)
RecentManagerAddItemMethodInfo ,
#endif
recentManagerAddItem ,
recentManagerGetDefault ,
#if defined(ENABLE_OVERLOADING)
RecentManagerGetItemsMethodInfo ,
#endif
recentManagerGetItems ,
#if defined(ENABLE_OVERLOADING)
RecentManagerHasItemMethodInfo ,
#endif
recentManagerHasItem ,
#if defined(ENABLE_OVERLOADING)
RecentManagerLookupItemMethodInfo ,
#endif
recentManagerLookupItem ,
#if defined(ENABLE_OVERLOADING)
RecentManagerMoveItemMethodInfo ,
#endif
recentManagerMoveItem ,
recentManagerNew ,
#if defined(ENABLE_OVERLOADING)
RecentManagerPurgeItemsMethodInfo ,
#endif
recentManagerPurgeItems ,
#if defined(ENABLE_OVERLOADING)
RecentManagerRemoveItemMethodInfo ,
#endif
recentManagerRemoveItem ,
#if defined(ENABLE_OVERLOADING)
RecentManagerFilenamePropertyInfo ,
#endif
constructRecentManagerFilename ,
getRecentManagerFilename ,
#if defined(ENABLE_OVERLOADING)
recentManagerFilename ,
#endif
#if defined(ENABLE_OVERLOADING)
RecentManagerSizePropertyInfo ,
#endif
getRecentManagerSize ,
#if defined(ENABLE_OVERLOADING)
recentManagerSize ,
#endif
C_RecentManagerChangedCallback ,
RecentManagerChangedCallback ,
#if defined(ENABLE_OVERLOADING)
RecentManagerChangedSignalInfo ,
#endif
afterRecentManagerChanged ,
genClosure_RecentManagerChanged ,
mk_RecentManagerChangedCallback ,
noRecentManagerChangedCallback ,
onRecentManagerChanged ,
wrap_RecentManagerChangedCallback ,
) 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 GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gtk.Structs.RecentData as Gtk.RecentData
import {-# SOURCE #-} qualified GI.Gtk.Structs.RecentInfo as Gtk.RecentInfo
newtype RecentManager = RecentManager (SP.ManagedPtr RecentManager)
deriving (RecentManager -> RecentManager -> Bool
(RecentManager -> RecentManager -> Bool)
-> (RecentManager -> RecentManager -> Bool) -> Eq RecentManager
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecentManager -> RecentManager -> Bool
$c/= :: RecentManager -> RecentManager -> Bool
== :: RecentManager -> RecentManager -> Bool
$c== :: RecentManager -> RecentManager -> Bool
Eq)
instance SP.ManagedPtrNewtype RecentManager where
toManagedPtr :: RecentManager -> ManagedPtr RecentManager
toManagedPtr (RecentManager ManagedPtr RecentManager
p) = ManagedPtr RecentManager
p
foreign import ccall "gtk_recent_manager_get_type"
c_gtk_recent_manager_get_type :: IO B.Types.GType
instance B.Types.TypedObject RecentManager where
glibType :: IO GType
glibType = IO GType
c_gtk_recent_manager_get_type
instance B.Types.GObject RecentManager
instance B.GValue.IsGValue RecentManager where
toGValue :: RecentManager -> IO GValue
toGValue RecentManager
o = do
GType
gtype <- IO GType
c_gtk_recent_manager_get_type
RecentManager -> (Ptr RecentManager -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr RecentManager
o (GType
-> (GValue -> Ptr RecentManager -> IO ())
-> Ptr RecentManager
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr RecentManager -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO RecentManager
fromGValue GValue
gv = do
Ptr RecentManager
ptr <- GValue -> IO (Ptr RecentManager)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr RecentManager)
(ManagedPtr RecentManager -> RecentManager)
-> Ptr RecentManager -> IO RecentManager
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr RecentManager -> RecentManager
RecentManager Ptr RecentManager
ptr
class (SP.GObject o, O.IsDescendantOf RecentManager o) => IsRecentManager o
instance (SP.GObject o, O.IsDescendantOf RecentManager o) => IsRecentManager o
instance O.HasParentTypes RecentManager
type instance O.ParentTypes RecentManager = '[GObject.Object.Object]
toRecentManager :: (MonadIO m, IsRecentManager o) => o -> m RecentManager
toRecentManager :: o -> m RecentManager
toRecentManager = IO RecentManager -> m RecentManager
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RecentManager -> m RecentManager)
-> (o -> IO RecentManager) -> o -> m RecentManager
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr RecentManager -> RecentManager)
-> o -> IO RecentManager
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr RecentManager -> RecentManager
RecentManager
#if defined(ENABLE_OVERLOADING)
type family ResolveRecentManagerMethod (t :: Symbol) (o :: *) :: * where
ResolveRecentManagerMethod "addFull" o = RecentManagerAddFullMethodInfo
ResolveRecentManagerMethod "addItem" o = RecentManagerAddItemMethodInfo
ResolveRecentManagerMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveRecentManagerMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveRecentManagerMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveRecentManagerMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveRecentManagerMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveRecentManagerMethod "hasItem" o = RecentManagerHasItemMethodInfo
ResolveRecentManagerMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveRecentManagerMethod "lookupItem" o = RecentManagerLookupItemMethodInfo
ResolveRecentManagerMethod "moveItem" o = RecentManagerMoveItemMethodInfo
ResolveRecentManagerMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveRecentManagerMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveRecentManagerMethod "purgeItems" o = RecentManagerPurgeItemsMethodInfo
ResolveRecentManagerMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveRecentManagerMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveRecentManagerMethod "removeItem" o = RecentManagerRemoveItemMethodInfo
ResolveRecentManagerMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveRecentManagerMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveRecentManagerMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveRecentManagerMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveRecentManagerMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveRecentManagerMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveRecentManagerMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveRecentManagerMethod "getItems" o = RecentManagerGetItemsMethodInfo
ResolveRecentManagerMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveRecentManagerMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveRecentManagerMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveRecentManagerMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveRecentManagerMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveRecentManagerMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveRecentManagerMethod t RecentManager, O.MethodInfo info RecentManager p) => OL.IsLabel t (RecentManager -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type RecentManagerChangedCallback =
IO ()
noRecentManagerChangedCallback :: Maybe RecentManagerChangedCallback
noRecentManagerChangedCallback :: Maybe (IO ())
noRecentManagerChangedCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_RecentManagerChangedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_RecentManagerChangedCallback :: C_RecentManagerChangedCallback -> IO (FunPtr C_RecentManagerChangedCallback)
genClosure_RecentManagerChanged :: MonadIO m => RecentManagerChangedCallback -> m (GClosure C_RecentManagerChangedCallback)
genClosure_RecentManagerChanged :: IO () -> m (GClosure C_RecentManagerChangedCallback)
genClosure_RecentManagerChanged IO ()
cb = IO (GClosure C_RecentManagerChangedCallback)
-> m (GClosure C_RecentManagerChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_RecentManagerChangedCallback)
-> m (GClosure C_RecentManagerChangedCallback))
-> IO (GClosure C_RecentManagerChangedCallback)
-> m (GClosure C_RecentManagerChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_RecentManagerChangedCallback
cb' = IO () -> C_RecentManagerChangedCallback
wrap_RecentManagerChangedCallback IO ()
cb
C_RecentManagerChangedCallback
-> IO (FunPtr C_RecentManagerChangedCallback)
mk_RecentManagerChangedCallback C_RecentManagerChangedCallback
cb' IO (FunPtr C_RecentManagerChangedCallback)
-> (FunPtr C_RecentManagerChangedCallback
-> IO (GClosure C_RecentManagerChangedCallback))
-> IO (GClosure C_RecentManagerChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_RecentManagerChangedCallback
-> IO (GClosure C_RecentManagerChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_RecentManagerChangedCallback ::
RecentManagerChangedCallback ->
C_RecentManagerChangedCallback
wrap_RecentManagerChangedCallback :: IO () -> C_RecentManagerChangedCallback
wrap_RecentManagerChangedCallback IO ()
_cb Ptr ()
_ Ptr ()
_ = do
IO ()
_cb
onRecentManagerChanged :: (IsRecentManager a, MonadIO m) => a -> RecentManagerChangedCallback -> m SignalHandlerId
onRecentManagerChanged :: a -> IO () -> m SignalHandlerId
onRecentManagerChanged a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_RecentManagerChangedCallback
cb' = IO () -> C_RecentManagerChangedCallback
wrap_RecentManagerChangedCallback IO ()
cb
FunPtr C_RecentManagerChangedCallback
cb'' <- C_RecentManagerChangedCallback
-> IO (FunPtr C_RecentManagerChangedCallback)
mk_RecentManagerChangedCallback C_RecentManagerChangedCallback
cb'
a
-> Text
-> FunPtr C_RecentManagerChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"changed" FunPtr C_RecentManagerChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterRecentManagerChanged :: (IsRecentManager a, MonadIO m) => a -> RecentManagerChangedCallback -> m SignalHandlerId
afterRecentManagerChanged :: a -> IO () -> m SignalHandlerId
afterRecentManagerChanged a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_RecentManagerChangedCallback
cb' = IO () -> C_RecentManagerChangedCallback
wrap_RecentManagerChangedCallback IO ()
cb
FunPtr C_RecentManagerChangedCallback
cb'' <- C_RecentManagerChangedCallback
-> IO (FunPtr C_RecentManagerChangedCallback)
mk_RecentManagerChangedCallback C_RecentManagerChangedCallback
cb'
a
-> Text
-> FunPtr C_RecentManagerChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"changed" FunPtr C_RecentManagerChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data RecentManagerChangedSignalInfo
instance SignalInfo RecentManagerChangedSignalInfo where
type HaskellCallbackType RecentManagerChangedSignalInfo = RecentManagerChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_RecentManagerChangedCallback cb
cb'' <- mk_RecentManagerChangedCallback cb'
connectSignalFunPtr obj "changed" cb'' connectMode detail
#endif
getRecentManagerFilename :: (MonadIO m, IsRecentManager o) => o -> m (Maybe T.Text)
getRecentManagerFilename :: o -> m (Maybe Text)
getRecentManagerFilename o
obj = 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
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"filename"
constructRecentManagerFilename :: (IsRecentManager o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructRecentManagerFilename :: Text -> m (GValueConstruct o)
constructRecentManagerFilename Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"filename" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
#if defined(ENABLE_OVERLOADING)
data RecentManagerFilenamePropertyInfo
instance AttrInfo RecentManagerFilenamePropertyInfo where
type AttrAllowedOps RecentManagerFilenamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint RecentManagerFilenamePropertyInfo = IsRecentManager
type AttrSetTypeConstraint RecentManagerFilenamePropertyInfo = (~) T.Text
type AttrTransferTypeConstraint RecentManagerFilenamePropertyInfo = (~) T.Text
type AttrTransferType RecentManagerFilenamePropertyInfo = T.Text
type AttrGetType RecentManagerFilenamePropertyInfo = (Maybe T.Text)
type AttrLabel RecentManagerFilenamePropertyInfo = "filename"
type AttrOrigin RecentManagerFilenamePropertyInfo = RecentManager
attrGet = getRecentManagerFilename
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructRecentManagerFilename
attrClear = undefined
#endif
getRecentManagerSize :: (MonadIO m, IsRecentManager o) => o -> m Int32
getRecentManagerSize :: o -> m Int32
getRecentManagerSize o
obj = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Int32
forall a. GObject a => a -> String -> IO Int32
B.Properties.getObjectPropertyInt32 o
obj String
"size"
#if defined(ENABLE_OVERLOADING)
data RecentManagerSizePropertyInfo
instance AttrInfo RecentManagerSizePropertyInfo where
type AttrAllowedOps RecentManagerSizePropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint RecentManagerSizePropertyInfo = IsRecentManager
type AttrSetTypeConstraint RecentManagerSizePropertyInfo = (~) ()
type AttrTransferTypeConstraint RecentManagerSizePropertyInfo = (~) ()
type AttrTransferType RecentManagerSizePropertyInfo = ()
type AttrGetType RecentManagerSizePropertyInfo = Int32
type AttrLabel RecentManagerSizePropertyInfo = "size"
type AttrOrigin RecentManagerSizePropertyInfo = RecentManager
attrGet = getRecentManagerSize
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList RecentManager
type instance O.AttributeList RecentManager = RecentManagerAttributeList
type RecentManagerAttributeList = ('[ '("filename", RecentManagerFilenamePropertyInfo), '("size", RecentManagerSizePropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
recentManagerFilename :: AttrLabelProxy "filename"
recentManagerFilename = AttrLabelProxy
recentManagerSize :: AttrLabelProxy "size"
recentManagerSize = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList RecentManager = RecentManagerSignalList
type RecentManagerSignalList = ('[ '("changed", RecentManagerChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_recent_manager_new" gtk_recent_manager_new ::
IO (Ptr RecentManager)
recentManagerNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m RecentManager
recentManagerNew :: m RecentManager
recentManagerNew = IO RecentManager -> m RecentManager
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RecentManager -> m RecentManager)
-> IO RecentManager -> m RecentManager
forall a b. (a -> b) -> a -> b
$ do
Ptr RecentManager
result <- IO (Ptr RecentManager)
gtk_recent_manager_new
Text -> Ptr RecentManager -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"recentManagerNew" Ptr RecentManager
result
RecentManager
result' <- ((ManagedPtr RecentManager -> RecentManager)
-> Ptr RecentManager -> IO RecentManager
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr RecentManager -> RecentManager
RecentManager) Ptr RecentManager
result
RecentManager -> IO RecentManager
forall (m :: * -> *) a. Monad m => a -> m a
return RecentManager
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_recent_manager_add_full" gtk_recent_manager_add_full ::
Ptr RecentManager ->
CString ->
Ptr Gtk.RecentData.RecentData ->
IO CInt
recentManagerAddFull ::
(B.CallStack.HasCallStack, MonadIO m, IsRecentManager a) =>
a
-> T.Text
-> Gtk.RecentData.RecentData
-> m Bool
recentManagerAddFull :: a -> Text -> RecentData -> m Bool
recentManagerAddFull a
manager Text
uri RecentData
recentData = 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
$ do
Ptr RecentManager
manager' <- a -> IO (Ptr RecentManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
CString
uri' <- Text -> IO CString
textToCString Text
uri
Ptr RecentData
recentData' <- RecentData -> IO (Ptr RecentData)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RecentData
recentData
CInt
result <- Ptr RecentManager -> CString -> Ptr RecentData -> IO CInt
gtk_recent_manager_add_full Ptr RecentManager
manager' CString
uri' Ptr RecentData
recentData'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
RecentData -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RecentData
recentData
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data RecentManagerAddFullMethodInfo
instance (signature ~ (T.Text -> Gtk.RecentData.RecentData -> m Bool), MonadIO m, IsRecentManager a) => O.MethodInfo RecentManagerAddFullMethodInfo a signature where
overloadedMethod = recentManagerAddFull
#endif
foreign import ccall "gtk_recent_manager_add_item" gtk_recent_manager_add_item ::
Ptr RecentManager ->
CString ->
IO CInt
recentManagerAddItem ::
(B.CallStack.HasCallStack, MonadIO m, IsRecentManager a) =>
a
-> T.Text
-> m Bool
recentManagerAddItem :: a -> Text -> m Bool
recentManagerAddItem a
manager Text
uri = 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
$ do
Ptr RecentManager
manager' <- a -> IO (Ptr RecentManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
CString
uri' <- Text -> IO CString
textToCString Text
uri
CInt
result <- Ptr RecentManager -> CString -> IO CInt
gtk_recent_manager_add_item Ptr RecentManager
manager' CString
uri'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data RecentManagerAddItemMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsRecentManager a) => O.MethodInfo RecentManagerAddItemMethodInfo a signature where
overloadedMethod = recentManagerAddItem
#endif
foreign import ccall "gtk_recent_manager_get_items" gtk_recent_manager_get_items ::
Ptr RecentManager ->
IO (Ptr (GList (Ptr Gtk.RecentInfo.RecentInfo)))
recentManagerGetItems ::
(B.CallStack.HasCallStack, MonadIO m, IsRecentManager a) =>
a
-> m [Gtk.RecentInfo.RecentInfo]
recentManagerGetItems :: a -> m [RecentInfo]
recentManagerGetItems a
manager = IO [RecentInfo] -> m [RecentInfo]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [RecentInfo] -> m [RecentInfo])
-> IO [RecentInfo] -> m [RecentInfo]
forall a b. (a -> b) -> a -> b
$ do
Ptr RecentManager
manager' <- a -> IO (Ptr RecentManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
Ptr (GList (Ptr RecentInfo))
result <- Ptr RecentManager -> IO (Ptr (GList (Ptr RecentInfo)))
gtk_recent_manager_get_items Ptr RecentManager
manager'
[Ptr RecentInfo]
result' <- Ptr (GList (Ptr RecentInfo)) -> IO [Ptr RecentInfo]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr RecentInfo))
result
[RecentInfo]
result'' <- (Ptr RecentInfo -> IO RecentInfo)
-> [Ptr RecentInfo] -> IO [RecentInfo]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr RecentInfo -> RecentInfo)
-> Ptr RecentInfo -> IO RecentInfo
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr RecentInfo -> RecentInfo
Gtk.RecentInfo.RecentInfo) [Ptr RecentInfo]
result'
Ptr (GList (Ptr RecentInfo)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr RecentInfo))
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
[RecentInfo] -> IO [RecentInfo]
forall (m :: * -> *) a. Monad m => a -> m a
return [RecentInfo]
result''
#if defined(ENABLE_OVERLOADING)
data RecentManagerGetItemsMethodInfo
instance (signature ~ (m [Gtk.RecentInfo.RecentInfo]), MonadIO m, IsRecentManager a) => O.MethodInfo RecentManagerGetItemsMethodInfo a signature where
overloadedMethod = recentManagerGetItems
#endif
foreign import ccall "gtk_recent_manager_has_item" gtk_recent_manager_has_item ::
Ptr RecentManager ->
CString ->
IO CInt
recentManagerHasItem ::
(B.CallStack.HasCallStack, MonadIO m, IsRecentManager a) =>
a
-> T.Text
-> m Bool
recentManagerHasItem :: a -> Text -> m Bool
recentManagerHasItem a
manager Text
uri = 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
$ do
Ptr RecentManager
manager' <- a -> IO (Ptr RecentManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
CString
uri' <- Text -> IO CString
textToCString Text
uri
CInt
result <- Ptr RecentManager -> CString -> IO CInt
gtk_recent_manager_has_item Ptr RecentManager
manager' CString
uri'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data RecentManagerHasItemMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsRecentManager a) => O.MethodInfo RecentManagerHasItemMethodInfo a signature where
overloadedMethod = recentManagerHasItem
#endif
foreign import ccall "gtk_recent_manager_lookup_item" gtk_recent_manager_lookup_item ::
Ptr RecentManager ->
CString ->
Ptr (Ptr GError) ->
IO (Ptr Gtk.RecentInfo.RecentInfo)
recentManagerLookupItem ::
(B.CallStack.HasCallStack, MonadIO m, IsRecentManager a) =>
a
-> T.Text
-> m (Maybe Gtk.RecentInfo.RecentInfo)
recentManagerLookupItem :: a -> Text -> m (Maybe RecentInfo)
recentManagerLookupItem a
manager Text
uri = IO (Maybe RecentInfo) -> m (Maybe RecentInfo)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe RecentInfo) -> m (Maybe RecentInfo))
-> IO (Maybe RecentInfo) -> m (Maybe RecentInfo)
forall a b. (a -> b) -> a -> b
$ do
Ptr RecentManager
manager' <- a -> IO (Ptr RecentManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
CString
uri' <- Text -> IO CString
textToCString Text
uri
IO (Maybe RecentInfo) -> IO () -> IO (Maybe RecentInfo)
forall a b. IO a -> IO b -> IO a
onException (do
Ptr RecentInfo
result <- (Ptr (Ptr GError) -> IO (Ptr RecentInfo)) -> IO (Ptr RecentInfo)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr RecentInfo)) -> IO (Ptr RecentInfo))
-> (Ptr (Ptr GError) -> IO (Ptr RecentInfo)) -> IO (Ptr RecentInfo)
forall a b. (a -> b) -> a -> b
$ Ptr RecentManager
-> CString -> Ptr (Ptr GError) -> IO (Ptr RecentInfo)
gtk_recent_manager_lookup_item Ptr RecentManager
manager' CString
uri'
Maybe RecentInfo
maybeResult <- Ptr RecentInfo
-> (Ptr RecentInfo -> IO RecentInfo) -> IO (Maybe RecentInfo)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr RecentInfo
result ((Ptr RecentInfo -> IO RecentInfo) -> IO (Maybe RecentInfo))
-> (Ptr RecentInfo -> IO RecentInfo) -> IO (Maybe RecentInfo)
forall a b. (a -> b) -> a -> b
$ \Ptr RecentInfo
result' -> do
RecentInfo
result'' <- ((ManagedPtr RecentInfo -> RecentInfo)
-> Ptr RecentInfo -> IO RecentInfo
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr RecentInfo -> RecentInfo
Gtk.RecentInfo.RecentInfo) Ptr RecentInfo
result'
RecentInfo -> IO RecentInfo
forall (m :: * -> *) a. Monad m => a -> m a
return RecentInfo
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
Maybe RecentInfo -> IO (Maybe RecentInfo)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe RecentInfo
maybeResult
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
)
#if defined(ENABLE_OVERLOADING)
data RecentManagerLookupItemMethodInfo
instance (signature ~ (T.Text -> m (Maybe Gtk.RecentInfo.RecentInfo)), MonadIO m, IsRecentManager a) => O.MethodInfo RecentManagerLookupItemMethodInfo a signature where
overloadedMethod = recentManagerLookupItem
#endif
foreign import ccall "gtk_recent_manager_move_item" gtk_recent_manager_move_item ::
Ptr RecentManager ->
CString ->
CString ->
Ptr (Ptr GError) ->
IO CInt
recentManagerMoveItem ::
(B.CallStack.HasCallStack, MonadIO m, IsRecentManager a) =>
a
-> T.Text
-> Maybe (T.Text)
-> m ()
recentManagerMoveItem :: a -> Text -> Maybe Text -> m ()
recentManagerMoveItem a
manager Text
uri Maybe Text
newUri = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr RecentManager
manager' <- a -> IO (Ptr RecentManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
CString
uri' <- Text -> IO CString
textToCString Text
uri
CString
maybeNewUri <- case Maybe Text
newUri of
Maybe Text
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just Text
jNewUri -> do
CString
jNewUri' <- Text -> IO CString
textToCString Text
jNewUri
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jNewUri'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr RecentManager
-> CString -> CString -> Ptr (Ptr GError) -> IO CInt
gtk_recent_manager_move_item Ptr RecentManager
manager' CString
uri' CString
maybeNewUri
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeNewUri
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeNewUri
)
#if defined(ENABLE_OVERLOADING)
data RecentManagerMoveItemMethodInfo
instance (signature ~ (T.Text -> Maybe (T.Text) -> m ()), MonadIO m, IsRecentManager a) => O.MethodInfo RecentManagerMoveItemMethodInfo a signature where
overloadedMethod = recentManagerMoveItem
#endif
foreign import ccall "gtk_recent_manager_purge_items" gtk_recent_manager_purge_items ::
Ptr RecentManager ->
Ptr (Ptr GError) ->
IO Int32
recentManagerPurgeItems ::
(B.CallStack.HasCallStack, MonadIO m, IsRecentManager a) =>
a
-> m Int32
recentManagerPurgeItems :: a -> m Int32
recentManagerPurgeItems a
manager = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
Ptr RecentManager
manager' <- a -> IO (Ptr RecentManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
IO Int32 -> IO () -> IO Int32
forall a b. IO a -> IO b -> IO a
onException (do
Int32
result <- (Ptr (Ptr GError) -> IO Int32) -> IO Int32
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO Int32) -> IO Int32)
-> (Ptr (Ptr GError) -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ Ptr RecentManager -> Ptr (Ptr GError) -> IO Int32
gtk_recent_manager_purge_items Ptr RecentManager
manager'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
result
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data RecentManagerPurgeItemsMethodInfo
instance (signature ~ (m Int32), MonadIO m, IsRecentManager a) => O.MethodInfo RecentManagerPurgeItemsMethodInfo a signature where
overloadedMethod = recentManagerPurgeItems
#endif
foreign import ccall "gtk_recent_manager_remove_item" gtk_recent_manager_remove_item ::
Ptr RecentManager ->
CString ->
Ptr (Ptr GError) ->
IO CInt
recentManagerRemoveItem ::
(B.CallStack.HasCallStack, MonadIO m, IsRecentManager a) =>
a
-> T.Text
-> m ()
recentManagerRemoveItem :: a -> Text -> m ()
recentManagerRemoveItem a
manager Text
uri = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr RecentManager
manager' <- a -> IO (Ptr RecentManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
CString
uri' <- Text -> IO CString
textToCString Text
uri
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr RecentManager -> CString -> Ptr (Ptr GError) -> IO CInt
gtk_recent_manager_remove_item Ptr RecentManager
manager' CString
uri'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
)
#if defined(ENABLE_OVERLOADING)
data RecentManagerRemoveItemMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsRecentManager a) => O.MethodInfo RecentManagerRemoveItemMethodInfo a signature where
overloadedMethod = recentManagerRemoveItem
#endif
foreign import ccall "gtk_recent_manager_get_default" gtk_recent_manager_get_default ::
IO (Ptr RecentManager)
recentManagerGetDefault ::
(B.CallStack.HasCallStack, MonadIO m) =>
m RecentManager
recentManagerGetDefault :: m RecentManager
recentManagerGetDefault = IO RecentManager -> m RecentManager
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RecentManager -> m RecentManager)
-> IO RecentManager -> m RecentManager
forall a b. (a -> b) -> a -> b
$ do
Ptr RecentManager
result <- IO (Ptr RecentManager)
gtk_recent_manager_get_default
Text -> Ptr RecentManager -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"recentManagerGetDefault" Ptr RecentManager
result
RecentManager
result' <- ((ManagedPtr RecentManager -> RecentManager)
-> Ptr RecentManager -> IO RecentManager
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr RecentManager -> RecentManager
RecentManager) Ptr RecentManager
result
RecentManager -> IO RecentManager
forall (m :: * -> *) a. Monad m => a -> m a
return RecentManager
result'
#if defined(ENABLE_OVERLOADING)
#endif