#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Objects.FilenameCompleter
(
FilenameCompleter(..) ,
IsFilenameCompleter ,
toFilenameCompleter ,
noFilenameCompleter ,
#if ENABLE_OVERLOADING
FilenameCompleterGetCompletionSuffixMethodInfo,
#endif
filenameCompleterGetCompletionSuffix ,
#if ENABLE_OVERLOADING
FilenameCompleterGetCompletionsMethodInfo,
#endif
filenameCompleterGetCompletions ,
filenameCompleterNew ,
#if ENABLE_OVERLOADING
FilenameCompleterSetDirsOnlyMethodInfo ,
#endif
filenameCompleterSetDirsOnly ,
C_FilenameCompleterGotCompletionDataCallback,
FilenameCompleterGotCompletionDataCallback,
#if 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.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.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 (ManagedPtr FilenameCompleter)
foreign import ccall "g_filename_completer_get_type"
c_g_filename_completer_get_type :: IO GType
instance GObject FilenameCompleter where
gobjectType = c_g_filename_completer_get_type
class (GObject o, O.IsDescendantOf FilenameCompleter o) => IsFilenameCompleter o
instance (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 = liftIO . unsafeCastTo FilenameCompleter
noFilenameCompleter :: Maybe FilenameCompleter
noFilenameCompleter = Nothing
#if 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 (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
type FilenameCompleterGotCompletionDataCallback =
IO ()
noFilenameCompleterGotCompletionDataCallback :: Maybe FilenameCompleterGotCompletionDataCallback
noFilenameCompleterGotCompletionDataCallback = 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 cb = liftIO $ do
let cb' = wrap_FilenameCompleterGotCompletionDataCallback cb
mk_FilenameCompleterGotCompletionDataCallback cb' >>= B.GClosure.newGClosure
wrap_FilenameCompleterGotCompletionDataCallback ::
FilenameCompleterGotCompletionDataCallback ->
C_FilenameCompleterGotCompletionDataCallback
wrap_FilenameCompleterGotCompletionDataCallback _cb _ _ = do
_cb
onFilenameCompleterGotCompletionData :: (IsFilenameCompleter a, MonadIO m) => a -> FilenameCompleterGotCompletionDataCallback -> m SignalHandlerId
onFilenameCompleterGotCompletionData obj cb = liftIO $ do
let cb' = wrap_FilenameCompleterGotCompletionDataCallback cb
cb'' <- mk_FilenameCompleterGotCompletionDataCallback cb'
connectSignalFunPtr obj "got-completion-data" cb'' SignalConnectBefore
afterFilenameCompleterGotCompletionData :: (IsFilenameCompleter a, MonadIO m) => a -> FilenameCompleterGotCompletionDataCallback -> m SignalHandlerId
afterFilenameCompleterGotCompletionData obj cb = liftIO $ do
let cb' = wrap_FilenameCompleterGotCompletionDataCallback cb
cb'' <- mk_FilenameCompleterGotCompletionDataCallback cb'
connectSignalFunPtr obj "got-completion-data" cb'' SignalConnectAfter
#if ENABLE_OVERLOADING
instance O.HasAttributeList FilenameCompleter
type instance O.AttributeList FilenameCompleter = FilenameCompleterAttributeList
type FilenameCompleterAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
data FilenameCompleterGotCompletionDataSignalInfo
instance SignalInfo FilenameCompleterGotCompletionDataSignalInfo where
type HaskellCallbackType FilenameCompleterGotCompletionDataSignalInfo = FilenameCompleterGotCompletionDataCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_FilenameCompleterGotCompletionDataCallback cb
cb'' <- mk_FilenameCompleterGotCompletionDataCallback cb'
connectSignalFunPtr obj "got-completion-data" cb'' connectMode
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 = liftIO $ do
result <- g_filename_completer_new
checkUnexpectedReturnNULL "filenameCompleterNew" result
result' <- (wrapObject FilenameCompleter) result
return result'
#if 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 completer initialText = liftIO $ do
completer' <- unsafeManagedPtrCastPtr completer
initialText' <- textToCString initialText
result <- g_filename_completer_get_completion_suffix completer' initialText'
checkUnexpectedReturnNULL "filenameCompleterGetCompletionSuffix" result
result' <- cstringToText result
freeMem result
touchManagedPtr completer
freeMem initialText'
return result'
#if 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 completer initialText = liftIO $ do
completer' <- unsafeManagedPtrCastPtr completer
initialText' <- textToCString initialText
result <- g_filename_completer_get_completions completer' initialText'
checkUnexpectedReturnNULL "filenameCompleterGetCompletions" result
result' <- unpackZeroTerminatedUTF8CArray result
mapZeroTerminatedCArray freeMem result
freeMem result
touchManagedPtr completer
freeMem initialText'
return result'
#if 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 completer dirsOnly = liftIO $ do
completer' <- unsafeManagedPtrCastPtr completer
let dirsOnly' = (fromIntegral . fromEnum) dirsOnly
g_filename_completer_set_dirs_only completer' dirsOnly'
touchManagedPtr completer
return ()
#if ENABLE_OVERLOADING
data FilenameCompleterSetDirsOnlyMethodInfo
instance (signature ~ (Bool -> m ()), MonadIO m, IsFilenameCompleter a) => O.MethodInfo FilenameCompleterSetDirsOnlyMethodInfo a signature where
overloadedMethod _ = filenameCompleterSetDirsOnly
#endif