{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.WebKit2.Objects.GeolocationManager
(
GeolocationManager(..) ,
IsGeolocationManager ,
toGeolocationManager ,
#if defined(ENABLE_OVERLOADING)
ResolveGeolocationManagerMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
GeolocationManagerFailedMethodInfo ,
#endif
geolocationManagerFailed ,
#if defined(ENABLE_OVERLOADING)
GeolocationManagerGetEnableHighAccuracyMethodInfo,
#endif
geolocationManagerGetEnableHighAccuracy ,
#if defined(ENABLE_OVERLOADING)
GeolocationManagerUpdatePositionMethodInfo,
#endif
geolocationManagerUpdatePosition ,
#if defined(ENABLE_OVERLOADING)
GeolocationManagerEnableHighAccuracyPropertyInfo,
#endif
#if defined(ENABLE_OVERLOADING)
geolocationManagerEnableHighAccuracy ,
#endif
getGeolocationManagerEnableHighAccuracy ,
GeolocationManagerStartCallback ,
#if defined(ENABLE_OVERLOADING)
GeolocationManagerStartSignalInfo ,
#endif
afterGeolocationManagerStart ,
onGeolocationManagerStart ,
GeolocationManagerStopCallback ,
#if defined(ENABLE_OVERLOADING)
GeolocationManagerStopSignalInfo ,
#endif
afterGeolocationManagerStop ,
onGeolocationManagerStop ,
) 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.Coerce as Coerce
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.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.WebKit2.Structs.GeolocationPosition as WebKit2.GeolocationPosition
newtype GeolocationManager = GeolocationManager (SP.ManagedPtr GeolocationManager)
deriving (GeolocationManager -> GeolocationManager -> Bool
(GeolocationManager -> GeolocationManager -> Bool)
-> (GeolocationManager -> GeolocationManager -> Bool)
-> Eq GeolocationManager
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GeolocationManager -> GeolocationManager -> Bool
$c/= :: GeolocationManager -> GeolocationManager -> Bool
== :: GeolocationManager -> GeolocationManager -> Bool
$c== :: GeolocationManager -> GeolocationManager -> Bool
Eq)
instance SP.ManagedPtrNewtype GeolocationManager where
toManagedPtr :: GeolocationManager -> ManagedPtr GeolocationManager
toManagedPtr (GeolocationManager ManagedPtr GeolocationManager
p) = ManagedPtr GeolocationManager
p
foreign import ccall "webkit_geolocation_manager_get_type"
c_webkit_geolocation_manager_get_type :: IO B.Types.GType
instance B.Types.TypedObject GeolocationManager where
glibType :: IO GType
glibType = IO GType
c_webkit_geolocation_manager_get_type
instance B.Types.GObject GeolocationManager
class (SP.GObject o, O.IsDescendantOf GeolocationManager o) => IsGeolocationManager o
instance (SP.GObject o, O.IsDescendantOf GeolocationManager o) => IsGeolocationManager o
instance O.HasParentTypes GeolocationManager
type instance O.ParentTypes GeolocationManager = '[GObject.Object.Object]
toGeolocationManager :: (MIO.MonadIO m, IsGeolocationManager o) => o -> m GeolocationManager
toGeolocationManager :: forall (m :: * -> *) o.
(MonadIO m, IsGeolocationManager o) =>
o -> m GeolocationManager
toGeolocationManager = IO GeolocationManager -> m GeolocationManager
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO GeolocationManager -> m GeolocationManager)
-> (o -> IO GeolocationManager) -> o -> m GeolocationManager
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr GeolocationManager -> GeolocationManager)
-> o -> IO GeolocationManager
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr GeolocationManager -> GeolocationManager
GeolocationManager
instance B.GValue.IsGValue (Maybe GeolocationManager) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_webkit_geolocation_manager_get_type
gvalueSet_ :: Ptr GValue -> Maybe GeolocationManager -> IO ()
gvalueSet_ Ptr GValue
gv Maybe GeolocationManager
P.Nothing = Ptr GValue -> Ptr GeolocationManager -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr GeolocationManager
forall a. Ptr a
FP.nullPtr :: FP.Ptr GeolocationManager)
gvalueSet_ Ptr GValue
gv (P.Just GeolocationManager
obj) = GeolocationManager -> (Ptr GeolocationManager -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr GeolocationManager
obj (Ptr GValue -> Ptr GeolocationManager -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe GeolocationManager)
gvalueGet_ Ptr GValue
gv = do
Ptr GeolocationManager
ptr <- Ptr GValue -> IO (Ptr GeolocationManager)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr GeolocationManager)
if Ptr GeolocationManager
ptr Ptr GeolocationManager -> Ptr GeolocationManager -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr GeolocationManager
forall a. Ptr a
FP.nullPtr
then GeolocationManager -> Maybe GeolocationManager
forall a. a -> Maybe a
P.Just (GeolocationManager -> Maybe GeolocationManager)
-> IO GeolocationManager -> IO (Maybe GeolocationManager)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr GeolocationManager -> GeolocationManager)
-> Ptr GeolocationManager -> IO GeolocationManager
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr GeolocationManager -> GeolocationManager
GeolocationManager Ptr GeolocationManager
ptr
else Maybe GeolocationManager -> IO (Maybe GeolocationManager)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe GeolocationManager
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveGeolocationManagerMethod (t :: Symbol) (o :: *) :: * where
ResolveGeolocationManagerMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveGeolocationManagerMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveGeolocationManagerMethod "failed" o = GeolocationManagerFailedMethodInfo
ResolveGeolocationManagerMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveGeolocationManagerMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveGeolocationManagerMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveGeolocationManagerMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveGeolocationManagerMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveGeolocationManagerMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveGeolocationManagerMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveGeolocationManagerMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveGeolocationManagerMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveGeolocationManagerMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveGeolocationManagerMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveGeolocationManagerMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveGeolocationManagerMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveGeolocationManagerMethod "updatePosition" o = GeolocationManagerUpdatePositionMethodInfo
ResolveGeolocationManagerMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveGeolocationManagerMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveGeolocationManagerMethod "getEnableHighAccuracy" o = GeolocationManagerGetEnableHighAccuracyMethodInfo
ResolveGeolocationManagerMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveGeolocationManagerMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveGeolocationManagerMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveGeolocationManagerMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveGeolocationManagerMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveGeolocationManagerMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveGeolocationManagerMethod t GeolocationManager, O.OverloadedMethod info GeolocationManager p) => OL.IsLabel t (GeolocationManager -> 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 ~ ResolveGeolocationManagerMethod t GeolocationManager, O.OverloadedMethod info GeolocationManager p, R.HasField t GeolocationManager p) => R.HasField t GeolocationManager p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveGeolocationManagerMethod t GeolocationManager, O.OverloadedMethodInfo info GeolocationManager) => OL.IsLabel t (O.MethodProxy info GeolocationManager) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type GeolocationManagerStartCallback =
IO Bool
type C_GeolocationManagerStartCallback =
Ptr GeolocationManager ->
Ptr () ->
IO CInt
foreign import ccall "wrapper"
mk_GeolocationManagerStartCallback :: C_GeolocationManagerStartCallback -> IO (FunPtr C_GeolocationManagerStartCallback)
wrap_GeolocationManagerStartCallback ::
GObject a => (a -> GeolocationManagerStartCallback) ->
C_GeolocationManagerStartCallback
wrap_GeolocationManagerStartCallback :: forall a.
GObject a =>
(a -> GeolocationManagerStartCallback)
-> C_GeolocationManagerStartCallback
wrap_GeolocationManagerStartCallback a -> GeolocationManagerStartCallback
gi'cb Ptr GeolocationManager
gi'selfPtr Ptr ()
_ = do
Bool
result <- Ptr GeolocationManager
-> (GeolocationManager -> GeolocationManagerStartCallback)
-> GeolocationManagerStartCallback
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr GeolocationManager
gi'selfPtr ((GeolocationManager -> GeolocationManagerStartCallback)
-> GeolocationManagerStartCallback)
-> (GeolocationManager -> GeolocationManagerStartCallback)
-> GeolocationManagerStartCallback
forall a b. (a -> b) -> a -> b
$ \GeolocationManager
gi'self -> a -> GeolocationManagerStartCallback
gi'cb (GeolocationManager -> a
Coerce.coerce GeolocationManager
gi'self)
let result' :: CInt
result' = (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
result
CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'
onGeolocationManagerStart :: (IsGeolocationManager a, MonadIO m) => a -> ((?self :: a) => GeolocationManagerStartCallback) -> m SignalHandlerId
onGeolocationManagerStart :: forall a (m :: * -> *).
(IsGeolocationManager a, MonadIO m) =>
a
-> ((?self::a) => GeolocationManagerStartCallback)
-> m SignalHandlerId
onGeolocationManagerStart a
obj (?self::a) => GeolocationManagerStartCallback
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 wrapped :: a -> GeolocationManagerStartCallback
wrapped a
self = let ?self = a
?self::a
self in GeolocationManagerStartCallback
(?self::a) => GeolocationManagerStartCallback
cb
let wrapped' :: C_GeolocationManagerStartCallback
wrapped' = (a -> GeolocationManagerStartCallback)
-> C_GeolocationManagerStartCallback
forall a.
GObject a =>
(a -> GeolocationManagerStartCallback)
-> C_GeolocationManagerStartCallback
wrap_GeolocationManagerStartCallback a -> GeolocationManagerStartCallback
wrapped
FunPtr C_GeolocationManagerStartCallback
wrapped'' <- C_GeolocationManagerStartCallback
-> IO (FunPtr C_GeolocationManagerStartCallback)
mk_GeolocationManagerStartCallback C_GeolocationManagerStartCallback
wrapped'
a
-> Text
-> FunPtr C_GeolocationManagerStartCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"start" FunPtr C_GeolocationManagerStartCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterGeolocationManagerStart :: (IsGeolocationManager a, MonadIO m) => a -> ((?self :: a) => GeolocationManagerStartCallback) -> m SignalHandlerId
afterGeolocationManagerStart :: forall a (m :: * -> *).
(IsGeolocationManager a, MonadIO m) =>
a
-> ((?self::a) => GeolocationManagerStartCallback)
-> m SignalHandlerId
afterGeolocationManagerStart a
obj (?self::a) => GeolocationManagerStartCallback
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 wrapped :: a -> GeolocationManagerStartCallback
wrapped a
self = let ?self = a
?self::a
self in GeolocationManagerStartCallback
(?self::a) => GeolocationManagerStartCallback
cb
let wrapped' :: C_GeolocationManagerStartCallback
wrapped' = (a -> GeolocationManagerStartCallback)
-> C_GeolocationManagerStartCallback
forall a.
GObject a =>
(a -> GeolocationManagerStartCallback)
-> C_GeolocationManagerStartCallback
wrap_GeolocationManagerStartCallback a -> GeolocationManagerStartCallback
wrapped
FunPtr C_GeolocationManagerStartCallback
wrapped'' <- C_GeolocationManagerStartCallback
-> IO (FunPtr C_GeolocationManagerStartCallback)
mk_GeolocationManagerStartCallback C_GeolocationManagerStartCallback
wrapped'
a
-> Text
-> FunPtr C_GeolocationManagerStartCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"start" FunPtr C_GeolocationManagerStartCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data GeolocationManagerStartSignalInfo
instance SignalInfo GeolocationManagerStartSignalInfo where
type HaskellCallbackType GeolocationManagerStartSignalInfo = GeolocationManagerStartCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_GeolocationManagerStartCallback cb
cb'' <- mk_GeolocationManagerStartCallback cb'
connectSignalFunPtr obj "start" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.WebKit2.Objects.GeolocationManager::start"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.28/docs/GI-WebKit2-Objects-GeolocationManager.html#g:signal:start"})
#endif
type GeolocationManagerStopCallback =
IO ()
type C_GeolocationManagerStopCallback =
Ptr GeolocationManager ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_GeolocationManagerStopCallback :: C_GeolocationManagerStopCallback -> IO (FunPtr C_GeolocationManagerStopCallback)
wrap_GeolocationManagerStopCallback ::
GObject a => (a -> GeolocationManagerStopCallback) ->
C_GeolocationManagerStopCallback
wrap_GeolocationManagerStopCallback :: forall a.
GObject a =>
(a -> IO ()) -> C_GeolocationManagerStopCallback
wrap_GeolocationManagerStopCallback a -> IO ()
gi'cb Ptr GeolocationManager
gi'selfPtr Ptr ()
_ = do
Ptr GeolocationManager -> (GeolocationManager -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient Ptr GeolocationManager
gi'selfPtr ((GeolocationManager -> IO ()) -> IO ())
-> (GeolocationManager -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \GeolocationManager
gi'self -> a -> IO ()
gi'cb (GeolocationManager -> a
Coerce.coerce GeolocationManager
gi'self)
onGeolocationManagerStop :: (IsGeolocationManager a, MonadIO m) => a -> ((?self :: a) => GeolocationManagerStopCallback) -> m SignalHandlerId
onGeolocationManagerStop :: forall a (m :: * -> *).
(IsGeolocationManager a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onGeolocationManagerStop a
obj (?self::a) => 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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_GeolocationManagerStopCallback
wrapped' = (a -> IO ()) -> C_GeolocationManagerStopCallback
forall a.
GObject a =>
(a -> IO ()) -> C_GeolocationManagerStopCallback
wrap_GeolocationManagerStopCallback a -> IO ()
wrapped
FunPtr C_GeolocationManagerStopCallback
wrapped'' <- C_GeolocationManagerStopCallback
-> IO (FunPtr C_GeolocationManagerStopCallback)
mk_GeolocationManagerStopCallback C_GeolocationManagerStopCallback
wrapped'
a
-> Text
-> FunPtr C_GeolocationManagerStopCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"stop" FunPtr C_GeolocationManagerStopCallback
wrapped'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterGeolocationManagerStop :: (IsGeolocationManager a, MonadIO m) => a -> ((?self :: a) => GeolocationManagerStopCallback) -> m SignalHandlerId
afterGeolocationManagerStop :: forall a (m :: * -> *).
(IsGeolocationManager a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterGeolocationManagerStop a
obj (?self::a) => 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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_GeolocationManagerStopCallback
wrapped' = (a -> IO ()) -> C_GeolocationManagerStopCallback
forall a.
GObject a =>
(a -> IO ()) -> C_GeolocationManagerStopCallback
wrap_GeolocationManagerStopCallback a -> IO ()
wrapped
FunPtr C_GeolocationManagerStopCallback
wrapped'' <- C_GeolocationManagerStopCallback
-> IO (FunPtr C_GeolocationManagerStopCallback)
mk_GeolocationManagerStopCallback C_GeolocationManagerStopCallback
wrapped'
a
-> Text
-> FunPtr C_GeolocationManagerStopCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"stop" FunPtr C_GeolocationManagerStopCallback
wrapped'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data GeolocationManagerStopSignalInfo
instance SignalInfo GeolocationManagerStopSignalInfo where
type HaskellCallbackType GeolocationManagerStopSignalInfo = GeolocationManagerStopCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_GeolocationManagerStopCallback cb
cb'' <- mk_GeolocationManagerStopCallback cb'
connectSignalFunPtr obj "stop" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.WebKit2.Objects.GeolocationManager::stop"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.28/docs/GI-WebKit2-Objects-GeolocationManager.html#g:signal:stop"})
#endif
getGeolocationManagerEnableHighAccuracy :: (MonadIO m, IsGeolocationManager o) => o -> m Bool
getGeolocationManagerEnableHighAccuracy :: forall (m :: * -> *) o.
(MonadIO m, IsGeolocationManager o) =>
o -> m Bool
getGeolocationManagerEnableHighAccuracy o
obj = GeolocationManagerStartCallback -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (GeolocationManagerStartCallback -> m Bool)
-> GeolocationManagerStartCallback -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> GeolocationManagerStartCallback
forall a.
GObject a =>
a -> String -> GeolocationManagerStartCallback
B.Properties.getObjectPropertyBool o
obj String
"enable-high-accuracy"
#if defined(ENABLE_OVERLOADING)
data GeolocationManagerEnableHighAccuracyPropertyInfo
instance AttrInfo GeolocationManagerEnableHighAccuracyPropertyInfo where
type AttrAllowedOps GeolocationManagerEnableHighAccuracyPropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint GeolocationManagerEnableHighAccuracyPropertyInfo = IsGeolocationManager
type AttrSetTypeConstraint GeolocationManagerEnableHighAccuracyPropertyInfo = (~) ()
type AttrTransferTypeConstraint GeolocationManagerEnableHighAccuracyPropertyInfo = (~) ()
type AttrTransferType GeolocationManagerEnableHighAccuracyPropertyInfo = ()
type AttrGetType GeolocationManagerEnableHighAccuracyPropertyInfo = Bool
type AttrLabel GeolocationManagerEnableHighAccuracyPropertyInfo = "enable-high-accuracy"
type AttrOrigin GeolocationManagerEnableHighAccuracyPropertyInfo = GeolocationManager
attrGet = getGeolocationManagerEnableHighAccuracy
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.WebKit2.Objects.GeolocationManager.enableHighAccuracy"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.28/docs/GI-WebKit2-Objects-GeolocationManager.html#g:attr:enableHighAccuracy"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList GeolocationManager
type instance O.AttributeList GeolocationManager = GeolocationManagerAttributeList
type GeolocationManagerAttributeList = ('[ '("enableHighAccuracy", GeolocationManagerEnableHighAccuracyPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
geolocationManagerEnableHighAccuracy :: AttrLabelProxy "enableHighAccuracy"
geolocationManagerEnableHighAccuracy = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList GeolocationManager = GeolocationManagerSignalList
type GeolocationManagerSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo), '("start", GeolocationManagerStartSignalInfo), '("stop", GeolocationManagerStopSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "webkit_geolocation_manager_failed" webkit_geolocation_manager_failed ::
Ptr GeolocationManager ->
CString ->
IO ()
geolocationManagerFailed ::
(B.CallStack.HasCallStack, MonadIO m, IsGeolocationManager a) =>
a
-> T.Text
-> m ()
geolocationManagerFailed :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGeolocationManager a) =>
a -> Text -> m ()
geolocationManagerFailed a
manager Text
errorMessage = 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 GeolocationManager
manager' <- a -> IO (Ptr GeolocationManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
CString
errorMessage' <- Text -> IO CString
textToCString Text
errorMessage
Ptr GeolocationManager -> CString -> IO ()
webkit_geolocation_manager_failed Ptr GeolocationManager
manager' CString
errorMessage'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
errorMessage'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data GeolocationManagerFailedMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsGeolocationManager a) => O.OverloadedMethod GeolocationManagerFailedMethodInfo a signature where
overloadedMethod = geolocationManagerFailed
instance O.OverloadedMethodInfo GeolocationManagerFailedMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.WebKit2.Objects.GeolocationManager.geolocationManagerFailed",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.28/docs/GI-WebKit2-Objects-GeolocationManager.html#v:geolocationManagerFailed"
})
#endif
foreign import ccall "webkit_geolocation_manager_get_enable_high_accuracy" webkit_geolocation_manager_get_enable_high_accuracy ::
Ptr GeolocationManager ->
IO CInt
geolocationManagerGetEnableHighAccuracy ::
(B.CallStack.HasCallStack, MonadIO m, IsGeolocationManager a) =>
a
-> m Bool
geolocationManagerGetEnableHighAccuracy :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGeolocationManager a) =>
a -> m Bool
geolocationManagerGetEnableHighAccuracy a
manager = GeolocationManagerStartCallback -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (GeolocationManagerStartCallback -> m Bool)
-> GeolocationManagerStartCallback -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr GeolocationManager
manager' <- a -> IO (Ptr GeolocationManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
CInt
result <- Ptr GeolocationManager -> IO CInt
webkit_geolocation_manager_get_enable_high_accuracy Ptr GeolocationManager
manager'
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
manager
Bool -> GeolocationManagerStartCallback
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data GeolocationManagerGetEnableHighAccuracyMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsGeolocationManager a) => O.OverloadedMethod GeolocationManagerGetEnableHighAccuracyMethodInfo a signature where
overloadedMethod = geolocationManagerGetEnableHighAccuracy
instance O.OverloadedMethodInfo GeolocationManagerGetEnableHighAccuracyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.WebKit2.Objects.GeolocationManager.geolocationManagerGetEnableHighAccuracy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.28/docs/GI-WebKit2-Objects-GeolocationManager.html#v:geolocationManagerGetEnableHighAccuracy"
})
#endif
foreign import ccall "webkit_geolocation_manager_update_position" webkit_geolocation_manager_update_position ::
Ptr GeolocationManager ->
Ptr WebKit2.GeolocationPosition.GeolocationPosition ->
IO ()
geolocationManagerUpdatePosition ::
(B.CallStack.HasCallStack, MonadIO m, IsGeolocationManager a) =>
a
-> WebKit2.GeolocationPosition.GeolocationPosition
-> m ()
geolocationManagerUpdatePosition :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsGeolocationManager a) =>
a -> GeolocationPosition -> m ()
geolocationManagerUpdatePosition a
manager GeolocationPosition
position = 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 GeolocationManager
manager' <- a -> IO (Ptr GeolocationManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
manager
Ptr GeolocationPosition
position' <- GeolocationPosition -> IO (Ptr GeolocationPosition)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GeolocationPosition
position
Ptr GeolocationManager -> Ptr GeolocationPosition -> IO ()
webkit_geolocation_manager_update_position Ptr GeolocationManager
manager' Ptr GeolocationPosition
position'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
manager
GeolocationPosition -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GeolocationPosition
position
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data GeolocationManagerUpdatePositionMethodInfo
instance (signature ~ (WebKit2.GeolocationPosition.GeolocationPosition -> m ()), MonadIO m, IsGeolocationManager a) => O.OverloadedMethod GeolocationManagerUpdatePositionMethodInfo a signature where
overloadedMethod = geolocationManagerUpdatePosition
instance O.OverloadedMethodInfo GeolocationManagerUpdatePositionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.WebKit2.Objects.GeolocationManager.geolocationManagerUpdatePosition",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-webkit2-4.0.28/docs/GI-WebKit2-Objects-GeolocationManager.html#v:geolocationManagerUpdatePosition"
})
#endif