{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (inaki@blueleaf.cc)

The 'GI.Wnck.Structs.ResourceUsage.ResourceUsage' struct contains information about the total resource
usage of an X client, and the number of resources allocated for each
resource type.

/Since: 2.6/
-}

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

module GI.Wnck.Structs.ResourceUsage
    (

-- * Exported types
    ResourceUsage(..)                       ,
    newZeroResourceUsage                    ,
    noResourceUsage                         ,


 -- * Properties
-- ** nColormapEntries #attr:nColormapEntries#
{- | number of Colormap resources allocated.
-}
    getResourceUsageNColormapEntries        ,
#if ENABLE_OVERLOADING
    resourceUsage_nColormapEntries          ,
#endif
    setResourceUsageNColormapEntries        ,


-- ** nCursors #attr:nCursors#
{- | number of Cursor resources allocated.
-}
    getResourceUsageNCursors                ,
#if ENABLE_OVERLOADING
    resourceUsage_nCursors                  ,
#endif
    setResourceUsageNCursors                ,


-- ** nFonts #attr:nFonts#
{- | number of Font resources allocated.
-}
    getResourceUsageNFonts                  ,
#if ENABLE_OVERLOADING
    resourceUsage_nFonts                    ,
#endif
    setResourceUsageNFonts                  ,


-- ** nGcs #attr:nGcs#
{- | number of GContext resources allocated.
-}
    getResourceUsageNGcs                    ,
#if ENABLE_OVERLOADING
    resourceUsage_nGcs                      ,
#endif
    setResourceUsageNGcs                    ,


-- ** nGlyphsets #attr:nGlyphsets#
{- | number of Glyphset resources allocated.
-}
    getResourceUsageNGlyphsets              ,
#if ENABLE_OVERLOADING
    resourceUsage_nGlyphsets                ,
#endif
    setResourceUsageNGlyphsets              ,


-- ** nOther #attr:nOther#
{- | number of other resources allocated.
-}
    getResourceUsageNOther                  ,
#if ENABLE_OVERLOADING
    resourceUsage_nOther                    ,
#endif
    setResourceUsageNOther                  ,


-- ** nPassiveGrabs #attr:nPassiveGrabs#
{- | number of PassiveGrab resources allocated.
-}
    getResourceUsageNPassiveGrabs           ,
#if ENABLE_OVERLOADING
    resourceUsage_nPassiveGrabs             ,
#endif
    setResourceUsageNPassiveGrabs           ,


-- ** nPictures #attr:nPictures#
{- | number of Picture resources allocated.
-}
    getResourceUsageNPictures               ,
#if ENABLE_OVERLOADING
    resourceUsage_nPictures                 ,
#endif
    setResourceUsageNPictures               ,


-- ** nPixmaps #attr:nPixmaps#
{- | number of Pixmap resources allocated.
-}
    getResourceUsageNPixmaps                ,
#if ENABLE_OVERLOADING
    resourceUsage_nPixmaps                  ,
#endif
    setResourceUsageNPixmaps                ,


-- ** nWindows #attr:nWindows#
{- | number of Window resources allocated.
-}
    getResourceUsageNWindows                ,
#if ENABLE_OVERLOADING
    resourceUsage_nWindows                  ,
#endif
    setResourceUsageNWindows                ,


-- ** pixmapBytes #attr:pixmapBytes#
{- | number of bytes allocated in the X server for resources of
type Pixmap.
-}
    getResourceUsagePixmapBytes             ,
#if ENABLE_OVERLOADING
    resourceUsage_pixmapBytes               ,
#endif
    setResourceUsagePixmapBytes             ,


-- ** totalBytesEstimate #attr:totalBytesEstimate#
{- | estimation of the total number of bytes allocated in
the X server.
-}
    getResourceUsageTotalBytesEstimate      ,
#if ENABLE_OVERLOADING
    resourceUsage_totalBytesEstimate        ,
#endif
    setResourceUsageTotalBytesEstimate      ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL


-- | Memory-managed wrapper type.
newtype ResourceUsage = ResourceUsage (ManagedPtr ResourceUsage)
instance WrappedPtr ResourceUsage where
    wrappedPtrCalloc = callocBytes 112
    wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 112 >=> wrapPtr ResourceUsage)
    wrappedPtrFree = Just ptr_to_g_free

