{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gtk.Objects.UriLauncher
(
UriLauncher(..) ,
IsUriLauncher ,
toUriLauncher ,
#if defined(ENABLE_OVERLOADING)
ResolveUriLauncherMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
UriLauncherGetUriMethodInfo ,
#endif
uriLauncherGetUri ,
#if defined(ENABLE_OVERLOADING)
UriLauncherLaunchMethodInfo ,
#endif
uriLauncherLaunch ,
#if defined(ENABLE_OVERLOADING)
UriLauncherLaunchFinishMethodInfo ,
#endif
uriLauncherLaunchFinish ,
uriLauncherNew ,
#if defined(ENABLE_OVERLOADING)
UriLauncherSetUriMethodInfo ,
#endif
uriLauncherSetUri ,
#if defined(ENABLE_OVERLOADING)
UriLauncherUriPropertyInfo ,
#endif
clearUriLauncherUri ,
constructUriLauncherUri ,
getUriLauncherUri ,
setUriLauncherUri ,
#if defined(ENABLE_OVERLOADING)
uriLauncherUri ,
#endif
) 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.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gtk.Objects.Window as Gtk.Window
newtype UriLauncher = UriLauncher (SP.ManagedPtr UriLauncher)
deriving (UriLauncher -> UriLauncher -> Bool
(UriLauncher -> UriLauncher -> Bool)
-> (UriLauncher -> UriLauncher -> Bool) -> Eq UriLauncher
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: UriLauncher -> UriLauncher -> Bool
== :: UriLauncher -> UriLauncher -> Bool
$c/= :: UriLauncher -> UriLauncher -> Bool
/= :: UriLauncher -> UriLauncher -> Bool
Eq)
instance SP.ManagedPtrNewtype UriLauncher where
toManagedPtr :: UriLauncher -> ManagedPtr UriLauncher
toManagedPtr (UriLauncher ManagedPtr UriLauncher
p) = ManagedPtr UriLauncher
p
foreign import ccall "gtk_uri_launcher_get_type"
c_gtk_uri_launcher_get_type :: IO B.Types.GType
instance B.Types.TypedObject UriLauncher where
glibType :: IO GType
glibType = IO GType
c_gtk_uri_launcher_get_type
instance B.Types.GObject UriLauncher
class (SP.GObject o, O.IsDescendantOf UriLauncher o) => IsUriLauncher o
instance (SP.GObject o, O.IsDescendantOf UriLauncher o) => IsUriLauncher o
instance O.HasParentTypes UriLauncher
type instance O.ParentTypes UriLauncher = '[GObject.Object.Object]
toUriLauncher :: (MIO.MonadIO m, IsUriLauncher o) => o -> m UriLauncher
toUriLauncher :: forall (m :: * -> *) o.
(MonadIO m, IsUriLauncher o) =>
o -> m UriLauncher
toUriLauncher = IO UriLauncher -> m UriLauncher
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO UriLauncher -> m UriLauncher)
-> (o -> IO UriLauncher) -> o -> m UriLauncher
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr UriLauncher -> UriLauncher) -> o -> IO UriLauncher
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr UriLauncher -> UriLauncher
UriLauncher
instance B.GValue.IsGValue (Maybe UriLauncher) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_uri_launcher_get_type
gvalueSet_ :: Ptr GValue -> Maybe UriLauncher -> IO ()
gvalueSet_ Ptr GValue
gv Maybe UriLauncher
P.Nothing = Ptr GValue -> Ptr UriLauncher -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr UriLauncher
forall a. Ptr a
FP.nullPtr :: FP.Ptr UriLauncher)
gvalueSet_ Ptr GValue
gv (P.Just UriLauncher
obj) = UriLauncher -> (Ptr UriLauncher -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr UriLauncher
obj (Ptr GValue -> Ptr UriLauncher -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe UriLauncher)
gvalueGet_ Ptr GValue
gv = do
Ptr UriLauncher
ptr <- Ptr GValue -> IO (Ptr UriLauncher)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr UriLauncher)
if Ptr UriLauncher
ptr Ptr UriLauncher -> Ptr UriLauncher -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr UriLauncher
forall a. Ptr a
FP.nullPtr
then UriLauncher -> Maybe UriLauncher
forall a. a -> Maybe a
P.Just (UriLauncher -> Maybe UriLauncher)
-> IO UriLauncher -> IO (Maybe UriLauncher)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr UriLauncher -> UriLauncher)
-> Ptr UriLauncher -> IO UriLauncher
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr UriLauncher -> UriLauncher
UriLauncher Ptr UriLauncher
ptr
else Maybe UriLauncher -> IO (Maybe UriLauncher)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe UriLauncher
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveUriLauncherMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveUriLauncherMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveUriLauncherMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveUriLauncherMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveUriLauncherMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveUriLauncherMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveUriLauncherMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveUriLauncherMethod "launch" o = UriLauncherLaunchMethodInfo
ResolveUriLauncherMethod "launchFinish" o = UriLauncherLaunchFinishMethodInfo
ResolveUriLauncherMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveUriLauncherMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveUriLauncherMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveUriLauncherMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveUriLauncherMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveUriLauncherMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveUriLauncherMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveUriLauncherMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveUriLauncherMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveUriLauncherMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveUriLauncherMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveUriLauncherMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveUriLauncherMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveUriLauncherMethod "getUri" o = UriLauncherGetUriMethodInfo
ResolveUriLauncherMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveUriLauncherMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveUriLauncherMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveUriLauncherMethod "setUri" o = UriLauncherSetUriMethodInfo
ResolveUriLauncherMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveUriLauncherMethod t UriLauncher, O.OverloadedMethod info UriLauncher p) => OL.IsLabel t (UriLauncher -> 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 ~ ResolveUriLauncherMethod t UriLauncher, O.OverloadedMethod info UriLauncher p, R.HasField t UriLauncher p) => R.HasField t UriLauncher p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveUriLauncherMethod t UriLauncher, O.OverloadedMethodInfo info UriLauncher) => OL.IsLabel t (O.MethodProxy info UriLauncher) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
getUriLauncherUri :: (MonadIO m, IsUriLauncher o) => o -> m (Maybe T.Text)
getUriLauncherUri :: forall (m :: * -> *) o.
(MonadIO m, IsUriLauncher o) =>
o -> m (Maybe Text)
getUriLauncherUri o
obj = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"uri"
setUriLauncherUri :: (MonadIO m, IsUriLauncher o) => o -> T.Text -> m ()
setUriLauncherUri :: forall (m :: * -> *) o.
(MonadIO m, IsUriLauncher o) =>
o -> Text -> m ()
setUriLauncherUri o
obj Text
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"uri" (Text -> Maybe Text
forall a. a -> Maybe a
Just Text
val)
constructUriLauncherUri :: (IsUriLauncher o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructUriLauncherUri :: forall o (m :: * -> *).
(IsUriLauncher o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructUriLauncherUri Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"uri" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
clearUriLauncherUri :: (MonadIO m, IsUriLauncher o) => o -> m ()
clearUriLauncherUri :: forall (m :: * -> *) o. (MonadIO m, IsUriLauncher o) => o -> m ()
clearUriLauncherUri o
obj = 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
$ o -> String -> Maybe Text -> IO ()
forall a. GObject a => a -> String -> Maybe Text -> IO ()
B.Properties.setObjectPropertyString o
obj String
"uri" (Maybe Text
forall a. Maybe a
Nothing :: Maybe T.Text)
#if defined(ENABLE_OVERLOADING)
data UriLauncherUriPropertyInfo
instance AttrInfo UriLauncherUriPropertyInfo where
type AttrAllowedOps UriLauncherUriPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint UriLauncherUriPropertyInfo = IsUriLauncher
type AttrSetTypeConstraint UriLauncherUriPropertyInfo = (~) T.Text
type AttrTransferTypeConstraint UriLauncherUriPropertyInfo = (~) T.Text
type AttrTransferType UriLauncherUriPropertyInfo = T.Text
type AttrGetType UriLauncherUriPropertyInfo = (Maybe T.Text)
type AttrLabel UriLauncherUriPropertyInfo = "uri"
type AttrOrigin UriLauncherUriPropertyInfo = UriLauncher
attrGet = getUriLauncherUri
attrSet = setUriLauncherUri
attrTransfer _ v = do
return v
attrConstruct = constructUriLauncherUri
attrClear = clearUriLauncherUri
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.UriLauncher.uri"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.8/docs/GI-Gtk-Objects-UriLauncher.html#g:attr:uri"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList UriLauncher
type instance O.AttributeList UriLauncher = UriLauncherAttributeList
type UriLauncherAttributeList = ('[ '("uri", UriLauncherUriPropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
uriLauncherUri :: AttrLabelProxy "uri"
uriLauncherUri = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList UriLauncher = UriLauncherSignalList
type UriLauncherSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "gtk_uri_launcher_new" gtk_uri_launcher_new ::
CString ->
IO (Ptr UriLauncher)
uriLauncherNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
Maybe (T.Text)
-> m UriLauncher
uriLauncherNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Maybe Text -> m UriLauncher
uriLauncherNew Maybe Text
uri = IO UriLauncher -> m UriLauncher
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO UriLauncher -> m UriLauncher)
-> IO UriLauncher -> m UriLauncher
forall a b. (a -> b) -> a -> b
$ do
Ptr CChar
maybeUri <- case Maybe Text
uri of
Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just Text
jUri -> do
Ptr CChar
jUri' <- Text -> IO (Ptr CChar)
textToCString Text
jUri
Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jUri'
Ptr UriLauncher
result <- Ptr CChar -> IO (Ptr UriLauncher)
gtk_uri_launcher_new Ptr CChar
maybeUri
Text -> Ptr UriLauncher -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"uriLauncherNew" Ptr UriLauncher
result
UriLauncher
result' <- ((ManagedPtr UriLauncher -> UriLauncher)
-> Ptr UriLauncher -> IO UriLauncher
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr UriLauncher -> UriLauncher
UriLauncher) Ptr UriLauncher
result
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeUri
UriLauncher -> IO UriLauncher
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return UriLauncher
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_uri_launcher_get_uri" gtk_uri_launcher_get_uri ::
Ptr UriLauncher ->
IO CString
uriLauncherGetUri ::
(B.CallStack.HasCallStack, MonadIO m, IsUriLauncher a) =>
a
-> m (Maybe T.Text)
uriLauncherGetUri :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsUriLauncher a) =>
a -> m (Maybe Text)
uriLauncherGetUri a
self = 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 UriLauncher
self' <- a -> IO (Ptr UriLauncher)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr CChar
result <- Ptr UriLauncher -> IO (Ptr CChar)
gtk_uri_launcher_get_uri Ptr UriLauncher
self'
Maybe Text
maybeResult <- Ptr CChar -> (Ptr CChar -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr CChar
result ((Ptr CChar -> IO Text) -> IO (Maybe Text))
-> (Ptr CChar -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr CChar
result' -> do
Text
result'' <- HasCallStack => Ptr CChar -> IO Text
Ptr CChar -> IO Text
cstringToText Ptr CChar
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
self
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 UriLauncherGetUriMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsUriLauncher a) => O.OverloadedMethod UriLauncherGetUriMethodInfo a signature where
overloadedMethod = uriLauncherGetUri
instance O.OverloadedMethodInfo UriLauncherGetUriMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.UriLauncher.uriLauncherGetUri",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.8/docs/GI-Gtk-Objects-UriLauncher.html#v:uriLauncherGetUri"
})
#endif
foreign import ccall "gtk_uri_launcher_launch" gtk_uri_launcher_launch ::
Ptr UriLauncher ->
Ptr Gtk.Window.Window ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
uriLauncherLaunch ::
(B.CallStack.HasCallStack, MonadIO m, IsUriLauncher a, Gtk.Window.IsWindow b, Gio.Cancellable.IsCancellable c) =>
a
-> Maybe (b)
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
uriLauncherLaunch :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsUriLauncher a, IsWindow b,
IsCancellable c) =>
a -> Maybe b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
uriLauncherLaunch a
self Maybe b
parent Maybe c
cancellable Maybe AsyncReadyCallback
callback = 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 UriLauncher
self' <- a -> IO (Ptr UriLauncher)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr Window
maybeParent <- case Maybe b
parent of
Maybe b
Nothing -> Ptr Window -> IO (Ptr Window)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Window
forall a. Ptr a
nullPtr
Just b
jParent -> do
Ptr Window
jParent' <- b -> IO (Ptr Window)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jParent
Ptr Window -> IO (Ptr Window)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Window
jParent'
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) AsyncReadyCallback
jCallback)
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr UriLauncher
-> Ptr Window
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
gtk_uri_launcher_launch Ptr UriLauncher
self' Ptr Window
maybeParent Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
parent b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data UriLauncherLaunchMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsUriLauncher a, Gtk.Window.IsWindow b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod UriLauncherLaunchMethodInfo a signature where
overloadedMethod = uriLauncherLaunch
instance O.OverloadedMethodInfo UriLauncherLaunchMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.UriLauncher.uriLauncherLaunch",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.8/docs/GI-Gtk-Objects-UriLauncher.html#v:uriLauncherLaunch"
})
#endif
foreign import ccall "gtk_uri_launcher_launch_finish" gtk_uri_launcher_launch_finish ::
Ptr UriLauncher ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
uriLauncherLaunchFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsUriLauncher a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
uriLauncherLaunchFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsUriLauncher a, IsAsyncResult b) =>
a -> b -> m ()
uriLauncherLaunchFinish a
self b
result_ = 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 UriLauncher
self' <- a -> IO (Ptr UriLauncher)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr UriLauncher -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
gtk_uri_launcher_launch_finish Ptr UriLauncher
self' Ptr AsyncResult
result_'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data UriLauncherLaunchFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsUriLauncher a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod UriLauncherLaunchFinishMethodInfo a signature where
overloadedMethod = uriLauncherLaunchFinish
instance O.OverloadedMethodInfo UriLauncherLaunchFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.UriLauncher.uriLauncherLaunchFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.8/docs/GI-Gtk-Objects-UriLauncher.html#v:uriLauncherLaunchFinish"
})
#endif
foreign import ccall "gtk_uri_launcher_set_uri" gtk_uri_launcher_set_uri ::
Ptr UriLauncher ->
CString ->
IO ()
uriLauncherSetUri ::
(B.CallStack.HasCallStack, MonadIO m, IsUriLauncher a) =>
a
-> Maybe (T.Text)
-> m ()
uriLauncherSetUri :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsUriLauncher a) =>
a -> Maybe Text -> m ()
uriLauncherSetUri a
self Maybe Text
uri = 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 UriLauncher
self' <- a -> IO (Ptr UriLauncher)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr CChar
maybeUri <- case Maybe Text
uri of
Maybe Text
Nothing -> Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
forall a. Ptr a
nullPtr
Just Text
jUri -> do
Ptr CChar
jUri' <- Text -> IO (Ptr CChar)
textToCString Text
jUri
Ptr CChar -> IO (Ptr CChar)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CChar
jUri'
Ptr UriLauncher -> Ptr CChar -> IO ()
gtk_uri_launcher_set_uri Ptr UriLauncher
self' Ptr CChar
maybeUri
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
Ptr CChar -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CChar
maybeUri
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data UriLauncherSetUriMethodInfo
instance (signature ~ (Maybe (T.Text) -> m ()), MonadIO m, IsUriLauncher a) => O.OverloadedMethod UriLauncherSetUriMethodInfo a signature where
overloadedMethod = uriLauncherSetUri
instance O.OverloadedMethodInfo UriLauncherSetUriMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gtk.Objects.UriLauncher.uriLauncherSetUri",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtk-4.0.8/docs/GI-Gtk-Objects-UriLauncher.html#v:uriLauncherSetUri"
})
#endif