{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- The interface allows unified access to control flipping and rotation
-- operations of video-sources or operators.
-- 
-- /Since: 1.10/

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.GstVideo.Interfaces.VideoDirection
    ( 

-- * Exported types
    VideoDirection(..)                      ,
    IsVideoDirection                        ,
    toVideoDirection                        ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getData]("GI.GObject.Objects.Object#g:method:getData"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

#if defined(ENABLE_OVERLOADING)
    ResolveVideoDirectionMethod             ,
#endif



 -- * Properties


-- ** videoDirection #attr:videoDirection#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    VideoDirectionVideoDirectionPropertyInfo,
#endif
    constructVideoDirectionVideoDirection   ,
    getVideoDirectionVideoDirection         ,
    setVideoDirectionVideoDirection         ,
#if defined(ENABLE_OVERLOADING)
    videoDirectionVideoDirection            ,
#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.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
import qualified GHC.Records as R

import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.GstVideo.Enums as GstVideo.Enums

-- interface VideoDirection 
-- | Memory-managed wrapper type.
newtype VideoDirection = VideoDirection (SP.ManagedPtr VideoDirection)
    deriving (VideoDirection -> VideoDirection -> Bool
(VideoDirection -> VideoDirection -> Bool)
-> (VideoDirection -> VideoDirection -> Bool) -> Eq VideoDirection
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VideoDirection -> VideoDirection -> Bool
$c/= :: VideoDirection -> VideoDirection -> Bool
== :: VideoDirection -> VideoDirection -> Bool
$c== :: VideoDirection -> VideoDirection -> Bool
Eq)

instance SP.ManagedPtrNewtype VideoDirection where
    toManagedPtr :: VideoDirection -> ManagedPtr VideoDirection
toManagedPtr (VideoDirection ManagedPtr VideoDirection
p) = ManagedPtr VideoDirection
p

foreign import ccall "gst_video_direction_get_type"
    c_gst_video_direction_get_type :: IO B.Types.GType

instance B.Types.TypedObject VideoDirection where
    glibType :: IO GType
glibType = IO GType
c_gst_video_direction_get_type

instance B.Types.GObject VideoDirection

-- | Type class for types which can be safely cast to `VideoDirection`, for instance with `toVideoDirection`.
class (SP.GObject o, O.IsDescendantOf VideoDirection o) => IsVideoDirection o
instance (SP.GObject o, O.IsDescendantOf VideoDirection o) => IsVideoDirection o

instance O.HasParentTypes VideoDirection
type instance O.ParentTypes VideoDirection = '[GObject.Object.Object]

-- | Cast to `VideoDirection`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toVideoDirection :: (MIO.MonadIO m, IsVideoDirection o) => o -> m VideoDirection
toVideoDirection :: forall (m :: * -> *) o.
(MonadIO m, IsVideoDirection o) =>
o -> m VideoDirection
toVideoDirection = IO VideoDirection -> m VideoDirection
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO VideoDirection -> m VideoDirection)
-> (o -> IO VideoDirection) -> o -> m VideoDirection
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr VideoDirection -> VideoDirection)
-> o -> IO VideoDirection
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
 ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr VideoDirection -> VideoDirection
VideoDirection

-- | Convert 'VideoDirection' to and from 'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe VideoDirection) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gst_video_direction_get_type
    gvalueSet_ :: Ptr GValue -> Maybe VideoDirection -> IO ()
gvalueSet_ Ptr GValue
gv Maybe VideoDirection
P.Nothing = Ptr GValue -> Ptr VideoDirection -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr VideoDirection
forall a. Ptr a
FP.nullPtr :: FP.Ptr VideoDirection)
    gvalueSet_ Ptr GValue
gv (P.Just VideoDirection
obj) = VideoDirection -> (Ptr VideoDirection -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr VideoDirection
obj (Ptr GValue -> Ptr VideoDirection -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe VideoDirection)
gvalueGet_ Ptr GValue
gv = do
        Ptr VideoDirection
ptr <- Ptr GValue -> IO (Ptr VideoDirection)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr VideoDirection)
        if Ptr VideoDirection
ptr Ptr VideoDirection -> Ptr VideoDirection -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr VideoDirection
forall a. Ptr a
FP.nullPtr
        then VideoDirection -> Maybe VideoDirection
forall a. a -> Maybe a
P.Just (VideoDirection -> Maybe VideoDirection)
-> IO VideoDirection -> IO (Maybe VideoDirection)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr VideoDirection -> VideoDirection)
-> Ptr VideoDirection -> IO VideoDirection
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr VideoDirection -> VideoDirection
VideoDirection Ptr VideoDirection
ptr
        else Maybe VideoDirection -> IO (Maybe VideoDirection)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe VideoDirection
forall a. Maybe a
P.Nothing
        
    

-- VVV Prop "video-direction"
   -- Type: TInterface (Name {namespace = "GstVideo", name = "VideoOrientationMethod"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@video-direction@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' videoDirection #videoDirection
-- @
getVideoDirectionVideoDirection :: (MonadIO m, IsVideoDirection o) => o -> m GstVideo.Enums.VideoOrientationMethod
getVideoDirectionVideoDirection :: forall (m :: * -> *) o.
(MonadIO m, IsVideoDirection o) =>
o -> m VideoOrientationMethod
getVideoDirectionVideoDirection o
obj = IO VideoOrientationMethod -> m VideoOrientationMethod
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO VideoOrientationMethod -> m VideoOrientationMethod)
-> IO VideoOrientationMethod -> m VideoOrientationMethod
forall a b. (a -> b) -> a -> b
$ o -> String -> IO VideoOrientationMethod
forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
B.Properties.getObjectPropertyEnum o
obj String
"video-direction"

-- | Set the value of the “@video-direction@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' videoDirection [ #videoDirection 'Data.GI.Base.Attributes.:=' value ]
-- @
setVideoDirectionVideoDirection :: (MonadIO m, IsVideoDirection o) => o -> GstVideo.Enums.VideoOrientationMethod -> m ()
setVideoDirectionVideoDirection :: forall (m :: * -> *) o.
(MonadIO m, IsVideoDirection o) =>
o -> VideoOrientationMethod -> m ()
setVideoDirectionVideoDirection o
obj VideoOrientationMethod
val = IO () -> m ()
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 -> VideoOrientationMethod -> IO ()
forall a b.
(GObject a, Enum b, BoxedEnum b) =>
a -> String -> b -> IO ()
B.Properties.setObjectPropertyEnum o
obj String
"video-direction" VideoOrientationMethod
val

-- | Construct a `GValueConstruct` with valid value for the “@video-direction@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructVideoDirectionVideoDirection :: (IsVideoDirection o, MIO.MonadIO m) => GstVideo.Enums.VideoOrientationMethod -> m (GValueConstruct o)
constructVideoDirectionVideoDirection :: forall o (m :: * -> *).
(IsVideoDirection o, MonadIO m) =>
VideoOrientationMethod -> m (GValueConstruct o)
constructVideoDirectionVideoDirection VideoOrientationMethod
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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 (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 -> VideoOrientationMethod -> IO (GValueConstruct o)
forall a o.
(Enum a, BoxedEnum a) =>
String -> a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyEnum String
"video-direction" VideoOrientationMethod
val

#if defined(ENABLE_OVERLOADING)
data VideoDirectionVideoDirectionPropertyInfo
instance AttrInfo VideoDirectionVideoDirectionPropertyInfo where
    type AttrAllowedOps VideoDirectionVideoDirectionPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint VideoDirectionVideoDirectionPropertyInfo = IsVideoDirection
    type AttrSetTypeConstraint VideoDirectionVideoDirectionPropertyInfo = (~) GstVideo.Enums.VideoOrientationMethod
    type AttrTransferTypeConstraint VideoDirectionVideoDirectionPropertyInfo = (~) GstVideo.Enums.VideoOrientationMethod
    type AttrTransferType VideoDirectionVideoDirectionPropertyInfo = GstVideo.Enums.VideoOrientationMethod
    type AttrGetType VideoDirectionVideoDirectionPropertyInfo = GstVideo.Enums.VideoOrientationMethod
    type AttrLabel VideoDirectionVideoDirectionPropertyInfo = "video-direction"
    type AttrOrigin VideoDirectionVideoDirectionPropertyInfo = VideoDirection
    attrGet = getVideoDirectionVideoDirection
    attrSet = setVideoDirectionVideoDirection
    attrTransfer _ v = do
        return v
    attrConstruct = constructVideoDirectionVideoDirection
    attrClear = undefined
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList VideoDirection
type instance O.AttributeList VideoDirection = VideoDirectionAttributeList
type VideoDirectionAttributeList = ('[ '("videoDirection", VideoDirectionVideoDirectionPropertyInfo)] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
videoDirectionVideoDirection :: AttrLabelProxy "videoDirection"
videoDirectionVideoDirection = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveVideoDirectionMethod (t :: Symbol) (o :: *) :: * where
    ResolveVideoDirectionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveVideoDirectionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveVideoDirectionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveVideoDirectionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveVideoDirectionMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveVideoDirectionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveVideoDirectionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveVideoDirectionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveVideoDirectionMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveVideoDirectionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveVideoDirectionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveVideoDirectionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveVideoDirectionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveVideoDirectionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveVideoDirectionMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveVideoDirectionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveVideoDirectionMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveVideoDirectionMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveVideoDirectionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveVideoDirectionMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveVideoDirectionMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveVideoDirectionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveVideoDirectionMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveVideoDirectionMethod t VideoDirection, O.OverloadedMethod info VideoDirection p) => OL.IsLabel t (VideoDirection -> 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 ~ ResolveVideoDirectionMethod t VideoDirection, O.OverloadedMethod info VideoDirection p, R.HasField t VideoDirection p) => R.HasField t VideoDirection p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolveVideoDirectionMethod t VideoDirection, O.OverloadedMethodInfo info VideoDirection) => OL.IsLabel t (O.MethodProxy info VideoDirection) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList VideoDirection = VideoDirectionSignalList
type VideoDirectionSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif