    {-# LANGUAGE TypeApplications #-}

    -- | Copyright  : Will Thompson and Iñaki García Etxebarria
    -- License    : LGPL-2.1
    -- Maintainer : Iñaki García Etxebarria
    --
    -- Contains the public fields of a
    -- [Queue][glib-Double-ended-Queues].

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

    module GI.GLib.Structs.Queue
        (

    -- * Exported types
        Queue(..)                               ,
        newZeroQueue                            ,

     -- * Methods
    -- |
    --
    --  === __Click to display all available methods, including inherited ones__
    -- ==== Methods
    -- [clear]("GI.GLib.Structs.Queue#g:method:clear"), [clearFull]("GI.GLib.Structs.Queue#g:method:clearFull"), [foreach]("GI.GLib.Structs.Queue#g:method:foreach"), [free]("GI.GLib.Structs.Queue#g:method:free"), [freeFull]("GI.GLib.Structs.Queue#g:method:freeFull"), [index]("GI.GLib.Structs.Queue#g:method:index"), [init]("GI.GLib.Structs.Queue#g:method:init"), [insertSorted]("GI.GLib.Structs.Queue#g:method:insertSorted"), [isEmpty]("GI.GLib.Structs.Queue#g:method:isEmpty"), [peekHead]("GI.GLib.Structs.Queue#g:method:peekHead"), [peekNth]("GI.GLib.Structs.Queue#g:method:peekNth"), [peekTail]("GI.GLib.Structs.Queue#g:method:peekTail"), [popHead]("GI.GLib.Structs.Queue#g:method:popHead"), [popNth]("GI.GLib.Structs.Queue#g:method:popNth"), [popTail]("GI.GLib.Structs.Queue#g:method:popTail"), [pushHead]("GI.GLib.Structs.Queue#g:method:pushHead"), [pushNth]("GI.GLib.Structs.Queue#g:method:pushNth"), [pushTail]("GI.GLib.Structs.Queue#g:method:pushTail"), [remove]("GI.GLib.Structs.Queue#g:method:remove"), [removeAll]("GI.GLib.Structs.Queue#g:method:removeAll"), [reverse]("GI.GLib.Structs.Queue#g:method:reverse"), [sort]("GI.GLib.Structs.Queue#g:method:sort").
    --
    -- ==== Getters
    -- [getLength]("GI.GLib.Structs.Queue#g:method:getLength").
    --
    -- ==== Setters
    -- /None/.

    #if defined(ENABLE_OVERLOADING)
        ResolveQueueMethod                      ,
    #endif

    -- ** clear #method:clear#

    #if defined(ENABLE_OVERLOADING)
        QueueClearMethodInfo                    ,
    #endif
        queueClear                              ,

    -- ** clearFull #method:clearFull#

    #if defined(ENABLE_OVERLOADING)
        QueueClearFullMethodInfo                ,
    #endif
        queueClearFull                          ,

    -- ** foreach #method:foreach#

    #if defined(ENABLE_OVERLOADING)
        QueueForeachMethodInfo                  ,
    #endif
        queueForeach                            ,

    -- ** free #method:free#

    #if defined(ENABLE_OVERLOADING)
        QueueFreeMethodInfo                     ,
    #endif
        queueFree                               ,

    -- ** freeFull #method:freeFull#

    #if defined(ENABLE_OVERLOADING)
        QueueFreeFullMethodInfo                 ,
    #endif
        queueFreeFull                           ,

    -- ** getLength #method:getLength#

    #if defined(ENABLE_OVERLOADING)
        QueueGetLengthMethodInfo                ,
    #endif
        queueGetLength                          ,

    -- ** index #method:index#

    #if defined(ENABLE_OVERLOADING)
        QueueIndexMethodInfo                    ,
    #endif
        queueIndex                              ,

    -- ** init #method:init#

    #if defined(ENABLE_OVERLOADING)
        QueueInitMethodInfo                     ,
    #endif
        queueInit                               ,

    -- ** insertSorted #method:insertSorted#

    #if defined(ENABLE_OVERLOADING)
        QueueInsertSortedMethodInfo             ,
    #endif
        queueInsertSorted                       ,

    -- ** isEmpty #method:isEmpty#

    #if defined(ENABLE_OVERLOADING)
        QueueIsEmptyMethodInfo                  ,
    #endif
        queueIsEmpty                            ,

    -- ** peekHead #method:peekHead#

    #if defined(ENABLE_OVERLOADING)
        QueuePeekHeadMethodInfo                 ,
    #endif
        queuePeekHead                           ,

    -- ** peekNth #method:peekNth#

    #if defined(ENABLE_OVERLOADING)
        QueuePeekNthMethodInfo                  ,
    #endif
        queuePeekNth                            ,

    -- ** peekTail #method:peekTail#

    #if defined(ENABLE_OVERLOADING)
        QueuePeekTailMethodInfo                 ,
    #endif
        queuePeekTail                           ,

    -- ** popHead #method:popHead#

    #if defined(ENABLE_OVERLOADING)
        QueuePopHeadMethodInfo                  ,
    #endif
        queuePopHead                            ,

    -- ** popNth #method:popNth#

    #if defined(ENABLE_OVERLOADING)
        QueuePopNthMethodInfo                   ,
    #endif
        queuePopNth                             ,

    -- ** popTail #method:popTail#

    #if defined(ENABLE_OVERLOADING)
        QueuePopTailMethodInfo                  ,
    #endif
        queuePopTail                            ,

    -- ** pushHead #method:pushHead#

    #if defined(ENABLE_OVERLOADING)
        QueuePushHeadMethodInfo                 ,
    #endif
        queuePushHead                           ,

    -- ** pushNth #method:pushNth#

    #if defined(ENABLE_OVERLOADING)
        QueuePushNthMethodInfo                  ,
    #endif
        queuePushNth                            ,

    -- ** pushTail #method:pushTail#

    #if defined(ENABLE_OVERLOADING)
        QueuePushTailMethodInfo                 ,
    #endif
        queuePushTail                           ,

    -- ** remove #method:remove#

    #if defined(ENABLE_OVERLOADING)
        QueueRemoveMethodInfo                   ,
    #endif
        queueRemove                             ,

    -- ** removeAll #method:removeAll#

    #if defined(ENABLE_OVERLOADING)
        QueueRemoveAllMethodInfo                ,
    #endif
        queueRemoveAll                          ,

    -- ** reverse #method:reverse#

    #if defined(ENABLE_OVERLOADING)
        QueueReverseMethodInfo                  ,
    #endif
        queueReverse                            ,

    -- ** sort #method:sort#

    #if defined(ENABLE_OVERLOADING)
        QueueSortMethodInfo                     ,
    #endif
        queueSort                               ,

     -- * Properties

    -- ** head #attr:head#
    -- | a pointer to the first element of the queue

        clearQueueHead                          ,
        getQueueHead                            ,
    #if defined(ENABLE_OVERLOADING)
        queue_head                              ,
    #endif
        setQueueHead                            ,

    -- ** length #attr:length#
    -- | the number of elements in the queue

        getQueueLength                          ,
    #if defined(ENABLE_OVERLOADING)
        queue_length                            ,
    #endif
        setQueueLength                          ,

    -- ** tail #attr:tail#
    -- | a pointer to the last element of the queue

        clearQueueTail                          ,
        getQueueTail                            ,
    #if defined(ENABLE_OVERLOADING)
        queue_tail                              ,
    #endif
        setQueueTail                            ,

        ) 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 qualified GI.GLib.Callbacks as GLib.Callbacks

    #else
    import qualified GI.GLib.Callbacks as GLib.Callbacks

    #endif

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

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

    instance BoxedPtr Queue where
        boxedPtrCopy :: Queue -> IO Queue
    boxedPtrCopy = \Queue
    p -> Queue -> (Ptr Queue -> IO Queue) -> IO Queue
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    B.ManagedPtr.withManagedPtr Queue
    p (Int -> Ptr Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, CallocPtr a) => Int -> Ptr a -> IO (Ptr a)
    copyBytes Int
    24 (Ptr Queue -> IO (Ptr Queue))
    -> (Ptr Queue -> IO Queue) -> Ptr Queue -> IO Queue
    forall (m :: * -> *) a b c.
    Monad m =>
    (a -> m b) -> (b -> m c) -> a -> m c
    >=> (ManagedPtr Queue -> Queue) -> Ptr Queue -> IO Queue
    forall a.
    (HasCallStack, BoxedPtr a) =>
    (ManagedPtr a -> a) -> Ptr a -> IO a
    B.ManagedPtr.wrapPtr ManagedPtr Queue -> Queue
    Queue)
        boxedPtrFree :: Queue -> IO ()
    boxedPtrFree = \Queue
    x -> Queue -> (Ptr Queue -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    SP.withManagedPtr Queue
    x Ptr Queue -> IO ()
    forall a. Ptr a -> IO ()
    SP.freeMem
    instance CallocPtr Queue where
        boxedPtrCalloc :: IO (Ptr Queue)
    boxedPtrCalloc = Int -> IO (Ptr Queue)
    forall a. Int -> IO (Ptr a)
    callocBytes Int
    24

    -- | Construct a `Queue` struct initialized to zero.
    newZeroQueue :: MonadIO m => m Queue
    newZeroQueue :: forall (m :: * -> *). MonadIO m => m Queue
    newZeroQueue = IO Queue -> m Queue
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Queue -> m Queue) -> IO Queue -> m Queue
    forall a b. (a -> b) -> a -> b
    $ IO (Ptr Queue)
    forall a. CallocPtr a => IO (Ptr a)
    boxedPtrCalloc IO (Ptr Queue) -> (Ptr Queue -> IO Queue) -> IO Queue
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= (ManagedPtr Queue -> Queue) -> Ptr Queue -> IO Queue
    forall a.
    (HasCallStack, BoxedPtr a) =>
    (ManagedPtr a -> a) -> Ptr a -> IO a
    wrapPtr ManagedPtr Queue -> Queue
    Queue

    instance tag ~ 'AttrSet => Constructible Queue tag where
        new :: forall (m :: * -> *).
    MonadIO m =>
    (ManagedPtr Queue -> Queue) -> [AttrOp Queue tag] -> m Queue
    new ManagedPtr Queue -> Queue
    _ [AttrOp Queue tag]
    attrs = do
            Queue
    o <- m Queue
    forall (m :: * -> *). MonadIO m => m Queue
    newZeroQueue
            Queue -> [AttrOp Queue 'AttrSet] -> m ()
    forall o (m :: * -> *).
    MonadIO m =>
    o -> [AttrOp o 'AttrSet] -> m ()
    GI.Attributes.set Queue
    o [AttrOp Queue tag]
    [AttrOp Queue 'AttrSet]
    attrs
            Queue -> m Queue
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Queue
    o

    -- | Get the value of the “@head@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' queue #head
    -- @
    getQueueHead :: MonadIO m => Queue -> m ([Ptr ()])
    getQueueHead :: forall (m :: * -> *). MonadIO m => Queue -> m [Ptr ()]
    getQueueHead Queue
    s = IO [Ptr ()] -> m [Ptr ()]
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO [Ptr ()] -> m [Ptr ()]) -> IO [Ptr ()] -> m [Ptr ()]
    forall a b. (a -> b) -> a -> b
    $ Queue -> (Ptr Queue -> IO [Ptr ()]) -> IO [Ptr ()]
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr Queue
    s ((Ptr Queue -> IO [Ptr ()]) -> IO [Ptr ()])
    -> (Ptr Queue -> IO [Ptr ()]) -> IO [Ptr ()]
    forall a b. (a -> b) -> a -> b
    $ \Ptr Queue
    ptr -> do
        Ptr (GList (Ptr ()))
    val <- Ptr (Ptr (GList (Ptr ()))) -> IO (Ptr (GList (Ptr ())))
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr Queue
    ptr Ptr Queue -> Int -> Ptr (Ptr (GList (Ptr ())))
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    0) :: IO (Ptr (GList (Ptr ())))
        [Ptr ()]
    val' <- Ptr (GList (Ptr ())) -> IO [Ptr ()]
    forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
    unpackGList Ptr (GList (Ptr ()))
    val
        [Ptr ()] -> IO [Ptr ()]
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return [Ptr ()]
    val'

    -- | Set the value of the “@head@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.set' queue [ #head 'Data.GI.Base.Attributes.:=' value ]
    -- @
    setQueueHead :: MonadIO m => Queue -> Ptr (GList (Ptr ())) -> m ()
    setQueueHead :: forall (m :: * -> *).
    MonadIO m =>
    Queue -> Ptr (GList (Ptr ())) -> m ()
    setQueueHead Queue
    s Ptr (GList (Ptr ()))
    val = 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
    $ Queue -> (Ptr Queue -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr Queue
    s ((Ptr Queue -> IO ()) -> IO ()) -> (Ptr Queue -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr Queue
    ptr -> do
        Ptr (Ptr (GList (Ptr ()))) -> Ptr (GList (Ptr ())) -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr Queue
    ptr Ptr Queue -> Int -> Ptr (Ptr (GList (Ptr ())))
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    0) (Ptr (GList (Ptr ()))
    val :: Ptr (GList (Ptr ())))

    -- | Set the value of the “@head@” field to `Nothing`.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.clear' #head
    -- @
    clearQueueHead :: MonadIO m => Queue -> m ()
    clearQueueHead :: forall (m :: * -> *). MonadIO m => Queue -> m ()
    clearQueueHead Queue
    s = 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
    $ Queue -> (Ptr Queue -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr Queue
    s ((Ptr Queue -> IO ()) -> IO ()) -> (Ptr Queue -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr Queue
    ptr -> do
        Ptr (Ptr (GList (Ptr ()))) -> Ptr (GList (Ptr ())) -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr Queue
    ptr Ptr Queue -> Int -> Ptr (Ptr (GList (Ptr ())))
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    0) (Ptr (GList (Ptr ()))
    forall a. Ptr a
    FP.nullPtr :: Ptr (GList (Ptr ())))

    #if defined(ENABLE_OVERLOADING)
    data QueueHeadFieldInfo
    instance AttrInfo QueueHeadFieldInfo where
        type AttrBaseTypeConstraint QueueHeadFieldInfo = (~) Queue
        type AttrAllowedOps QueueHeadFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
        type AttrSetTypeConstraint QueueHeadFieldInfo = (~) (Ptr (GList (Ptr ())))
        type AttrTransferTypeConstraint QueueHeadFieldInfo = (~)(Ptr (GList (Ptr ())))
        type AttrTransferType QueueHeadFieldInfo = (Ptr (GList (Ptr ())))
        type AttrGetType QueueHeadFieldInfo = [Ptr ()]
        type AttrLabel QueueHeadFieldInfo = "head"
        type AttrOrigin QueueHeadFieldInfo = Queue
        attrGet = getQueueHead
        attrSet = setQueueHead
        attrConstruct = undefined
        attrClear = clearQueueHead
        attrTransfer _ v = do
            return v
        dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.head"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#g:attr:head"
            })

    queue_head :: AttrLabelProxy "head"
    queue_head = AttrLabelProxy

    #endif

    -- | Get the value of the “@tail@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' queue #tail
    -- @
    getQueueTail :: MonadIO m => Queue -> m ([Ptr ()])
    getQueueTail :: forall (m :: * -> *). MonadIO m => Queue -> m [Ptr ()]
    getQueueTail Queue
    s = IO [Ptr ()] -> m [Ptr ()]
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO [Ptr ()] -> m [Ptr ()]) -> IO [Ptr ()] -> m [Ptr ()]
    forall a b. (a -> b) -> a -> b
    $ Queue -> (Ptr Queue -> IO [Ptr ()]) -> IO [Ptr ()]
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr Queue
    s ((Ptr Queue -> IO [Ptr ()]) -> IO [Ptr ()])
    -> (Ptr Queue -> IO [Ptr ()]) -> IO [Ptr ()]
    forall a b. (a -> b) -> a -> b
    $ \Ptr Queue
    ptr -> do
        Ptr (GList (Ptr ()))
    val <- Ptr (Ptr (GList (Ptr ()))) -> IO (Ptr (GList (Ptr ())))
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr Queue
    ptr Ptr Queue -> Int -> Ptr (Ptr (GList (Ptr ())))
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    8) :: IO (Ptr (GList (Ptr ())))
        [Ptr ()]
    val' <- Ptr (GList (Ptr ())) -> IO [Ptr ()]
    forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
    unpackGList Ptr (GList (Ptr ()))
    val
        [Ptr ()] -> IO [Ptr ()]
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return [Ptr ()]
    val'

    -- | Set the value of the “@tail@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.set' queue [ #tail 'Data.GI.Base.Attributes.:=' value ]
    -- @
    setQueueTail :: MonadIO m => Queue -> Ptr (GList (Ptr ())) -> m ()
    setQueueTail :: forall (m :: * -> *).
    MonadIO m =>
    Queue -> Ptr (GList (Ptr ())) -> m ()
    setQueueTail Queue
    s Ptr (GList (Ptr ()))
    val = 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
    $ Queue -> (Ptr Queue -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr Queue
    s ((Ptr Queue -> IO ()) -> IO ()) -> (Ptr Queue -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr Queue
    ptr -> do
        Ptr (Ptr (GList (Ptr ()))) -> Ptr (GList (Ptr ())) -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr Queue
    ptr Ptr Queue -> Int -> Ptr (Ptr (GList (Ptr ())))
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    8) (Ptr (GList (Ptr ()))
    val :: Ptr (GList (Ptr ())))

    -- | Set the value of the “@tail@” field to `Nothing`.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.clear' #tail
    -- @
    clearQueueTail :: MonadIO m => Queue -> m ()
    clearQueueTail :: forall (m :: * -> *). MonadIO m => Queue -> m ()
    clearQueueTail Queue
    s = 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
    $ Queue -> (Ptr Queue -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr Queue
    s ((Ptr Queue -> IO ()) -> IO ()) -> (Ptr Queue -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr Queue
    ptr -> do
        Ptr (Ptr (GList (Ptr ()))) -> Ptr (GList (Ptr ())) -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr Queue
    ptr Ptr Queue -> Int -> Ptr (Ptr (GList (Ptr ())))
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    8) (Ptr (GList (Ptr ()))
    forall a. Ptr a
    FP.nullPtr :: Ptr (GList (Ptr ())))

    #if defined(ENABLE_OVERLOADING)
    data QueueTailFieldInfo
    instance AttrInfo QueueTailFieldInfo where
        type AttrBaseTypeConstraint QueueTailFieldInfo = (~) Queue
        type AttrAllowedOps QueueTailFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
        type AttrSetTypeConstraint QueueTailFieldInfo = (~) (Ptr (GList (Ptr ())))
        type AttrTransferTypeConstraint QueueTailFieldInfo = (~)(Ptr (GList (Ptr ())))
        type AttrTransferType QueueTailFieldInfo = (Ptr (GList (Ptr ())))
        type AttrGetType QueueTailFieldInfo = [Ptr ()]
        type AttrLabel QueueTailFieldInfo = "tail"
        type AttrOrigin QueueTailFieldInfo = Queue
        attrGet = getQueueTail
        attrSet = setQueueTail
        attrConstruct = undefined
        attrClear = clearQueueTail
        attrTransfer _ v = do
            return v
        dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.tail"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#g:attr:tail"
            })

    queue_tail :: AttrLabelProxy "tail"
    queue_tail = AttrLabelProxy

    #endif

    -- | Get the value of the “@length@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' queue #length
    -- @
    getQueueLength :: MonadIO m => Queue -> m Word32
    getQueueLength :: forall (m :: * -> *). MonadIO m => Queue -> m Word32
    getQueueLength Queue
    s = IO Word32 -> m Word32
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
    forall a b. (a -> b) -> a -> b
    $ Queue -> (Ptr Queue -> IO Word32) -> IO Word32
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr Queue
    s ((Ptr Queue -> IO Word32) -> IO Word32)
    -> (Ptr Queue -> IO Word32) -> IO Word32
    forall a b. (a -> b) -> a -> b
    $ \Ptr Queue
    ptr -> do
        Word32
    val <- Ptr Word32 -> IO Word32
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr Queue
    ptr Ptr Queue -> Int -> Ptr Word32
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    16) :: IO Word32
        Word32 -> IO Word32
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Word32
    val

    -- | Set the value of the “@length@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.set' queue [ #length 'Data.GI.Base.Attributes.:=' value ]
    -- @
    setQueueLength :: MonadIO m => Queue -> Word32 -> m ()
    setQueueLength :: forall (m :: * -> *). MonadIO m => Queue -> Word32 -> m ()
    setQueueLength Queue
    s Word32
    val = 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
    $ Queue -> (Ptr Queue -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr Queue
    s ((Ptr Queue -> IO ()) -> IO ()) -> (Ptr Queue -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr Queue
    ptr -> do
        Ptr Word32 -> Word32 -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr Queue
    ptr Ptr Queue -> Int -> Ptr Word32
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    16) (Word32
    val :: Word32)

    #if defined(ENABLE_OVERLOADING)
    data QueueLengthFieldInfo
    instance AttrInfo QueueLengthFieldInfo where
        type AttrBaseTypeConstraint QueueLengthFieldInfo = (~) Queue
        type AttrAllowedOps QueueLengthFieldInfo = '[ 'AttrSet, 'AttrGet]
        type AttrSetTypeConstraint QueueLengthFieldInfo = (~) Word32
        type AttrTransferTypeConstraint QueueLengthFieldInfo = (~)Word32
        type AttrTransferType QueueLengthFieldInfo = Word32
        type AttrGetType QueueLengthFieldInfo = Word32
        type AttrLabel QueueLengthFieldInfo = "length"
        type AttrOrigin QueueLengthFieldInfo = Queue
        attrGet = getQueueLength
        attrSet = setQueueLength
        attrConstruct = undefined
        attrClear = undefined
        attrTransfer _ v = do
            return v
        dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.length"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#g:attr:length"
            })

    queue_length :: AttrLabelProxy "length"
    queue_length = AttrLabelProxy

    #endif

    #if defined(ENABLE_OVERLOADING)
    instance O.HasAttributeList Queue
    type instance O.AttributeList Queue = QueueAttributeList
    type QueueAttributeList = ('[ '("head", QueueHeadFieldInfo), '("tail", QueueTailFieldInfo), '("length", QueueLengthFieldInfo)] :: [(Symbol, DK.Type)])
    #endif

    -- method Queue::clear
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GQueue" , 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 "g_queue_clear" g_queue_clear ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        IO ()

    -- | Removes all the elements in /@queue@/. If queue elements contain
    -- dynamically-allocated memory, they should be freed first.
    --
    -- /Since: 2.14/
    queueClear ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a t'GI.GLib.Structs.Queue.Queue'
        -> m ()
    queueClear :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Queue -> m ()
    queueClear Queue
    queue = 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
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        Ptr Queue -> IO ()
    g_queue_clear Ptr Queue
    queue'
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        () -> IO ()
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()

    #if defined(ENABLE_OVERLOADING)
    data QueueClearMethodInfo
    instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod QueueClearMethodInfo Queue signature where
        overloadedMethod = queueClear

    instance O.OverloadedMethodInfo QueueClearMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queueClear",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queueClear"
            })

    #endif

    -- method Queue::clear_full
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a pointer to a #GQueue"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "free_func"
    --           , argType =
    --               TInterface Name { namespace = "GLib" , name = "DestroyNotify" }
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText =
    --                     Just "the function to be called to free memory allocated"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeAsync
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "g_queue_clear_full" g_queue_clear_full ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        FunPtr GLib.Callbacks.C_DestroyNotify -> -- free_func : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
        IO ()

    -- | Convenience method, which frees all the memory used by a t'GI.GLib.Structs.Queue.Queue',
    -- and calls the provided /@freeFunc@/ on each item in the t'GI.GLib.Structs.Queue.Queue'.
    --
    -- /Since: 2.60/
    queueClearFull ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a pointer to a t'GI.GLib.Structs.Queue.Queue'
        -> Maybe (GLib.Callbacks.DestroyNotify)
        -- ^ /@freeFunc@/: the function to be called to free memory allocated
        -> m ()
    queueClearFull :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    Queue -> Maybe DestroyNotify -> m ()
    queueClearFull Queue
    queue Maybe DestroyNotify
    freeFunc = 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
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        FunPtr DestroyNotify
    maybeFreeFunc <- case Maybe DestroyNotify
    freeFunc of
            Maybe DestroyNotify
    Nothing -> FunPtr DestroyNotify -> IO (FunPtr DestroyNotify)
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return FunPtr DestroyNotify
    forall a. FunPtr a
    FP.nullFunPtr
            Just DestroyNotify
    jFreeFunc -> do
                Ptr (FunPtr DestroyNotify)
    ptrfreeFunc <- IO (Ptr (FunPtr DestroyNotify))
    forall a. Storable a => IO (Ptr a)
    callocMem :: IO (Ptr (FunPtr GLib.Callbacks.C_DestroyNotify))
                FunPtr DestroyNotify
    jFreeFunc' <- DestroyNotify -> IO (FunPtr DestroyNotify)
    GLib.Callbacks.mk_DestroyNotify (Maybe (Ptr (FunPtr DestroyNotify))
    -> DestroyNotify -> DestroyNotify
    GLib.Callbacks.wrap_DestroyNotify (Ptr (FunPtr DestroyNotify) -> Maybe (Ptr (FunPtr DestroyNotify))
    forall a. a -> Maybe a
    Just Ptr (FunPtr DestroyNotify)
    ptrfreeFunc) DestroyNotify
    jFreeFunc)
                Ptr (FunPtr DestroyNotify) -> FunPtr DestroyNotify -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke Ptr (FunPtr DestroyNotify)
    ptrfreeFunc FunPtr DestroyNotify
    jFreeFunc'
                FunPtr DestroyNotify -> IO (FunPtr DestroyNotify)
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return FunPtr DestroyNotify
    jFreeFunc'
        Ptr Queue -> FunPtr DestroyNotify -> IO ()
    g_queue_clear_full Ptr Queue
    queue' FunPtr DestroyNotify
    maybeFreeFunc
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        () -> IO ()
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()

    #if defined(ENABLE_OVERLOADING)
    data QueueClearFullMethodInfo
    instance (signature ~ (Maybe (GLib.Callbacks.DestroyNotify) -> m ()), MonadIO m) => O.OverloadedMethod QueueClearFullMethodInfo Queue signature where
        overloadedMethod = queueClearFull

    instance O.OverloadedMethodInfo QueueClearFullMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queueClearFull",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queueClearFull"
            })

    #endif

    -- method Queue::foreach
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GQueue" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "func"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Func" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the function to call for each element's data"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeCall
    --           , argClosure = 2
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "user_data"
    --           , argType = TBasicType TPtr
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "user data to pass to @func"
    --                 , 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 "g_queue_foreach" g_queue_foreach ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        FunPtr GLib.Callbacks.C_Func ->         -- func : TInterface (Name {namespace = "GLib", name = "Func"})
        Ptr () ->                               -- user_data : TBasicType TPtr
        IO ()

    -- | Calls /@func@/ for each element in the queue passing /@userData@/ to the
    -- function.
    --
    -- It is safe for /@func@/ to remove the element from /@queue@/, but it must
    -- not modify any part of the queue after that element.
    --
    -- /Since: 2.4/
    queueForeach ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a t'GI.GLib.Structs.Queue.Queue'
        -> GLib.Callbacks.Func
        -- ^ /@func@/: the function to call for each element\'s data
        -> m ()
    queueForeach :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    Queue -> DestroyNotify -> m ()
    queueForeach Queue
    queue DestroyNotify
    func = 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
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        FunPtr C_Func
    func' <- C_Func -> IO (FunPtr C_Func)
    GLib.Callbacks.mk_Func (Maybe (Ptr (FunPtr C_Func)) -> C_Func -> C_Func
    GLib.Callbacks.wrap_Func Maybe (Ptr (FunPtr C_Func))
    forall a. Maybe a
    Nothing (DestroyNotify -> C_Func
    GLib.Callbacks.drop_closures_Func DestroyNotify
    func))
        let userData :: Ptr a
    userData = Ptr a
    forall a. Ptr a
    nullPtr
        Ptr Queue -> FunPtr C_Func -> DestroyNotify
    g_queue_foreach Ptr Queue
    queue' FunPtr C_Func
    func' Ptr ()
    forall a. Ptr a
    userData
        Ptr Any -> IO ()
    forall a. Ptr a -> IO ()
    safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
    forall a b. (a -> b) -> a -> b
    $ FunPtr C_Func -> Ptr Any
    forall a b. FunPtr a -> Ptr b
    castFunPtrToPtr FunPtr C_Func
    func'
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        () -> IO ()
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()

    #if defined(ENABLE_OVERLOADING)
    data QueueForeachMethodInfo
    instance (signature ~ (GLib.Callbacks.Func -> m ()), MonadIO m) => O.OverloadedMethod QueueForeachMethodInfo Queue signature where
        overloadedMethod = queueForeach

    instance O.OverloadedMethodInfo QueueForeachMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queueForeach",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queueForeach"
            })

    #endif

    -- method Queue::free
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GQueue" , 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 "g_queue_free" g_queue_free ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        IO ()

    -- | Frees the memory allocated for the t'GI.GLib.Structs.Queue.Queue'. Only call this function
    -- if /@queue@/ was created with @/g_queue_new()/@. If queue elements contain
    -- dynamically-allocated memory, they should be freed first.
    --
    -- If queue elements contain dynamically-allocated memory, you should
    -- either use 'GI.GLib.Structs.Queue.queueFreeFull' or free them manually first.
    queueFree ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a t'GI.GLib.Structs.Queue.Queue'
        -> m ()
    queueFree :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Queue -> m ()
    queueFree Queue
    queue = 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
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        Ptr Queue -> IO ()
    g_queue_free Ptr Queue
    queue'
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        () -> IO ()
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()

    #if defined(ENABLE_OVERLOADING)
    data QueueFreeMethodInfo
    instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod QueueFreeMethodInfo Queue signature where
        overloadedMethod = queueFree

    instance O.OverloadedMethodInfo QueueFreeMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queueFree",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queueFree"
            })

    #endif

    -- method Queue::free_full
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a pointer to a #GQueue"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "free_func"
    --           , argType =
    --               TInterface Name { namespace = "GLib" , name = "DestroyNotify" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText =
    --                     Just "the function to be called to free each element's data"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeAsync
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "g_queue_free_full" g_queue_free_full ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        FunPtr GLib.Callbacks.C_DestroyNotify -> -- free_func : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
        IO ()

    -- | Convenience method, which frees all the memory used by a t'GI.GLib.Structs.Queue.Queue',
    -- and calls the specified destroy function on every element\'s data.
    --
    -- /@freeFunc@/ should not modify the queue (eg, by removing the freed
    -- element from it).
    --
    -- /Since: 2.32/
    queueFreeFull ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a pointer to a t'GI.GLib.Structs.Queue.Queue'
        -> GLib.Callbacks.DestroyNotify
        -- ^ /@freeFunc@/: the function to be called to free each element\'s data
        -> m ()
    queueFreeFull :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    Queue -> DestroyNotify -> m ()
    queueFreeFull Queue
    queue DestroyNotify
    freeFunc = 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
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        Ptr (FunPtr DestroyNotify)
    ptrfreeFunc <- IO (Ptr (FunPtr DestroyNotify))
    forall a. Storable a => IO (Ptr a)
    callocMem :: IO (Ptr (FunPtr GLib.Callbacks.C_DestroyNotify))
        FunPtr DestroyNotify
    freeFunc' <- DestroyNotify -> IO (FunPtr DestroyNotify)
    GLib.Callbacks.mk_DestroyNotify (Maybe (Ptr (FunPtr DestroyNotify))
    -> DestroyNotify -> DestroyNotify
    GLib.Callbacks.wrap_DestroyNotify (Ptr (FunPtr DestroyNotify) -> Maybe (Ptr (FunPtr DestroyNotify))
    forall a. a -> Maybe a
    Just Ptr (FunPtr DestroyNotify)
    ptrfreeFunc) DestroyNotify
    freeFunc)
        Ptr (FunPtr DestroyNotify) -> FunPtr DestroyNotify -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke Ptr (FunPtr DestroyNotify)
    ptrfreeFunc FunPtr DestroyNotify
    freeFunc'
        Ptr Queue -> FunPtr DestroyNotify -> IO ()
    g_queue_free_full Ptr Queue
    queue' FunPtr DestroyNotify
    freeFunc'
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        () -> IO ()
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()

    #if defined(ENABLE_OVERLOADING)
    data QueueFreeFullMethodInfo
    instance (signature ~ (GLib.Callbacks.DestroyNotify -> m ()), MonadIO m) => O.OverloadedMethod QueueFreeFullMethodInfo Queue signature where
        overloadedMethod = queueFreeFull

    instance O.OverloadedMethodInfo QueueFreeFullMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queueFreeFull",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queueFreeFull"
            })

    #endif

    -- method Queue::get_length
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GQueue" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TUInt)
    -- throws : False
    -- Skip return : False

    foreign import ccall "g_queue_get_length" g_queue_get_length ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        IO Word32

    -- | Returns the number of items in /@queue@/.
    --
    -- /Since: 2.4/
    queueGetLength ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a t'GI.GLib.Structs.Queue.Queue'
        -> m Word32
        -- ^ __Returns:__ the number of items in /@queue@/
    queueGetLength :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    Queue -> m Word32
    queueGetLength Queue
    queue = IO Word32 -> m Word32
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
    forall a b. (a -> b) -> a -> b
    $ do
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        Word32
    result <- Ptr Queue -> IO Word32
    g_queue_get_length Ptr Queue
    queue'
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        Word32 -> IO Word32
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Word32
    result

    #if defined(ENABLE_OVERLOADING)
    data QueueGetLengthMethodInfo
    instance (signature ~ (m Word32), MonadIO m) => O.OverloadedMethod QueueGetLengthMethodInfo Queue signature where
        overloadedMethod = queueGetLength

    instance O.OverloadedMethodInfo QueueGetLengthMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queueGetLength",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queueGetLength"
            })

    #endif

    -- method Queue::index
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GQueue" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "data"
    --           , argType = TBasicType TPtr
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the data to find" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TInt)
    -- throws : False
    -- Skip return : False

    foreign import ccall "g_queue_index" g_queue_index ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        Ptr () ->                               -- data : TBasicType TPtr
        IO Int32

    -- | Returns the position of the first element in /@queue@/ which contains /@data@/.
    --
    -- /Since: 2.4/
    queueIndex ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a t'GI.GLib.Structs.Queue.Queue'
        -> Ptr ()
        -- ^ /@data@/: the data to find
        -> m Int32
        -- ^ __Returns:__ the position of the first element in /@queue@/ which
        --     contains /@data@/, or -1 if no element in /@queue@/ contains /@data@/
    queueIndex :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    Queue -> Ptr () -> m Int32
    queueIndex Queue
    queue Ptr ()
    data_ = IO Int32 -> m Int32
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
    forall a b. (a -> b) -> a -> b
    $ do
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        Int32
    result <- Ptr Queue -> Ptr () -> IO Int32
    g_queue_index Ptr Queue
    queue' Ptr ()
    data_
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        Int32 -> IO Int32
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Int32
    result

    #if defined(ENABLE_OVERLOADING)
    data QueueIndexMethodInfo
    instance (signature ~ (Ptr () -> m Int32), MonadIO m) => O.OverloadedMethod QueueIndexMethodInfo Queue signature where
        overloadedMethod = queueIndex

    instance O.OverloadedMethodInfo QueueIndexMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queueIndex",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queueIndex"
            })

    #endif

    -- method Queue::init
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "an uninitialized #GQueue"
    --                 , 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 "g_queue_init" g_queue_init ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        IO ()

    -- | A statically-allocated t'GI.GLib.Structs.Queue.Queue' must be initialized with this function
    -- before it can be used. Alternatively you can initialize it with
    -- @/G_QUEUE_INIT/@. It is not necessary to initialize queues created with
    -- @/g_queue_new()/@.
    --
    -- /Since: 2.14/
    queueInit ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: an uninitialized t'GI.GLib.Structs.Queue.Queue'
        -> m ()
    queueInit :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Queue -> m ()
    queueInit Queue
    queue = 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
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        Ptr Queue -> IO ()
    g_queue_init Ptr Queue
    queue'
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        () -> IO ()
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()

    #if defined(ENABLE_OVERLOADING)
    data QueueInitMethodInfo
    instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod QueueInitMethodInfo Queue signature where
        overloadedMethod = queueInit

    instance O.OverloadedMethodInfo QueueInitMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queueInit",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queueInit"
            })

    #endif

    -- method Queue::insert_sorted
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GQueue" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "data"
    --           , argType = TBasicType TPtr
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the data to insert" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "func"
    --           , argType =
    --               TInterface Name { namespace = "GLib" , name = "CompareDataFunc" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText =
    --                     Just
    --                       "the #GCompareDataFunc used to compare elements in the queue. It is\n    called with two elements of the @queue and @user_data. It should\n    return 0 if the elements are equal, a negative value if the first\n    element comes before the second, and a positive value if the second\n    element comes before the first."
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeCall
    --           , argClosure = 3
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "user_data"
    --           , argType = TBasicType TPtr
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "user data passed to @func"
    --                 , 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 "g_queue_insert_sorted" g_queue_insert_sorted ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        Ptr () ->                               -- data : TBasicType TPtr
        FunPtr GLib.Callbacks.C_CompareDataFunc -> -- func : TInterface (Name {namespace = "GLib", name = "CompareDataFunc"})
        Ptr () ->                               -- user_data : TBasicType TPtr
        IO ()

    -- | Inserts /@data@/ into /@queue@/ using /@func@/ to determine the new position.
    --
    -- /Since: 2.4/
    queueInsertSorted ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a t'GI.GLib.Structs.Queue.Queue'
        -> Ptr ()
        -- ^ /@data@/: the data to insert
        -> GLib.Callbacks.CompareDataFunc
        -- ^ /@func@/: the t'GI.GLib.Callbacks.CompareDataFunc' used to compare elements in the queue. It is
        --     called with two elements of the /@queue@/ and /@userData@/. It should
        --     return 0 if the elements are equal, a negative value if the first
        --     element comes before the second, and a positive value if the second
        --     element comes before the first.
        -> m ()
    queueInsertSorted :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    Queue -> Ptr () -> CompareDataFunc -> m ()
    queueInsertSorted Queue
    queue Ptr ()
    data_ CompareDataFunc
    func = 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
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        FunPtr C_CompareDataFunc
    func' <- C_CompareDataFunc -> IO (FunPtr C_CompareDataFunc)
    GLib.Callbacks.mk_CompareDataFunc (Maybe (Ptr (FunPtr C_CompareDataFunc))
    -> C_CompareDataFunc -> C_CompareDataFunc
    GLib.Callbacks.wrap_CompareDataFunc Maybe (Ptr (FunPtr C_CompareDataFunc))
    forall a. Maybe a
    Nothing (CompareDataFunc -> C_CompareDataFunc
    GLib.Callbacks.drop_closures_CompareDataFunc CompareDataFunc
    func))
        let userData :: Ptr a
    userData = Ptr a
    forall a. Ptr a
    nullPtr
        Ptr Queue -> Ptr () -> FunPtr C_CompareDataFunc -> DestroyNotify
    g_queue_insert_sorted Ptr Queue
    queue' Ptr ()
    data_ FunPtr C_CompareDataFunc
    func' Ptr ()
    forall a. Ptr a
    userData
        Ptr Any -> IO ()
    forall a. Ptr a -> IO ()
    safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
    forall a b. (a -> b) -> a -> b
    $ FunPtr C_CompareDataFunc -> Ptr Any
    forall a b. FunPtr a -> Ptr b
    castFunPtrToPtr FunPtr C_CompareDataFunc
    func'
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        () -> IO ()
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()

    #if defined(ENABLE_OVERLOADING)
    data QueueInsertSortedMethodInfo
    instance (signature ~ (Ptr () -> GLib.Callbacks.CompareDataFunc -> m ()), MonadIO m) => O.OverloadedMethod QueueInsertSortedMethodInfo Queue signature where
        overloadedMethod = queueInsertSorted

    instance O.OverloadedMethodInfo QueueInsertSortedMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queueInsertSorted",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queueInsertSorted"
            })

    #endif

    -- method Queue::is_empty
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GQueue." , 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 "g_queue_is_empty" g_queue_is_empty ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        IO CInt

    -- | Returns 'P.True' if the queue is empty.
    queueIsEmpty ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a t'GI.GLib.Structs.Queue.Queue'.
        -> m Bool
        -- ^ __Returns:__ 'P.True' if the queue is empty
    queueIsEmpty :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Queue -> m Bool
    queueIsEmpty Queue
    queue = 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
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        CInt
    result <- Ptr Queue -> IO CInt
    g_queue_is_empty Ptr Queue
    queue'
        let result' :: Bool
    result' = (CInt -> CInt -> Bool
    forall a. Eq a => a -> a -> Bool
    /= CInt
    0) CInt
    result
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        Bool -> IO Bool
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Bool
    result'

    #if defined(ENABLE_OVERLOADING)
    data QueueIsEmptyMethodInfo
    instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod QueueIsEmptyMethodInfo Queue signature where
        overloadedMethod = queueIsEmpty

    instance O.OverloadedMethodInfo QueueIsEmptyMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queueIsEmpty",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queueIsEmpty"
            })

    #endif

    -- method Queue::peek_head
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GQueue" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TPtr)
    -- throws : False
    -- Skip return : False

    foreign import ccall "g_queue_peek_head" g_queue_peek_head ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        IO (Ptr ())

    -- | Returns the first element of the queue.
    queuePeekHead ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a t'GI.GLib.Structs.Queue.Queue'
        -> m (Ptr ())
        -- ^ __Returns:__ the data of the first element in the queue, or 'P.Nothing'
        --     if the queue is empty
    queuePeekHead :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    Queue -> m (Ptr ())
    queuePeekHead Queue
    queue = IO (Ptr ()) -> m (Ptr ())
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
    forall a b. (a -> b) -> a -> b
    $ do
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        Ptr ()
    result <- Ptr Queue -> IO (Ptr ())
    g_queue_peek_head Ptr Queue
    queue'
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        Ptr () -> IO (Ptr ())
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Ptr ()
    result

    #if defined(ENABLE_OVERLOADING)
    data QueuePeekHeadMethodInfo
    instance (signature ~ (m (Ptr ())), MonadIO m) => O.OverloadedMethod QueuePeekHeadMethodInfo Queue signature where
        overloadedMethod = queuePeekHead

    instance O.OverloadedMethodInfo QueuePeekHeadMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queuePeekHead",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queuePeekHead"
            })

    #endif

    -- method Queue::peek_nth
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GQueue" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "n"
    --           , argType = TBasicType TUInt
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the position of the element"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TPtr)
    -- throws : False
    -- Skip return : False

    foreign import ccall "g_queue_peek_nth" g_queue_peek_nth ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        Word32 ->                               -- n : TBasicType TUInt
        IO (Ptr ())

    -- | Returns the /@n@/\'th element of /@queue@/.
    --
    -- /Since: 2.4/
    queuePeekNth ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a t'GI.GLib.Structs.Queue.Queue'
        -> Word32
        -- ^ /@n@/: the position of the element
        -> m (Ptr ())
        -- ^ __Returns:__ the data for the /@n@/\'th element of /@queue@/,
        --     or 'P.Nothing' if /@n@/ is off the end of /@queue@/
    queuePeekNth :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    Queue -> Word32 -> m (Ptr ())
    queuePeekNth Queue
    queue Word32
    n = IO (Ptr ()) -> m (Ptr ())
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
    forall a b. (a -> b) -> a -> b
    $ do
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        Ptr ()
    result <- Ptr Queue -> Word32 -> IO (Ptr ())
    g_queue_peek_nth Ptr Queue
    queue' Word32
    n
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        Ptr () -> IO (Ptr ())
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Ptr ()
    result

    #if defined(ENABLE_OVERLOADING)
    data QueuePeekNthMethodInfo
    instance (signature ~ (Word32 -> m (Ptr ())), MonadIO m) => O.OverloadedMethod QueuePeekNthMethodInfo Queue signature where
        overloadedMethod = queuePeekNth

    instance O.OverloadedMethodInfo QueuePeekNthMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queuePeekNth",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queuePeekNth"
            })

    #endif

    -- method Queue::peek_tail
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GQueue" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TPtr)
    -- throws : False
    -- Skip return : False

    foreign import ccall "g_queue_peek_tail" g_queue_peek_tail ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        IO (Ptr ())

    -- | Returns the last element of the queue.
    queuePeekTail ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a t'GI.GLib.Structs.Queue.Queue'
        -> m (Ptr ())
        -- ^ __Returns:__ the data of the last element in the queue, or 'P.Nothing'
        --     if the queue is empty
    queuePeekTail :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    Queue -> m (Ptr ())
    queuePeekTail Queue
    queue = IO (Ptr ()) -> m (Ptr ())
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
    forall a b. (a -> b) -> a -> b
    $ do
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        Ptr ()
    result <- Ptr Queue -> IO (Ptr ())
    g_queue_peek_tail Ptr Queue
    queue'
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        Ptr () -> IO (Ptr ())
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Ptr ()
    result

    #if defined(ENABLE_OVERLOADING)
    data QueuePeekTailMethodInfo
    instance (signature ~ (m (Ptr ())), MonadIO m) => O.OverloadedMethod QueuePeekTailMethodInfo Queue signature where
        overloadedMethod = queuePeekTail

    instance O.OverloadedMethodInfo QueuePeekTailMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queuePeekTail",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queuePeekTail"
            })

    #endif

    -- method Queue::pop_head
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GQueue" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TPtr)
    -- throws : False
    -- Skip return : False

    foreign import ccall "g_queue_pop_head" g_queue_pop_head ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        IO (Ptr ())

    -- | Removes the first element of the queue and returns its data.
    queuePopHead ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a t'GI.GLib.Structs.Queue.Queue'
        -> m (Ptr ())
        -- ^ __Returns:__ the data of the first element in the queue, or 'P.Nothing'
        --     if the queue is empty
    queuePopHead :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    Queue -> m (Ptr ())
    queuePopHead Queue
    queue = IO (Ptr ()) -> m (Ptr ())
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
    forall a b. (a -> b) -> a -> b
    $ do
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        Ptr ()
    result <- Ptr Queue -> IO (Ptr ())
    g_queue_pop_head Ptr Queue
    queue'
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        Ptr () -> IO (Ptr ())
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Ptr ()
    result

    #if defined(ENABLE_OVERLOADING)
    data QueuePopHeadMethodInfo
    instance (signature ~ (m (Ptr ())), MonadIO m) => O.OverloadedMethod QueuePopHeadMethodInfo Queue signature where
        overloadedMethod = queuePopHead

    instance O.OverloadedMethodInfo QueuePopHeadMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queuePopHead",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queuePopHead"
            })

    #endif

    -- method Queue::pop_nth
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GQueue" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "n"
    --           , argType = TBasicType TUInt
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the position of the element"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TPtr)
    -- throws : False
    -- Skip return : False

    foreign import ccall "g_queue_pop_nth" g_queue_pop_nth ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        Word32 ->                               -- n : TBasicType TUInt
        IO (Ptr ())

    -- | Removes the /@n@/\'th element of /@queue@/ and returns its data.
    --
    -- /Since: 2.4/
    queuePopNth ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a t'GI.GLib.Structs.Queue.Queue'
        -> Word32
        -- ^ /@n@/: the position of the element
        -> m (Ptr ())
        -- ^ __Returns:__ the element\'s data, or 'P.Nothing' if /@n@/ is off the end of /@queue@/
    queuePopNth :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    Queue -> Word32 -> m (Ptr ())
    queuePopNth Queue
    queue Word32
    n = IO (Ptr ()) -> m (Ptr ())
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
    forall a b. (a -> b) -> a -> b
    $ do
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        Ptr ()
    result <- Ptr Queue -> Word32 -> IO (Ptr ())
    g_queue_pop_nth Ptr Queue
    queue' Word32
    n
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        Ptr () -> IO (Ptr ())
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Ptr ()
    result

    #if defined(ENABLE_OVERLOADING)
    data QueuePopNthMethodInfo
    instance (signature ~ (Word32 -> m (Ptr ())), MonadIO m) => O.OverloadedMethod QueuePopNthMethodInfo Queue signature where
        overloadedMethod = queuePopNth

    instance O.OverloadedMethodInfo QueuePopNthMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queuePopNth",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queuePopNth"
            })

    #endif

    -- method Queue::pop_tail
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GQueue" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TPtr)
    -- throws : False
    -- Skip return : False

    foreign import ccall "g_queue_pop_tail" g_queue_pop_tail ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        IO (Ptr ())

    -- | Removes the last element of the queue and returns its data.
    queuePopTail ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a t'GI.GLib.Structs.Queue.Queue'
        -> m (Ptr ())
        -- ^ __Returns:__ the data of the last element in the queue, or 'P.Nothing'
        --     if the queue is empty
    queuePopTail :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    Queue -> m (Ptr ())
    queuePopTail Queue
    queue = IO (Ptr ()) -> m (Ptr ())
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
    forall a b. (a -> b) -> a -> b
    $ do
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        Ptr ()
    result <- Ptr Queue -> IO (Ptr ())
    g_queue_pop_tail Ptr Queue
    queue'
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        Ptr () -> IO (Ptr ())
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Ptr ()
    result

    #if defined(ENABLE_OVERLOADING)
    data QueuePopTailMethodInfo
    instance (signature ~ (m (Ptr ())), MonadIO m) => O.OverloadedMethod QueuePopTailMethodInfo Queue signature where
        overloadedMethod = queuePopTail

    instance O.OverloadedMethodInfo QueuePopTailMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queuePopTail",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queuePopTail"
            })

    #endif

    -- method Queue::push_head
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GQueue." , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "data"
    --           , argType = TBasicType TPtr
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the data for the new element."
    --                 , 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 "g_queue_push_head" g_queue_push_head ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        Ptr () ->                               -- data : TBasicType TPtr
        IO ()

    -- | Adds a new element at the head of the queue.
    queuePushHead ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a t'GI.GLib.Structs.Queue.Queue'.
        -> Ptr ()
        -- ^ /@data@/: the data for the new element.
        -> m ()
    queuePushHead :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    Queue -> Ptr () -> m ()
    queuePushHead Queue
    queue Ptr ()
    data_ = 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
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        Ptr Queue -> DestroyNotify
    g_queue_push_head Ptr Queue
    queue' Ptr ()
    data_
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        () -> IO ()
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()

    #if defined(ENABLE_OVERLOADING)
    data QueuePushHeadMethodInfo
    instance (signature ~ (Ptr () -> m ()), MonadIO m) => O.OverloadedMethod QueuePushHeadMethodInfo Queue signature where
        overloadedMethod = queuePushHead

    instance O.OverloadedMethodInfo QueuePushHeadMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queuePushHead",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queuePushHead"
            })

    #endif

    -- method Queue::push_nth
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GQueue" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "data"
    --           , argType = TBasicType TPtr
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the data for the new element"
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "n"
    --           , argType = TBasicType TInt
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText =
    --                     Just
    --                       "the position to insert the new element. If @n is negative or\n    larger than the number of elements in the @queue, the element is\n    added to the end of the queue."
    --                 , 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 "g_queue_push_nth" g_queue_push_nth ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        Ptr () ->                               -- data : TBasicType TPtr
        Int32 ->                                -- n : TBasicType TInt
        IO ()

    -- | Inserts a new element into /@queue@/ at the given position.
    --
    -- /Since: 2.4/
    queuePushNth ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a t'GI.GLib.Structs.Queue.Queue'
        -> Ptr ()
        -- ^ /@data@/: the data for the new element
        -> Int32
        -- ^ /@n@/: the position to insert the new element. If /@n@/ is negative or
        --     larger than the number of elements in the /@queue@/, the element is
        --     added to the end of the queue.
        -> m ()
    queuePushNth :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    Queue -> Ptr () -> Int32 -> m ()
    queuePushNth Queue
    queue Ptr ()
    data_ Int32
    n = 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
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        Ptr Queue -> Ptr () -> Int32 -> IO ()
    g_queue_push_nth Ptr Queue
    queue' Ptr ()
    data_ Int32
    n
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        () -> IO ()
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()

    #if defined(ENABLE_OVERLOADING)
    data QueuePushNthMethodInfo
    instance (signature ~ (Ptr () -> Int32 -> m ()), MonadIO m) => O.OverloadedMethod QueuePushNthMethodInfo Queue signature where
        overloadedMethod = queuePushNth

    instance O.OverloadedMethodInfo QueuePushNthMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queuePushNth",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queuePushNth"
            })

    #endif

    -- method Queue::push_tail
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GQueue" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "data"
    --           , argType = TBasicType TPtr
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the data for the new element"
    --                 , 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 "g_queue_push_tail" g_queue_push_tail ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        Ptr () ->                               -- data : TBasicType TPtr
        IO ()

    -- | Adds a new element at the tail of the queue.
    queuePushTail ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a t'GI.GLib.Structs.Queue.Queue'
        -> Ptr ()
        -- ^ /@data@/: the data for the new element
        -> m ()
    queuePushTail :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    Queue -> Ptr () -> m ()
    queuePushTail Queue
    queue Ptr ()
    data_ = 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
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        Ptr Queue -> DestroyNotify
    g_queue_push_tail Ptr Queue
    queue' Ptr ()
    data_
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        () -> IO ()
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()

    #if defined(ENABLE_OVERLOADING)
    data QueuePushTailMethodInfo
    instance (signature ~ (Ptr () -> m ()), MonadIO m) => O.OverloadedMethod QueuePushTailMethodInfo Queue signature where
        overloadedMethod = queuePushTail

    instance O.OverloadedMethodInfo QueuePushTailMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queuePushTail",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queuePushTail"
            })

    #endif

    -- method Queue::remove
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GQueue" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "data"
    --           , argType = TBasicType TPtr
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the data to remove" , 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 "g_queue_remove" g_queue_remove ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        Ptr () ->                               -- data : TBasicType TPtr
        IO CInt

    -- | Removes the first element in /@queue@/ that contains /@data@/.
    --
    -- /Since: 2.4/
    queueRemove ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a t'GI.GLib.Structs.Queue.Queue'
        -> Ptr ()
        -- ^ /@data@/: the data to remove
        -> m Bool
        -- ^ __Returns:__ 'P.True' if /@data@/ was found and removed from /@queue@/
    queueRemove :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    Queue -> Ptr () -> m Bool
    queueRemove Queue
    queue Ptr ()
    data_ = 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
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        CInt
    result <- Ptr Queue -> Ptr () -> IO CInt
    g_queue_remove Ptr Queue
    queue' Ptr ()
    data_
        let result' :: Bool
    result' = (CInt -> CInt -> Bool
    forall a. Eq a => a -> a -> Bool
    /= CInt
    0) CInt
    result
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        Bool -> IO Bool
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Bool
    result'

    #if defined(ENABLE_OVERLOADING)
    data QueueRemoveMethodInfo
    instance (signature ~ (Ptr () -> m Bool), MonadIO m) => O.OverloadedMethod QueueRemoveMethodInfo Queue signature where
        overloadedMethod = queueRemove

    instance O.OverloadedMethodInfo QueueRemoveMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queueRemove",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queueRemove"
            })

    #endif

    -- method Queue::remove_all
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GQueue" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "data"
    --           , argType = TBasicType TPtr
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "the data to remove" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Just (TBasicType TUInt)
    -- throws : False
    -- Skip return : False

    foreign import ccall "g_queue_remove_all" g_queue_remove_all ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        Ptr () ->                               -- data : TBasicType TPtr
        IO Word32

    -- | Remove all elements whose data equals /@data@/ from /@queue@/.
    --
    -- /Since: 2.4/
    queueRemoveAll ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a t'GI.GLib.Structs.Queue.Queue'
        -> Ptr ()
        -- ^ /@data@/: the data to remove
        -> m Word32
        -- ^ __Returns:__ the number of elements removed from /@queue@/
    queueRemoveAll :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    Queue -> Ptr () -> m Word32
    queueRemoveAll Queue
    queue Ptr ()
    data_ = IO Word32 -> m Word32
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
    forall a b. (a -> b) -> a -> b
    $ do
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        Word32
    result <- Ptr Queue -> Ptr () -> IO Word32
    g_queue_remove_all Ptr Queue
    queue' Ptr ()
    data_
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        Word32 -> IO Word32
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return Word32
    result

    #if defined(ENABLE_OVERLOADING)
    data QueueRemoveAllMethodInfo
    instance (signature ~ (Ptr () -> m Word32), MonadIO m) => O.OverloadedMethod QueueRemoveAllMethodInfo Queue signature where
        overloadedMethod = queueRemoveAll

    instance O.OverloadedMethodInfo QueueRemoveAllMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queueRemoveAll",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queueRemoveAll"
            })

    #endif

    -- method Queue::reverse
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GQueue" , 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 "g_queue_reverse" g_queue_reverse ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        IO ()

    -- | Reverses the order of the items in /@queue@/.
    --
    -- /Since: 2.4/
    queueReverse ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a t'GI.GLib.Structs.Queue.Queue'
        -> m ()
    queueReverse :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Queue -> m ()
    queueReverse Queue
    queue = 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
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        Ptr Queue -> IO ()
    g_queue_reverse Ptr Queue
    queue'
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        () -> IO ()
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()

    #if defined(ENABLE_OVERLOADING)
    data QueueReverseMethodInfo
    instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod QueueReverseMethodInfo Queue signature where
        overloadedMethod = queueReverse

    instance O.OverloadedMethodInfo QueueReverseMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queueReverse",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queueReverse"
            })

    #endif

    -- method Queue::sort
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "queue"
    --           , argType = TInterface Name { namespace = "GLib" , name = "Queue" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "a #GQueue" , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "compare_func"
    --           , argType =
    --               TInterface Name { namespace = "GLib" , name = "CompareDataFunc" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation
    --                 { rawDocText =
    --                     Just
    --                       "the #GCompareDataFunc used to sort @queue. This function\n    is passed two elements of the queue and should return 0 if they are\n    equal, a negative value if the first comes before the second, and\n    a positive value if the second comes before the first."
    --                 , sinceVersion = Nothing
    --                 }
    --           , argScope = ScopeTypeCall
    --           , argClosure = 2
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "user_data"
    --           , argType = TBasicType TPtr
    --           , direction = DirectionIn
    --           , mayBeNull = True
    --           , argDoc =
    --               Documentation
    --                 { rawDocText = Just "user data passed to @compare_func"
    --                 , 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 "g_queue_sort" g_queue_sort ::
        Ptr Queue ->                            -- queue : TInterface (Name {namespace = "GLib", name = "Queue"})
        FunPtr GLib.Callbacks.C_CompareDataFunc -> -- compare_func : TInterface (Name {namespace = "GLib", name = "CompareDataFunc"})
        Ptr () ->                               -- user_data : TBasicType TPtr
        IO ()

    -- | Sorts /@queue@/ using /@compareFunc@/.
    --
    -- /Since: 2.4/
    queueSort ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        Queue
        -- ^ /@queue@/: a t'GI.GLib.Structs.Queue.Queue'
        -> GLib.Callbacks.CompareDataFunc
        -- ^ /@compareFunc@/: the t'GI.GLib.Callbacks.CompareDataFunc' used to sort /@queue@/. This function
        --     is passed two elements of the queue and should return 0 if they are
        --     equal, a negative value if the first comes before the second, and
        --     a positive value if the second comes before the first.
        -> m ()
    queueSort :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    Queue -> CompareDataFunc -> m ()
    queueSort Queue
    queue CompareDataFunc
    compareFunc = 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
        Ptr Queue
    queue' <- Queue -> IO (Ptr Queue)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr Queue
    queue
        FunPtr C_CompareDataFunc
    compareFunc' <- C_CompareDataFunc -> IO (FunPtr C_CompareDataFunc)
    GLib.Callbacks.mk_CompareDataFunc (Maybe (Ptr (FunPtr C_CompareDataFunc))
    -> C_CompareDataFunc -> C_CompareDataFunc
    GLib.Callbacks.wrap_CompareDataFunc Maybe (Ptr (FunPtr C_CompareDataFunc))
    forall a. Maybe a
    Nothing (CompareDataFunc -> C_CompareDataFunc
    GLib.Callbacks.drop_closures_CompareDataFunc CompareDataFunc
    compareFunc))
        let userData :: Ptr a
    userData = Ptr a
    forall a. Ptr a
    nullPtr
        Ptr Queue -> FunPtr C_CompareDataFunc -> DestroyNotify
    g_queue_sort Ptr Queue
    queue' FunPtr C_CompareDataFunc
    compareFunc' Ptr ()
    forall a. Ptr a
    userData
        Ptr Any -> IO ()
    forall a. Ptr a -> IO ()
    safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
    forall a b. (a -> b) -> a -> b
    $ FunPtr C_CompareDataFunc -> Ptr Any
    forall a b. FunPtr a -> Ptr b
    castFunPtrToPtr FunPtr C_CompareDataFunc
    compareFunc'
        Queue -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr Queue
    queue
        () -> IO ()
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()

    #if defined(ENABLE_OVERLOADING)
    data QueueSortMethodInfo
    instance (signature ~ (GLib.Callbacks.CompareDataFunc -> m ()), MonadIO m) => O.OverloadedMethod QueueSortMethodInfo Queue signature where
        overloadedMethod = queueSort

    instance O.OverloadedMethodInfo QueueSortMethodInfo Queue where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.Queue.queueSort",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.30/docs/GI-GLib-Structs-Queue.html#v:queueSort"
            })

    #endif

    #if defined(ENABLE_OVERLOADING)
    type family ResolveQueueMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
        ResolveQueueMethod "clear" o = QueueClearMethodInfo
        ResolveQueueMethod "clearFull" o = QueueClearFullMethodInfo
        ResolveQueueMethod "foreach" o = QueueForeachMethodInfo
        ResolveQueueMethod "free" o = QueueFreeMethodInfo
        ResolveQueueMethod "freeFull" o = QueueFreeFullMethodInfo
        ResolveQueueMethod "index" o = QueueIndexMethodInfo
        ResolveQueueMethod "init" o = QueueInitMethodInfo
        ResolveQueueMethod "insertSorted" o = QueueInsertSortedMethodInfo
        ResolveQueueMethod "isEmpty" o = QueueIsEmptyMethodInfo
        ResolveQueueMethod "peekHead" o = QueuePeekHeadMethodInfo
        ResolveQueueMethod "peekNth" o = QueuePeekNthMethodInfo
        ResolveQueueMethod "peekTail" o = QueuePeekTailMethodInfo
        ResolveQueueMethod "popHead" o = QueuePopHeadMethodInfo
        ResolveQueueMethod "popNth" o = QueuePopNthMethodInfo
        ResolveQueueMethod "popTail" o = QueuePopTailMethodInfo
        ResolveQueueMethod "pushHead" o = QueuePushHeadMethodInfo
        ResolveQueueMethod "pushNth" o = QueuePushNthMethodInfo
        ResolveQueueMethod "pushTail" o = QueuePushTailMethodInfo
        ResolveQueueMethod "remove" o = QueueRemoveMethodInfo
        ResolveQueueMethod "removeAll" o = QueueRemoveAllMethodInfo
        ResolveQueueMethod "reverse" o = QueueReverseMethodInfo
        ResolveQueueMethod "sort" o = QueueSortMethodInfo
        ResolveQueueMethod "getLength" o = QueueGetLengthMethodInfo
        ResolveQueueMethod l o = O.MethodResolutionFailed l o

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

    #endif

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

    #endif