#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.GstVideo.Structs.VideoRectangle
(
VideoRectangle(..) ,
newZeroVideoRectangle ,
noVideoRectangle ,
getVideoRectangleH ,
setVideoRectangleH ,
#if ENABLE_OVERLOADING
videoRectangle_h ,
#endif
getVideoRectangleW ,
setVideoRectangleW ,
#if ENABLE_OVERLOADING
videoRectangle_w ,
#endif
getVideoRectangleX ,
setVideoRectangleX ,
#if ENABLE_OVERLOADING
videoRectangle_x ,
#endif
getVideoRectangleY ,
setVideoRectangleY ,
#if ENABLE_OVERLOADING
videoRectangle_y ,
#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.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.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 VideoRectangle = VideoRectangle (ManagedPtr VideoRectangle)
instance WrappedPtr VideoRectangle where
wrappedPtrCalloc = callocBytes 16
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 16 >=> wrapPtr VideoRectangle)
wrappedPtrFree = Just ptr_to_g_free
newZeroVideoRectangle :: MonadIO m => m VideoRectangle
newZeroVideoRectangle = liftIO $ wrappedPtrCalloc >>= wrapPtr VideoRectangle
instance tag ~ 'AttrSet => Constructible VideoRectangle tag where
new _ attrs = do
o <- newZeroVideoRectangle
GI.Attributes.set o attrs
return o
noVideoRectangle :: Maybe VideoRectangle
noVideoRectangle = Nothing
getVideoRectangleX :: MonadIO m => VideoRectangle -> m Int32
getVideoRectangleX s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO Int32
return val
setVideoRectangleX :: MonadIO m => VideoRectangle -> Int32 -> m ()
setVideoRectangleX s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (val :: Int32)
#if ENABLE_OVERLOADING
data VideoRectangleXFieldInfo
instance AttrInfo VideoRectangleXFieldInfo where
type AttrAllowedOps VideoRectangleXFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint VideoRectangleXFieldInfo = (~) Int32
type AttrBaseTypeConstraint VideoRectangleXFieldInfo = (~) VideoRectangle
type AttrGetType VideoRectangleXFieldInfo = Int32
type AttrLabel VideoRectangleXFieldInfo = "x"
type AttrOrigin VideoRectangleXFieldInfo = VideoRectangle
attrGet _ = getVideoRectangleX
attrSet _ = setVideoRectangleX
attrConstruct = undefined
attrClear _ = undefined
videoRectangle_x :: AttrLabelProxy "x"
videoRectangle_x = AttrLabelProxy
#endif
getVideoRectangleY :: MonadIO m => VideoRectangle -> m Int32
getVideoRectangleY s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 4) :: IO Int32
return val
setVideoRectangleY :: MonadIO m => VideoRectangle -> Int32 -> m ()
setVideoRectangleY s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 4) (val :: Int32)
#if ENABLE_OVERLOADING
data VideoRectangleYFieldInfo
instance AttrInfo VideoRectangleYFieldInfo where
type AttrAllowedOps VideoRectangleYFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint VideoRectangleYFieldInfo = (~) Int32
type AttrBaseTypeConstraint VideoRectangleYFieldInfo = (~) VideoRectangle
type AttrGetType VideoRectangleYFieldInfo = Int32
type AttrLabel VideoRectangleYFieldInfo = "y"
type AttrOrigin VideoRectangleYFieldInfo = VideoRectangle
attrGet _ = getVideoRectangleY
attrSet _ = setVideoRectangleY
attrConstruct = undefined
attrClear _ = undefined
videoRectangle_y :: AttrLabelProxy "y"
videoRectangle_y = AttrLabelProxy
#endif
getVideoRectangleW :: MonadIO m => VideoRectangle -> m Int32
getVideoRectangleW s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO Int32
return val
setVideoRectangleW :: MonadIO m => VideoRectangle -> Int32 -> m ()
setVideoRectangleW s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: Int32)
#if ENABLE_OVERLOADING
data VideoRectangleWFieldInfo
instance AttrInfo VideoRectangleWFieldInfo where
type AttrAllowedOps VideoRectangleWFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint VideoRectangleWFieldInfo = (~) Int32
type AttrBaseTypeConstraint VideoRectangleWFieldInfo = (~) VideoRectangle
type AttrGetType VideoRectangleWFieldInfo = Int32
type AttrLabel VideoRectangleWFieldInfo = "w"
type AttrOrigin VideoRectangleWFieldInfo = VideoRectangle
attrGet _ = getVideoRectangleW
attrSet _ = setVideoRectangleW
attrConstruct = undefined
attrClear _ = undefined
videoRectangle_w :: AttrLabelProxy "w"
videoRectangle_w = AttrLabelProxy
#endif
getVideoRectangleH :: MonadIO m => VideoRectangle -> m Int32
getVideoRectangleH s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 12) :: IO Int32
return val
setVideoRectangleH :: MonadIO m => VideoRectangle -> Int32 -> m ()
setVideoRectangleH s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 12) (val :: Int32)
#if ENABLE_OVERLOADING
data VideoRectangleHFieldInfo
instance AttrInfo VideoRectangleHFieldInfo where
type AttrAllowedOps VideoRectangleHFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint VideoRectangleHFieldInfo = (~) Int32
type AttrBaseTypeConstraint VideoRectangleHFieldInfo = (~) VideoRectangle
type AttrGetType VideoRectangleHFieldInfo = Int32
type AttrLabel VideoRectangleHFieldInfo = "h"
type AttrOrigin VideoRectangleHFieldInfo = VideoRectangle
attrGet _ = getVideoRectangleH
attrSet _ = setVideoRectangleH
attrConstruct = undefined
attrClear _ = undefined
videoRectangle_h :: AttrLabelProxy "h"
videoRectangle_h = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList VideoRectangle
type instance O.AttributeList VideoRectangle = VideoRectangleAttributeList
type VideoRectangleAttributeList = ('[ '("x", VideoRectangleXFieldInfo), '("y", VideoRectangleYFieldInfo), '("w", VideoRectangleWFieldInfo), '("h", VideoRectangleHFieldInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
type family ResolveVideoRectangleMethod (t :: Symbol) (o :: *) :: * where
ResolveVideoRectangleMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveVideoRectangleMethod t VideoRectangle, O.MethodInfo info VideoRectangle p) => OL.IsLabel t (VideoRectangle -> 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