{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.FileFilter
(
FileFilter(..) ,
IsFileFilter ,
toFileFilter ,
#if defined(ENABLE_OVERLOADING)
ResolveFileFilterMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
FileFilterAddCustomMethodInfo ,
#endif
fileFilterAddCustom ,
#if defined(ENABLE_OVERLOADING)
FileFilterAddMimeTypeMethodInfo ,
#endif
fileFilterAddMimeType ,
#if defined(ENABLE_OVERLOADING)
FileFilterAddPatternMethodInfo ,
#endif
fileFilterAddPattern ,
#if defined(ENABLE_OVERLOADING)
FileFilterAddPixbufFormatsMethodInfo ,
#endif
fileFilterAddPixbufFormats ,
#if defined(ENABLE_OVERLOADING)
FileFilterFilterMethodInfo ,
#endif
fileFilterFilter ,
#if defined(ENABLE_OVERLOADING)
FileFilterGetNameMethodInfo ,
#endif
fileFilterGetName ,
#if defined(ENABLE_OVERLOADING)
FileFilterGetNeededMethodInfo ,
#endif
fileFilterGetNeeded ,
fileFilterNew ,
fileFilterNewFromGvariant ,
#if defined(ENABLE_OVERLOADING)
FileFilterSetNameMethodInfo ,
#endif
fileFilterSetName ,
#if defined(ENABLE_OVERLOADING)
FileFilterToGvariantMethodInfo ,
#endif
fileFilterToGvariant ,
) 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
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.FileFilterInfo as Gtk.FileFilterInfo
newtype FileFilter = FileFilter (SP.ManagedPtr FileFilter)
deriving (FileFilter -> FileFilter -> Bool
(FileFilter -> FileFilter -> Bool)
-> (FileFilter -> FileFilter -> Bool) -> Eq FileFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FileFilter -> FileFilter -> Bool
$c/= :: FileFilter -> FileFilter -> Bool
== :: FileFilter -> FileFilter -> Bool
$c== :: FileFilter -> FileFilter -> Bool
Eq)
instance SP.ManagedPtrNewtype FileFilter where
toManagedPtr :: FileFilter -> ManagedPtr FileFilter
toManagedPtr (FileFilter ManagedPtr FileFilter
p) = ManagedPtr FileFilter
p
foreign import ccall "gtk_file_filter_get_type"
c_gtk_file_filter_get_type :: IO B.Types.GType
instance B.Types.TypedObject FileFilter where
glibType :: IO GType
glibType = IO GType
c_gtk_file_filter_get_type
instance B.Types.GObject FileFilter
class (SP.GObject o, O.IsDescendantOf FileFilter o) => IsFileFilter o
instance (SP.GObject o, O.IsDescendantOf FileFilter o) => IsFileFilter o
instance O.HasParentTypes FileFilter
type instance O.ParentTypes FileFilter = '[GObject.Object.Object, Gtk.Buildable.Buildable]
toFileFilter :: (MIO.MonadIO m, IsFileFilter o) => o -> m FileFilter
toFileFilter :: forall (m :: * -> *) o.
(MonadIO m, IsFileFilter o) =>
o -> m FileFilter
toFileFilter = IO FileFilter -> m FileFilter
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO FileFilter -> m FileFilter)
-> (o -> IO FileFilter) -> o -> m FileFilter
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr FileFilter -> FileFilter) -> o -> IO FileFilter
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr FileFilter -> FileFilter
FileFilter
instance B.GValue.IsGValue (Maybe FileFilter) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_file_filter_get_type
gvalueSet_ :: Ptr GValue -> Maybe FileFilter -> IO ()
gvalueSet_ Ptr GValue
gv Maybe FileFilter
P.Nothing = Ptr GValue -> Ptr FileFilter -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr FileFilter
forall a. Ptr a
FP.nullPtr :: FP.Ptr FileFilter)
gvalueSet_ Ptr GValue
gv (P.Just FileFilter
obj) = FileFilter -> (Ptr FileFilter -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr FileFilter
obj (Ptr GValue -> Ptr FileFilter -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe FileFilter)
gvalueGet_ Ptr GValue
gv = do
Ptr FileFilter
ptr <- Ptr GValue -> IO (Ptr FileFilter)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr FileFilter)
if Ptr FileFilter
ptr Ptr FileFilter -> Ptr FileFilter -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr FileFilter
forall a. Ptr a
FP.nullPtr
then FileFilter -> Maybe FileFilter
forall a. a -> Maybe a
P.Just (FileFilter -> Maybe FileFilter)
-> IO FileFilter -> IO (Maybe FileFilter)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr FileFilter -> FileFilter)
-> Ptr FileFilter -> IO FileFilter
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr FileFilter -> FileFilter
FileFilter Ptr FileFilter
ptr
else Maybe FileFilter -> IO (Maybe FileFilter)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe FileFilter
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveFileFilterMethod (t :: Symbol) (o :: *) :: * where
ResolveFileFilterMethod "addChild" o = Gtk.Buildable.BuildableAddChildMethodInfo
ResolveFileFilterMethod "addCustom" o = FileFilterAddCustomMethodInfo
ResolveFileFilterMethod "addMimeType" o = FileFilterAddMimeTypeMethodInfo
ResolveFileFilterMethod "addPattern" o = FileFilterAddPatternMethodInfo
ResolveFileFilterMethod "addPixbufFormats" o = FileFilterAddPixbufFormatsMethodInfo
ResolveFileFilterMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveFileFilterMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveFileFilterMethod "constructChild" o = Gtk.Buildable.BuildableConstructChildMethodInfo
ResolveFileFilterMethod "customFinished" o = Gtk.Buildable.BuildableCustomFinishedMethodInfo
ResolveFileFilterMethod "customTagEnd" o = Gtk.Buildable.BuildableCustomTagEndMethodInfo
ResolveFileFilterMethod "customTagStart" o = Gtk.Buildable.BuildableCustomTagStartMethodInfo
ResolveFileFilterMethod "filter" o = FileFilterFilterMethodInfo
ResolveFileFilterMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveFileFilterMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveFileFilterMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveFileFilterMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveFileFilterMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveFileFilterMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveFileFilterMethod "parserFinished" o = Gtk.Buildable.BuildableParserFinishedMethodInfo
ResolveFileFilterMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveFileFilterMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveFileFilterMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveFileFilterMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveFileFilterMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveFileFilterMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveFileFilterMethod "toGvariant" o = FileFilterToGvariantMethodInfo
ResolveFileFilterMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveFileFilterMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveFileFilterMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveFileFilterMethod "getInternalChild" o = Gtk.Buildable.BuildableGetInternalChildMethodInfo
ResolveFileFilterMethod "getName" o = FileFilterGetNameMethodInfo
ResolveFileFilterMethod "getNeeded" o = FileFilterGetNeededMethodInfo
ResolveFileFilterMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveFileFilterMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveFileFilterMethod "setBuildableProperty" o = Gtk.Buildable.BuildableSetBuildablePropertyMethodInfo
ResolveFileFilterMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveFileFilterMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveFileFilterMethod "setName" o = FileFilterSetNameMethodInfo
ResolveFileFilterMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveFileFilterMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveFileFilterMethod t FileFilter, O.OverloadedMethod info FileFilter p) => OL.IsLabel t (FileFilter -> 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 ~ ResolveFileFilterMethod t FileFilter, O.OverloadedMethod info FileFilter p, R.HasField t FileFilter p) => R.HasField t FileFilter p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveFileFilterMethod t FileFilter, O.OverloadedMethodInfo info FileFilter) => OL.IsLabel t (O.MethodProxy info FileFilter) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList FileFilter
type instance O.AttributeList FileFilter = FileFilterAttributeList
type FileFilterAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList FileFilter = FileFilterSignalList
type FileFilterSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_file_filter_new" gtk_file_filter_new ::
IO (Ptr FileFilter)
fileFilterNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m FileFilter
fileFilterNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m FileFilter
fileFilterNew = IO FileFilter -> m FileFilter
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FileFilter -> m FileFilter) -> IO FileFilter -> m FileFilter
forall a b. (a -> b) -> a -> b
$ do
Ptr FileFilter
result <- IO (Ptr FileFilter)
gtk_file_filter_new
Text -> Ptr FileFilter -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"fileFilterNew" Ptr FileFilter
result
FileFilter
result' <- ((ManagedPtr FileFilter -> FileFilter)
-> Ptr FileFilter -> IO FileFilter
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr FileFilter -> FileFilter
FileFilter) Ptr FileFilter
result
FileFilter -> IO FileFilter
forall (m :: * -> *) a. Monad m => a -> m a
return FileFilter
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_file_filter_new_from_gvariant" gtk_file_filter_new_from_gvariant ::
Ptr GVariant ->
IO (Ptr FileFilter)
fileFilterNewFromGvariant ::
(B.CallStack.HasCallStack, MonadIO m) =>
GVariant
-> m FileFilter
fileFilterNewFromGvariant :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
GVariant -> m FileFilter
fileFilterNewFromGvariant GVariant
variant = IO FileFilter -> m FileFilter
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FileFilter -> m FileFilter) -> IO FileFilter -> m FileFilter
forall a b. (a -> b) -> a -> b
$ do
Ptr GVariant
variant' <- GVariant -> IO (Ptr GVariant)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GVariant
variant
Ptr FileFilter
result <- Ptr GVariant -> IO (Ptr FileFilter)
gtk_file_filter_new_from_gvariant Ptr GVariant
variant'
Text -> Ptr FileFilter -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"fileFilterNewFromGvariant" Ptr FileFilter
result
FileFilter
result' <- ((ManagedPtr FileFilter -> FileFilter)
-> Ptr FileFilter -> IO FileFilter
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr FileFilter -> FileFilter
FileFilter) Ptr FileFilter
result
GVariant -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GVariant
variant
FileFilter -> IO FileFilter
forall (m :: * -> *) a. Monad m => a -> m a
return FileFilter
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_file_filter_add_custom" gtk_file_filter_add_custom ::
Ptr FileFilter ->
CUInt ->
FunPtr Gtk.Callbacks.C_FileFilterFunc ->
Ptr () ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
IO ()
fileFilterAddCustom ::
(B.CallStack.HasCallStack, MonadIO m, IsFileFilter a) =>
a
-> [Gtk.Flags.FileFilterFlags]
-> Gtk.Callbacks.FileFilterFunc
-> m ()
fileFilterAddCustom :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFileFilter a) =>
a -> [FileFilterFlags] -> FileFilterFunc -> m ()
fileFilterAddCustom a
filter [FileFilterFlags]
needed FileFilterFunc
func = 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 FileFilter
filter' <- a -> IO (Ptr FileFilter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
filter
let needed' :: CUInt
needed' = [FileFilterFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [FileFilterFlags]
needed
FunPtr C_FileFilterFunc
func' <- C_FileFilterFunc -> IO (FunPtr C_FileFilterFunc)
Gtk.Callbacks.mk_FileFilterFunc (Maybe (Ptr (FunPtr C_FileFilterFunc))
-> FileFilterFunc_WithClosures -> C_FileFilterFunc
Gtk.Callbacks.wrap_FileFilterFunc Maybe (Ptr (FunPtr C_FileFilterFunc))
forall a. Maybe a
Nothing (FileFilterFunc -> FileFilterFunc_WithClosures
Gtk.Callbacks.drop_closures_FileFilterFunc FileFilterFunc
func))
let data_ :: Ptr ()
data_ = FunPtr C_FileFilterFunc -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_FileFilterFunc
func'
let notify :: FunPtr (Ptr a -> IO ())
notify = FunPtr (Ptr a -> IO ())
forall a. FunPtr (Ptr a -> IO ())
SP.safeFreeFunPtrPtr
Ptr FileFilter
-> CUInt
-> FunPtr C_FileFilterFunc
-> Ptr ()
-> FunPtr C_DestroyNotify
-> IO ()
gtk_file_filter_add_custom Ptr FileFilter
filter' CUInt
needed' FunPtr C_FileFilterFunc
func' Ptr ()
data_ FunPtr C_DestroyNotify
forall a. FunPtr (Ptr a -> IO ())
notify
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
filter
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FileFilterAddCustomMethodInfo
instance (signature ~ ([Gtk.Flags.FileFilterFlags] -> Gtk.Callbacks.FileFilterFunc -> m ()), MonadIO m, IsFileFilter a) => O.OverloadedMethod FileFilterAddCustomMethodInfo a signature where
overloadedMethod = fileFilterAddCustom
instance O.OverloadedMethodInfo FileFilterAddCustomMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.FileFilter.fileFilterAddCustom",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-FileFilter.html#v:fileFilterAddCustom"
}
#endif
foreign import ccall "gtk_file_filter_add_mime_type" gtk_file_filter_add_mime_type ::
Ptr FileFilter ->
CString ->
IO ()
fileFilterAddMimeType ::
(B.CallStack.HasCallStack, MonadIO m, IsFileFilter a) =>
a
-> T.Text
-> m ()
fileFilterAddMimeType :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFileFilter a) =>
a -> Text -> m ()
fileFilterAddMimeType a
filter Text
mimeType = 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 FileFilter
filter' <- a -> IO (Ptr FileFilter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
filter
CString
mimeType' <- Text -> IO CString
textToCString Text
mimeType
Ptr FileFilter -> CString -> IO ()
gtk_file_filter_add_mime_type Ptr FileFilter
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 (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FileFilterAddMimeTypeMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsFileFilter a) => O.OverloadedMethod FileFilterAddMimeTypeMethodInfo a signature where
overloadedMethod = fileFilterAddMimeType
instance O.OverloadedMethodInfo FileFilterAddMimeTypeMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.FileFilter.fileFilterAddMimeType",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-FileFilter.html#v:fileFilterAddMimeType"
}
#endif
foreign import ccall "gtk_file_filter_add_pattern" gtk_file_filter_add_pattern ::
Ptr FileFilter ->
CString ->
IO ()
fileFilterAddPattern ::
(B.CallStack.HasCallStack, MonadIO m, IsFileFilter a) =>
a
-> T.Text
-> m ()
fileFilterAddPattern :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFileFilter a) =>
a -> Text -> m ()
fileFilterAddPattern a
filter Text
pattern = 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 FileFilter
filter' <- a -> IO (Ptr FileFilter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
filter
CString
pattern' <- Text -> IO CString
textToCString Text
pattern
Ptr FileFilter -> CString -> IO ()
gtk_file_filter_add_pattern Ptr FileFilter
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 (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FileFilterAddPatternMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsFileFilter a) => O.OverloadedMethod FileFilterAddPatternMethodInfo a signature where
overloadedMethod = fileFilterAddPattern
instance O.OverloadedMethodInfo FileFilterAddPatternMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.FileFilter.fileFilterAddPattern",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-FileFilter.html#v:fileFilterAddPattern"
}
#endif
foreign import ccall "gtk_file_filter_add_pixbuf_formats" gtk_file_filter_add_pixbuf_formats ::
Ptr FileFilter ->
IO ()
fileFilterAddPixbufFormats ::
(B.CallStack.HasCallStack, MonadIO m, IsFileFilter a) =>
a
-> m ()
fileFilterAddPixbufFormats :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFileFilter a) =>
a -> m ()
fileFilterAddPixbufFormats a
filter = 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 FileFilter
filter' <- a -> IO (Ptr FileFilter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
filter
Ptr FileFilter -> IO ()
gtk_file_filter_add_pixbuf_formats Ptr FileFilter
filter'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
filter
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FileFilterAddPixbufFormatsMethodInfo
instance (signature ~ (m ()), MonadIO m, IsFileFilter a) => O.OverloadedMethod FileFilterAddPixbufFormatsMethodInfo a signature where
overloadedMethod = fileFilterAddPixbufFormats
instance O.OverloadedMethodInfo FileFilterAddPixbufFormatsMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.FileFilter.fileFilterAddPixbufFormats",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-FileFilter.html#v:fileFilterAddPixbufFormats"
}
#endif
foreign import ccall "gtk_file_filter_filter" gtk_file_filter_filter ::
Ptr FileFilter ->
Ptr Gtk.FileFilterInfo.FileFilterInfo ->
IO CInt
fileFilterFilter ::
(B.CallStack.HasCallStack, MonadIO m, IsFileFilter a) =>
a
-> Gtk.FileFilterInfo.FileFilterInfo
-> m Bool
fileFilterFilter :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFileFilter a) =>
a -> FileFilterInfo -> m Bool
fileFilterFilter a
filter FileFilterInfo
filterInfo = 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 FileFilter
filter' <- a -> IO (Ptr FileFilter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
filter
Ptr FileFilterInfo
filterInfo' <- FileFilterInfo -> IO (Ptr FileFilterInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr FileFilterInfo
filterInfo
CInt
result <- Ptr FileFilter -> Ptr FileFilterInfo -> IO CInt
gtk_file_filter_filter Ptr FileFilter
filter' Ptr FileFilterInfo
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
FileFilterInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr FileFilterInfo
filterInfo
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data FileFilterFilterMethodInfo
instance (signature ~ (Gtk.FileFilterInfo.FileFilterInfo -> m Bool), MonadIO m, IsFileFilter a) => O.OverloadedMethod FileFilterFilterMethodInfo a signature where
overloadedMethod = fileFilterFilter
instance O.OverloadedMethodInfo FileFilterFilterMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.FileFilter.fileFilterFilter",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-FileFilter.html#v:fileFilterFilter"
}
#endif
foreign import ccall "gtk_file_filter_get_name" gtk_file_filter_get_name ::
Ptr FileFilter ->
IO CString
fileFilterGetName ::
(B.CallStack.HasCallStack, MonadIO m, IsFileFilter a) =>
a
-> m (Maybe T.Text)
fileFilterGetName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFileFilter a) =>
a -> m (Maybe Text)
fileFilterGetName a
filter = 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
$ do
Ptr FileFilter
filter' <- a -> IO (Ptr FileFilter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
filter
CString
result <- Ptr FileFilter -> IO CString
gtk_file_filter_get_name Ptr FileFilter
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 (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 (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data FileFilterGetNameMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsFileFilter a) => O.OverloadedMethod FileFilterGetNameMethodInfo a signature where
overloadedMethod = fileFilterGetName
instance O.OverloadedMethodInfo FileFilterGetNameMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.FileFilter.fileFilterGetName",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-FileFilter.html#v:fileFilterGetName"
}
#endif
foreign import ccall "gtk_file_filter_get_needed" gtk_file_filter_get_needed ::
Ptr FileFilter ->
IO CUInt
fileFilterGetNeeded ::
(B.CallStack.HasCallStack, MonadIO m, IsFileFilter a) =>
a
-> m [Gtk.Flags.FileFilterFlags]
fileFilterGetNeeded :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFileFilter a) =>
a -> m [FileFilterFlags]
fileFilterGetNeeded a
filter = IO [FileFilterFlags] -> m [FileFilterFlags]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [FileFilterFlags] -> m [FileFilterFlags])
-> IO [FileFilterFlags] -> m [FileFilterFlags]
forall a b. (a -> b) -> a -> b
$ do
Ptr FileFilter
filter' <- a -> IO (Ptr FileFilter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
filter
CUInt
result <- Ptr FileFilter -> IO CUInt
gtk_file_filter_get_needed Ptr FileFilter
filter'
let result' :: [FileFilterFlags]
result' = CUInt -> [FileFilterFlags]
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
[FileFilterFlags] -> IO [FileFilterFlags]
forall (m :: * -> *) a. Monad m => a -> m a
return [FileFilterFlags]
result'
#if defined(ENABLE_OVERLOADING)
data FileFilterGetNeededMethodInfo
instance (signature ~ (m [Gtk.Flags.FileFilterFlags]), MonadIO m, IsFileFilter a) => O.OverloadedMethod FileFilterGetNeededMethodInfo a signature where
overloadedMethod = fileFilterGetNeeded
instance O.OverloadedMethodInfo FileFilterGetNeededMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.FileFilter.fileFilterGetNeeded",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-FileFilter.html#v:fileFilterGetNeeded"
}
#endif
foreign import ccall "gtk_file_filter_set_name" gtk_file_filter_set_name ::
Ptr FileFilter ->
CString ->
IO ()
fileFilterSetName ::
(B.CallStack.HasCallStack, MonadIO m, IsFileFilter a) =>
a
-> Maybe (T.Text)
-> m ()
fileFilterSetName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFileFilter a) =>
a -> Maybe Text -> m ()
fileFilterSetName a
filter Maybe Text
name = 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 FileFilter
filter' <- a -> IO (Ptr FileFilter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
filter
CString
maybeName <- case Maybe Text
name of
Maybe Text
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just Text
jName -> do
CString
jName' <- Text -> IO CString
textToCString Text
jName
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jName'
Ptr FileFilter -> CString -> IO ()
gtk_file_filter_set_name Ptr FileFilter
filter' CString
maybeName
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
filter
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeName
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FileFilterSetNameMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsFileFilter a) => O.OverloadedMethod FileFilterSetNameMethodInfo a signature where
overloadedMethod = fileFilterSetName
instance O.OverloadedMethodInfo FileFilterSetNameMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.FileFilter.fileFilterSetName",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-FileFilter.html#v:fileFilterSetName"
}
#endif
foreign import ccall "gtk_file_filter_to_gvariant" gtk_file_filter_to_gvariant ::
Ptr FileFilter ->
IO (Ptr GVariant)
fileFilterToGvariant ::
(B.CallStack.HasCallStack, MonadIO m, IsFileFilter a) =>
a
-> m GVariant
fileFilterToGvariant :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFileFilter a) =>
a -> m GVariant
fileFilterToGvariant a
filter = IO GVariant -> m GVariant
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO GVariant -> m GVariant) -> IO GVariant -> m GVariant
forall a b. (a -> b) -> a -> b
$ do
Ptr FileFilter
filter' <- a -> IO (Ptr FileFilter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
filter
Ptr GVariant
result <- Ptr FileFilter -> IO (Ptr GVariant)
gtk_file_filter_to_gvariant Ptr FileFilter
filter'
Text -> Ptr GVariant -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"fileFilterToGvariant" Ptr GVariant
result
GVariant
result' <- Ptr GVariant -> IO GVariant
B.GVariant.newGVariantFromPtr Ptr GVariant
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
filter
GVariant -> IO GVariant
forall (m :: * -> *) a. Monad m => a -> m a
return GVariant
result'
#if defined(ENABLE_OVERLOADING)
data FileFilterToGvariantMethodInfo
instance (signature ~ (m GVariant), MonadIO m, IsFileFilter a) => O.OverloadedMethod FileFilterToGvariantMethodInfo a signature where
overloadedMethod = fileFilterToGvariant
instance O.OverloadedMethodInfo FileFilterToGvariantMethodInfo a where
overloadedMethodInfo = O.MethodInfo {
O.overloadedMethodName = "GI.Gtk.Objects.FileFilter.fileFilterToGvariant",
O.overloadedMethodURL = "https://hackage.haskell.org/package/gi-gtk-3.0.37/docs/GI-Gtk-Objects-FileFilter.html#v:fileFilterToGvariant"
}
#endif