#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.WebKit2.Functions
(
getMajorVersion ,
getMicroVersion ,
getMinorVersion ,
mediaKeySystemPermissionGetName ,
uriForDisplay ,
userMediaPermissionIsForAudioDevice ,
userMediaPermissionIsForDisplayDevice ,
userMediaPermissionIsForVideoDevice ,
) 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 {-# SOURCE #-} qualified GI.WebKit2.Objects.MediaKeySystemPermissionRequest as WebKit2.MediaKeySystemPermissionRequest
import {-# SOURCE #-} qualified GI.WebKit2.Objects.UserMediaPermissionRequest as WebKit2.UserMediaPermissionRequest
foreign import ccall "webkit_user_media_permission_is_for_video_device" webkit_user_media_permission_is_for_video_device ::
Ptr WebKit2.UserMediaPermissionRequest.UserMediaPermissionRequest ->
IO CInt
userMediaPermissionIsForVideoDevice ::
(B.CallStack.HasCallStack, MonadIO m, WebKit2.UserMediaPermissionRequest.IsUserMediaPermissionRequest a) =>
a
-> m Bool
userMediaPermissionIsForVideoDevice :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsUserMediaPermissionRequest a) =>
a -> m Bool
userMediaPermissionIsForVideoDevice a
request = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr UserMediaPermissionRequest
request' <- a -> IO (Ptr UserMediaPermissionRequest)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
request
CInt
result <- Ptr UserMediaPermissionRequest -> IO CInt
webkit_user_media_permission_is_for_video_device Ptr UserMediaPermissionRequest
request'
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
request
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
foreign import ccall "webkit_user_media_permission_is_for_display_device" webkit_user_media_permission_is_for_display_device ::
Ptr WebKit2.UserMediaPermissionRequest.UserMediaPermissionRequest ->
IO CInt
userMediaPermissionIsForDisplayDevice ::
(B.CallStack.HasCallStack, MonadIO m, WebKit2.UserMediaPermissionRequest.IsUserMediaPermissionRequest a) =>
a
-> m Bool
userMediaPermissionIsForDisplayDevice :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsUserMediaPermissionRequest a) =>
a -> m Bool
userMediaPermissionIsForDisplayDevice a
request = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr UserMediaPermissionRequest
request' <- a -> IO (Ptr UserMediaPermissionRequest)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
request
CInt
result <- Ptr UserMediaPermissionRequest -> IO CInt
webkit_user_media_permission_is_for_display_device Ptr UserMediaPermissionRequest
request'
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
request
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
foreign import ccall "webkit_user_media_permission_is_for_audio_device" webkit_user_media_permission_is_for_audio_device ::
Ptr WebKit2.UserMediaPermissionRequest.UserMediaPermissionRequest ->
IO CInt
userMediaPermissionIsForAudioDevice ::
(B.CallStack.HasCallStack, MonadIO m, WebKit2.UserMediaPermissionRequest.IsUserMediaPermissionRequest a) =>
a
-> m Bool
userMediaPermissionIsForAudioDevice :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsUserMediaPermissionRequest a) =>
a -> m Bool
userMediaPermissionIsForAudioDevice a
request = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr UserMediaPermissionRequest
request' <- a -> IO (Ptr UserMediaPermissionRequest)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
request
CInt
result <- Ptr UserMediaPermissionRequest -> IO CInt
webkit_user_media_permission_is_for_audio_device Ptr UserMediaPermissionRequest
request'
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
request
Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
foreign import ccall "webkit_uri_for_display" webkit_uri_for_display ::
CString ->
IO CString
uriForDisplay ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m (Maybe T.Text)
uriForDisplay :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m (Maybe Text)
uriForDisplay Text
uri = 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
CString
uri' <- Text -> IO CString
textToCString Text
uri
CString
result <- CString -> IO CString
webkit_uri_for_display CString
uri'
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result'
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
Maybe Text -> IO (Maybe Text)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
foreign import ccall "webkit_media_key_system_permission_get_name" webkit_media_key_system_permission_get_name ::
Ptr WebKit2.MediaKeySystemPermissionRequest.MediaKeySystemPermissionRequest ->
IO CString
mediaKeySystemPermissionGetName ::
(B.CallStack.HasCallStack, MonadIO m, WebKit2.MediaKeySystemPermissionRequest.IsMediaKeySystemPermissionRequest a) =>
a
-> m T.Text
mediaKeySystemPermissionGetName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMediaKeySystemPermissionRequest a) =>
a -> m Text
mediaKeySystemPermissionGetName a
request = IO Text -> m Text
forall a. IO a -> m a
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 MediaKeySystemPermissionRequest
request' <- a -> IO (Ptr MediaKeySystemPermissionRequest)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
request
CString
result <- Ptr MediaKeySystemPermissionRequest -> IO CString
webkit_media_key_system_permission_get_name Ptr MediaKeySystemPermissionRequest
request'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"mediaKeySystemPermissionGetName" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
request
Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
foreign import ccall "webkit_get_minor_version" webkit_get_minor_version ::
IO Word32
getMinorVersion ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Word32
getMinorVersion :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Word32
getMinorVersion = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Word32
result <- IO Word32
webkit_get_minor_version
Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
foreign import ccall "webkit_get_micro_version" webkit_get_micro_version ::
IO Word32
getMicroVersion ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Word32
getMicroVersion :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Word32
getMicroVersion = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Word32
result <- IO Word32
webkit_get_micro_version
Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
foreign import ccall "webkit_get_major_version" webkit_get_major_version ::
IO Word32
getMajorVersion ::
(B.CallStack.HasCallStack, MonadIO m) =>
m Word32
getMajorVersion :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Word32
getMajorVersion = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Word32
result <- IO Word32
webkit_get_major_version
Word32 -> IO Word32
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result