{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.RecentFilter
(
RecentFilter(..) ,
IsRecentFilter ,
toRecentFilter ,
#if defined(ENABLE_OVERLOADING)
ResolveRecentFilterMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
RecentFilterAddAgeMethodInfo ,
#endif
recentFilterAddAge ,
#if defined(ENABLE_OVERLOADING)
RecentFilterAddApplicationMethodInfo ,
#endif
recentFilterAddApplication ,
#if defined(ENABLE_OVERLOADING)
RecentFilterAddCustomMethodInfo ,
#endif
recentFilterAddCustom ,
#if defined(ENABLE_OVERLOADING)
RecentFilterAddGroupMethodInfo ,
#endif
recentFilterAddGroup ,
#if defined(ENABLE_OVERLOADING)
RecentFilterAddMimeTypeMethodInfo ,
#endif
recentFilterAddMimeType ,
#if defined(ENABLE_OVERLOADING)
RecentFilterAddPatternMethodInfo ,
#endif
recentFilterAddPattern ,
#if defined(ENABLE_OVERLOADING)
RecentFilterAddPixbufFormatsMethodInfo ,
#endif
recentFilterAddPixbufFormats ,
#if defined(ENABLE_OVERLOADING)
RecentFilterFilterMethodInfo ,
#endif
recentFilterFilter ,
#if defined(ENABLE_OVERLOADING)
RecentFilterGetNameMethodInfo ,
#endif
recentFilterGetName ,
#if defined(ENABLE_OVERLOADING)
RecentFilterGetNeededMethodInfo ,
#endif
recentFilterGetNeeded ,
recentFilterNew ,
#if defined(ENABLE_OVERLOADING)
RecentFilterSetNameMethodInfo ,
#endif
recentFilterSetName ,
) 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.GHashTable as B.GHT
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.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
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
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gtk.Callbacks as Gtk.Callbacks
import {-# SOURCE #-} qualified GI.Gtk.Flags as Gtk.Flags
import {-# SOURCE #-} qualified GI.Gtk.Interfaces.Buildable as Gtk.Buildable
import {-# SOURCE #-} qualified GI.Gtk.Structs.RecentFilterInfo as Gtk.RecentFilterInfo
newtype RecentFilter = RecentFilter (SP.ManagedPtr RecentFilter)
deriving (RecentFilter -> RecentFilter -> Bool
(RecentFilter -> RecentFilter -> Bool)
-> (RecentFilter -> RecentFilter -> Bool) -> Eq RecentFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RecentFilter -> RecentFilter -> Bool
== :: RecentFilter -> RecentFilter -> Bool
$c/= :: RecentFilter -> RecentFilter -> Bool
/= :: RecentFilter -> RecentFilter -> Bool
Eq)
instance SP.ManagedPtrNewtype RecentFilter where
toManagedPtr :: RecentFilter -> ManagedPtr RecentFilter
toManagedPtr (RecentFilter ManagedPtr RecentFilter
p) = ManagedPtr RecentFilter
p
foreign import ccall "gtk_recent_filter_get_type"
c_gtk_recent_filter_get_type :: IO B.Types.GType
instance B.Types.TypedObject RecentFilter where
glibType :: IO GType
glibType = IO GType
c_gtk_recent_filter_get_type
instance B.Types.GObject RecentFilter
class (SP.GObject o, O.IsDescendantOf RecentFilter o) => IsRecentFilter o
instance (SP.GObject o, O.IsDescendantOf RecentFilter o) => IsRecentFilter o
instance O.HasParentTypes RecentFilter
type instance O.ParentTypes RecentFilter = '[GObject.Object.Object, Gtk.Buildable.Buildable]
toRecentFilter :: (MIO.MonadIO m, IsRecentFilter o) => o -> m RecentFilter
toRecentFilter :: forall (m :: * -> *) o.
(MonadIO m, IsRecentFilter o) =>
o -> m RecentFilter
toRecentFilter = IO RecentFilter -> m RecentFilter
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO RecentFilter -> m RecentFilter)
-> (o -> IO RecentFilter) -> o -> m RecentFilter
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr RecentFilter -> RecentFilter) -> o -> IO RecentFilter
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr RecentFilter -> RecentFilter
RecentFilter
instance B.GValue.IsGValue (Maybe RecentFilter) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_recent_filter_get_type
gvalueSet_ :: Ptr GValue -> Maybe RecentFilter -> IO ()
gvalueSet_ Ptr GValue
gv Maybe RecentFilter
P.Nothing = Ptr GValue -> Ptr RecentFilter -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr RecentFilter
forall a. Ptr a
FP.nullPtr :: FP.Ptr RecentFilter)
gvalueSet_ Ptr GValue
gv (P.Just RecentFilter
obj) = RecentFilter -> (Ptr RecentFilter -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr RecentFilter
obj (Ptr GValue -> Ptr RecentFilter -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe RecentFilter)
gvalueGet_ Ptr GValue
gv = do
Ptr RecentFilter
ptr <- Ptr GValue -> IO (Ptr RecentFilter)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr RecentFilter)
if Ptr RecentFilter
ptr Ptr RecentFilter -> Ptr RecentFilter -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr RecentFilter
forall a. Ptr a
FP.nullPtr
then RecentFilter -> Maybe RecentFilter
forall a. a -> Maybe a
P.Just (RecentFilter -> Maybe RecentFilter)
-> IO RecentFilter -> IO (Maybe RecentFilter)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr RecentFilter -> RecentFilter)
-> Ptr RecentFilter -> IO RecentFilter
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr RecentFilter -> RecentFilter
RecentFilter Ptr RecentFilter
ptr
else Maybe RecentFilter -> IO (Maybe RecentFilter)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe RecentFilter
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveRecentFilterMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveRecentFilterMethod "addAge" o = RecentFilterAddAgeMethodInfo
ResolveRecentFilterMethod "addApplication" o = RecentFilterAddApplicationMethodInfo
ResolveRecentFilterMethod "addChild" o = Gtk.Buildable.BuildableAddChildMethodInfo
ResolveRecentFilterMethod "addCustom" o = RecentFilterAddCustomMethodInfo
ResolveRecentFilterMethod "addGroup" o = RecentFilterAddGroupMethodInfo
ResolveRecentFilterMethod "addMimeType" o = RecentFilterAddMimeTypeMethodInfo
ResolveRecentFilterMethod "addPattern" o = RecentFilterAddPatternMethodInfo
ResolveRecentFilterMethod "addPixbufFormats" o = RecentFilterAddPixbufFormatsMethodInfo
ResolveRecentFilterMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveRecentFilterMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveRecentFilterMethod "constructChild" o = Gtk.Buildable.BuildableConstructChildMethodInfo
ResolveRecentFilterMethod "customFinished" o = Gtk.Buildable.BuildableCustomFinishedMethodInfo
ResolveRecentFilterMethod "customTagEnd" o = Gtk.Buildable.BuildableCustomTagEndMethodInfo
ResolveRecentFilterMethod "customTagStart" o = Gtk.Buildable.BuildableCustomTagStartMethodInfo
ResolveRecentFilterMethod "filter" o = RecentFilterFilterMethodInfo
ResolveRecentFilterMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveRecentFilterMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveRecentFilterMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveRecentFilterMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveRecentFilterMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveRecentFilterMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveRecentFilterMethod "parserFinished" o = Gtk.Buildable.BuildableParserFinishedMethodInfo
ResolveRecentFilterMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveRecentFilterMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveRecentFilterMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveRecentFilterMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveRecentFilterMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveRecentFilterMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveRecentFilterMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveRecentFilterMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveRecentFilterMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveRecentFilterMethod "getInternalChild" o = Gtk.Buildable.BuildableGetInternalChildMethodInfo
ResolveRecentFilterMethod "getName" o = RecentFilterGetNameMethodInfo
ResolveRecentFilterMethod "getNeeded" o = RecentFilterGetNeededMethodInfo
ResolveRecentFilterMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveRecentFilterMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveRecentFilterMethod "setBuildableProperty" o = Gtk.Buildable.BuildableSetBuildablePropertyMethodInfo
ResolveRecentFilterMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveRecentFilterMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveRecentFilterMethod "setName" o = RecentFilterSetNameMethodInfo
ResolveRecentFilterMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveRecentFilterMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveRecentFilterMethod t RecentFilter, O.OverloadedMethod info RecentFilter p) => OL.IsLabel t (RecentFilter -> 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 ~ ResolveRecentFilterMethod t RecentFilter, O.OverloadedMethod info RecentFilter p, R.HasField t RecentFilter p) => R.HasField t RecentFilter p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveRecentFilterMethod t RecentFilter, O.OverloadedMethodInfo info RecentFilter) => OL.IsLabel t (O.MethodProxy info RecentFilter) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList RecentFilter
type instance O.AttributeList RecentFilter = RecentFilterAttributeList
type RecentFilterAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList RecentFilter = RecentFilterSignalList
type RecentFilterSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "gtk_recent_filter_new" gtk_recent_filter_new ::
IO (Ptr RecentFilter)
recentFilterNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m RecentFilter
recentFilterNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m RecentFilter
recentFilterNew = IO RecentFilter -> m RecentFilter
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RecentFilter -> m RecentFilter)
-> IO RecentFilter -> m RecentFilter
forall a b. (a -> b) -> a -> b
$ do
Ptr RecentFilter
result <- IO (Ptr RecentFilter)
gtk_recent_filter_new
Text -> Ptr RecentFilter -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"recentFilterNew" Ptr RecentFilter
result
RecentFilter
result' <- ((ManagedPtr RecentFilter -> RecentFilter)
-> Ptr RecentFilter -> IO RecentFilter
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr RecentFilter -> RecentFilter
RecentFilter) Ptr RecentFilter
result
RecentFilter -> IO RecentFilter
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return RecentFilter
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_recent_filter_add_age" gtk_recent_filter_add_age ::
Ptr RecentFilter ->
Int32 ->
IO ()
recentFilterAddAge ::
(B.CallStack.HasCallStack, MonadIO m, IsRecentFilter a) =>
a
-> Int32
-> m ()
recentFilterAddAge :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRecentFilter a) =>
a -> Int32 -> m ()
recentFilterAddAge a
filter Int32
days = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr RecentFilter
filter' <- a -> IO (Ptr RecentFilter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
filter
Ptr RecentFilter -> Int32 -> IO ()
gtk_recent_filter_add_age Ptr RecentFilter
filter' Int32
days
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
filter
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RecentFilterAddAgeMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m, IsRecentFilter a) => O.OverloadedMethod RecentFilterAddAgeMethodInfo a signature where
overloadedMethod = recentFilterAddAge
instance O.OverloadedMethodInfo RecentFilterAddAgeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.RecentFilter.recentFilterAddAge",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-RecentFilter.html#v:recentFilterAddAge"
})
#endif
foreign import ccall "gtk_recent_filter_add_application" gtk_recent_filter_add_application ::
Ptr RecentFilter ->
CString ->
IO ()
recentFilterAddApplication ::
(B.CallStack.HasCallStack, MonadIO m, IsRecentFilter a) =>
a
-> T.Text
-> m ()
recentFilterAddApplication :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRecentFilter a) =>
a -> Text -> m ()
recentFilterAddApplication a
filter Text
application = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr RecentFilter
filter' <- a -> IO (Ptr RecentFilter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
filter
CString
application' <- Text -> IO CString
textToCString Text
application
Ptr RecentFilter -> CString -> IO ()
gtk_recent_filter_add_application Ptr RecentFilter
filter' CString
application'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
filter
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
application'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RecentFilterAddApplicationMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsRecentFilter a) => O.OverloadedMethod RecentFilterAddApplicationMethodInfo a signature where
overloadedMethod = recentFilterAddApplication
instance O.OverloadedMethodInfo RecentFilterAddApplicationMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.RecentFilter.recentFilterAddApplication",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-RecentFilter.html#v:recentFilterAddApplication"
})
#endif
foreign import ccall "gtk_recent_filter_add_custom" gtk_recent_filter_add_custom ::
Ptr RecentFilter ->
CUInt ->
FunPtr Gtk.Callbacks.C_RecentFilterFunc ->
Ptr () ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
IO ()
recentFilterAddCustom ::
(B.CallStack.HasCallStack, MonadIO m, IsRecentFilter a) =>
a
-> [Gtk.Flags.RecentFilterFlags]
-> Gtk.Callbacks.RecentFilterFunc
-> m ()
recentFilterAddCustom :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRecentFilter a) =>
a -> [RecentFilterFlags] -> RecentFilterFunc -> m ()
recentFilterAddCustom a
filter [RecentFilterFlags]
needed RecentFilterFunc
func = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr RecentFilter
filter' <- a -> IO (Ptr RecentFilter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
filter
let needed' :: CUInt
needed' = [RecentFilterFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [RecentFilterFlags]
needed
FunPtr C_RecentFilterFunc
func' <- C_RecentFilterFunc -> IO (FunPtr C_RecentFilterFunc)
Gtk.Callbacks.mk_RecentFilterFunc (Maybe (Ptr (FunPtr C_RecentFilterFunc))
-> RecentFilterFunc_WithClosures -> C_RecentFilterFunc
Gtk.Callbacks.wrap_RecentFilterFunc Maybe (Ptr (FunPtr C_RecentFilterFunc))
forall a. Maybe a
Nothing (RecentFilterFunc -> RecentFilterFunc_WithClosures
Gtk.Callbacks.drop_closures_RecentFilterFunc RecentFilterFunc
func))
let data_ :: Ptr ()
data_ = FunPtr C_RecentFilterFunc -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_RecentFilterFunc
func'
let dataDestroy :: FunPtr (Ptr a -> IO ())
dataDestroy = FunPtr (Ptr a -> IO ())
forall a. FunPtr (Ptr a -> IO ())
SP.safeFreeFunPtrPtr
Ptr RecentFilter
-> CUInt
-> FunPtr C_RecentFilterFunc
-> Ptr ()
-> FunPtr C_DestroyNotify
-> IO ()
gtk_recent_filter_add_custom Ptr RecentFilter
filter' CUInt
needed' FunPtr C_RecentFilterFunc
func' Ptr ()
data_ FunPtr C_DestroyNotify
forall a. FunPtr (Ptr a -> IO ())
dataDestroy
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
filter
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RecentFilterAddCustomMethodInfo
instance (signature ~ ([Gtk.Flags.RecentFilterFlags] -> Gtk.Callbacks.RecentFilterFunc -> m ()), MonadIO m, IsRecentFilter a) => O.OverloadedMethod RecentFilterAddCustomMethodInfo a signature where
overloadedMethod = recentFilterAddCustom
instance O.OverloadedMethodInfo RecentFilterAddCustomMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.RecentFilter.recentFilterAddCustom",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-RecentFilter.html#v:recentFilterAddCustom"
})
#endif
foreign import ccall "gtk_recent_filter_add_group" gtk_recent_filter_add_group ::
Ptr RecentFilter ->
CString ->
IO ()
recentFilterAddGroup ::
(B.CallStack.HasCallStack, MonadIO m, IsRecentFilter a) =>
a
-> T.Text
-> m ()
recentFilterAddGroup :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRecentFilter a) =>
a -> Text -> m ()
recentFilterAddGroup a
filter Text
group = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr RecentFilter
filter' <- a -> IO (Ptr RecentFilter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
filter
CString
group' <- Text -> IO CString
textToCString Text
group
Ptr RecentFilter -> CString -> IO ()
gtk_recent_filter_add_group Ptr RecentFilter
filter' CString
group'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
filter
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
group'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RecentFilterAddGroupMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsRecentFilter a) => O.OverloadedMethod RecentFilterAddGroupMethodInfo a signature where
overloadedMethod = recentFilterAddGroup
instance O.OverloadedMethodInfo RecentFilterAddGroupMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.RecentFilter.recentFilterAddGroup",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-RecentFilter.html#v:recentFilterAddGroup"
})
#endif
foreign import ccall "gtk_recent_filter_add_mime_type" gtk_recent_filter_add_mime_type ::
Ptr RecentFilter ->
CString ->
IO ()
recentFilterAddMimeType ::
(B.CallStack.HasCallStack, MonadIO m, IsRecentFilter a) =>
a
-> T.Text
-> m ()
recentFilterAddMimeType :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRecentFilter a) =>
a -> Text -> m ()
recentFilterAddMimeType a
filter Text
mimeType = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr RecentFilter
filter' <- a -> IO (Ptr RecentFilter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
filter
CString
mimeType' <- Text -> IO CString
textToCString Text
mimeType
Ptr RecentFilter -> CString -> IO ()
gtk_recent_filter_add_mime_type Ptr RecentFilter
filter' CString
mimeType'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
filter
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
mimeType'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RecentFilterAddMimeTypeMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsRecentFilter a) => O.OverloadedMethod RecentFilterAddMimeTypeMethodInfo a signature where
overloadedMethod = recentFilterAddMimeType
instance O.OverloadedMethodInfo RecentFilterAddMimeTypeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.RecentFilter.recentFilterAddMimeType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-RecentFilter.html#v:recentFilterAddMimeType"
})
#endif
foreign import ccall "gtk_recent_filter_add_pattern" gtk_recent_filter_add_pattern ::
Ptr RecentFilter ->
CString ->
IO ()
recentFilterAddPattern ::
(B.CallStack.HasCallStack, MonadIO m, IsRecentFilter a) =>
a
-> T.Text
-> m ()
recentFilterAddPattern :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRecentFilter a) =>
a -> Text -> m ()
recentFilterAddPattern a
filter Text
pattern = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr RecentFilter
filter' <- a -> IO (Ptr RecentFilter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
filter
CString
pattern' <- Text -> IO CString
textToCString Text
pattern
Ptr RecentFilter -> CString -> IO ()
gtk_recent_filter_add_pattern Ptr RecentFilter
filter' CString
pattern'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
filter
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
pattern'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RecentFilterAddPatternMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsRecentFilter a) => O.OverloadedMethod RecentFilterAddPatternMethodInfo a signature where
overloadedMethod = recentFilterAddPattern
instance O.OverloadedMethodInfo RecentFilterAddPatternMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.RecentFilter.recentFilterAddPattern",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-RecentFilter.html#v:recentFilterAddPattern"
})
#endif
foreign import ccall "gtk_recent_filter_add_pixbuf_formats" gtk_recent_filter_add_pixbuf_formats ::
Ptr RecentFilter ->
IO ()
recentFilterAddPixbufFormats ::
(B.CallStack.HasCallStack, MonadIO m, IsRecentFilter a) =>
a
-> m ()
recentFilterAddPixbufFormats :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRecentFilter a) =>
a -> m ()
recentFilterAddPixbufFormats a
filter = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr RecentFilter
filter' <- a -> IO (Ptr RecentFilter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
filter
Ptr RecentFilter -> IO ()
gtk_recent_filter_add_pixbuf_formats Ptr RecentFilter
filter'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
filter
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RecentFilterAddPixbufFormatsMethodInfo
instance (signature ~ (m ()), MonadIO m, IsRecentFilter a) => O.OverloadedMethod RecentFilterAddPixbufFormatsMethodInfo a signature where
overloadedMethod = recentFilterAddPixbufFormats
instance O.OverloadedMethodInfo RecentFilterAddPixbufFormatsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.RecentFilter.recentFilterAddPixbufFormats",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-RecentFilter.html#v:recentFilterAddPixbufFormats"
})
#endif
foreign import ccall "gtk_recent_filter_filter" gtk_recent_filter_filter ::
Ptr RecentFilter ->
Ptr Gtk.RecentFilterInfo.RecentFilterInfo ->
IO CInt
recentFilterFilter ::
(B.CallStack.HasCallStack, MonadIO m, IsRecentFilter a) =>
a
-> Gtk.RecentFilterInfo.RecentFilterInfo
-> m Bool
recentFilterFilter :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRecentFilter a) =>
a -> RecentFilterInfo -> m Bool
recentFilterFilter a
filter RecentFilterInfo
filterInfo = IO Bool -> m Bool
forall a. IO a -> m a
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 RecentFilter
filter' <- a -> IO (Ptr RecentFilter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
filter
Ptr RecentFilterInfo
filterInfo' <- RecentFilterInfo -> IO (Ptr RecentFilterInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr RecentFilterInfo
filterInfo
CInt
result <- Ptr RecentFilter -> Ptr RecentFilterInfo -> IO CInt
gtk_recent_filter_filter Ptr RecentFilter
filter' Ptr RecentFilterInfo
filterInfo'
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
filter
RecentFilterInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr RecentFilterInfo
filterInfo
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data RecentFilterFilterMethodInfo
instance (signature ~ (Gtk.RecentFilterInfo.RecentFilterInfo -> m Bool), MonadIO m, IsRecentFilter a) => O.OverloadedMethod RecentFilterFilterMethodInfo a signature where
overloadedMethod = recentFilterFilter
instance O.OverloadedMethodInfo RecentFilterFilterMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.RecentFilter.recentFilterFilter",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-RecentFilter.html#v:recentFilterFilter"
})
#endif
foreign import ccall "gtk_recent_filter_get_name" gtk_recent_filter_get_name ::
Ptr RecentFilter ->
IO CString
recentFilterGetName ::
(B.CallStack.HasCallStack, MonadIO m, IsRecentFilter a) =>
a
-> m (Maybe T.Text)
recentFilterGetName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRecentFilter a) =>
a -> m (Maybe Text)
recentFilterGetName a
filter = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
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
$ do
Ptr RecentFilter
filter' <- a -> IO (Ptr RecentFilter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
filter
CString
result <- Ptr RecentFilter -> IO CString
gtk_recent_filter_get_name Ptr RecentFilter
filter'
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
filter
Maybe Text -> IO (Maybe Text)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data RecentFilterGetNameMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsRecentFilter a) => O.OverloadedMethod RecentFilterGetNameMethodInfo a signature where
overloadedMethod = recentFilterGetName
instance O.OverloadedMethodInfo RecentFilterGetNameMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.RecentFilter.recentFilterGetName",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-RecentFilter.html#v:recentFilterGetName"
})
#endif
foreign import ccall "gtk_recent_filter_get_needed" gtk_recent_filter_get_needed ::
Ptr RecentFilter ->
IO CUInt
recentFilterGetNeeded ::
(B.CallStack.HasCallStack, MonadIO m, IsRecentFilter a) =>
a
-> m [Gtk.Flags.RecentFilterFlags]
recentFilterGetNeeded :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRecentFilter a) =>
a -> m [RecentFilterFlags]
recentFilterGetNeeded a
filter = IO [RecentFilterFlags] -> m [RecentFilterFlags]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [RecentFilterFlags] -> m [RecentFilterFlags])
-> IO [RecentFilterFlags] -> m [RecentFilterFlags]
forall a b. (a -> b) -> a -> b
$ do
Ptr RecentFilter
filter' <- a -> IO (Ptr RecentFilter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
filter
CUInt
result <- Ptr RecentFilter -> IO CUInt
gtk_recent_filter_get_needed Ptr RecentFilter
filter'
let result' :: [RecentFilterFlags]
result' = CUInt -> [RecentFilterFlags]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
filter
[RecentFilterFlags] -> IO [RecentFilterFlags]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return [RecentFilterFlags]
result'
#if defined(ENABLE_OVERLOADING)
data RecentFilterGetNeededMethodInfo
instance (signature ~ (m [Gtk.Flags.RecentFilterFlags]), MonadIO m, IsRecentFilter a) => O.OverloadedMethod RecentFilterGetNeededMethodInfo a signature where
overloadedMethod = recentFilterGetNeeded
instance O.OverloadedMethodInfo RecentFilterGetNeededMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.RecentFilter.recentFilterGetNeeded",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-RecentFilter.html#v:recentFilterGetNeeded"
})
#endif
foreign import ccall "gtk_recent_filter_set_name" gtk_recent_filter_set_name ::
Ptr RecentFilter ->
CString ->
IO ()
recentFilterSetName ::
(B.CallStack.HasCallStack, MonadIO m, IsRecentFilter a) =>
a
-> T.Text
-> m ()
recentFilterSetName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRecentFilter a) =>
a -> Text -> m ()
recentFilterSetName a
filter Text
name = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr RecentFilter
filter' <- a -> IO (Ptr RecentFilter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
filter
CString
name' <- Text -> IO CString
textToCString Text
name
Ptr RecentFilter -> CString -> IO ()
gtk_recent_filter_set_name Ptr RecentFilter
filter' CString
name'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
filter
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RecentFilterSetNameMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsRecentFilter a) => O.OverloadedMethod RecentFilterSetNameMethodInfo a signature where
overloadedMethod = recentFilterSetName
instance O.OverloadedMethodInfo RecentFilterSetNameMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.RecentFilter.recentFilterSetName",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-3.0.41/docs/GI-Gtk-Objects-RecentFilter.html#v:recentFilterSetName"
})
#endif