{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
-}

module GI.Gtk.Structs.TableChild
    ( 

-- * Exported types
    TableChild(..)                          ,
    newZeroTableChild                       ,
    noTableChild                            ,


 -- * Properties
-- ** bottomAttach #attr:bottomAttach#
    getTableChildBottomAttach               ,
    setTableChildBottomAttach               ,
    tableChild_bottomAttach                 ,


-- ** leftAttach #attr:leftAttach#
    getTableChildLeftAttach                 ,
    setTableChildLeftAttach                 ,
    tableChild_leftAttach                   ,


-- ** rightAttach #attr:rightAttach#
    getTableChildRightAttach                ,
    setTableChildRightAttach                ,
    tableChild_rightAttach                  ,


-- ** topAttach #attr:topAttach#
    getTableChildTopAttach                  ,
    setTableChildTopAttach                  ,
    tableChild_topAttach                    ,


-- ** widget #attr:widget#
    clearTableChildWidget                   ,
    getTableChildWidget                     ,
    setTableChildWidget                     ,
    tableChild_widget                       ,


-- ** xexpand #attr:xexpand#
    getTableChildXexpand                    ,
    setTableChildXexpand                    ,
    tableChild_xexpand                      ,


-- ** xfill #attr:xfill#
    getTableChildXfill                      ,
    setTableChildXfill                      ,
    tableChild_xfill                        ,


-- ** xpadding #attr:xpadding#
    getTableChildXpadding                   ,
    setTableChildXpadding                   ,
    tableChild_xpadding                     ,


-- ** xshrink #attr:xshrink#
    getTableChildXshrink                    ,
    setTableChildXshrink                    ,
    tableChild_xshrink                      ,


-- ** yexpand #attr:yexpand#
    getTableChildYexpand                    ,
    setTableChildYexpand                    ,
    tableChild_yexpand                      ,


-- ** yfill #attr:yfill#
    getTableChildYfill                      ,
    setTableChildYfill                      ,
    tableChild_yfill                        ,


-- ** ypadding #attr:ypadding#
    getTableChildYpadding                   ,
    setTableChildYpadding                   ,
    tableChild_ypadding                     ,


-- ** yshrink #attr:yshrink#
    getTableChildYshrink                    ,
    setTableChildYshrink                    ,
    tableChild_yshrink                      ,




    ) 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.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 {-# SOURCE #-} qualified GI.Gtk.Objects.Widget as Gtk.Widget

newtype TableChild = TableChild (ManagedPtr TableChild)
instance WrappedPtr TableChild where
    wrappedPtrCalloc = callocBytes 48
    wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 48 >=> wrapPtr TableChild)
    wrappedPtrFree = Just ptr_to_g_free

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

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


noTableChild :: Maybe TableChild
noTableChild = Nothing

getTableChildWidget :: MonadIO m => TableChild -> m (Maybe Gtk.Widget.Widget)
getTableChildWidget s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 0) :: IO (Ptr Gtk.Widget.Widget)
    result <- SP.convertIfNonNull val $ \val' -> do
        val'' <- (newObject Gtk.Widget.Widget) val'
        return val''
    return result

setTableChildWidget :: MonadIO m => TableChild -> Ptr Gtk.Widget.Widget -> m ()
setTableChildWidget s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 0) (val :: Ptr Gtk.Widget.Widget)

clearTableChildWidget :: MonadIO m => TableChild -> m ()
clearTableChildWidget s = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 0) (FP.nullPtr :: Ptr Gtk.Widget.Widget)

data TableChildWidgetFieldInfo
instance AttrInfo TableChildWidgetFieldInfo where
    type AttrAllowedOps TableChildWidgetFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint TableChildWidgetFieldInfo = (~) (Ptr Gtk.Widget.Widget)
    type AttrBaseTypeConstraint TableChildWidgetFieldInfo = (~) TableChild
    type AttrGetType TableChildWidgetFieldInfo = Maybe Gtk.Widget.Widget
    type AttrLabel TableChildWidgetFieldInfo = "widget"
    type AttrOrigin TableChildWidgetFieldInfo = TableChild
    attrGet _ = getTableChildWidget
    attrSet _ = setTableChildWidget
    attrConstruct = undefined
    attrClear _ = clearTableChildWidget

tableChild_widget :: AttrLabelProxy "widget"
tableChild_widget = AttrLabelProxy


getTableChildLeftAttach :: MonadIO m => TableChild -> m Word16
getTableChildLeftAttach s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 8) :: IO Word16
    return val

setTableChildLeftAttach :: MonadIO m => TableChild -> Word16 -> m ()
setTableChildLeftAttach s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 8) (val :: Word16)