-- | Construct a `ResourceUsage` struct initialized to zero.
newZeroResourceUsage :: MonadIO m => m ResourceUsage
newZeroResourceUsage = liftIO $ wrappedPtrCalloc >>= wrapPtr ResourceUsage

instance tag ~ 'AttrSet => Constructible ResourceUsage tag where
    new _ attrs = do
        o <- newZeroResourceUsage
        GI.Attributes.set o attrs
        return o


-- | A convenience alias for `Nothing` :: `Maybe` `ResourceUsage`.
noResourceUsage :: Maybe ResourceUsage
noResourceUsage = Nothing

{- |
Get the value of the “@total_bytes_estimate@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' resourceUsage #totalBytesEstimate
@
-}
getResourceUsageTotalBytesEstimate :: MonadIO m => ResourceUsage -> m CULong
getResourceUsageTotalBytesEstimate s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 0) :: IO CULong
    return val

{- |
Set the value of the “@total_bytes_estimate@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' resourceUsage [ #totalBytesEstimate 'Data.GI.Base.Attributes.:=' value ]
@
-}
setResourceUsageTotalBytesEstimate :: MonadIO m => ResourceUsage -> CULong -> m ()
setResourceUsageTotalBytesEstimate s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 0) (val :: CULong)

#if ENABLE_OVERLOADING
data ResourceUsageTotalBytesEstimateFieldInfo
instance AttrInfo ResourceUsageTotalBytesEstimateFieldInfo where
    type AttrAllowedOps ResourceUsageTotalBytesEstimateFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint ResourceUsageTotalBytesEstimateFieldInfo = (~) CULong
    type AttrBaseTypeConstraint ResourceUsageTotalBytesEstimateFieldInfo = (~) ResourceUsage
    type AttrGetType ResourceUsageTotalBytesEstimateFieldInfo = CULong
    type AttrLabel ResourceUsageTotalBytesEstimateFieldInfo = "total_bytes_estimate"
    type AttrOrigin ResourceUsageTotalBytesEstimateFieldInfo = ResourceUsage
    attrGet _ = getResourceUsageTotalBytesEstimate
    attrSet _ = setResourceUsageTotalBytesEstimate
    attrConstruct = undefined
    attrClear _ = undefined

resourceUsage_totalBytesEstimate :: AttrLabelProxy "totalBytesEstimate"
resourceUsage_totalBytesEstimate = AttrLabelProxy

#endif


{- |
Get the value of the “@pixmap_bytes@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' resourceUsage #pixmapBytes
@
-}
getResourceUsagePixmapBytes :: MonadIO m => ResourceUsage -> m CULong
getResourceUsagePixmapBytes s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 8) :: IO CULong
    return val

{- |
Set the value of the “@pixmap_bytes@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' resourceUsage [ #pixmapBytes 'Data.GI.Base.Attributes.:=' value ]
@
-}
setResourceUsagePixmapBytes :: MonadIO m => ResourceUsage -> CULong -> m ()
setResourceUsagePixmapBytes s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 8) (val :: CULong)

#if ENABLE_OVERLOADING
data ResourceUsagePixmapBytesFieldInfo
instance AttrInfo ResourceUsagePixmapBytesFieldInfo where
    type AttrAllowedOps ResourceUsagePixmapBytesFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint ResourceUsagePixmapBytesFieldInfo = (~) CULong
    type AttrBaseTypeConstraint ResourceUsagePixmapBytesFieldInfo = (~) ResourceUsage
    type AttrGetType ResourceUsagePixmapBytesFieldInfo = CULong
    type AttrLabel ResourceUsagePixmapBytesFieldInfo = "pixmap_bytes"
    type AttrOrigin ResourceUsagePixmapBytesFieldInfo = ResourceUsage
    attrGet _ = getResourceUsagePixmapBytes
    attrSet _ = setResourceUsagePixmapBytes
    attrConstruct = undefined
    attrClear _ = undefined

resourceUsage_pixmapBytes :: AttrLabelProxy "pixmapBytes"
resourceUsage_pixmapBytes = AttrLabelProxy

#endif


