{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GstVideo.Interfaces.VideoOrientation
(
VideoOrientation(..) ,
IsVideoOrientation ,
#if defined(ENABLE_OVERLOADING)
ResolveVideoOrientationMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
VideoOrientationGetHcenterMethodInfo ,
#endif
videoOrientationGetHcenter ,
#if defined(ENABLE_OVERLOADING)
VideoOrientationGetHflipMethodInfo ,
#endif
videoOrientationGetHflip ,
#if defined(ENABLE_OVERLOADING)
VideoOrientationGetVcenterMethodInfo ,
#endif
videoOrientationGetVcenter ,
#if defined(ENABLE_OVERLOADING)
VideoOrientationGetVflipMethodInfo ,
#endif
videoOrientationGetVflip ,
#if defined(ENABLE_OVERLOADING)
VideoOrientationSetHcenterMethodInfo ,
#endif
videoOrientationSetHcenter ,
#if defined(ENABLE_OVERLOADING)
VideoOrientationSetHflipMethodInfo ,
#endif
videoOrientationSetHflip ,
#if defined(ENABLE_OVERLOADING)
VideoOrientationSetVcenterMethodInfo ,
#endif
videoOrientationSetVcenter ,
#if defined(ENABLE_OVERLOADING)
VideoOrientationSetVflipMethodInfo ,
#endif
videoOrientationSetVflip ,
) 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.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.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
newtype VideoOrientation = VideoOrientation (SP.ManagedPtr VideoOrientation)
deriving (VideoOrientation -> VideoOrientation -> Bool
(VideoOrientation -> VideoOrientation -> Bool)
-> (VideoOrientation -> VideoOrientation -> Bool)
-> Eq VideoOrientation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VideoOrientation -> VideoOrientation -> Bool
$c/= :: VideoOrientation -> VideoOrientation -> Bool
== :: VideoOrientation -> VideoOrientation -> Bool
$c== :: VideoOrientation -> VideoOrientation -> Bool
Eq)
instance SP.ManagedPtrNewtype VideoOrientation where
toManagedPtr :: VideoOrientation -> ManagedPtr VideoOrientation
toManagedPtr (VideoOrientation ManagedPtr VideoOrientation
p) = ManagedPtr VideoOrientation
p
class (ManagedPtrNewtype o, O.IsDescendantOf VideoOrientation o) => IsVideoOrientation o
instance (ManagedPtrNewtype o, O.IsDescendantOf VideoOrientation o) => IsVideoOrientation o
instance BoxedPtr VideoOrientation where
boxedPtrCopy :: VideoOrientation -> IO VideoOrientation
boxedPtrCopy = VideoOrientation -> IO VideoOrientation
forall (m :: * -> *) a. Monad m => a -> m a
return
boxedPtrFree :: VideoOrientation -> IO ()
boxedPtrFree = \VideoOrientation
_x -> () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
type family ResolveVideoOrientationMethod (t :: Symbol) (o :: *) :: * where
ResolveVideoOrientationMethod "getHcenter" o = VideoOrientationGetHcenterMethodInfo
ResolveVideoOrientationMethod "getHflip" o = VideoOrientationGetHflipMethodInfo
ResolveVideoOrientationMethod "getVcenter" o = VideoOrientationGetVcenterMethodInfo
ResolveVideoOrientationMethod "getVflip" o = VideoOrientationGetVflipMethodInfo
ResolveVideoOrientationMethod "setHcenter" o = VideoOrientationSetHcenterMethodInfo
ResolveVideoOrientationMethod "setHflip" o = VideoOrientationSetHflipMethodInfo
ResolveVideoOrientationMethod "setVcenter" o = VideoOrientationSetVcenterMethodInfo
ResolveVideoOrientationMethod "setVflip" o = VideoOrientationSetVflipMethodInfo
ResolveVideoOrientationMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveVideoOrientationMethod t VideoOrientation, O.MethodInfo info VideoOrientation p) => OL.IsLabel t (VideoOrientation -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
foreign import ccall "gst_video_orientation_get_hcenter" gst_video_orientation_get_hcenter ::
Ptr VideoOrientation ->
Ptr Int32 ->
IO CInt
videoOrientationGetHcenter ::
(B.CallStack.HasCallStack, MonadIO m, IsVideoOrientation a) =>
a
-> m ((Bool, Int32))
videoOrientationGetHcenter :: a -> m (Bool, Int32)
videoOrientationGetHcenter a
videoOrientation = IO (Bool, Int32) -> m (Bool, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Int32) -> m (Bool, Int32))
-> IO (Bool, Int32) -> m (Bool, Int32)
forall a b. (a -> b) -> a -> b
$ do
Ptr VideoOrientation
videoOrientation' <- a -> IO (Ptr VideoOrientation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
videoOrientation
Ptr Int32
center <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
CInt
result <- Ptr VideoOrientation -> Ptr Int32 -> IO CInt
gst_video_orientation_get_hcenter Ptr VideoOrientation
videoOrientation' Ptr Int32
center
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Int32
center' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
center
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
videoOrientation
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
center
(Bool, Int32) -> IO (Bool, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Int32
center')
#if defined(ENABLE_OVERLOADING)
data VideoOrientationGetHcenterMethodInfo
instance (signature ~ (m ((Bool, Int32))), MonadIO m, IsVideoOrientation a) => O.MethodInfo VideoOrientationGetHcenterMethodInfo a signature where
overloadedMethod = videoOrientationGetHcenter
#endif
foreign import ccall "gst_video_orientation_get_hflip" gst_video_orientation_get_hflip ::
Ptr VideoOrientation ->
Ptr CInt ->
IO CInt
videoOrientationGetHflip ::
(B.CallStack.HasCallStack, MonadIO m, IsVideoOrientation a) =>
a
-> m ((Bool, Bool))
videoOrientationGetHflip :: a -> m (Bool, Bool)
videoOrientationGetHflip a
videoOrientation = IO (Bool, Bool) -> m (Bool, Bool)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Bool) -> m (Bool, Bool))
-> IO (Bool, Bool) -> m (Bool, Bool)
forall a b. (a -> b) -> a -> b
$ do
Ptr VideoOrientation
videoOrientation' <- a -> IO (Ptr VideoOrientation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
videoOrientation
Ptr CInt
flip <- IO (Ptr CInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CInt)
CInt
result <- Ptr VideoOrientation -> Ptr CInt -> IO CInt
gst_video_orientation_get_hflip Ptr VideoOrientation
videoOrientation' Ptr CInt
flip
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
CInt
flip' <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
flip
let flip'' :: Bool
flip'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
flip'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
videoOrientation
Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
flip
(Bool, Bool) -> IO (Bool, Bool)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Bool
flip'')
#if defined(ENABLE_OVERLOADING)
data VideoOrientationGetHflipMethodInfo
instance (signature ~ (m ((Bool, Bool))), MonadIO m, IsVideoOrientation a) => O.MethodInfo VideoOrientationGetHflipMethodInfo a signature where
overloadedMethod = videoOrientationGetHflip
#endif
foreign import ccall "gst_video_orientation_get_vcenter" gst_video_orientation_get_vcenter ::
Ptr VideoOrientation ->
Ptr Int32 ->
IO CInt
videoOrientationGetVcenter ::
(B.CallStack.HasCallStack, MonadIO m, IsVideoOrientation a) =>
a
-> m ((Bool, Int32))
videoOrientationGetVcenter :: a -> m (Bool, Int32)
videoOrientationGetVcenter a
videoOrientation = IO (Bool, Int32) -> m (Bool, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Int32) -> m (Bool, Int32))
-> IO (Bool, Int32) -> m (Bool, Int32)
forall a b. (a -> b) -> a -> b
$ do
Ptr VideoOrientation
videoOrientation' <- a -> IO (Ptr VideoOrientation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
videoOrientation
Ptr Int32
center <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
CInt
result <- Ptr VideoOrientation -> Ptr Int32 -> IO CInt
gst_video_orientation_get_vcenter Ptr VideoOrientation
videoOrientation' Ptr Int32
center
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Int32
center' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
center
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
videoOrientation
Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
center
(Bool, Int32) -> IO (Bool, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Int32
center')
#if defined(ENABLE_OVERLOADING)
data VideoOrientationGetVcenterMethodInfo
instance (signature ~ (m ((Bool, Int32))), MonadIO m, IsVideoOrientation a) => O.MethodInfo VideoOrientationGetVcenterMethodInfo a signature where
overloadedMethod = videoOrientationGetVcenter
#endif
foreign import ccall "gst_video_orientation_get_vflip" gst_video_orientation_get_vflip ::
Ptr VideoOrientation ->
Ptr CInt ->
IO CInt
videoOrientationGetVflip ::
(B.CallStack.HasCallStack, MonadIO m, IsVideoOrientation a) =>
a
-> m ((Bool, Bool))
videoOrientationGetVflip :: a -> m (Bool, Bool)
videoOrientationGetVflip a
videoOrientation = IO (Bool, Bool) -> m (Bool, Bool)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Bool) -> m (Bool, Bool))
-> IO (Bool, Bool) -> m (Bool, Bool)
forall a b. (a -> b) -> a -> b
$ do
Ptr VideoOrientation
videoOrientation' <- a -> IO (Ptr VideoOrientation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
videoOrientation
Ptr CInt
flip <- IO (Ptr CInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CInt)
CInt
result <- Ptr VideoOrientation -> Ptr CInt -> IO CInt
gst_video_orientation_get_vflip Ptr VideoOrientation
videoOrientation' Ptr CInt
flip
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
CInt
flip' <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
flip
let flip'' :: Bool
flip'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
flip'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
videoOrientation
Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
flip
(Bool, Bool) -> IO (Bool, Bool)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Bool
flip'')
#if defined(ENABLE_OVERLOADING)
data VideoOrientationGetVflipMethodInfo
instance (signature ~ (m ((Bool, Bool))), MonadIO m, IsVideoOrientation a) => O.MethodInfo VideoOrientationGetVflipMethodInfo a signature where
overloadedMethod = videoOrientationGetVflip
#endif
foreign import ccall "gst_video_orientation_set_hcenter" gst_video_orientation_set_hcenter ::
Ptr VideoOrientation ->
Int32 ->
IO CInt
videoOrientationSetHcenter ::
(B.CallStack.HasCallStack, MonadIO m, IsVideoOrientation a) =>
a
-> Int32
-> m Bool
videoOrientationSetHcenter :: a -> Int32 -> m Bool
videoOrientationSetHcenter a
videoOrientation Int32
center = IO Bool -> m Bool
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 VideoOrientation
videoOrientation' <- a -> IO (Ptr VideoOrientation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
videoOrientation
CInt
result <- Ptr VideoOrientation -> Int32 -> IO CInt
gst_video_orientation_set_hcenter Ptr VideoOrientation
videoOrientation' Int32
center
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
videoOrientation
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data VideoOrientationSetHcenterMethodInfo
instance (signature ~ (Int32 -> m Bool), MonadIO m, IsVideoOrientation a) => O.MethodInfo VideoOrientationSetHcenterMethodInfo a signature where
overloadedMethod = videoOrientationSetHcenter
#endif
foreign import ccall "gst_video_orientation_set_hflip" gst_video_orientation_set_hflip ::
Ptr VideoOrientation ->
CInt ->
IO CInt
videoOrientationSetHflip ::
(B.CallStack.HasCallStack, MonadIO m, IsVideoOrientation a) =>
a
-> Bool
-> m Bool
videoOrientationSetHflip :: a -> Bool -> m Bool
videoOrientationSetHflip a
videoOrientation Bool
flip = IO Bool -> m Bool
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 VideoOrientation
videoOrientation' <- a -> IO (Ptr VideoOrientation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
videoOrientation
let flip' :: CInt
flip' = (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
flip
CInt
result <- Ptr VideoOrientation -> CInt -> IO CInt
gst_video_orientation_set_hflip Ptr VideoOrientation
videoOrientation' CInt
flip'
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
videoOrientation
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data VideoOrientationSetHflipMethodInfo
instance (signature ~ (Bool -> m Bool), MonadIO m, IsVideoOrientation a) => O.MethodInfo VideoOrientationSetHflipMethodInfo a signature where
overloadedMethod = videoOrientationSetHflip
#endif
foreign import ccall "gst_video_orientation_set_vcenter" gst_video_orientation_set_vcenter ::
Ptr VideoOrientation ->
Int32 ->
IO CInt
videoOrientationSetVcenter ::
(B.CallStack.HasCallStack, MonadIO m, IsVideoOrientation a) =>
a
-> Int32
-> m Bool
videoOrientationSetVcenter :: a -> Int32 -> m Bool
videoOrientationSetVcenter a
videoOrientation Int32
center = IO Bool -> m Bool
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 VideoOrientation
videoOrientation' <- a -> IO (Ptr VideoOrientation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
videoOrientation
CInt
result <- Ptr VideoOrientation -> Int32 -> IO CInt
gst_video_orientation_set_vcenter Ptr VideoOrientation
videoOrientation' Int32
center
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
videoOrientation
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data VideoOrientationSetVcenterMethodInfo
instance (signature ~ (Int32 -> m Bool), MonadIO m, IsVideoOrientation a) => O.MethodInfo VideoOrientationSetVcenterMethodInfo a signature where
overloadedMethod = videoOrientationSetVcenter
#endif
foreign import ccall "gst_video_orientation_set_vflip" gst_video_orientation_set_vflip ::
Ptr VideoOrientation ->
CInt ->
IO CInt
videoOrientationSetVflip ::
(B.CallStack.HasCallStack, MonadIO m, IsVideoOrientation a) =>
a
-> Bool
-> m Bool
videoOrientationSetVflip :: a -> Bool -> m Bool
videoOrientationSetVflip a
videoOrientation Bool
flip = IO Bool -> m Bool
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 VideoOrientation
videoOrientation' <- a -> IO (Ptr VideoOrientation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
videoOrientation
let flip' :: CInt
flip' = (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
flip
CInt
result <- Ptr VideoOrientation -> CInt -> IO CInt
gst_video_orientation_set_vflip Ptr VideoOrientation
videoOrientation' CInt
flip'
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
videoOrientation
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data VideoOrientationSetVflipMethodInfo
instance (signature ~ (Bool -> m Bool), MonadIO m, IsVideoOrientation a) => O.MethodInfo VideoOrientationSetVflipMethodInfo a signature where
overloadedMethod = videoOrientationSetVflip
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList VideoOrientation = VideoOrientationSignalList
type VideoOrientationSignalList = ('[ ] :: [(Symbol, *)])
#endif