data TableChildLeftAttachFieldInfo
instance AttrInfo TableChildLeftAttachFieldInfo where
    type AttrAllowedOps TableChildLeftAttachFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint TableChildLeftAttachFieldInfo = (~) Word16
    type AttrBaseTypeConstraint TableChildLeftAttachFieldInfo = (~) TableChild
    type AttrGetType TableChildLeftAttachFieldInfo = Word16
    type AttrLabel TableChildLeftAttachFieldInfo = "left_attach"
    type AttrOrigin TableChildLeftAttachFieldInfo = TableChild
    attrGet _ = getTableChildLeftAttach
    attrSet _ = setTableChildLeftAttach
    attrConstruct = undefined
    attrClear _ = undefined

tableChild_leftAttach :: AttrLabelProxy "leftAttach"
tableChild_leftAttach = AttrLabelProxy


getTableChildRightAttach :: MonadIO m => TableChild -> m Word16
getTableChildRightAttach s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 10) :: IO Word16
    return val

setTableChildRightAttach :: MonadIO m => TableChild -> Word16 -> m ()
setTableChildRightAttach s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 10) (val :: Word16)

data TableChildRightAttachFieldInfo
instance AttrInfo TableChildRightAttachFieldInfo where
    type AttrAllowedOps TableChildRightAttachFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint TableChildRightAttachFieldInfo = (~) Word16
    type AttrBaseTypeConstraint TableChildRightAttachFieldInfo = (~) TableChild
    type AttrGetType TableChildRightAttachFieldInfo = Word16
    type AttrLabel TableChildRightAttachFieldInfo = "right_attach"
    type AttrOrigin TableChildRightAttachFieldInfo = TableChild
    attrGet _ = getTableChildRightAttach
    attrSet _ = setTableChildRightAttach
    attrConstruct = undefined
    attrClear _ = undefined

tableChild_rightAttach :: AttrLabelProxy "rightAttach"
tableChild_rightAttach = AttrLabelProxy


getTableChildTopAttach :: MonadIO m => TableChild -> m Word16
getTableChildTopAttach s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 12) :: IO Word16
    return val

setTableChildTopAttach :: MonadIO m => TableChild -> Word16 -> m ()
setTableChildTopAttach s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 12) (val :: Word16)

data TableChildTopAttachFieldInfo
instance AttrInfo TableChildTopAttachFieldInfo where
    type AttrAllowedOps TableChildTopAttachFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint TableChildTopAttachFieldInfo = (~) Word16
    type AttrBaseTypeConstraint TableChildTopAttachFieldInfo = (~) TableChild
    type AttrGetType TableChildTopAttachFieldInfo = Word16
    type AttrLabel TableChildTopAttachFieldInfo = "top_attach"
    type AttrOrigin TableChildTopAttachFieldInfo = TableChild
    attrGet _ = getTableChildTopAttach
    attrSet _ = setTableChildTopAttach
    attrConstruct = undefined
    attrClear _ = undefined

tableChild_topAttach :: AttrLabelProxy "topAttach"
tableChild_topAttach = AttrLabelProxy


getTableChildBottomAttach :: MonadIO m => TableChild -> m Word16
getTableChildBottomAttach s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 14) :: IO Word16
    return val

setTableChildBottomAttach :: MonadIO m => TableChild -> Word16 -> m ()
setTableChildBottomAttach s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 14) (val :: Word16)

data TableChildBottomAttachFieldInfo
instance AttrInfo TableChildBottomAttachFieldInfo where
    type AttrAllowedOps TableChildBottomAttachFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint TableChildBottomAttachFieldInfo = (~) Word16
    type AttrBaseTypeConstraint TableChildBottomAttachFieldInfo = (~) TableChild
    type AttrGetType TableChildBottomAttachFieldInfo = Word16
    type AttrLabel TableChildBottomAttachFieldInfo = "bottom_attach"
    type AttrOrigin TableChildBottomAttachFieldInfo = TableChild
    attrGet _ = getTableChildBottomAttach
    attrSet _ = setTableChildBottomAttach
    attrConstruct = undefined
    attrClear _ = undefined

tableChild_bottomAttach :: AttrLabelProxy "bottomAttach"
tableChild_bottomAttach = AttrLabelProxy


getTableChildXpadding :: MonadIO m => TableChild -> m Word16
getTableChildXpadding s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 16) :: IO Word16
    return val

setTableChildXpadding :: MonadIO m => TableChild -> Word16 -> m ()
setTableChildXpadding s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 16) (val :: Word16)