{- |
Get the value of the “@n_pixmaps@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' resourceUsage #nPixmaps
@
-}
getResourceUsageNPixmaps :: MonadIO m => ResourceUsage -> m Word32
getResourceUsageNPixmaps s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 16) :: IO Word32
    return val

{- |
Set the value of the “@n_pixmaps@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' resourceUsage [ #nPixmaps 'Data.GI.Base.Attributes.:=' value ]
@
-}
setResourceUsageNPixmaps :: MonadIO m => ResourceUsage -> Word32 -> m ()
setResourceUsageNPixmaps s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 16) (val :: Word32)

#if ENABLE_OVERLOADING
data ResourceUsageNPixmapsFieldInfo
instance AttrInfo ResourceUsageNPixmapsFieldInfo where
    type AttrAllowedOps ResourceUsageNPixmapsFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint ResourceUsageNPixmapsFieldInfo = (~) Word32
    type AttrBaseTypeConstraint ResourceUsageNPixmapsFieldInfo = (~) ResourceUsage
    type AttrGetType ResourceUsageNPixmapsFieldInfo = Word32
    type AttrLabel ResourceUsageNPixmapsFieldInfo = "n_pixmaps"
    type AttrOrigin ResourceUsageNPixmapsFieldInfo = ResourceUsage
    attrGet _ = getResourceUsageNPixmaps
    attrSet _ = setResourceUsageNPixmaps
    attrConstruct = undefined
    attrClear _ = undefined

resourceUsage_nPixmaps :: AttrLabelProxy "nPixmaps"
resourceUsage_nPixmaps = AttrLabelProxy

#endif


{- |
Get the value of the “@n_windows@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' resourceUsage #nWindows
@
-}
getResourceUsageNWindows :: MonadIO m => ResourceUsage -> m Word32
getResourceUsageNWindows s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 20) :: IO Word32
    return val

{- |
Set the value of the “@n_windows@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' resourceUsage [ #nWindows 'Data.GI.Base.Attributes.:=' value ]
@
-}
setResourceUsageNWindows :: MonadIO m => ResourceUsage -> Word32 -> m ()
setResourceUsageNWindows s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 20) (val :: Word32)

#if ENABLE_OVERLOADING
data ResourceUsageNWindowsFieldInfo
instance AttrInfo ResourceUsageNWindowsFieldInfo where
    type AttrAllowedOps ResourceUsageNWindowsFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint ResourceUsageNWindowsFieldInfo = (~) Word32
    type AttrBaseTypeConstraint ResourceUsageNWindowsFieldInfo = (~) ResourceUsage
    type AttrGetType ResourceUsageNWindowsFieldInfo = Word32
    type AttrLabel ResourceUsageNWindowsFieldInfo = "n_windows"
    type AttrOrigin ResourceUsageNWindowsFieldInfo = ResourceUsage
    attrGet _ = getResourceUsageNWindows
    attrSet _ = setResourceUsageNWindows
    attrConstruct = undefined
    attrClear _ = undefined

resourceUsage_nWindows :: AttrLabelProxy "nWindows"
resourceUsage_nWindows = AttrLabelProxy

#endif


{- |
Get the value of the “@n_gcs@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' resourceUsage #nGcs
@
-}
getResourceUsageNGcs :: MonadIO m => ResourceUsage -> m Word32
getResourceUsageNGcs s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 24) :: IO Word32
    return val

{- |
Set the value of the “@n_gcs@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' resourceUsage [ #nGcs 'Data.GI.Base.Attributes.:=' value ]
@
-}
setResourceUsageNGcs :: MonadIO m => ResourceUsage -> Word32 -> m ()
setResourceUsageNGcs s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 24) (val :: Word32)

#if ENABLE_OVERLOADING
data ResourceUsageNGcsFieldInfo
instance AttrInfo ResourceUsageNGcsFieldInfo where
    type AttrAllowedOps ResourceUsageNGcsFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint ResourceUsageNGcsFieldInfo = (~) Word32
    type AttrBaseTypeConstraint ResourceUsageNGcsFieldInfo = (~) ResourceUsage
    type AttrGetType ResourceUsageNGcsFieldInfo = Word32
    type AttrLabel ResourceUsageNGcsFieldInfo = "n_gcs"
    type AttrOrigin ResourceUsageNGcsFieldInfo = ResourceUsage
    attrGet _ = getResourceUsageNGcs
    attrSet _ = setResourceUsageNGcs
    attrConstruct = undefined
    attrClear _ = undefined

