    {-# LANGUAGE TypeApplications #-}

    -- | Copyright  : Will Thompson and Iñaki García Etxebarria
    -- License    : LGPL-2.1
    -- Maintainer : Iñaki García Etxebarria
    --
    -- Holds timing information for a single frame of the application’s displays.
    --
    -- To retrieve @GdkFrameTimings@ objects, use 'GI.Gdk.Objects.FrameClock.frameClockGetTimings'
    -- or 'GI.Gdk.Objects.FrameClock.frameClockGetCurrentTimings'. The information in
    -- @GdkFrameTimings@ is useful for precise synchronization of video with
    -- the event or audio streams, and for measuring quality metrics for the
    -- application’s display, such as latency and jitter.

    #if !defined(__HADDOCK_VERSION__)
    #define ENABLE_OVERLOADING
    #endif

    module GI.Gdk.Structs.FrameTimings
        (

    -- * Exported types
        FrameTimings(..)                        ,

     -- * Methods
    -- |
    --
    --  === __Click to display all available methods, including inherited ones__
    -- ==== Methods
    -- [ref]("GI.Gdk.Structs.FrameTimings#g:method:ref"), [unref]("GI.Gdk.Structs.FrameTimings#g:method:unref").
    --
    -- ==== Getters
    -- [getComplete]("GI.Gdk.Structs.FrameTimings#g:method:getComplete"), [getFrameCounter]("GI.Gdk.Structs.FrameTimings#g:method:getFrameCounter"), [getFrameTime]("GI.Gdk.Structs.FrameTimings#g:method:getFrameTime"), [getPredictedPresentationTime]("GI.Gdk.Structs.FrameTimings#g:method:getPredictedPresentationTime"), [getPresentationTime]("GI.Gdk.Structs.FrameTimings#g:method:getPresentationTime"), [getRefreshInterval]("GI.Gdk.Structs.FrameTimings#g:method:getRefreshInterval"), [getResult]("GI.Gdk.Structs.FrameTimings#g:method:getResult").
    --
    -- ==== Setters
    -- /None/.

    #if defined(ENABLE_OVERLOADING)
        ResolveFrameTimingsMethod               ,
    #endif

    -- ** getComplete #method:getComplete#

    #if defined(ENABLE_OVERLOADING)
        FrameTimingsGetCompleteMethodInfo       ,
    #endif
        frameTimingsGetComplete                 ,

    -- ** getFrameCounter #method:getFrameCounter#

    #if defined(ENABLE_OVERLOADING)
        FrameTimingsGetFrameCounterMethodInfo   ,
    #endif
        frameTimingsGetFrameCounter             ,

    -- ** getFrameTime #method:getFrameTime#

    #if defined(ENABLE_OVERLOADING)
        FrameTimingsGetFrameTimeMethodInfo      ,
    #endif
        frameTimingsGetFrameTime                ,

    -- ** getPredictedPresentationTime #method:getPredictedPresentationTime#

    #if defined(ENABLE_OVERLOADING)
        FrameTimingsGetPredictedPresentationTimeMethodInfo,
    #endif
        frameTimingsGetPredictedPresentationTime,

    -- ** getPresentationTime #method:getPresentationTime#

    #if defined(ENABLE_OVERLOADING)
        FrameTimingsGetPresentationTimeMethodInfo,
    #endif
        frameTimingsGetPresentationTime         ,

    -- ** getRefreshInterval #method:getRefreshInterval#

    #if defined(ENABLE_OVERLOADING)
        FrameTimingsGetRefreshIntervalMethodInfo,
    #endif
        frameTimingsGetRefreshInterval          ,

    -- ** getResult #method:getResult#

    #if defined(ENABLE_OVERLOADING)
        FrameTimingsGetResultMethodInfo         ,
    #endif
        frameTimingsGetResult                   ,

    -- ** ref #method:ref#

    #if defined(ENABLE_OVERLOADING)
        FrameTimingsRefMethodInfo               ,
    #endif
        frameTimingsRef                         ,

    -- ** unref #method:unref#

    #if defined(ENABLE_OVERLOADING)
        FrameTimingsUnrefMethodInfo             ,
    #endif
        frameTimingsUnref                       ,

        ) 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 qualified Data.Word as DW
    import qualified Data.Int as DI
    import qualified System.Posix.Types as SPT
    import qualified Foreign.C.Types as FCT

    -- Workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/23392
    #if MIN_VERSION_base(4,18,0)
    import {-# SOURCE #-} qualified GI.Gdk.Enums as Gdk.Enums

    #else
    import {-# SOURCE #-} qualified GI.Gdk.Enums as Gdk.Enums

    #endif

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

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

    foreign import ccall "gdk_frame_timings_get_type" c_gdk_frame_timings_get_type ::
        IO GType

    type instance O.ParentTypes FrameTimings = '[]
    instance O.HasParentTypes FrameTimings

    instance B.Types.TypedObject FrameTimings where
        glibType :: IO GType
    glibType = IO GType
    c_gdk_frame_timings_get_type

    instance B.Types.GBoxed FrameTimings

    -- | Convert t'FrameTimings' 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 FrameTimings) where
        gvalueGType_ :: IO GType
    gvalueGType_ = IO GType
    c_gdk_frame_timings_get_type
        gvalueSet_ :: Ptr GValue -> Maybe FrameTimings -> IO ()
    gvalueSet_ Ptr GValue
    gv Maybe FrameTimings
    P.Nothing = Ptr GValue -> Ptr FrameTimings -> IO ()
    forall a. Ptr GValue -> Ptr a -> IO ()
    B.GValue.set_boxed Ptr GValue
    gv (Ptr FrameTimings
    forall a. Ptr a
    FP.nullPtr :: FP.Ptr FrameTimings)
        gvalueSet_ Ptr GValue
    gv (P.Just FrameTimings
    obj) = FrameTimings -> (Ptr FrameTimings -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    B.ManagedPtr.withManagedPtr FrameTimings
    obj (Ptr GValue -> Ptr FrameTimings -> IO ()
    forall a. Ptr GValue -> Ptr a -> IO ()
    B.GValue.set_boxed Ptr GValue
    gv)
        gvalueGet_ :: Ptr GValue -> IO (Maybe FrameTimings)
    gvalueGet_ Ptr GValue
    gv = do
            ptr <- Ptr GValue -> IO (Ptr FrameTimings)
    forall b. Ptr GValue -> IO (Ptr b)
    B.GValue.get_boxed Ptr GValue
    gv :: IO (Ptr FrameTimings)
            if ptr /= FP.nullPtr
            then P.Just <$> B.ManagedPtr.newBoxed FrameTimings ptr
            else return P.Nothing

    #if defined(ENABLE_OVERLOADING)
    instance O.HasAttributeList FrameTimings
    type instance O.AttributeList FrameTimings = FrameTimingsAttributeList
    type FrameTimingsAttributeList = ('[ ] :: [(Symbol, DK.Type)])
    #endif

    -- method FrameTimings::get_complete
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "timings"
    --           , argType =
    --               TInterface Name { namespace = "Gdk" , name = "FrameTimings" }
    --           , argCType = Just "GdkFrameTimings*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GdkFrameTimings`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TBoolean)
    -- throws : False
    -- Skip return : False

    foreign import ccall "gdk_frame_timings_get_complete" gdk_frame_timings_get_complete ::
        Ptr FrameTimings ->                     -- timings : TInterface (Name {namespace = "Gdk", name = "FrameTimings"})
        IO CInt

    -- | Returns whether /@timings@/ are complete.
    --
    -- The timing information in a @GdkFrameTimings@ is filled in
    -- incrementally as the frame as drawn and passed off to the
    -- window system for processing and display to the user. The
    -- accessor functions for @GdkFrameTimings@ can return 0 to
    -- indicate an unavailable value for two reasons: either because
    -- the information is not yet available, or because it isn\'t
    -- available at all.
    --
    -- Once this function returns 'P.True' for a frame, you can be
    -- certain that no further values will become available and be
    -- stored in the @GdkFrameTimings@.
    frameTimingsGetComplete ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        FrameTimings
        -- ^ /@timings@/: a @GdkFrameTimings@
        -> m Bool
        -- ^ __Returns:__ 'P.True' if all information that will be available
        --   for the frame has been filled in.
    frameTimingsGetComplete :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    FrameTimings -> m Bool
    frameTimingsGetComplete FrameTimings
    timings = IO Bool -> m Bool
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
    forall a b. (a -> b) -> a -> b
    $ do
        timings' <- FrameTimings -> IO (Ptr FrameTimings)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr FrameTimings
    timings
        result <- gdk_frame_timings_get_complete timings'
        let result' = (CInt -> CInt -> Bool
    forall a. Eq a => a -> a -> Bool
    /= CInt
    0) CInt
    result
        touchManagedPtr timings
        return result'

    #if defined(ENABLE_OVERLOADING)
    data FrameTimingsGetCompleteMethodInfo
    instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod FrameTimingsGetCompleteMethodInfo FrameTimings signature where
        overloadedMethod = frameTimingsGetComplete

    instance O.OverloadedMethodInfo FrameTimingsGetCompleteMethodInfo FrameTimings where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gdk.Structs.FrameTimings.frameTimingsGetComplete",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk4-4.0.10/docs/GI-Gdk-Structs-FrameTimings.html#v:frameTimingsGetComplete"
            })

    #endif

    -- method FrameTimings::get_frame_counter
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "timings"
    --           , argType =
    --               TInterface Name { namespace = "Gdk" , name = "FrameTimings" }
    --           , argCType = Just "GdkFrameTimings*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GdkFrameTimings`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TInt64)
    -- throws : False
    -- Skip return : False

    foreign import ccall "gdk_frame_timings_get_frame_counter" gdk_frame_timings_get_frame_counter ::
        Ptr FrameTimings ->                     -- timings : TInterface (Name {namespace = "Gdk", name = "FrameTimings"})
        IO Int64

    -- | Gets the frame counter value of the @GdkFrameClock@ when
    -- this frame was drawn.
    frameTimingsGetFrameCounter ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        FrameTimings
        -- ^ /@timings@/: a @GdkFrameTimings@
        -> m Int64
        -- ^ __Returns:__ the frame counter value for this frame
    frameTimingsGetFrameCounter :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    FrameTimings -> m Int64
    frameTimingsGetFrameCounter FrameTimings
    timings = IO Int64 -> m Int64
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Int64 -> m Int64) -> IO Int64 -> m Int64
    forall a b. (a -> b) -> a -> b
    $ do
        timings' <- FrameTimings -> IO (Ptr FrameTimings)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr FrameTimings
    timings
        result <- gdk_frame_timings_get_frame_counter timings'
        touchManagedPtr timings
        return result

    #if defined(ENABLE_OVERLOADING)
    data FrameTimingsGetFrameCounterMethodInfo
    instance (signature ~ (m Int64), MonadIO m) => O.OverloadedMethod FrameTimingsGetFrameCounterMethodInfo FrameTimings signature where
        overloadedMethod = frameTimingsGetFrameCounter

    instance O.OverloadedMethodInfo FrameTimingsGetFrameCounterMethodInfo FrameTimings where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gdk.Structs.FrameTimings.frameTimingsGetFrameCounter",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk4-4.0.10/docs/GI-Gdk-Structs-FrameTimings.html#v:frameTimingsGetFrameCounter"
            })

    #endif

    -- method FrameTimings::get_frame_time
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "timings"
    --           , argType =
    --               TInterface Name { namespace = "Gdk" , name = "FrameTimings" }
    --           , argCType = Just "GdkFrameTimings*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "A `GdkFrameTimings`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TInt64)
    -- throws : False
    -- Skip return : False

    foreign import ccall "gdk_frame_timings_get_frame_time" gdk_frame_timings_get_frame_time ::
        Ptr FrameTimings ->                     -- timings : TInterface (Name {namespace = "Gdk", name = "FrameTimings"})
        IO Int64

    -- | Returns the frame time for the frame.
    --
    -- This is the time value that is typically used to time
    -- animations for the frame. See 'GI.Gdk.Objects.FrameClock.frameClockGetFrameTime'.
    frameTimingsGetFrameTime ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        FrameTimings
        -- ^ /@timings@/: A @GdkFrameTimings@
        -> m Int64
        -- ^ __Returns:__ the frame time for the frame, in the timescale
        --  of 'GI.GLib.Functions.getMonotonicTime'
    frameTimingsGetFrameTime :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    FrameTimings -> m Int64
    frameTimingsGetFrameTime FrameTimings
    timings = IO Int64 -> m Int64
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Int64 -> m Int64) -> IO Int64 -> m Int64
    forall a b. (a -> b) -> a -> b
    $ do
        timings' <- FrameTimings -> IO (Ptr FrameTimings)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr FrameTimings
    timings
        result <- gdk_frame_timings_get_frame_time timings'
        touchManagedPtr timings
        return result

    #if defined(ENABLE_OVERLOADING)
    data FrameTimingsGetFrameTimeMethodInfo
    instance (signature ~ (m Int64), MonadIO m) => O.OverloadedMethod FrameTimingsGetFrameTimeMethodInfo FrameTimings signature where
        overloadedMethod = frameTimingsGetFrameTime

    instance O.OverloadedMethodInfo FrameTimingsGetFrameTimeMethodInfo FrameTimings where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gdk.Structs.FrameTimings.frameTimingsGetFrameTime",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk4-4.0.10/docs/GI-Gdk-Structs-FrameTimings.html#v:frameTimingsGetFrameTime"
            })

    #endif

    -- method FrameTimings::get_predicted_presentation_time
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "timings"
    --           , argType =
    --               TInterface Name { namespace = "Gdk" , name = "FrameTimings" }
    --           , argCType = Just "GdkFrameTimings*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GdkFrameTimings`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TInt64)
    -- throws : False
    -- Skip return : False

    foreign import ccall "gdk_frame_timings_get_predicted_presentation_time" gdk_frame_timings_get_predicted_presentation_time ::
        Ptr FrameTimings ->                     -- timings : TInterface (Name {namespace = "Gdk", name = "FrameTimings"})
        IO Int64

    -- | Gets the predicted time at which this frame will be displayed.
    --
    -- Although no predicted time may be available, if one is available,
    -- it will be available while the frame is being generated, in contrast
    -- to 'GI.Gdk.Structs.FrameTimings.frameTimingsGetPresentationTime', which is only
    -- available after the frame has been presented.
    --
    -- In general, if you are simply animating, you should use
    -- 'GI.Gdk.Objects.FrameClock.frameClockGetFrameTime' rather than this function,
    -- but this function is useful for applications that want exact control
    -- over latency. For example, a movie player may want this information
    -- for Audio\/Video synchronization.
    frameTimingsGetPredictedPresentationTime ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        FrameTimings
        -- ^ /@timings@/: a @GdkFrameTimings@
        -> m Int64
        -- ^ __Returns:__ The predicted time at which the frame will be presented,
        --   in the timescale of 'GI.GLib.Functions.getMonotonicTime', or 0 if no predicted
        --   presentation time is available.
    frameTimingsGetPredictedPresentationTime :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    FrameTimings -> m Int64
    frameTimingsGetPredictedPresentationTime FrameTimings
    timings = IO Int64 -> m Int64
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Int64 -> m Int64) -> IO Int64 -> m Int64
    forall a b. (a -> b) -> a -> b
    $ do
        timings' <- FrameTimings -> IO (Ptr FrameTimings)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr FrameTimings
    timings
        result <- gdk_frame_timings_get_predicted_presentation_time timings'
        touchManagedPtr timings
        return result

    #if defined(ENABLE_OVERLOADING)
    data FrameTimingsGetPredictedPresentationTimeMethodInfo
    instance (signature ~ (m Int64), MonadIO m) => O.OverloadedMethod FrameTimingsGetPredictedPresentationTimeMethodInfo FrameTimings signature where
        overloadedMethod = frameTimingsGetPredictedPresentationTime

    instance O.OverloadedMethodInfo FrameTimingsGetPredictedPresentationTimeMethodInfo FrameTimings where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gdk.Structs.FrameTimings.frameTimingsGetPredictedPresentationTime",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk4-4.0.10/docs/GI-Gdk-Structs-FrameTimings.html#v:frameTimingsGetPredictedPresentationTime"
            })

    #endif

    -- method FrameTimings::get_presentation_time
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "timings"
    --           , argType =
    --               TInterface Name { namespace = "Gdk" , name = "FrameTimings" }
    --           , argCType = Just "GdkFrameTimings*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GdkFrameTimings`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TInt64)
    -- throws : False
    -- Skip return : False

    foreign import ccall "gdk_frame_timings_get_presentation_time" gdk_frame_timings_get_presentation_time ::
        Ptr FrameTimings ->                     -- timings : TInterface (Name {namespace = "Gdk", name = "FrameTimings"})
        IO Int64

    -- | Reurns the presentation time.
    --
    -- This is the time at which the frame became visible to the user.
    frameTimingsGetPresentationTime ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        FrameTimings
        -- ^ /@timings@/: a @GdkFrameTimings@
        -> m Int64
        -- ^ __Returns:__ the time the frame was displayed to the user, in the
        --   timescale of 'GI.GLib.Functions.getMonotonicTime', or 0 if no presentation
        --   time is available. See 'GI.Gdk.Structs.FrameTimings.frameTimingsGetComplete'
    frameTimingsGetPresentationTime :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    FrameTimings -> m Int64
    frameTimingsGetPresentationTime FrameTimings
    timings = IO Int64 -> m Int64
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Int64 -> m Int64) -> IO Int64 -> m Int64
    forall a b. (a -> b) -> a -> b
    $ do
        timings' <- FrameTimings -> IO (Ptr FrameTimings)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr FrameTimings
    timings
        result <- gdk_frame_timings_get_presentation_time timings'
        touchManagedPtr timings
        return result

    #if defined(ENABLE_OVERLOADING)
    data FrameTimingsGetPresentationTimeMethodInfo
    instance (signature ~ (m Int64), MonadIO m) => O.OverloadedMethod FrameTimingsGetPresentationTimeMethodInfo FrameTimings signature where
        overloadedMethod = frameTimingsGetPresentationTime

    instance O.OverloadedMethodInfo FrameTimingsGetPresentationTimeMethodInfo FrameTimings where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gdk.Structs.FrameTimings.frameTimingsGetPresentationTime",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk4-4.0.10/docs/GI-Gdk-Structs-FrameTimings.html#v:frameTimingsGetPresentationTime"
            })

    #endif

    -- method FrameTimings::get_refresh_interval
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "timings"
    --           , argType =
    --               TInterface Name { namespace = "Gdk" , name = "FrameTimings" }
    --           , argCType = Just "GdkFrameTimings*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GdkFrameTimings`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TInt64)
    -- throws : False
    -- Skip return : False

    foreign import ccall "gdk_frame_timings_get_refresh_interval" gdk_frame_timings_get_refresh_interval ::
        Ptr FrameTimings ->                     -- timings : TInterface (Name {namespace = "Gdk", name = "FrameTimings"})
        IO Int64

    -- | Gets the natural interval between presentation times for
    -- the display that this frame was displayed on.
    --
    -- Frame presentation usually happens during the “vertical
    -- blanking interval”.
    frameTimingsGetRefreshInterval ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        FrameTimings
        -- ^ /@timings@/: a @GdkFrameTimings@
        -> m Int64
        -- ^ __Returns:__ the refresh interval of the display, in microseconds,
        --   or 0 if the refresh interval is not available.
        --   See 'GI.Gdk.Structs.FrameTimings.frameTimingsGetComplete'.
    frameTimingsGetRefreshInterval :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    FrameTimings -> m Int64
    frameTimingsGetRefreshInterval FrameTimings
    timings = IO Int64 -> m Int64
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Int64 -> m Int64) -> IO Int64 -> m Int64
    forall a b. (a -> b) -> a -> b
    $ do
        timings' <- FrameTimings -> IO (Ptr FrameTimings)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr FrameTimings
    timings
        result <- gdk_frame_timings_get_refresh_interval timings'
        touchManagedPtr timings
        return result

    #if defined(ENABLE_OVERLOADING)
    data FrameTimingsGetRefreshIntervalMethodInfo
    instance (signature ~ (m Int64), MonadIO m) => O.OverloadedMethod FrameTimingsGetRefreshIntervalMethodInfo FrameTimings signature where
        overloadedMethod = frameTimingsGetRefreshInterval

    instance O.OverloadedMethodInfo FrameTimingsGetRefreshIntervalMethodInfo FrameTimings where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gdk.Structs.FrameTimings.frameTimingsGetRefreshInterval",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk4-4.0.10/docs/GI-Gdk-Structs-FrameTimings.html#v:frameTimingsGetRefreshInterval"
            })

    #endif

    -- method FrameTimings::get_result
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "timings"
    --           , argType =
    --               TInterface Name { namespace = "Gdk" , name = "FrameTimings" }
    --           , argCType = Just "GdkFrameTimings*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GdkFrameTimings`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TInterface Name { namespace = "Gdk" , name = "FrameResult" })
    -- throws : False
    -- Skip return : False

    foreign import ccall "gdk_frame_timings_get_result" gdk_frame_timings_get_result ::
        Ptr FrameTimings ->                     -- timings : TInterface (Name {namespace = "Gdk", name = "FrameTimings"})
        IO CUInt

    -- | Gets the result of the frame cycle that recorded these timings.
    --
    -- The timing information in a @GdkFrameTimings@ is filled in
    -- incrementally as the frame as drawn and passed off to the
    -- window system for processing and display to the user. The
    -- accessor functions for @GdkFrameTimings@ can return 0 to
    -- indicate an unavailable value for two reasons: either because
    -- the information is not yet available, or because it isn\'t
    -- available at all. Looking at the result of the timings gives
    -- an explanation for why a value is not available.
    --
    -- /Since: 4.24/
    frameTimingsGetResult ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        FrameTimings
        -- ^ /@timings@/: a @GdkFrameTimings@
        -> m Gdk.Enums.FrameResult
        -- ^ __Returns:__ The result of the frame these timings have been recorded for.
    frameTimingsGetResult :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    FrameTimings -> m FrameResult
    frameTimingsGetResult FrameTimings
    timings = IO FrameResult -> m FrameResult
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO FrameResult -> m FrameResult)
    -> IO FrameResult -> m FrameResult
    forall a b. (a -> b) -> a -> b
    $ do
        timings' <- FrameTimings -> IO (Ptr FrameTimings)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr FrameTimings
    timings
        result <- gdk_frame_timings_get_result timings'
        let result' = (Int -> FrameResult
    forall a. Enum a => Int -> a
    toEnum (Int -> FrameResult) -> (CUInt -> Int) -> CUInt -> FrameResult
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . CUInt -> Int
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral) CUInt
    result
        touchManagedPtr timings
        return result'

    #if defined(ENABLE_OVERLOADING)
    data FrameTimingsGetResultMethodInfo
    instance (signature ~ (m Gdk.Enums.FrameResult), MonadIO m) => O.OverloadedMethod FrameTimingsGetResultMethodInfo FrameTimings signature where
        overloadedMethod = frameTimingsGetResult

    instance O.OverloadedMethodInfo FrameTimingsGetResultMethodInfo FrameTimings where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gdk.Structs.FrameTimings.frameTimingsGetResult",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk4-4.0.10/docs/GI-Gdk-Structs-FrameTimings.html#v:frameTimingsGetResult"
            })

    #endif

    -- method FrameTimings::ref
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "timings"
    --           , argType =
    --               TInterface Name { namespace = "Gdk" , name = "FrameTimings" }
    --           , argCType = Just "GdkFrameTimings*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GdkFrameTimings`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just
    --               (TInterface Name { namespace = "Gdk" , name = "FrameTimings" })
    -- throws : False
    -- Skip return : False

    foreign import ccall "gdk_frame_timings_ref" gdk_frame_timings_ref ::
        Ptr FrameTimings ->                     -- timings : TInterface (Name {namespace = "Gdk", name = "FrameTimings"})
        IO (Ptr FrameTimings)

    -- | Increases the reference count of /@timings@/.
    frameTimingsRef ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        FrameTimings
        -- ^ /@timings@/: a @GdkFrameTimings@
        -> m FrameTimings
        -- ^ __Returns:__ /@timings@/
    frameTimingsRef :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    FrameTimings -> m FrameTimings
    frameTimingsRef FrameTimings
    timings = IO FrameTimings -> m FrameTimings
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO FrameTimings -> m FrameTimings)
    -> IO FrameTimings -> m FrameTimings
    forall a b. (a -> b) -> a -> b
    $ do
        timings' <- FrameTimings -> IO (Ptr FrameTimings)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr FrameTimings
    timings
        result <- gdk_frame_timings_ref timings'
        checkUnexpectedReturnNULL "frameTimingsRef" result
        result' <- (wrapBoxed FrameTimings) result
        touchManagedPtr timings
        return result'

    #if defined(ENABLE_OVERLOADING)
    data FrameTimingsRefMethodInfo
    instance (signature ~ (m FrameTimings), MonadIO m) => O.OverloadedMethod FrameTimingsRefMethodInfo FrameTimings signature where
        overloadedMethod = frameTimingsRef

    instance O.OverloadedMethodInfo FrameTimingsRefMethodInfo FrameTimings where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gdk.Structs.FrameTimings.frameTimingsRef",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk4-4.0.10/docs/GI-Gdk-Structs-FrameTimings.html#v:frameTimingsRef"
            })

    #endif

    -- method FrameTimings::unref
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "timings"
    --           , argType =
    --               TInterface Name { namespace = "Gdk" , name = "FrameTimings" }
    --           , argCType = Just "GdkFrameTimings*"
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a `GdkFrameTimings`"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "gdk_frame_timings_unref" gdk_frame_timings_unref ::
        Ptr FrameTimings ->                     -- timings : TInterface (Name {namespace = "Gdk", name = "FrameTimings"})
        IO ()

    -- | Decreases the reference count of /@timings@/.
    --
    -- If /@timings@/ is no longer referenced, it will be freed.
    frameTimingsUnref ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        FrameTimings
        -- ^ /@timings@/: a @GdkFrameTimings@
        -> m ()
    frameTimingsUnref :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    FrameTimings -> m ()
    frameTimingsUnref FrameTimings
    timings = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ do
        timings' <- FrameTimings -> IO (Ptr FrameTimings)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr FrameTimings
    timings
        gdk_frame_timings_unref timings'
        touchManagedPtr timings
        return ()

    #if defined(ENABLE_OVERLOADING)
    data FrameTimingsUnrefMethodInfo
    instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod FrameTimingsUnrefMethodInfo FrameTimings signature where
        overloadedMethod = frameTimingsUnref

    instance O.OverloadedMethodInfo FrameTimingsUnrefMethodInfo FrameTimings where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Gdk.Structs.FrameTimings.frameTimingsUnref",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gdk4-4.0.10/docs/GI-Gdk-Structs-FrameTimings.html#v:frameTimingsUnref"
            })

    #endif

    #if defined(ENABLE_OVERLOADING)
    type family ResolveFrameTimingsMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
        ResolveFrameTimingsMethod "ref" o = FrameTimingsRefMethodInfo
        ResolveFrameTimingsMethod "unref" o = FrameTimingsUnrefMethodInfo
        ResolveFrameTimingsMethod "getComplete" o = FrameTimingsGetCompleteMethodInfo
        ResolveFrameTimingsMethod "getFrameCounter" o = FrameTimingsGetFrameCounterMethodInfo
        ResolveFrameTimingsMethod "getFrameTime" o = FrameTimingsGetFrameTimeMethodInfo
        ResolveFrameTimingsMethod "getPredictedPresentationTime" o = FrameTimingsGetPredictedPresentationTimeMethodInfo
        ResolveFrameTimingsMethod "getPresentationTime" o = FrameTimingsGetPresentationTimeMethodInfo
        ResolveFrameTimingsMethod "getRefreshInterval" o = FrameTimingsGetRefreshIntervalMethodInfo
        ResolveFrameTimingsMethod "getResult" o = FrameTimingsGetResultMethodInfo
        ResolveFrameTimingsMethod l o = O.MethodResolutionFailed l o

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

    #endif

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

    #endif