{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GES.Objects.Marker
(
Marker(..) ,
IsMarker ,
toMarker ,
#if defined(ENABLE_OVERLOADING)
ResolveMarkerMethod ,
#endif
#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.Kind as DK
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
newtype Marker = Marker (SP.ManagedPtr Marker)
deriving (Marker -> Marker -> Bool
(Marker -> Marker -> Bool)
-> (Marker -> Marker -> Bool) -> Eq Marker
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Marker -> Marker -> Bool
== :: Marker -> Marker -> Bool
$c/= :: Marker -> Marker -> Bool
/= :: 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
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]
toMarker :: (MIO.MonadIO m, IsMarker o) => o -> m Marker
toMarker :: forall (m :: * -> *) o. (MonadIO m, IsMarker o) => o -> m Marker
toMarker = IO Marker -> m Marker
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Marker -> m Marker) -> (o -> IO Marker) -> o -> m Marker
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Marker -> Marker) -> o -> IO Marker
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
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 = Ptr GValue -> Ptr Marker -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Marker
forall a. Ptr a
FP.nullPtr :: FP.Ptr Marker)
gvalueSet_ Ptr GValue
gv (P.Just Marker
obj) = Marker -> (Ptr Marker -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Marker
obj (Ptr GValue -> Ptr Marker -> IO ()
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 <- Ptr GValue -> IO (Ptr Marker)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Marker)
if Ptr Marker
ptr Ptr Marker -> Ptr Marker -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr Marker
forall a. Ptr a
FP.nullPtr
then Marker -> Maybe Marker
forall a. a -> Maybe a
P.Just (Marker -> Maybe Marker) -> IO Marker -> IO (Maybe Marker)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr Marker -> Marker) -> Ptr Marker -> IO Marker
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 Maybe Marker -> IO (Maybe Marker)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Marker
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveMarkerMethod (t :: Symbol) (o :: DK.Type) :: DK.Type 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
getMarkerPosition :: (MonadIO m, IsMarker o) => o -> m Word64
getMarkerPosition :: forall (m :: * -> *) o. (MonadIO m, IsMarker o) => o -> m Word64
getMarkerPosition o
obj = IO Word64 -> m Word64
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Word64
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.4/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, DK.Type)])
#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, DK.Type)])
#endif