#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Secret.Objects.Prompt
(
Prompt(..) ,
IsPrompt ,
toPrompt ,
noPrompt ,
#if ENABLE_OVERLOADING
PromptPerformMethodInfo ,
#endif
promptPerform ,
#if ENABLE_OVERLOADING
PromptPerformFinishMethodInfo ,
#endif
promptPerformFinish ,
#if ENABLE_OVERLOADING
PromptPerformSyncMethodInfo ,
#endif
promptPerformSync ,
#if ENABLE_OVERLOADING
PromptRunMethodInfo ,
#endif
promptRun ,
) 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.GLib.Structs.VariantType as GLib.VariantType
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncInitable as Gio.AsyncInitable
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.DBusInterface as Gio.DBusInterface
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.DBusProxy as Gio.DBusProxy
newtype Prompt = Prompt (ManagedPtr Prompt)
foreign import ccall "secret_prompt_get_type"
c_secret_prompt_get_type :: IO GType
instance GObject Prompt where
gobjectType = c_secret_prompt_get_type
class (GObject o, O.IsDescendantOf Prompt o) => IsPrompt o
instance (GObject o, O.IsDescendantOf Prompt o) => IsPrompt o
instance O.HasParentTypes Prompt
type instance O.ParentTypes Prompt = '[Gio.DBusProxy.DBusProxy, GObject.Object.Object, Gio.AsyncInitable.AsyncInitable, Gio.DBusInterface.DBusInterface, Gio.Initable.Initable]
toPrompt :: (MonadIO m, IsPrompt o) => o -> m Prompt
toPrompt = liftIO . unsafeCastTo Prompt
noPrompt :: Maybe Prompt
noPrompt = Nothing
#if ENABLE_OVERLOADING
type family ResolvePromptMethod (t :: Symbol) (o :: *) :: * where
ResolvePromptMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolvePromptMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolvePromptMethod "call" o = Gio.DBusProxy.DBusProxyCallMethodInfo
ResolvePromptMethod "callFinish" o = Gio.DBusProxy.DBusProxyCallFinishMethodInfo
ResolvePromptMethod "callSync" o = Gio.DBusProxy.DBusProxyCallSyncMethodInfo
ResolvePromptMethod "callWithUnixFdList" o = Gio.DBusProxy.DBusProxyCallWithUnixFdListMethodInfo
ResolvePromptMethod "callWithUnixFdListFinish" o = Gio.DBusProxy.DBusProxyCallWithUnixFdListFinishMethodInfo
ResolvePromptMethod "callWithUnixFdListSync" o = Gio.DBusProxy.DBusProxyCallWithUnixFdListSyncMethodInfo
ResolvePromptMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolvePromptMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolvePromptMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolvePromptMethod "init" o = Gio.Initable.InitableInitMethodInfo
ResolvePromptMethod "initAsync" o = Gio.AsyncInitable.AsyncInitableInitAsyncMethodInfo
ResolvePromptMethod "initFinish" o = Gio.AsyncInitable.AsyncInitableInitFinishMethodInfo
ResolvePromptMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolvePromptMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolvePromptMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolvePromptMethod "perform" o = PromptPerformMethodInfo
ResolvePromptMethod "performFinish" o = PromptPerformFinishMethodInfo
ResolvePromptMethod "performSync" o = PromptPerformSyncMethodInfo
ResolvePromptMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolvePromptMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolvePromptMethod "run" o = PromptRunMethodInfo
ResolvePromptMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolvePromptMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolvePromptMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolvePromptMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolvePromptMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolvePromptMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolvePromptMethod "getCachedProperty" o = Gio.DBusProxy.DBusProxyGetCachedPropertyMethodInfo
ResolvePromptMethod "getCachedPropertyNames" o = Gio.DBusProxy.DBusProxyGetCachedPropertyNamesMethodInfo
ResolvePromptMethod "getConnection" o = Gio.DBusProxy.DBusProxyGetConnectionMethodInfo
ResolvePromptMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolvePromptMethod "getDefaultTimeout" o = Gio.DBusProxy.DBusProxyGetDefaultTimeoutMethodInfo
ResolvePromptMethod "getFlags" o = Gio.DBusProxy.DBusProxyGetFlagsMethodInfo
ResolvePromptMethod "getInfo" o = Gio.DBusInterface.DBusInterfaceGetInfoMethodInfo
ResolvePromptMethod "getInterfaceInfo" o = Gio.DBusProxy.DBusProxyGetInterfaceInfoMethodInfo
ResolvePromptMethod "getInterfaceName" o = Gio.DBusProxy.DBusProxyGetInterfaceNameMethodInfo
ResolvePromptMethod "getName" o = Gio.DBusProxy.DBusProxyGetNameMethodInfo
ResolvePromptMethod "getNameOwner" o = Gio.DBusProxy.DBusProxyGetNameOwnerMethodInfo
ResolvePromptMethod "getObject" o = Gio.DBusInterface.DBusInterfaceGetObjectMethodInfo
ResolvePromptMethod "getObjectPath" o = Gio.DBusProxy.DBusProxyGetObjectPathMethodInfo
ResolvePromptMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolvePromptMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolvePromptMethod "setCachedProperty" o = Gio.DBusProxy.DBusProxySetCachedPropertyMethodInfo
ResolvePromptMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolvePromptMethod "setDefaultTimeout" o = Gio.DBusProxy.DBusProxySetDefaultTimeoutMethodInfo
ResolvePromptMethod "setInterfaceInfo" o = Gio.DBusProxy.DBusProxySetInterfaceInfoMethodInfo
ResolvePromptMethod "setObject" o = Gio.DBusInterface.DBusInterfaceSetObjectMethodInfo
ResolvePromptMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolvePromptMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolvePromptMethod t Prompt, O.MethodInfo info Prompt p) => OL.IsLabel t (Prompt -> 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
#if ENABLE_OVERLOADING
instance O.HasAttributeList Prompt
type instance O.AttributeList Prompt = PromptAttributeList
type PromptAttributeList = ('[ '("gBusType", Gio.DBusProxy.DBusProxyGBusTypePropertyInfo), '("gConnection", Gio.DBusProxy.DBusProxyGConnectionPropertyInfo), '("gDefaultTimeout", Gio.DBusProxy.DBusProxyGDefaultTimeoutPropertyInfo), '("gFlags", Gio.DBusProxy.DBusProxyGFlagsPropertyInfo), '("gInterfaceInfo", Gio.DBusProxy.DBusProxyGInterfaceInfoPropertyInfo), '("gInterfaceName", Gio.DBusProxy.DBusProxyGInterfaceNamePropertyInfo), '("gName", Gio.DBusProxy.DBusProxyGNamePropertyInfo), '("gNameOwner", Gio.DBusProxy.DBusProxyGNameOwnerPropertyInfo), '("gObjectPath", Gio.DBusProxy.DBusProxyGObjectPathPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList Prompt = PromptSignalList
type PromptSignalList = ('[ '("gPropertiesChanged", Gio.DBusProxy.DBusProxyGPropertiesChangedSignalInfo), '("gSignal", Gio.DBusProxy.DBusProxyGSignalSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "secret_prompt_perform" secret_prompt_perform ::
Ptr Prompt ->
CString ->
Ptr GLib.VariantType.VariantType ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
promptPerform ::
(B.CallStack.HasCallStack, MonadIO m, IsPrompt a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (T.Text)
-> GLib.VariantType.VariantType
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
promptPerform self windowId returnType cancellable callback = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
maybeWindowId <- case windowId of
Nothing -> return nullPtr
Just jWindowId -> do
jWindowId' <- textToCString jWindowId
return jWindowId'
returnType' <- unsafeManagedPtrGetPtr returnType
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
maybeCallback <- case callback of
Nothing -> return (castPtrToFunPtr nullPtr)
Just jCallback -> do
ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = nullPtr
secret_prompt_perform self' maybeWindowId returnType' maybeCancellable maybeCallback userData
touchManagedPtr self
touchManagedPtr returnType
whenJust cancellable touchManagedPtr
freeMem maybeWindowId
return ()
#if ENABLE_OVERLOADING
data PromptPerformMethodInfo
instance (signature ~ (Maybe (T.Text) -> GLib.VariantType.VariantType -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsPrompt a, Gio.Cancellable.IsCancellable b) => O.MethodInfo PromptPerformMethodInfo a signature where
overloadedMethod _ = promptPerform
#endif
foreign import ccall "secret_prompt_perform_finish" secret_prompt_perform_finish ::
Ptr Prompt ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr GVariant)
promptPerformFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsPrompt a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m GVariant
promptPerformFinish self result_ = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ secret_prompt_perform_finish self' result_'
checkUnexpectedReturnNULL "promptPerformFinish" result
result' <- B.GVariant.wrapGVariantPtr result
touchManagedPtr self
touchManagedPtr result_
return result'
) (do
return ()
)
#if ENABLE_OVERLOADING
data PromptPerformFinishMethodInfo
instance (signature ~ (b -> m GVariant), MonadIO m, IsPrompt a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo PromptPerformFinishMethodInfo a signature where
overloadedMethod _ = promptPerformFinish
#endif
foreign import ccall "secret_prompt_perform_sync" secret_prompt_perform_sync ::
Ptr Prompt ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr GLib.VariantType.VariantType ->
Ptr (Ptr GError) ->
IO (Ptr GVariant)
promptPerformSync ::
(B.CallStack.HasCallStack, MonadIO m, IsPrompt a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (T.Text)
-> Maybe (b)
-> GLib.VariantType.VariantType
-> m GVariant
promptPerformSync self windowId cancellable returnType = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
maybeWindowId <- case windowId of
Nothing -> return nullPtr
Just jWindowId -> do
jWindowId' <- textToCString jWindowId
return jWindowId'
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
returnType' <- unsafeManagedPtrGetPtr returnType
onException (do
result <- propagateGError $ secret_prompt_perform_sync self' maybeWindowId maybeCancellable returnType'
checkUnexpectedReturnNULL "promptPerformSync" result
result' <- B.GVariant.wrapGVariantPtr result
touchManagedPtr self
whenJust cancellable touchManagedPtr
touchManagedPtr returnType
freeMem maybeWindowId
return result'
) (do
freeMem maybeWindowId
)
#if ENABLE_OVERLOADING
data PromptPerformSyncMethodInfo
instance (signature ~ (Maybe (T.Text) -> Maybe (b) -> GLib.VariantType.VariantType -> m GVariant), MonadIO m, IsPrompt a, Gio.Cancellable.IsCancellable b) => O.MethodInfo PromptPerformSyncMethodInfo a signature where
overloadedMethod _ = promptPerformSync
#endif
foreign import ccall "secret_prompt_run" secret_prompt_run ::
Ptr Prompt ->
CString ->
Ptr Gio.Cancellable.Cancellable ->
Ptr GLib.VariantType.VariantType ->
Ptr (Ptr GError) ->
IO (Ptr GVariant)
promptRun ::
(B.CallStack.HasCallStack, MonadIO m, IsPrompt a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (T.Text)
-> Maybe (b)
-> GLib.VariantType.VariantType
-> m GVariant
promptRun self windowId cancellable returnType = liftIO $ do
self' <- unsafeManagedPtrCastPtr self
maybeWindowId <- case windowId of
Nothing -> return nullPtr
Just jWindowId -> do
jWindowId' <- textToCString jWindowId
return jWindowId'
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
returnType' <- unsafeManagedPtrGetPtr returnType
onException (do
result <- propagateGError $ secret_prompt_run self' maybeWindowId maybeCancellable returnType'
checkUnexpectedReturnNULL "promptRun" result
result' <- B.GVariant.wrapGVariantPtr result
touchManagedPtr self
whenJust cancellable touchManagedPtr
touchManagedPtr returnType
freeMem maybeWindowId
return result'
) (do
freeMem maybeWindowId
)
#if ENABLE_OVERLOADING
data PromptRunMethodInfo
instance (signature ~ (Maybe (T.Text) -> Maybe (b) -> GLib.VariantType.VariantType -> m GVariant), MonadIO m, IsPrompt a, Gio.Cancellable.IsCancellable b) => O.MethodInfo PromptRunMethodInfo a signature where
overloadedMethod _ = promptRun
#endif