resourceUsage_nGcs :: AttrLabelProxy "nGcs"
resourceUsage_nGcs = AttrLabelProxy

#endif


{- |
Get the value of the “@n_pictures@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' resourceUsage #nPictures
@
-}
getResourceUsageNPictures :: MonadIO m => ResourceUsage -> m Word32
getResourceUsageNPictures s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 28) :: IO Word32
    return val

{- |
Set the value of the “@n_pictures@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' resourceUsage [ #nPictures 'Data.GI.Base.Attributes.:=' value ]
@
-}
setResourceUsageNPictures :: MonadIO m => ResourceUsage -> Word32 -> m ()
setResourceUsageNPictures s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 28) (val :: Word32)

#if ENABLE_OVERLOADING
data ResourceUsageNPicturesFieldInfo
instance AttrInfo ResourceUsageNPicturesFieldInfo where
    type AttrAllowedOps ResourceUsageNPicturesFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint ResourceUsageNPicturesFieldInfo = (~) Word32
    type AttrBaseTypeConstraint ResourceUsageNPicturesFieldInfo = (~) ResourceUsage
    type AttrGetType ResourceUsageNPicturesFieldInfo = Word32
    type AttrLabel ResourceUsageNPicturesFieldInfo = "n_pictures"
    type AttrOrigin ResourceUsageNPicturesFieldInfo = ResourceUsage
    attrGet _ = getResourceUsageNPictures
    attrSet _ = setResourceUsageNPictures
    attrConstruct = undefined
    attrClear _ = undefined

resourceUsage_nPictures :: AttrLabelProxy "nPictures"
resourceUsage_nPictures = AttrLabelProxy

#endif


{- |
Get the value of the “@n_glyphsets@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' resourceUsage #nGlyphsets
@
-}
getResourceUsageNGlyphsets :: MonadIO m => ResourceUsage -> m Word32
getResourceUsageNGlyphsets s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 32) :: IO Word32
    return val

{- |
Set the value of the “@n_glyphsets@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' resourceUsage [ #nGlyphsets 'Data.GI.Base.Attributes.:=' value ]
@
-}
setResourceUsageNGlyphsets :: MonadIO m => ResourceUsage -> Word32 -> m ()
setResourceUsageNGlyphsets s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 32) (val :: Word32)

#if ENABLE_OVERLOADING
data ResourceUsageNGlyphsetsFieldInfo
instance AttrInfo ResourceUsageNGlyphsetsFieldInfo where
    type AttrAllowedOps ResourceUsageNGlyphsetsFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint ResourceUsageNGlyphsetsFieldInfo = (~) Word32
    type AttrBaseTypeConstraint ResourceUsageNGlyphsetsFieldInfo = (~) ResourceUsage
    type AttrGetType ResourceUsageNGlyphsetsFieldInfo = Word32
    type AttrLabel ResourceUsageNGlyphsetsFieldInfo = "n_glyphsets"
    type AttrOrigin ResourceUsageNGlyphsetsFieldInfo = ResourceUsage
    attrGet _ = getResourceUsageNGlyphsets
    attrSet _ = setResourceUsageNGlyphsets
    attrConstruct = undefined
    attrClear _ = undefined

resourceUsage_nGlyphsets :: AttrLabelProxy "nGlyphsets"
resourceUsage_nGlyphsets = AttrLabelProxy

#endif


{- |
Get the value of the “@n_fonts@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' resourceUsage #nFonts
@
-}
getResourceUsageNFonts :: MonadIO m => ResourceUsage -> m Word32
getResourceUsageNFonts s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 36) :: IO Word32
    return val

{- |
Set the value of the “@n_fonts@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' resourceUsage [ #nFonts 'Data.GI.Base.Attributes.:=' value ]
@
-}
setResourceUsageNFonts :: MonadIO m => ResourceUsage -> Word32 -> m ()
setResourceUsageNFonts s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 36) (val :: Word32)

#if ENABLE_OVERLOADING
data ResourceUsageNFontsFieldInfo
instance AttrInfo ResourceUsageNFontsFieldInfo where
    type AttrAllowedOps ResourceUsageNFontsFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint ResourceUsageNFontsFieldInfo = (~) Word32
    type AttrBaseTypeConstraint ResourceUsageNFontsFieldInfo = (~) ResourceUsage
    type AttrGetType ResourceUsageNFontsFieldInfo = Word32
    type AttrLabel ResourceUsageNFontsFieldInfo = "n_fonts"
    type AttrOrigin ResourceUsageNFontsFieldInfo = ResourceUsage
    attrGet _ = getResourceUsageNFonts
    attrSet _ = setResourceUsageNFonts
    attrConstruct = undefined
    attrClear _ = undefined

resourceUsage_nFonts :: AttrLabelProxy "nFonts"
resourceUsage_nFonts = AttrLabelProxy

#endif


{- |
Get the value of the “@n_colormap_entries@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' resourceUsage #nColormapEntries
@
-}
getResourceUsageNColormapEntries :: MonadIO m => ResourceUsage -> m Word32
getResourceUsageNColormapEntries s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 40) :: IO Word32
    return val

{- |
Set the value of the “@n_colormap_entries@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' resourceUsage [ #nColormapEntries 'Data.GI.Base.Attributes.:=' value ]
@
-}
setResourceUsageNColormapEntries :: MonadIO m => ResourceUsage -> Word32 -> m ()
setResourceUsageNColormapEntries s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 40) (val :: Word32)

#if ENABLE_OVERLOADING
data ResourceUsageNColormapEntriesFieldInfo
instance AttrInfo ResourceUsageNColormapEntriesFieldInfo where
    type AttrAllowedOps ResourceUsageNColormapEntriesFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint ResourceUsageNColormapEntriesFieldInfo = (~) Word32
    type AttrBaseTypeConstraint ResourceUsageNColormapEntriesFieldInfo = (~) ResourceUsage
    type AttrGetType ResourceUsageNColormapEntriesFieldInfo = Word32
    type AttrLabel ResourceUsageNColormapEntriesFieldInfo = "n_colormap_entries"
    type AttrOrigin ResourceUsageNColormapEntriesFieldInfo = ResourceUsage
    attrGet _ = getResourceUsageNColormapEntries
    attrSet _ = setResourceUsageNColormapEntries
    attrConstruct = undefined
    attrClear _ = undefined

resourceUsage_nColormapEntries :: AttrLabelProxy "nColormapEntries"
resourceUsage_nColormapEntries = AttrLabelProxy

#endif


{- |
Get the value of the “@n_passive_grabs@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' resourceUsage #nPassiveGrabs
@
-}
getResourceUsageNPassiveGrabs :: MonadIO m => ResourceUsage -> m Word32
getResourceUsageNPassiveGrabs s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 44) :: IO Word32
    return val

{- |
Set the value of the “@n_passive_grabs@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' resourceUsage [ #nPassiveGrabs 'Data.GI.Base.Attributes.:=' value ]
@
-}
setResourceUsageNPassiveGrabs :: MonadIO m => ResourceUsage -> Word32 -> m ()
setResourceUsageNPassiveGrabs s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 44) (val :: Word32)

#if ENABLE_OVERLOADING
data ResourceUsageNPassiveGrabsFieldInfo
instance AttrInfo ResourceUsageNPassiveGrabsFieldInfo where
    type AttrAllowedOps ResourceUsageNPassiveGrabsFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint ResourceUsageNPassiveGrabsFieldInfo = (~) Word32
    type AttrBaseTypeConstraint ResourceUsageNPassiveGrabsFieldInfo = (~) ResourceUsage
    type AttrGetType ResourceUsageNPassiveGrabsFieldInfo = Word32
    type AttrLabel ResourceUsageNPassiveGrabsFieldInfo = "n_passive_grabs"
    type AttrOrigin ResourceUsageNPassiveGrabsFieldInfo = ResourceUsage
    attrGet _ = getResourceUsageNPassiveGrabs
    attrSet _ = setResourceUsageNPassiveGrabs
    attrConstruct = undefined
    attrClear _ = undefined

resourceUsage_nPassiveGrabs :: AttrLabelProxy "nPassiveGrabs"
resourceUsage_nPassiveGrabs = AttrLabelProxy

#endif


{- |
Get the value of the “@n_cursors@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' resourceUsage #nCursors
@
-}
getResourceUsageNCursors :: MonadIO m => ResourceUsage -> m Word32
getResourceUsageNCursors s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 48) :: IO Word32
    return val

{- |
Set the value of the “@n_cursors@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' resourceUsage [ #nCursors 'Data.GI.Base.Attributes.:=' value ]
@
-}
setResourceUsageNCursors :: MonadIO m => ResourceUsage -> Word32 -> m ()
setResourceUsageNCursors s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 48) (val :: Word32)

#if ENABLE_OVERLOADING
data ResourceUsageNCursorsFieldInfo
instance AttrInfo ResourceUsageNCursorsFieldInfo where
    type AttrAllowedOps ResourceUsageNCursorsFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint ResourceUsageNCursorsFieldInfo = (~) Word32
    type AttrBaseTypeConstraint ResourceUsageNCursorsFieldInfo = (~) ResourceUsage
    type AttrGetType ResourceUsageNCursorsFieldInfo = Word32
    type AttrLabel ResourceUsageNCursorsFieldInfo = "n_cursors"
    type AttrOrigin ResourceUsageNCursorsFieldInfo = ResourceUsage
    attrGet _ = getResourceUsageNCursors
    attrSet _ = setResourceUsageNCursors
    attrConstruct = undefined
    attrClear _ = undefined

resourceUsage_nCursors :: AttrLabelProxy "nCursors"
resourceUsage_nCursors = AttrLabelProxy

#endif


{- |
Get the value of the “@n_other@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' resourceUsage #nOther
@
-}
getResourceUsageNOther :: MonadIO m => ResourceUsage -> m Word32
getResourceUsageNOther s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 52) :: IO Word32
    return val

{- |
Set the value of the “@n_other@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' resourceUsage [ #nOther 'Data.GI.Base.Attributes.:=' value ]
@
-}
setResourceUsageNOther :: MonadIO m => ResourceUsage -> Word32 -> m ()
setResourceUsageNOther s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 52) (val :: Word32)

#if ENABLE_OVERLOADING
data ResourceUsageNOtherFieldInfo
instance AttrInfo ResourceUsageNOtherFieldInfo where
    type AttrAllowedOps ResourceUsageNOtherFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint ResourceUsageNOtherFieldInfo = (~) Word32
    type AttrBaseTypeConstraint ResourceUsageNOtherFieldInfo = (~) ResourceUsage
    type AttrGetType ResourceUsageNOtherFieldInfo = Word32
    type AttrLabel ResourceUsageNOtherFieldInfo = "n_other"
    type AttrOrigin ResourceUsageNOtherFieldInfo = ResourceUsage
    attrGet _ = getResourceUsageNOther
    attrSet _ = setResourceUsageNOther
    attrConstruct = undefined
    attrClear _ = undefined

resourceUsage_nOther :: AttrLabelProxy "nOther"
resourceUsage_nOther = AttrLabelProxy

#endif



#if ENABLE_OVERLOADING
instance O.HasAttributeList ResourceUsage
type instance O.AttributeList ResourceUsage = ResourceUsageAttributeList
type ResourceUsageAttributeList = ('[ '("totalBytesEstimate", ResourceUsageTotalBytesEstimateFieldInfo), '("pixmapBytes", ResourceUsagePixmapBytesFieldInfo), '("nPixmaps", ResourceUsageNPixmapsFieldInfo), '("nWindows", ResourceUsageNWindowsFieldInfo), '("nGcs", ResourceUsageNGcsFieldInfo), '("nPictures", ResourceUsageNPicturesFieldInfo), '("nGlyphsets", ResourceUsageNGlyphsetsFieldInfo), '("nFonts", ResourceUsageNFontsFieldInfo), '("nColormapEntries", ResourceUsageNColormapEntriesFieldInfo), '("nPassiveGrabs", ResourceUsageNPassiveGrabsFieldInfo), '("nCursors", ResourceUsageNCursorsFieldInfo), '("nOther", ResourceUsageNOtherFieldInfo)] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
type family ResolveResourceUsageMethod (t :: Symbol) (o :: *) :: * where
    ResolveResourceUsageMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveResourceUsageMethod t ResourceUsage, O.MethodInfo info ResourceUsage p) => OL.IsLabel t (ResourceUsage -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

#endif