data TableChildXpaddingFieldInfo
instance AttrInfo TableChildXpaddingFieldInfo where
    type AttrAllowedOps TableChildXpaddingFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint TableChildXpaddingFieldInfo = (~) Word16
    type AttrBaseTypeConstraint TableChildXpaddingFieldInfo = (~) TableChild
    type AttrGetType TableChildXpaddingFieldInfo = Word16
    type AttrLabel TableChildXpaddingFieldInfo = "xpadding"
    type AttrOrigin TableChildXpaddingFieldInfo = TableChild
    attrGet _ = getTableChildXpadding
    attrSet _ = setTableChildXpadding
    attrConstruct = undefined
    attrClear _ = undefined

tableChild_xpadding :: AttrLabelProxy "xpadding"
tableChild_xpadding = AttrLabelProxy


getTableChildYpadding :: MonadIO m => TableChild -> m Word16
getTableChildYpadding s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 18) :: IO Word16
    return val

setTableChildYpadding :: MonadIO m => TableChild -> Word16 -> m ()
setTableChildYpadding s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 18) (val :: Word16)

data TableChildYpaddingFieldInfo
instance AttrInfo TableChildYpaddingFieldInfo where
    type AttrAllowedOps TableChildYpaddingFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint TableChildYpaddingFieldInfo = (~) Word16
    type AttrBaseTypeConstraint TableChildYpaddingFieldInfo = (~) TableChild
    type AttrGetType TableChildYpaddingFieldInfo = Word16
    type AttrLabel TableChildYpaddingFieldInfo = "ypadding"
    type AttrOrigin TableChildYpaddingFieldInfo = TableChild
    attrGet _ = getTableChildYpadding
    attrSet _ = setTableChildYpadding
    attrConstruct = undefined
    attrClear _ = undefined

tableChild_ypadding :: AttrLabelProxy "ypadding"
tableChild_ypadding = AttrLabelProxy


getTableChildXexpand :: MonadIO m => TableChild -> m Word32
getTableChildXexpand s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 20) :: IO Word32
    return val

setTableChildXexpand :: MonadIO m => TableChild -> Word32 -> m ()
setTableChildXexpand s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 20) (val :: Word32)

data TableChildXexpandFieldInfo
instance AttrInfo TableChildXexpandFieldInfo where
    type AttrAllowedOps TableChildXexpandFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint TableChildXexpandFieldInfo = (~) Word32
    type AttrBaseTypeConstraint TableChildXexpandFieldInfo = (~) TableChild
    type AttrGetType TableChildXexpandFieldInfo = Word32
    type AttrLabel TableChildXexpandFieldInfo = "xexpand"
    type AttrOrigin TableChildXexpandFieldInfo = TableChild
    attrGet _ = getTableChildXexpand
    attrSet _ = setTableChildXexpand
    attrConstruct = undefined
    attrClear _ = undefined

tableChild_xexpand :: AttrLabelProxy "xexpand"
tableChild_xexpand = AttrLabelProxy


getTableChildYexpand :: MonadIO m => TableChild -> m Word32
getTableChildYexpand s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 24) :: IO Word32
    return val

setTableChildYexpand :: MonadIO m => TableChild -> Word32 -> m ()
setTableChildYexpand s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 24) (val :: Word32)

data TableChildYexpandFieldInfo
instance AttrInfo TableChildYexpandFieldInfo where
    type AttrAllowedOps TableChildYexpandFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint TableChildYexpandFieldInfo = (~) Word32
    type AttrBaseTypeConstraint TableChildYexpandFieldInfo = (~) TableChild
    type AttrGetType TableChildYexpandFieldInfo = Word32
    type AttrLabel TableChildYexpandFieldInfo = "yexpand"
    type AttrOrigin TableChildYexpandFieldInfo = TableChild
    attrGet _ = getTableChildYexpand
    attrSet _ = setTableChildYexpand
    attrConstruct = undefined
    attrClear _ = undefined

tableChild_yexpand :: AttrLabelProxy "yexpand"
tableChild_yexpand = AttrLabelProxy


getTableChildXshrink :: MonadIO m => TableChild -> m Word32
getTableChildXshrink s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 28) :: IO Word32
    return val

setTableChildXshrink :: MonadIO m => TableChild -> Word32 -> m ()
setTableChildXshrink s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 28) (val :: Word32)

data TableChildXshrinkFieldInfo
instance AttrInfo TableChildXshrinkFieldInfo where
    type AttrAllowedOps TableChildXshrinkFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint TableChildXshrinkFieldInfo = (~) Word32
    type AttrBaseTypeConstraint TableChildXshrinkFieldInfo = (~) TableChild
    type AttrGetType TableChildXshrinkFieldInfo = Word32
    type AttrLabel TableChildXshrinkFieldInfo = "xshrink"
    type AttrOrigin TableChildXshrinkFieldInfo = TableChild
    attrGet _ = getTableChildXshrink
    attrSet _ = setTableChildXshrink
    attrConstruct = undefined
    attrClear _ = undefined

