{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.FilenameCompleter
(
FilenameCompleter(..) ,
IsFilenameCompleter ,
toFilenameCompleter ,
#if defined(ENABLE_OVERLOADING)
ResolveFilenameCompleterMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
FilenameCompleterGetCompletionSuffixMethodInfo,
#endif
filenameCompleterGetCompletionSuffix ,
#if defined(ENABLE_OVERLOADING)
FilenameCompleterGetCompletionsMethodInfo,
#endif
filenameCompleterGetCompletions ,
filenameCompleterNew ,
#if defined(ENABLE_OVERLOADING)
FilenameCompleterSetDirsOnlyMethodInfo ,
#endif
filenameCompleterSetDirsOnly ,
C_FilenameCompleterGotCompletionDataCallback,
FilenameCompleterGotCompletionDataCallback,
#if defined(ENABLE_OVERLOADING)
FilenameCompleterGotCompletionDataSignalInfo,
#endif
afterFilenameCompleterGotCompletionData ,
genClosure_FilenameCompleterGotCompletionData,
mk_FilenameCompleterGotCompletionDataCallback,
noFilenameCompleterGotCompletionDataCallback,
onFilenameCompleterGotCompletionData ,
wrap_FilenameCompleterGotCompletionDataCallback,
) 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.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
newtype FilenameCompleter = FilenameCompleter (SP.ManagedPtr FilenameCompleter)
deriving (FilenameCompleter -> FilenameCompleter -> Bool
(FilenameCompleter -> FilenameCompleter -> Bool)
-> (FilenameCompleter -> FilenameCompleter -> Bool)
-> Eq FilenameCompleter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FilenameCompleter -> FilenameCompleter -> Bool
$c/= :: FilenameCompleter -> FilenameCompleter -> Bool
== :: FilenameCompleter -> FilenameCompleter -> Bool
$c== :: FilenameCompleter -> FilenameCompleter -> Bool
Eq)
instance SP.ManagedPtrNewtype FilenameCompleter where
toManagedPtr :: FilenameCompleter -> ManagedPtr FilenameCompleter
toManagedPtr (FilenameCompleter ManagedPtr FilenameCompleter
p) = ManagedPtr FilenameCompleter
p
foreign import ccall "g_filename_completer_get_type"
c_g_filename_completer_get_type :: IO B.Types.GType
instance B.Types.TypedObject FilenameCompleter where
glibType :: IO GType
glibType = IO GType
c_g_filename_completer_get_type
instance B.Types.GObject FilenameCompleter
instance B.GValue.IsGValue FilenameCompleter where
toGValue :: FilenameCompleter -> IO GValue
toGValue FilenameCompleter
o = do
GType
gtype <- IO GType
c_g_filename_completer_get_type
FilenameCompleter
-> (Ptr FilenameCompleter -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr FilenameCompleter
o (GType
-> (GValue -> Ptr FilenameCompleter -> IO ())
-> Ptr FilenameCompleter
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr FilenameCompleter -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO FilenameCompleter
fromGValue GValue
gv = do
Ptr FilenameCompleter
ptr <- GValue -> IO (Ptr FilenameCompleter)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr FilenameCompleter)
(ManagedPtr FilenameCompleter -> FilenameCompleter)
-> Ptr FilenameCompleter -> IO FilenameCompleter
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr FilenameCompleter -> FilenameCompleter
FilenameCompleter Ptr FilenameCompleter
ptr
class (SP.GObject o, O.IsDescendantOf FilenameCompleter o) => IsFilenameCompleter o
instance (SP.GObject o, O.IsDescendantOf FilenameCompleter o) => IsFilenameCompleter o
instance O.HasParentTypes FilenameCompleter
type instance O.ParentTypes FilenameCompleter = '[GObject.Object.Object]
toFilenameCompleter :: (MonadIO m, IsFilenameCompleter o) => o -> m FilenameCompleter
toFilenameCompleter :: o -> m FilenameCompleter
toFilenameCompleter = IO FilenameCompleter -> m FilenameCompleter
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FilenameCompleter -> m FilenameCompleter)
-> (o -> IO FilenameCompleter) -> o -> m FilenameCompleter
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr FilenameCompleter -> FilenameCompleter)
-> o -> IO FilenameCompleter
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr FilenameCompleter -> FilenameCompleter
FilenameCompleter
#if defined(ENABLE_OVERLOADING)
type family ResolveFilenameCompleterMethod (t :: Symbol) (o :: *) :: * where
ResolveFilenameCompleterMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveFilenameCompleterMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveFilenameCompleterMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveFilenameCompleterMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveFilenameCompleterMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveFilenameCompleterMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveFilenameCompleterMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveFilenameCompleterMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveFilenameCompleterMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveFilenameCompleterMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveFilenameCompleterMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveFilenameCompleterMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveFilenameCompleterMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveFilenameCompleterMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveFilenameCompleterMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveFilenameCompleterMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveFilenameCompleterMethod "getCompletionSuffix" o = FilenameCompleterGetCompletionSuffixMethodInfo
ResolveFilenameCompleterMethod "getCompletions" o = FilenameCompleterGetCompletionsMethodInfo
ResolveFilenameCompleterMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveFilenameCompleterMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveFilenameCompleterMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveFilenameCompleterMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveFilenameCompleterMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveFilenameCompleterMethod "setDirsOnly" o = FilenameCompleterSetDirsOnlyMethodInfo
ResolveFilenameCompleterMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveFilenameCompleterMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveFilenameCompleterMethod t FilenameCompleter, O.MethodInfo info FilenameCompleter p) => OL.IsLabel t (FilenameCompleter -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
type FilenameCompleterGotCompletionDataCallback =
IO ()
noFilenameCompleterGotCompletionDataCallback :: Maybe FilenameCompleterGotCompletionDataCallback
noFilenameCompleterGotCompletionDataCallback :: Maybe (IO ())
noFilenameCompleterGotCompletionDataCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_FilenameCompleterGotCompletionDataCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_FilenameCompleterGotCompletionDataCallback :: C_FilenameCompleterGotCompletionDataCallback -> IO (FunPtr C_FilenameCompleterGotCompletionDataCallback)
genClosure_FilenameCompleterGotCompletionData :: MonadIO m => FilenameCompleterGotCompletionDataCallback -> m (GClosure C_FilenameCompleterGotCompletionDataCallback)
genClosure_FilenameCompleterGotCompletionData :: IO () -> m (GClosure C_FilenameCompleterGotCompletionDataCallback)
genClosure_FilenameCompleterGotCompletionData IO ()
cb = IO (GClosure C_FilenameCompleterGotCompletionDataCallback)
-> m (GClosure C_FilenameCompleterGotCompletionDataCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_FilenameCompleterGotCompletionDataCallback)
-> m (GClosure C_FilenameCompleterGotCompletionDataCallback))
-> IO (GClosure C_FilenameCompleterGotCompletionDataCallback)
-> m (GClosure C_FilenameCompleterGotCompletionDataCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_FilenameCompleterGotCompletionDataCallback
cb' = IO () -> C_FilenameCompleterGotCompletionDataCallback
wrap_FilenameCompleterGotCompletionDataCallback IO ()
cb
C_FilenameCompleterGotCompletionDataCallback
-> IO (FunPtr C_FilenameCompleterGotCompletionDataCallback)
mk_FilenameCompleterGotCompletionDataCallback C_FilenameCompleterGotCompletionDataCallback
cb' IO (FunPtr C_FilenameCompleterGotCompletionDataCallback)
-> (FunPtr C_FilenameCompleterGotCompletionDataCallback
-> IO (GClosure C_FilenameCompleterGotCompletionDataCallback))
-> IO (GClosure C_FilenameCompleterGotCompletionDataCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_FilenameCompleterGotCompletionDataCallback
-> IO (GClosure C_FilenameCompleterGotCompletionDataCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_FilenameCompleterGotCompletionDataCallback ::
FilenameCompleterGotCompletionDataCallback ->
C_FilenameCompleterGotCompletionDataCallback
wrap_FilenameCompleterGotCompletionDataCallback :: IO () -> C_FilenameCompleterGotCompletionDataCallback
wrap_FilenameCompleterGotCompletionDataCallback IO ()
_cb Ptr ()
_ Ptr ()
_ = do
IO ()
_cb
onFilenameCompleterGotCompletionData :: (IsFilenameCompleter a, MonadIO m) => a -> FilenameCompleterGotCompletionDataCallback -> m SignalHandlerId
onFilenameCompleterGotCompletionData :: a -> IO () -> m SignalHandlerId
onFilenameCompleterGotCompletionData 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_FilenameCompleterGotCompletionDataCallback
cb' = IO () -> C_FilenameCompleterGotCompletionDataCallback
wrap_FilenameCompleterGotCompletionDataCallback IO ()
cb
FunPtr C_FilenameCompleterGotCompletionDataCallback
cb'' <- C_FilenameCompleterGotCompletionDataCallback
-> IO (FunPtr C_FilenameCompleterGotCompletionDataCallback)
mk_FilenameCompleterGotCompletionDataCallback C_FilenameCompleterGotCompletionDataCallback
cb'
a
-> Text
-> FunPtr C_FilenameCompleterGotCompletionDataCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"got-completion-data" FunPtr C_FilenameCompleterGotCompletionDataCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterFilenameCompleterGotCompletionData :: (IsFilenameCompleter a, MonadIO m) => a -> FilenameCompleterGotCompletionDataCallback -> m SignalHandlerId
afterFilenameCompleterGotCompletionData :: a -> IO () -> m SignalHandlerId
afterFilenameCompleterGotCompletionData 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_FilenameCompleterGotCompletionDataCallback
cb' = IO () -> C_FilenameCompleterGotCompletionDataCallback
wrap_FilenameCompleterGotCompletionDataCallback IO ()
cb
FunPtr C_FilenameCompleterGotCompletionDataCallback
cb'' <- C_FilenameCompleterGotCompletionDataCallback
-> IO (FunPtr C_FilenameCompleterGotCompletionDataCallback)
mk_FilenameCompleterGotCompletionDataCallback C_FilenameCompleterGotCompletionDataCallback
cb'
a
-> Text
-> FunPtr C_FilenameCompleterGotCompletionDataCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"got-completion-data" FunPtr C_FilenameCompleterGotCompletionDataCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data FilenameCompleterGotCompletionDataSignalInfo
instance SignalInfo FilenameCompleterGotCompletionDataSignalInfo where
type HaskellCallbackType FilenameCompleterGotCompletionDataSignalInfo = FilenameCompleterGotCompletionDataCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_FilenameCompleterGotCompletionDataCallback cb
cb'' <- mk_FilenameCompleterGotCompletionDataCallback cb'
connectSignalFunPtr obj "got-completion-data" cb'' connectMode detail
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList FilenameCompleter
type instance O.AttributeList FilenameCompleter = FilenameCompleterAttributeList
type FilenameCompleterAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList FilenameCompleter = FilenameCompleterSignalList
type FilenameCompleterSignalList = ('[ '("gotCompletionData", FilenameCompleterGotCompletionDataSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_filename_completer_new" g_filename_completer_new ::
IO (Ptr FilenameCompleter)
filenameCompleterNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m FilenameCompleter
filenameCompleterNew :: m FilenameCompleter
filenameCompleterNew = IO FilenameCompleter -> m FilenameCompleter
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FilenameCompleter -> m FilenameCompleter)
-> IO FilenameCompleter -> m FilenameCompleter
forall a b. (a -> b) -> a -> b
$ do
Ptr FilenameCompleter
result <- IO (Ptr FilenameCompleter)
g_filename_completer_new
Text -> Ptr FilenameCompleter -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"filenameCompleterNew" Ptr FilenameCompleter
result
FilenameCompleter
result' <- ((ManagedPtr FilenameCompleter -> FilenameCompleter)
-> Ptr FilenameCompleter -> IO FilenameCompleter
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr FilenameCompleter -> FilenameCompleter
FilenameCompleter) Ptr FilenameCompleter
result
FilenameCompleter -> IO FilenameCompleter
forall (m :: * -> *) a. Monad m => a -> m a
return FilenameCompleter
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_filename_completer_get_completion_suffix" g_filename_completer_get_completion_suffix ::
Ptr FilenameCompleter ->
CString ->
IO CString
filenameCompleterGetCompletionSuffix ::
(B.CallStack.HasCallStack, MonadIO m, IsFilenameCompleter a) =>
a
-> T.Text
-> m T.Text
filenameCompleterGetCompletionSuffix :: a -> Text -> m Text
filenameCompleterGetCompletionSuffix a
completer Text
initialText = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr FilenameCompleter
completer' <- a -> IO (Ptr FilenameCompleter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
completer
CString
initialText' <- Text -> IO CString
textToCString Text
initialText
CString
result <- Ptr FilenameCompleter -> CString -> IO CString
g_filename_completer_get_completion_suffix Ptr FilenameCompleter
completer' CString
initialText'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"filenameCompleterGetCompletionSuffix" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
completer
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
initialText'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data FilenameCompleterGetCompletionSuffixMethodInfo
instance (signature ~ (T.Text -> m T.Text), MonadIO m, IsFilenameCompleter a) => O.MethodInfo FilenameCompleterGetCompletionSuffixMethodInfo a signature where
overloadedMethod = filenameCompleterGetCompletionSuffix
#endif
foreign import ccall "g_filename_completer_get_completions" g_filename_completer_get_completions ::
Ptr FilenameCompleter ->
CString ->
IO (Ptr CString)
filenameCompleterGetCompletions ::
(B.CallStack.HasCallStack, MonadIO m, IsFilenameCompleter a) =>
a
-> T.Text
-> m [T.Text]
filenameCompleterGetCompletions :: a -> Text -> m [Text]
filenameCompleterGetCompletions a
completer Text
initialText = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
Ptr FilenameCompleter
completer' <- a -> IO (Ptr FilenameCompleter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
completer
CString
initialText' <- Text -> IO CString
textToCString Text
initialText
Ptr CString
result <- Ptr FilenameCompleter -> CString -> IO (Ptr CString)
g_filename_completer_get_completions Ptr FilenameCompleter
completer' CString
initialText'
Text -> Ptr CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"filenameCompleterGetCompletions" Ptr CString
result
[Text]
result' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
result
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
completer
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
initialText'
[Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'
#if defined(ENABLE_OVERLOADING)
data FilenameCompleterGetCompletionsMethodInfo
instance (signature ~ (T.Text -> m [T.Text]), MonadIO m, IsFilenameCompleter a) => O.MethodInfo FilenameCompleterGetCompletionsMethodInfo a signature where
overloadedMethod = filenameCompleterGetCompletions
#endif
foreign import ccall "g_filename_completer_set_dirs_only" g_filename_completer_set_dirs_only ::
Ptr FilenameCompleter ->
CInt ->
IO ()
filenameCompleterSetDirsOnly ::
(B.CallStack.HasCallStack, MonadIO m, IsFilenameCompleter a) =>
a
-> Bool
-> m ()
filenameCompleterSetDirsOnly :: a -> Bool -> m ()
filenameCompleterSetDirsOnly a
completer Bool
dirsOnly = 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 FilenameCompleter
completer' <- a -> IO (Ptr FilenameCompleter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
completer
let dirsOnly' :: CInt
dirsOnly' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
dirsOnly
Ptr FilenameCompleter -> CInt -> IO ()
g_filename_completer_set_dirs_only Ptr FilenameCompleter
completer' CInt
dirsOnly'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
completer
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FilenameCompleterSetDirsOnlyMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsFilenameCompleter a) => O.MethodInfo FilenameCompleterSetDirsOnlyMethodInfo a signature where
overloadedMethod = filenameCompleterSetDirsOnly
#endif