#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Wnck.Structs.ResourceUsage
(
ResourceUsage(..) ,
newZeroResourceUsage ,
noResourceUsage ,
getResourceUsageNColormapEntries ,
#if ENABLE_OVERLOADING
resourceUsage_nColormapEntries ,
#endif
setResourceUsageNColormapEntries ,
getResourceUsageNCursors ,
#if ENABLE_OVERLOADING
resourceUsage_nCursors ,
#endif
setResourceUsageNCursors ,
getResourceUsageNFonts ,
#if ENABLE_OVERLOADING
resourceUsage_nFonts ,
#endif
setResourceUsageNFonts ,
getResourceUsageNGcs ,
#if ENABLE_OVERLOADING
resourceUsage_nGcs ,
#endif
setResourceUsageNGcs ,
getResourceUsageNGlyphsets ,
#if ENABLE_OVERLOADING
resourceUsage_nGlyphsets ,
#endif
setResourceUsageNGlyphsets ,
getResourceUsageNOther ,
#if ENABLE_OVERLOADING
resourceUsage_nOther ,
#endif
setResourceUsageNOther ,
getResourceUsageNPassiveGrabs ,
#if ENABLE_OVERLOADING
resourceUsage_nPassiveGrabs ,
#endif
setResourceUsageNPassiveGrabs ,
getResourceUsageNPictures ,
#if ENABLE_OVERLOADING
resourceUsage_nPictures ,
#endif
setResourceUsageNPictures ,
getResourceUsageNPixmaps ,
#if ENABLE_OVERLOADING
resourceUsage_nPixmaps ,
#endif
setResourceUsageNPixmaps ,
getResourceUsageNWindows ,
#if ENABLE_OVERLOADING
resourceUsage_nWindows ,
#endif
setResourceUsageNWindows ,
getResourceUsagePixmapBytes ,
#if ENABLE_OVERLOADING
resourceUsage_pixmapBytes ,
#endif
setResourceUsagePixmapBytes ,
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
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
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
noResourceUsage :: Maybe ResourceUsage
noResourceUsage = Nothing
getResourceUsageTotalBytesEstimate :: MonadIO m => ResourceUsage -> m CULong
getResourceUsageTotalBytesEstimate s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO CULong
return val
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
getResourceUsagePixmapBytes :: MonadIO m => ResourceUsage -> m CULong
getResourceUsagePixmapBytes s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO CULong
return val
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
getResourceUsageNPixmaps :: MonadIO m => ResourceUsage -> m Word32
getResourceUsageNPixmaps s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO Word32
return val
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
getResourceUsageNWindows :: MonadIO m => ResourceUsage -> m Word32
getResourceUsageNWindows s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 20) :: IO Word32
return val
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
getResourceUsageNGcs :: MonadIO m => ResourceUsage -> m Word32
getResourceUsageNGcs s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 24) :: IO Word32
return val
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
getResourceUsageNPictures :: MonadIO m => ResourceUsage -> m Word32
getResourceUsageNPictures s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 28) :: IO Word32
return val
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
getResourceUsageNGlyphsets :: MonadIO m => ResourceUsage -> m Word32
getResourceUsageNGlyphsets s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 32) :: IO Word32
return val
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
getResourceUsageNFonts :: MonadIO m => ResourceUsage -> m Word32
getResourceUsageNFonts s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 36) :: IO Word32
return val
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
getResourceUsageNColormapEntries :: MonadIO m => ResourceUsage -> m Word32
getResourceUsageNColormapEntries s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 40) :: IO Word32
return val
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
getResourceUsageNPassiveGrabs :: MonadIO m => ResourceUsage -> m Word32
getResourceUsageNPassiveGrabs s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 44) :: IO Word32
return val
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
getResourceUsageNCursors :: MonadIO m => ResourceUsage -> m Word32
getResourceUsageNCursors s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 48) :: IO Word32
return val
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
getResourceUsageNOther :: MonadIO m => ResourceUsage -> m Word32
getResourceUsageNOther s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 52) :: IO Word32
return val
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