tableChild_xshrink :: AttrLabelProxy "xshrink"
tableChild_xshrink = AttrLabelProxy


getTableChildYshrink :: MonadIO m => TableChild -> m Word32
getTableChildYshrink s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 32) :: IO Word32
    return val

setTableChildYshrink :: MonadIO m => TableChild -> Word32 -> m ()
setTableChildYshrink s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 32) (val :: Word32)

data TableChildYshrinkFieldInfo
instance AttrInfo TableChildYshrinkFieldInfo where
    type AttrAllowedOps TableChildYshrinkFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint TableChildYshrinkFieldInfo = (~) Word32
    type AttrBaseTypeConstraint TableChildYshrinkFieldInfo = (~) TableChild
    type AttrGetType TableChildYshrinkFieldInfo = Word32
    type AttrLabel TableChildYshrinkFieldInfo = "yshrink"
    type AttrOrigin TableChildYshrinkFieldInfo = TableChild
    attrGet _ = getTableChildYshrink
    attrSet _ = setTableChildYshrink
    attrConstruct = undefined
    attrClear _ = undefined

tableChild_yshrink :: AttrLabelProxy "yshrink"
tableChild_yshrink = AttrLabelProxy


getTableChildXfill :: MonadIO m => TableChild -> m Word32
getTableChildXfill s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 36) :: IO Word32
    return val

setTableChildXfill :: MonadIO m => TableChild -> Word32 -> m ()
setTableChildXfill s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 36) (val :: Word32)

data TableChildXfillFieldInfo
instance AttrInfo TableChildXfillFieldInfo where
    type AttrAllowedOps TableChildXfillFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint TableChildXfillFieldInfo = (~) Word32
    type AttrBaseTypeConstraint TableChildXfillFieldInfo = (~) TableChild
    type AttrGetType TableChildXfillFieldInfo = Word32
    type AttrLabel TableChildXfillFieldInfo = "xfill"
    type AttrOrigin TableChildXfillFieldInfo = TableChild
    attrGet _ = getTableChildXfill
    attrSet _ = setTableChildXfill
    attrConstruct = undefined
    attrClear _ = undefined

tableChild_xfill :: AttrLabelProxy "xfill"
tableChild_xfill = AttrLabelProxy


getTableChildYfill :: MonadIO m => TableChild -> m Word32
getTableChildYfill s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 40) :: IO Word32
    return val

setTableChildYfill :: MonadIO m => TableChild -> Word32 -> m ()
setTableChildYfill s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 40) (val :: Word32)

data TableChildYfillFieldInfo
instance AttrInfo TableChildYfillFieldInfo where
    type AttrAllowedOps TableChildYfillFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint TableChildYfillFieldInfo = (~) Word32
    type AttrBaseTypeConstraint TableChildYfillFieldInfo = (~) TableChild
    type AttrGetType TableChildYfillFieldInfo = Word32
    type AttrLabel TableChildYfillFieldInfo = "yfill"
    type AttrOrigin TableChildYfillFieldInfo = TableChild
    attrGet _ = getTableChildYfill
    attrSet _ = setTableChildYfill
    attrConstruct = undefined
    attrClear _ = undefined

tableChild_yfill :: AttrLabelProxy "yfill"
tableChild_yfill = AttrLabelProxy



instance O.HasAttributeList TableChild
type instance O.AttributeList TableChild = TableChildAttributeList
type TableChildAttributeList = ('[ '("widget", TableChildWidgetFieldInfo), '("leftAttach", TableChildLeftAttachFieldInfo), '("rightAttach", TableChildRightAttachFieldInfo), '("topAttach", TableChildTopAttachFieldInfo), '("bottomAttach", TableChildBottomAttachFieldInfo), '("xpadding", TableChildXpaddingFieldInfo), '("ypadding", TableChildYpaddingFieldInfo), '("xexpand", TableChildXexpandFieldInfo), '("yexpand", TableChildYexpandFieldInfo), '("xshrink", TableChildXshrinkFieldInfo), '("yshrink", TableChildYshrinkFieldInfo), '("xfill", TableChildXfillFieldInfo), '("yfill", TableChildYfillFieldInfo)] :: [(Symbol, *)])

type family ResolveTableChildMethod (t :: Symbol) (o :: *) :: * where
    ResolveTableChildMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveTableChildMethod t TableChild, O.MethodInfo info TableChild p) => O.IsLabelProxy t (TableChild -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveTableChildMethod t TableChild, O.MethodInfo info TableChild p) => O.IsLabel t (TableChild -> p) where
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif