{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)

The interface allows unified access to control flipping and rotation
operations of video-sources or operators.
-}

module GI.GstVideo.Interfaces.VideoDirection
    ( 

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


 -- * Properties
-- ** videoDirection #attr:videoDirection#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    VideoDirectionVideoDirectionPropertyInfo,
#endif
    constructVideoDirectionVideoDirection   ,
    getVideoDirectionVideoDirection         ,
    setVideoDirectionVideoDirection         ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    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.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.GstVideo.Enums as GstVideo.Enums

-- interface VideoDirection 
newtype VideoDirection = VideoDirection (ManagedPtr VideoDirection)
noVideoDirection :: Maybe VideoDirection
noVideoDirection = Nothing

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

#endif

foreign import ccall "gst_video_direction_get_type"
    c_gst_video_direction_get_type :: IO GType

instance GObject VideoDirection where
    gobjectType _ = c_gst_video_direction_get_type
    

class GObject o => IsVideoDirection o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError VideoDirection a) =>
    IsVideoDirection a
#endif
instance IsVideoDirection VideoDirection
instance GObject.Object.IsObject VideoDirection

toVideoDirection :: (MonadIO m, IsVideoDirection o) => o -> m VideoDirection
toVideoDirection = liftIO . unsafeCastTo VideoDirection

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

getVideoDirectionVideoDirection :: (MonadIO m, IsVideoDirection o) => o -> m GstVideo.Enums.VideoOrientationMethod
getVideoDirectionVideoDirection obj = liftIO $ getObjectPropertyEnum obj "video-direction"

setVideoDirectionVideoDirection :: (MonadIO m, IsVideoDirection o) => o -> GstVideo.Enums.VideoOrientationMethod -> m ()
setVideoDirectionVideoDirection obj val = liftIO $ setObjectPropertyEnum obj "video-direction" val

constructVideoDirectionVideoDirection :: (IsVideoDirection o) => GstVideo.Enums.VideoOrientationMethod -> IO (GValueConstruct o)
constructVideoDirectionVideoDirection val = constructObjectPropertyEnum "video-direction" val

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

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

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

#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
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 "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 "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveVideoDirectionMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    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 "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveVideoDirectionMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveVideoDirectionMethod t VideoDirection, O.MethodInfo info VideoDirection p) => O.IsLabelProxy t (VideoDirection -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveVideoDirectionMethod t VideoDirection, O.MethodInfo info VideoDirection p) => O.IsLabel t (VideoDirection -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif

#endif