{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- A timed t'GI.GES.Interfaces.MetaContainer.MetaContainer' object.
-- 
-- /Since: 1.18/

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

module GI.GES.Objects.Marker
    ( 

-- * Exported types
    Marker(..)                              ,
    IsMarker                                ,
    toMarker                                ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [addMetasFromString]("GI.GES.Interfaces.MetaContainer#g:method:addMetasFromString"), [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [checkMetaRegistered]("GI.GES.Interfaces.MetaContainer#g:method:checkMetaRegistered"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [foreach]("GI.GES.Interfaces.MetaContainer#g:method:foreach"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [metasToString]("GI.GES.Interfaces.MetaContainer#g:method:metasToString"), [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"), [registerMeta]("GI.GES.Interfaces.MetaContainer#g:method:registerMeta"), [registerMetaBoolean]("GI.GES.Interfaces.MetaContainer#g:method:registerMetaBoolean"), [registerMetaDate]("GI.GES.Interfaces.MetaContainer#g:method:registerMetaDate"), [registerMetaDateTime]("GI.GES.Interfaces.MetaContainer#g:method:registerMetaDateTime"), [registerMetaDouble]("GI.GES.Interfaces.MetaContainer#g:method:registerMetaDouble"), [registerMetaFloat]("GI.GES.Interfaces.MetaContainer#g:method:registerMetaFloat"), [registerMetaInt]("GI.GES.Interfaces.MetaContainer#g:method:registerMetaInt"), [registerMetaInt64]("GI.GES.Interfaces.MetaContainer#g:method:registerMetaInt64"), [registerMetaString]("GI.GES.Interfaces.MetaContainer#g:method:registerMetaString"), [registerMetaUint]("GI.GES.Interfaces.MetaContainer#g:method:registerMetaUint"), [registerMetaUint64]("GI.GES.Interfaces.MetaContainer#g:method:registerMetaUint64"), [registerStaticMeta]("GI.GES.Interfaces.MetaContainer#g:method:registerStaticMeta"), [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
-- [getBoolean]("GI.GES.Interfaces.MetaContainer#g:method:getBoolean"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getDate]("GI.GES.Interfaces.MetaContainer#g:method:getDate"), [getDateTime]("GI.GES.Interfaces.MetaContainer#g:method:getDateTime"), [getDouble]("GI.GES.Interfaces.MetaContainer#g:method:getDouble"), [getFloat]("GI.GES.Interfaces.MetaContainer#g:method:getFloat"), [getInt]("GI.GES.Interfaces.MetaContainer#g:method:getInt"), [getInt64]("GI.GES.Interfaces.MetaContainer#g:method:getInt64"), [getMarkerList]("GI.GES.Interfaces.MetaContainer#g:method:getMarkerList"), [getMeta]("GI.GES.Interfaces.MetaContainer#g:method:getMeta"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getString]("GI.GES.Interfaces.MetaContainer#g:method:getString"), [getUint]("GI.GES.Interfaces.MetaContainer#g:method:getUint"), [getUint64]("GI.GES.Interfaces.MetaContainer#g:method:getUint64").
-- 
-- ==== Setters
-- [setBoolean]("GI.GES.Interfaces.MetaContainer#g:method:setBoolean"), [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setDate]("GI.GES.Interfaces.MetaContainer#g:method:setDate"), [setDateTime]("GI.GES.Interfaces.MetaContainer#g:method:setDateTime"), [setDouble]("GI.GES.Interfaces.MetaContainer#g:method:setDouble"), [setFloat]("GI.GES.Interfaces.MetaContainer#g:method:setFloat"), [setInt]("GI.GES.Interfaces.MetaContainer#g:method:setInt"), [setInt64]("GI.GES.Interfaces.MetaContainer#g:method:setInt64"), [setMarkerList]("GI.GES.Interfaces.MetaContainer#g:method:setMarkerList"), [setMeta]("GI.GES.Interfaces.MetaContainer#g:method:setMeta"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty"), [setString]("GI.GES.Interfaces.MetaContainer#g:method:setString"), [setUint]("GI.GES.Interfaces.MetaContainer#g:method:setUint"), [setUint64]("GI.GES.Interfaces.MetaContainer#g:method:setUint64").

#if defined(ENABLE_OVERLOADING)
    ResolveMarkerMethod                     ,
#endif



 -- * Properties


-- ** position #attr:position#
-- | Current position (in nanoseconds) of the t'GI.GES.Objects.Marker.Marker'
-- 
-- /Since: 1.18/

#if defined(ENABLE_OVERLOADING)
    MarkerPositionPropertyInfo              ,
#endif
    getMarkerPosition                       ,
#if defined(ENABLE_OVERLOADING)
    markerPosition                          ,
#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.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.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.GES.Interfaces.MetaContainer as GES.MetaContainer
import qualified GI.GObject.Objects.Object as GObject.Object

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

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

foreign import ccall "ges_marker_get_type"
    c_ges_marker_get_type :: IO B.Types.GType

instance B.Types.TypedObject Marker where
    glibType :: IO GType
glibType = IO GType
c_ges_marker_get_type

instance B.Types.GObject Marker

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

instance O.HasParentTypes Marker
type instance O.ParentTypes Marker = '[GObject.Object.Object, GES.MetaContainer.MetaContainer]

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

-- | Convert 'Marker' 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 Marker) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_ges_marker_get_type
    gvalueSet_ :: Ptr GValue -> Maybe Marker -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Marker
P.Nothing = forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (forall a. Ptr a
FP.nullPtr :: FP.Ptr Marker)
    gvalueSet_ Ptr GValue
gv (P.Just Marker
obj) = forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Marker
obj (forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe Marker)
gvalueGet_ Ptr GValue
gv = do
        Ptr Marker
ptr <- forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Marker)
        if Ptr Marker
ptr forall a. Eq a => a -> a -> Bool
/= forall a. Ptr a
FP.nullPtr
        then forall a. a -> Maybe a
P.Just forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Marker -> Marker
Marker Ptr Marker
ptr
        else forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Maybe a
P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
type family ResolveMarkerMethod (t :: Symbol) (o :: *) :: * where
    ResolveMarkerMethod "addMetasFromString" o = GES.MetaContainer.MetaContainerAddMetasFromStringMethodInfo
    ResolveMarkerMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveMarkerMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveMarkerMethod "checkMetaRegistered" o = GES.MetaContainer.MetaContainerCheckMetaRegisteredMethodInfo
    ResolveMarkerMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveMarkerMethod "foreach" o = GES.MetaContainer.MetaContainerForeachMethodInfo
    ResolveMarkerMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveMarkerMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveMarkerMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveMarkerMethod "metasToString" o = GES.MetaContainer.MetaContainerMetasToStringMethodInfo
    ResolveMarkerMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveMarkerMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveMarkerMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveMarkerMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveMarkerMethod "registerMeta" o = GES.MetaContainer.MetaContainerRegisterMetaMethodInfo
    ResolveMarkerMethod "registerMetaBoolean" o = GES.MetaContainer.MetaContainerRegisterMetaBooleanMethodInfo
    ResolveMarkerMethod "registerMetaDate" o = GES.MetaContainer.MetaContainerRegisterMetaDateMethodInfo
    ResolveMarkerMethod "registerMetaDateTime" o = GES.MetaContainer.MetaContainerRegisterMetaDateTimeMethodInfo
    ResolveMarkerMethod "registerMetaDouble" o = GES.MetaContainer.MetaContainerRegisterMetaDoubleMethodInfo
    ResolveMarkerMethod "registerMetaFloat" o = GES.MetaContainer.MetaContainerRegisterMetaFloatMethodInfo
    ResolveMarkerMethod "registerMetaInt" o = GES.MetaContainer.MetaContainerRegisterMetaIntMethodInfo
    ResolveMarkerMethod "registerMetaInt64" o = GES.MetaContainer.MetaContainerRegisterMetaInt64MethodInfo
    ResolveMarkerMethod "registerMetaString" o = GES.MetaContainer.MetaContainerRegisterMetaStringMethodInfo
    ResolveMarkerMethod "registerMetaUint" o = GES.MetaContainer.MetaContainerRegisterMetaUintMethodInfo
    ResolveMarkerMethod "registerMetaUint64" o = GES.MetaContainer.MetaContainerRegisterMetaUint64MethodInfo
    ResolveMarkerMethod "registerStaticMeta" o = GES.MetaContainer.MetaContainerRegisterStaticMetaMethodInfo
    ResolveMarkerMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveMarkerMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveMarkerMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveMarkerMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveMarkerMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveMarkerMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveMarkerMethod "getBoolean" o = GES.MetaContainer.MetaContainerGetBooleanMethodInfo
    ResolveMarkerMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveMarkerMethod "getDate" o = GES.MetaContainer.MetaContainerGetDateMethodInfo
    ResolveMarkerMethod "getDateTime" o = GES.MetaContainer.MetaContainerGetDateTimeMethodInfo
    ResolveMarkerMethod "getDouble" o = GES.MetaContainer.MetaContainerGetDoubleMethodInfo
    ResolveMarkerMethod "getFloat" o = GES.MetaContainer.MetaContainerGetFloatMethodInfo
    ResolveMarkerMethod "getInt" o = GES.MetaContainer.MetaContainerGetIntMethodInfo
    ResolveMarkerMethod "getInt64" o = GES.MetaContainer.MetaContainerGetInt64MethodInfo
    ResolveMarkerMethod "getMarkerList" o = GES.MetaContainer.MetaContainerGetMarkerListMethodInfo
    ResolveMarkerMethod "getMeta" o = GES.MetaContainer.MetaContainerGetMetaMethodInfo
    ResolveMarkerMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveMarkerMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveMarkerMethod "getString" o = GES.MetaContainer.MetaContainerGetStringMethodInfo
    ResolveMarkerMethod "getUint" o = GES.MetaContainer.MetaContainerGetUintMethodInfo
    ResolveMarkerMethod "getUint64" o = GES.MetaContainer.MetaContainerGetUint64MethodInfo
    ResolveMarkerMethod "setBoolean" o = GES.MetaContainer.MetaContainerSetBooleanMethodInfo
    ResolveMarkerMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveMarkerMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveMarkerMethod "setDate" o = GES.MetaContainer.MetaContainerSetDateMethodInfo
    ResolveMarkerMethod "setDateTime" o = GES.MetaContainer.MetaContainerSetDateTimeMethodInfo
    ResolveMarkerMethod "setDouble" o = GES.MetaContainer.MetaContainerSetDoubleMethodInfo
    ResolveMarkerMethod "setFloat" o = GES.MetaContainer.MetaContainerSetFloatMethodInfo
    ResolveMarkerMethod "setInt" o = GES.MetaContainer.MetaContainerSetIntMethodInfo
    ResolveMarkerMethod "setInt64" o = GES.MetaContainer.MetaContainerSetInt64MethodInfo
    ResolveMarkerMethod "setMarkerList" o = GES.MetaContainer.MetaContainerSetMarkerListMethodInfo
    ResolveMarkerMethod "setMeta" o = GES.MetaContainer.MetaContainerSetMetaMethodInfo
    ResolveMarkerMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveMarkerMethod "setString" o = GES.MetaContainer.MetaContainerSetStringMethodInfo
    ResolveMarkerMethod "setUint" o = GES.MetaContainer.MetaContainerSetUintMethodInfo
    ResolveMarkerMethod "setUint64" o = GES.MetaContainer.MetaContainerSetUint64MethodInfo
    ResolveMarkerMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif

-- VVV Prop "position"
   -- Type: TBasicType TUInt64
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@position@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' marker #position
-- @
getMarkerPosition :: (MonadIO m, IsMarker o) => o -> m Word64
getMarkerPosition :: forall (m :: * -> *) o. (MonadIO m, IsMarker o) => o -> m Word64
getMarkerPosition o
obj = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall a b. (a -> b) -> a -> b
$ forall a. GObject a => a -> String -> IO Word64
B.Properties.getObjectPropertyUInt64 o
obj String
"position"

#if defined(ENABLE_OVERLOADING)
data MarkerPositionPropertyInfo
instance AttrInfo MarkerPositionPropertyInfo where
    type AttrAllowedOps MarkerPositionPropertyInfo = '[ 'AttrGet]
    type AttrBaseTypeConstraint MarkerPositionPropertyInfo = IsMarker
    type AttrSetTypeConstraint MarkerPositionPropertyInfo = (~) ()
    type AttrTransferTypeConstraint MarkerPositionPropertyInfo = (~) ()
    type AttrTransferType MarkerPositionPropertyInfo = ()
    type AttrGetType MarkerPositionPropertyInfo = Word64
    type AttrLabel MarkerPositionPropertyInfo = "position"
    type AttrOrigin MarkerPositionPropertyInfo = Marker
    attrGet = getMarkerPosition
    attrSet = undefined
    attrTransfer _ = undefined
    attrConstruct = undefined
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GES.Objects.Marker.position"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ges-1.0.1/docs/GI-GES-Objects-Marker.html#g:attr:position"
        })
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Marker
type instance O.AttributeList Marker = MarkerAttributeList
type MarkerAttributeList = ('[ '("position", MarkerPositionPropertyInfo)] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
markerPosition :: AttrLabelProxy "position"
markerPosition = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Marker = MarkerSignalList
type MarkerSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo), '("notifyMeta", GES.MetaContainer.MetaContainerNotifyMetaSignalInfo)] :: [(Symbol, *)])

#endif