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

'GI.Gtk.Interfaces.Scrollable.Scrollable' is an interface that is implemented by widgets with native
scrolling ability.

To implement this interface you should override the
'GI.Gtk.Interfaces.Scrollable.Scrollable':@/hadjustment/@ and 'GI.Gtk.Interfaces.Scrollable.Scrollable':@/vadjustment/@ properties.

== Creating a scrollable widget

All scrollable widgets should do the following.

* When a parent widget sets the scrollable child widget’s adjustments,
the widget should populate the adjustments’
'GI.Gtk.Objects.Adjustment.Adjustment':@/lower/@, 'GI.Gtk.Objects.Adjustment.Adjustment':@/upper/@,
'GI.Gtk.Objects.Adjustment.Adjustment':@/step-increment/@, 'GI.Gtk.Objects.Adjustment.Adjustment':@/page-increment/@ and
'GI.Gtk.Objects.Adjustment.Adjustment':@/page-size/@ properties and connect to the
'GI.Gtk.Objects.Adjustment.Adjustment'::@/value-changed/@ signal.
* Because its preferred size is the size for a fully expanded widget,
the scrollable widget must be able to cope with underallocations.
This means that it must accept any value passed to its
'GI.Gtk.Structs.WidgetClass.WidgetClass'.@/size_allocate/@() function.
* When the parent allocates space to the scrollable child widget,
the widget should update the adjustments’ properties with new values.
* When any of the adjustments emits the 'GI.Gtk.Objects.Adjustment.Adjustment'::@/value-changed/@ signal,
the scrollable widget should scroll its contents.

-}

module GI.Gtk.Interfaces.Scrollable
    ( 

-- * Exported types
    Scrollable(..)                          ,
    noScrollable                            ,
    IsScrollable                            ,
    toScrollable                            ,


 -- * Methods
-- ** getBorder #method:getBorder#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    ScrollableGetBorderMethodInfo           ,
#endif
    scrollableGetBorder                     ,


-- ** getHadjustment #method:getHadjustment#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    ScrollableGetHadjustmentMethodInfo      ,
#endif
    scrollableGetHadjustment                ,


-- ** getHscrollPolicy #method:getHscrollPolicy#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    ScrollableGetHscrollPolicyMethodInfo    ,
#endif
    scrollableGetHscrollPolicy              ,


-- ** getVadjustment #method:getVadjustment#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    ScrollableGetVadjustmentMethodInfo      ,
#endif
    scrollableGetVadjustment                ,


-- ** getVscrollPolicy #method:getVscrollPolicy#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    ScrollableGetVscrollPolicyMethodInfo    ,
#endif
    scrollableGetVscrollPolicy              ,


-- ** setHadjustment #method:setHadjustment#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    ScrollableSetHadjustmentMethodInfo      ,
#endif
    scrollableSetHadjustment                ,


-- ** setHscrollPolicy #method:setHscrollPolicy#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    ScrollableSetHscrollPolicyMethodInfo    ,
#endif
    scrollableSetHscrollPolicy              ,


-- ** setVadjustment #method:setVadjustment#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    ScrollableSetVadjustmentMethodInfo      ,
#endif
    scrollableSetVadjustment                ,


-- ** setVscrollPolicy #method:setVscrollPolicy#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    ScrollableSetVscrollPolicyMethodInfo    ,
#endif
    scrollableSetVscrollPolicy              ,




 -- * Properties
-- ** hadjustment #attr:hadjustment#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    ScrollableHadjustmentPropertyInfo       ,
#endif
    clearScrollableHadjustment              ,
    constructScrollableHadjustment          ,
    getScrollableHadjustment                ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    scrollableHadjustment                   ,
#endif
    setScrollableHadjustment                ,


-- ** hscrollPolicy #attr:hscrollPolicy#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    ScrollableHscrollPolicyPropertyInfo     ,
#endif
    constructScrollableHscrollPolicy        ,
    getScrollableHscrollPolicy              ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    scrollableHscrollPolicy                 ,
#endif
    setScrollableHscrollPolicy              ,


-- ** vadjustment #attr:vadjustment#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    ScrollableVadjustmentPropertyInfo       ,
#endif
    clearScrollableVadjustment              ,
    constructScrollableVadjustment          ,
    getScrollableVadjustment                ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    scrollableVadjustment                   ,
#endif
    setScrollableVadjustment                ,


-- ** vscrollPolicy #attr:vscrollPolicy#
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    ScrollableVscrollPolicyPropertyInfo     ,
#endif
    constructScrollableVscrollPolicy        ,
    getScrollableVscrollPolicy              ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
    scrollableVscrollPolicy                 ,
#endif
    setScrollableVscrollPolicy              ,




    ) 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 qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gtk.Enums as Gtk.Enums
import {-# SOURCE #-} qualified GI.Gtk.Objects.Adjustment as Gtk.Adjustment
import {-# SOURCE #-} qualified GI.Gtk.Structs.Border as Gtk.Border

-- interface Scrollable 
newtype Scrollable = Scrollable (ManagedPtr Scrollable)
noScrollable :: Maybe Scrollable
noScrollable = Nothing

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type instance O.SignalList Scrollable = ScrollableSignalList
type ScrollableSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

foreign import ccall "gtk_scrollable_get_type"
    c_gtk_scrollable_get_type :: IO GType

instance GObject Scrollable where
    gobjectType _ = c_gtk_scrollable_get_type
    

class GObject o => IsScrollable o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError Scrollable a) =>
    IsScrollable a
#endif
instance IsScrollable Scrollable
instance GObject.Object.IsObject Scrollable

toScrollable :: (MonadIO m, IsScrollable o) => o -> m Scrollable
toScrollable = liftIO . unsafeCastTo Scrollable

-- VVV Prop "hadjustment"
   -- Type: TInterface (Name {namespace = "Gtk", name = "Adjustment"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct]
   -- Nullable: (Just False,Just True)

getScrollableHadjustment :: (MonadIO m, IsScrollable o) => o -> m Gtk.Adjustment.Adjustment
getScrollableHadjustment obj = liftIO $ checkUnexpectedNothing "getScrollableHadjustment" $ getObjectPropertyObject obj "hadjustment" Gtk.Adjustment.Adjustment

setScrollableHadjustment :: (MonadIO m, IsScrollable o, Gtk.Adjustment.IsAdjustment a) => o -> a -> m ()
setScrollableHadjustment obj val = liftIO $ setObjectPropertyObject obj "hadjustment" (Just val)

constructScrollableHadjustment :: (IsScrollable o, Gtk.Adjustment.IsAdjustment a) => a -> IO (GValueConstruct o)
constructScrollableHadjustment val = constructObjectPropertyObject "hadjustment" (Just val)

clearScrollableHadjustment :: (MonadIO m, IsScrollable o) => o -> m ()
clearScrollableHadjustment obj = liftIO $ setObjectPropertyObject obj "hadjustment" (Nothing :: Maybe Gtk.Adjustment.Adjustment)

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data ScrollableHadjustmentPropertyInfo
instance AttrInfo ScrollableHadjustmentPropertyInfo where
    type AttrAllowedOps ScrollableHadjustmentPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint ScrollableHadjustmentPropertyInfo = Gtk.Adjustment.IsAdjustment
    type AttrBaseTypeConstraint ScrollableHadjustmentPropertyInfo = IsScrollable
    type AttrGetType ScrollableHadjustmentPropertyInfo = Gtk.Adjustment.Adjustment
    type AttrLabel ScrollableHadjustmentPropertyInfo = "hadjustment"
    type AttrOrigin ScrollableHadjustmentPropertyInfo = Scrollable
    attrGet _ = getScrollableHadjustment
    attrSet _ = setScrollableHadjustment
    attrConstruct _ = constructScrollableHadjustment
    attrClear _ = clearScrollableHadjustment
#endif

-- VVV Prop "hscroll-policy"
   -- Type: TInterface (Name {namespace = "Gtk", name = "ScrollablePolicy"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

getScrollableHscrollPolicy :: (MonadIO m, IsScrollable o) => o -> m Gtk.Enums.ScrollablePolicy
getScrollableHscrollPolicy obj = liftIO $ getObjectPropertyEnum obj "hscroll-policy"

setScrollableHscrollPolicy :: (MonadIO m, IsScrollable o) => o -> Gtk.Enums.ScrollablePolicy -> m ()
setScrollableHscrollPolicy obj val = liftIO $ setObjectPropertyEnum obj "hscroll-policy" val

constructScrollableHscrollPolicy :: (IsScrollable o) => Gtk.Enums.ScrollablePolicy -> IO (GValueConstruct o)
constructScrollableHscrollPolicy val = constructObjectPropertyEnum "hscroll-policy" val

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data ScrollableHscrollPolicyPropertyInfo
instance AttrInfo ScrollableHscrollPolicyPropertyInfo where
    type AttrAllowedOps ScrollableHscrollPolicyPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint ScrollableHscrollPolicyPropertyInfo = (~) Gtk.Enums.ScrollablePolicy
    type AttrBaseTypeConstraint ScrollableHscrollPolicyPropertyInfo = IsScrollable
    type AttrGetType ScrollableHscrollPolicyPropertyInfo = Gtk.Enums.ScrollablePolicy
    type AttrLabel ScrollableHscrollPolicyPropertyInfo = "hscroll-policy"
    type AttrOrigin ScrollableHscrollPolicyPropertyInfo = Scrollable
    attrGet _ = getScrollableHscrollPolicy
    attrSet _ = setScrollableHscrollPolicy
    attrConstruct _ = constructScrollableHscrollPolicy
    attrClear _ = undefined
#endif

-- VVV Prop "vadjustment"
   -- Type: TInterface (Name {namespace = "Gtk", name = "Adjustment"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstruct]
   -- Nullable: (Just False,Just True)

getScrollableVadjustment :: (MonadIO m, IsScrollable o) => o -> m Gtk.Adjustment.Adjustment
getScrollableVadjustment obj = liftIO $ checkUnexpectedNothing "getScrollableVadjustment" $ getObjectPropertyObject obj "vadjustment" Gtk.Adjustment.Adjustment

setScrollableVadjustment :: (MonadIO m, IsScrollable o, Gtk.Adjustment.IsAdjustment a) => o -> a -> m ()
setScrollableVadjustment obj val = liftIO $ setObjectPropertyObject obj "vadjustment" (Just val)

constructScrollableVadjustment :: (IsScrollable o, Gtk.Adjustment.IsAdjustment a) => a -> IO (GValueConstruct o)
constructScrollableVadjustment val = constructObjectPropertyObject "vadjustment" (Just val)

clearScrollableVadjustment :: (MonadIO m, IsScrollable o) => o -> m ()
clearScrollableVadjustment obj = liftIO $ setObjectPropertyObject obj "vadjustment" (Nothing :: Maybe Gtk.Adjustment.Adjustment)

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data ScrollableVadjustmentPropertyInfo
instance AttrInfo ScrollableVadjustmentPropertyInfo where
    type AttrAllowedOps ScrollableVadjustmentPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint ScrollableVadjustmentPropertyInfo = Gtk.Adjustment.IsAdjustment
    type AttrBaseTypeConstraint ScrollableVadjustmentPropertyInfo = IsScrollable
    type AttrGetType ScrollableVadjustmentPropertyInfo = Gtk.Adjustment.Adjustment
    type AttrLabel ScrollableVadjustmentPropertyInfo = "vadjustment"
    type AttrOrigin ScrollableVadjustmentPropertyInfo = Scrollable
    attrGet _ = getScrollableVadjustment
    attrSet _ = setScrollableVadjustment
    attrConstruct _ = constructScrollableVadjustment
    attrClear _ = clearScrollableVadjustment
#endif

-- VVV Prop "vscroll-policy"
   -- Type: TInterface (Name {namespace = "Gtk", name = "ScrollablePolicy"})
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just False)

getScrollableVscrollPolicy :: (MonadIO m, IsScrollable o) => o -> m Gtk.Enums.ScrollablePolicy
getScrollableVscrollPolicy obj = liftIO $ getObjectPropertyEnum obj "vscroll-policy"

setScrollableVscrollPolicy :: (MonadIO m, IsScrollable o) => o -> Gtk.Enums.ScrollablePolicy -> m ()
setScrollableVscrollPolicy obj val = liftIO $ setObjectPropertyEnum obj "vscroll-policy" val

constructScrollableVscrollPolicy :: (IsScrollable o) => Gtk.Enums.ScrollablePolicy -> IO (GValueConstruct o)
constructScrollableVscrollPolicy val = constructObjectPropertyEnum "vscroll-policy" val

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data ScrollableVscrollPolicyPropertyInfo
instance AttrInfo ScrollableVscrollPolicyPropertyInfo where
    type AttrAllowedOps ScrollableVscrollPolicyPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint ScrollableVscrollPolicyPropertyInfo = (~) Gtk.Enums.ScrollablePolicy
    type AttrBaseTypeConstraint ScrollableVscrollPolicyPropertyInfo = IsScrollable
    type AttrGetType ScrollableVscrollPolicyPropertyInfo = Gtk.Enums.ScrollablePolicy
    type AttrLabel ScrollableVscrollPolicyPropertyInfo = "vscroll-policy"
    type AttrOrigin ScrollableVscrollPolicyPropertyInfo = Scrollable
    attrGet _ = getScrollableVscrollPolicy
    attrSet _ = setScrollableVscrollPolicy
    attrConstruct _ = constructScrollableVscrollPolicy
    attrClear _ = undefined
#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList Scrollable
type instance O.AttributeList Scrollable = ScrollableAttributeList
type ScrollableAttributeList = ('[ '("hadjustment", ScrollableHadjustmentPropertyInfo), '("hscrollPolicy", ScrollableHscrollPolicyPropertyInfo), '("vadjustment", ScrollableVadjustmentPropertyInfo), '("vscrollPolicy", ScrollableVscrollPolicyPropertyInfo)] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
scrollableHadjustment :: AttrLabelProxy "hadjustment"
scrollableHadjustment = AttrLabelProxy

scrollableHscrollPolicy :: AttrLabelProxy "hscrollPolicy"
scrollableHscrollPolicy = AttrLabelProxy

scrollableVadjustment :: AttrLabelProxy "vadjustment"
scrollableVadjustment = AttrLabelProxy

scrollableVscrollPolicy :: AttrLabelProxy "vscrollPolicy"
scrollableVscrollPolicy = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveScrollableMethod (t :: Symbol) (o :: *) :: * where
    ResolveScrollableMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveScrollableMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveScrollableMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveScrollableMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveScrollableMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveScrollableMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveScrollableMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveScrollableMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveScrollableMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveScrollableMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolveScrollableMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolveScrollableMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveScrollableMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveScrollableMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveScrollableMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveScrollableMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveScrollableMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveScrollableMethod "getBorder" o = ScrollableGetBorderMethodInfo
    ResolveScrollableMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveScrollableMethod "getHadjustment" o = ScrollableGetHadjustmentMethodInfo
    ResolveScrollableMethod "getHscrollPolicy" o = ScrollableGetHscrollPolicyMethodInfo
    ResolveScrollableMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveScrollableMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveScrollableMethod "getVadjustment" o = ScrollableGetVadjustmentMethodInfo
    ResolveScrollableMethod "getVscrollPolicy" o = ScrollableGetVscrollPolicyMethodInfo
    ResolveScrollableMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveScrollableMethod "setHadjustment" o = ScrollableSetHadjustmentMethodInfo
    ResolveScrollableMethod "setHscrollPolicy" o = ScrollableSetHscrollPolicyMethodInfo
    ResolveScrollableMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveScrollableMethod "setVadjustment" o = ScrollableSetVadjustmentMethodInfo
    ResolveScrollableMethod "setVscrollPolicy" o = ScrollableSetVscrollPolicyMethodInfo
    ResolveScrollableMethod l o = O.MethodResolutionFailed l o

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

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveScrollableMethod t Scrollable, O.MethodInfo info Scrollable p) => O.IsLabel t (Scrollable -> 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

#endif

-- method Scrollable::get_border
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "scrollable", argType = TInterface (Name {namespace = "Gtk", name = "Scrollable"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkScrollable", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "border", argType = TInterface (Name {namespace = "Gtk", name = "Border"}), direction = DirectionOut, mayBeNull = False, argDoc = Documentation {rawDocText = Just "return location for the results", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = True, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gtk_scrollable_get_border" gtk_scrollable_get_border :: 
    Ptr Scrollable ->                       -- scrollable : TInterface (Name {namespace = "Gtk", name = "Scrollable"})
    Ptr Gtk.Border.Border ->                -- border : TInterface (Name {namespace = "Gtk", name = "Border"})
    IO CInt

{- |
Returns the size of a non-scrolling border around the
outside of the scrollable. An example for this would
be treeview headers. GTK+ can use this information to
display overlayed graphics, like the overshoot indication,
at the right position.

@since 3.16
-}
scrollableGetBorder ::
    (B.CallStack.HasCallStack, MonadIO m, IsScrollable a) =>
    a
    {- ^ /@scrollable@/: a 'GI.Gtk.Interfaces.Scrollable.Scrollable' -}
    -> m ((Bool, Gtk.Border.Border))
    {- ^ __Returns:__ 'True' if /@border@/ has been set -}
scrollableGetBorder scrollable = liftIO $ do
    scrollable' <- unsafeManagedPtrCastPtr scrollable
    border <- callocBoxedBytes 8 :: IO (Ptr Gtk.Border.Border)
    result <- gtk_scrollable_get_border scrollable' border
    let result' = (/= 0) result
    border' <- (wrapBoxed Gtk.Border.Border) border
    touchManagedPtr scrollable
    return (result', border')

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data ScrollableGetBorderMethodInfo
instance (signature ~ (m ((Bool, Gtk.Border.Border))), MonadIO m, IsScrollable a) => O.MethodInfo ScrollableGetBorderMethodInfo a signature where
    overloadedMethod _ = scrollableGetBorder

#endif

-- method Scrollable::get_hadjustment
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "scrollable", argType = TInterface (Name {namespace = "Gtk", name = "Scrollable"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkScrollable", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "Adjustment"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_scrollable_get_hadjustment" gtk_scrollable_get_hadjustment :: 
    Ptr Scrollable ->                       -- scrollable : TInterface (Name {namespace = "Gtk", name = "Scrollable"})
    IO (Ptr Gtk.Adjustment.Adjustment)

{- |
Retrieves the 'GI.Gtk.Objects.Adjustment.Adjustment' used for horizontal scrolling.

@since 3.0
-}
scrollableGetHadjustment ::
    (B.CallStack.HasCallStack, MonadIO m, IsScrollable a) =>
    a
    {- ^ /@scrollable@/: a 'GI.Gtk.Interfaces.Scrollable.Scrollable' -}
    -> m Gtk.Adjustment.Adjustment
    {- ^ __Returns:__ horizontal 'GI.Gtk.Objects.Adjustment.Adjustment'. -}
scrollableGetHadjustment scrollable = liftIO $ do
    scrollable' <- unsafeManagedPtrCastPtr scrollable
    result <- gtk_scrollable_get_hadjustment scrollable'
    checkUnexpectedReturnNULL "scrollableGetHadjustment" result
    result' <- (newObject Gtk.Adjustment.Adjustment) result
    touchManagedPtr scrollable
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data ScrollableGetHadjustmentMethodInfo
instance (signature ~ (m Gtk.Adjustment.Adjustment), MonadIO m, IsScrollable a) => O.MethodInfo ScrollableGetHadjustmentMethodInfo a signature where
    overloadedMethod _ = scrollableGetHadjustment

#endif

-- method Scrollable::get_hscroll_policy
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "scrollable", argType = TInterface (Name {namespace = "Gtk", name = "Scrollable"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkScrollable", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "ScrollablePolicy"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_scrollable_get_hscroll_policy" gtk_scrollable_get_hscroll_policy :: 
    Ptr Scrollable ->                       -- scrollable : TInterface (Name {namespace = "Gtk", name = "Scrollable"})
    IO CUInt

{- |
Gets the horizontal 'GI.Gtk.Enums.ScrollablePolicy'.

@since 3.0
-}
scrollableGetHscrollPolicy ::
    (B.CallStack.HasCallStack, MonadIO m, IsScrollable a) =>
    a
    {- ^ /@scrollable@/: a 'GI.Gtk.Interfaces.Scrollable.Scrollable' -}
    -> m Gtk.Enums.ScrollablePolicy
    {- ^ __Returns:__ The horizontal 'GI.Gtk.Enums.ScrollablePolicy'. -}
scrollableGetHscrollPolicy scrollable = liftIO $ do
    scrollable' <- unsafeManagedPtrCastPtr scrollable
    result <- gtk_scrollable_get_hscroll_policy scrollable'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr scrollable
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data ScrollableGetHscrollPolicyMethodInfo
instance (signature ~ (m Gtk.Enums.ScrollablePolicy), MonadIO m, IsScrollable a) => O.MethodInfo ScrollableGetHscrollPolicyMethodInfo a signature where
    overloadedMethod _ = scrollableGetHscrollPolicy

#endif

-- method Scrollable::get_vadjustment
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "scrollable", argType = TInterface (Name {namespace = "Gtk", name = "Scrollable"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkScrollable", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "Adjustment"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_scrollable_get_vadjustment" gtk_scrollable_get_vadjustment :: 
    Ptr Scrollable ->                       -- scrollable : TInterface (Name {namespace = "Gtk", name = "Scrollable"})
    IO (Ptr Gtk.Adjustment.Adjustment)

{- |
Retrieves the 'GI.Gtk.Objects.Adjustment.Adjustment' used for vertical scrolling.

@since 3.0
-}
scrollableGetVadjustment ::
    (B.CallStack.HasCallStack, MonadIO m, IsScrollable a) =>
    a
    {- ^ /@scrollable@/: a 'GI.Gtk.Interfaces.Scrollable.Scrollable' -}
    -> m Gtk.Adjustment.Adjustment
    {- ^ __Returns:__ vertical 'GI.Gtk.Objects.Adjustment.Adjustment'. -}
scrollableGetVadjustment scrollable = liftIO $ do
    scrollable' <- unsafeManagedPtrCastPtr scrollable
    result <- gtk_scrollable_get_vadjustment scrollable'
    checkUnexpectedReturnNULL "scrollableGetVadjustment" result
    result' <- (newObject Gtk.Adjustment.Adjustment) result
    touchManagedPtr scrollable
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data ScrollableGetVadjustmentMethodInfo
instance (signature ~ (m Gtk.Adjustment.Adjustment), MonadIO m, IsScrollable a) => O.MethodInfo ScrollableGetVadjustmentMethodInfo a signature where
    overloadedMethod _ = scrollableGetVadjustment

#endif

-- method Scrollable::get_vscroll_policy
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "scrollable", argType = TInterface (Name {namespace = "Gtk", name = "Scrollable"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkScrollable", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gtk", name = "ScrollablePolicy"}))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_scrollable_get_vscroll_policy" gtk_scrollable_get_vscroll_policy :: 
    Ptr Scrollable ->                       -- scrollable : TInterface (Name {namespace = "Gtk", name = "Scrollable"})
    IO CUInt

{- |
Gets the vertical 'GI.Gtk.Enums.ScrollablePolicy'.

@since 3.0
-}
scrollableGetVscrollPolicy ::
    (B.CallStack.HasCallStack, MonadIO m, IsScrollable a) =>
    a
    {- ^ /@scrollable@/: a 'GI.Gtk.Interfaces.Scrollable.Scrollable' -}
    -> m Gtk.Enums.ScrollablePolicy
    {- ^ __Returns:__ The vertical 'GI.Gtk.Enums.ScrollablePolicy'. -}
scrollableGetVscrollPolicy scrollable = liftIO $ do
    scrollable' <- unsafeManagedPtrCastPtr scrollable
    result <- gtk_scrollable_get_vscroll_policy scrollable'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr scrollable
    return result'

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data ScrollableGetVscrollPolicyMethodInfo
instance (signature ~ (m Gtk.Enums.ScrollablePolicy), MonadIO m, IsScrollable a) => O.MethodInfo ScrollableGetVscrollPolicyMethodInfo a signature where
    overloadedMethod _ = scrollableGetVscrollPolicy

#endif

-- method Scrollable::set_hadjustment
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "scrollable", argType = TInterface (Name {namespace = "Gtk", name = "Scrollable"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkScrollable", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "hadjustment", argType = TInterface (Name {namespace = "Gtk", name = "Adjustment"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GtkAdjustment", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_scrollable_set_hadjustment" gtk_scrollable_set_hadjustment :: 
    Ptr Scrollable ->                       -- scrollable : TInterface (Name {namespace = "Gtk", name = "Scrollable"})
    Ptr Gtk.Adjustment.Adjustment ->        -- hadjustment : TInterface (Name {namespace = "Gtk", name = "Adjustment"})
    IO ()

{- |
Sets the horizontal adjustment of the 'GI.Gtk.Interfaces.Scrollable.Scrollable'.

@since 3.0
-}
scrollableSetHadjustment ::
    (B.CallStack.HasCallStack, MonadIO m, IsScrollable a, Gtk.Adjustment.IsAdjustment b) =>
    a
    {- ^ /@scrollable@/: a 'GI.Gtk.Interfaces.Scrollable.Scrollable' -}
    -> Maybe (b)
    {- ^ /@hadjustment@/: a 'GI.Gtk.Objects.Adjustment.Adjustment' -}
    -> m ()
scrollableSetHadjustment scrollable hadjustment = liftIO $ do
    scrollable' <- unsafeManagedPtrCastPtr scrollable
    maybeHadjustment <- case hadjustment of
        Nothing -> return nullPtr
        Just jHadjustment -> do
            jHadjustment' <- unsafeManagedPtrCastPtr jHadjustment
            return jHadjustment'
    gtk_scrollable_set_hadjustment scrollable' maybeHadjustment
    touchManagedPtr scrollable
    whenJust hadjustment touchManagedPtr
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data ScrollableSetHadjustmentMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsScrollable a, Gtk.Adjustment.IsAdjustment b) => O.MethodInfo ScrollableSetHadjustmentMethodInfo a signature where
    overloadedMethod _ = scrollableSetHadjustment

#endif

-- method Scrollable::set_hscroll_policy
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "scrollable", argType = TInterface (Name {namespace = "Gtk", name = "Scrollable"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkScrollable", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "policy", argType = TInterface (Name {namespace = "Gtk", name = "ScrollablePolicy"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the horizontal #GtkScrollablePolicy", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_scrollable_set_hscroll_policy" gtk_scrollable_set_hscroll_policy :: 
    Ptr Scrollable ->                       -- scrollable : TInterface (Name {namespace = "Gtk", name = "Scrollable"})
    CUInt ->                                -- policy : TInterface (Name {namespace = "Gtk", name = "ScrollablePolicy"})
    IO ()

{- |
Sets the 'GI.Gtk.Enums.ScrollablePolicy' to determine whether
horizontal scrolling should start below the minimum width or
below the natural width.

@since 3.0
-}
scrollableSetHscrollPolicy ::
    (B.CallStack.HasCallStack, MonadIO m, IsScrollable a) =>
    a
    {- ^ /@scrollable@/: a 'GI.Gtk.Interfaces.Scrollable.Scrollable' -}
    -> Gtk.Enums.ScrollablePolicy
    {- ^ /@policy@/: the horizontal 'GI.Gtk.Enums.ScrollablePolicy' -}
    -> m ()
scrollableSetHscrollPolicy scrollable policy = liftIO $ do
    scrollable' <- unsafeManagedPtrCastPtr scrollable
    let policy' = (fromIntegral . fromEnum) policy
    gtk_scrollable_set_hscroll_policy scrollable' policy'
    touchManagedPtr scrollable
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data ScrollableSetHscrollPolicyMethodInfo
instance (signature ~ (Gtk.Enums.ScrollablePolicy -> m ()), MonadIO m, IsScrollable a) => O.MethodInfo ScrollableSetHscrollPolicyMethodInfo a signature where
    overloadedMethod _ = scrollableSetHscrollPolicy

#endif

-- method Scrollable::set_vadjustment
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "scrollable", argType = TInterface (Name {namespace = "Gtk", name = "Scrollable"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkScrollable", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "vadjustment", argType = TInterface (Name {namespace = "Gtk", name = "Adjustment"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GtkAdjustment", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_scrollable_set_vadjustment" gtk_scrollable_set_vadjustment :: 
    Ptr Scrollable ->                       -- scrollable : TInterface (Name {namespace = "Gtk", name = "Scrollable"})
    Ptr Gtk.Adjustment.Adjustment ->        -- vadjustment : TInterface (Name {namespace = "Gtk", name = "Adjustment"})
    IO ()

{- |
Sets the vertical adjustment of the 'GI.Gtk.Interfaces.Scrollable.Scrollable'.

@since 3.0
-}
scrollableSetVadjustment ::
    (B.CallStack.HasCallStack, MonadIO m, IsScrollable a, Gtk.Adjustment.IsAdjustment b) =>
    a
    {- ^ /@scrollable@/: a 'GI.Gtk.Interfaces.Scrollable.Scrollable' -}
    -> Maybe (b)
    {- ^ /@vadjustment@/: a 'GI.Gtk.Objects.Adjustment.Adjustment' -}
    -> m ()
scrollableSetVadjustment scrollable vadjustment = liftIO $ do
    scrollable' <- unsafeManagedPtrCastPtr scrollable
    maybeVadjustment <- case vadjustment of
        Nothing -> return nullPtr
        Just jVadjustment -> do
            jVadjustment' <- unsafeManagedPtrCastPtr jVadjustment
            return jVadjustment'
    gtk_scrollable_set_vadjustment scrollable' maybeVadjustment
    touchManagedPtr scrollable
    whenJust vadjustment touchManagedPtr
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data ScrollableSetVadjustmentMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsScrollable a, Gtk.Adjustment.IsAdjustment b) => O.MethodInfo ScrollableSetVadjustmentMethodInfo a signature where
    overloadedMethod _ = scrollableSetVadjustment

#endif

-- method Scrollable::set_vscroll_policy
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "scrollable", argType = TInterface (Name {namespace = "Gtk", name = "Scrollable"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GtkScrollable", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "policy", argType = TInterface (Name {namespace = "Gtk", name = "ScrollablePolicy"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the vertical #GtkScrollablePolicy", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_scrollable_set_vscroll_policy" gtk_scrollable_set_vscroll_policy :: 
    Ptr Scrollable ->                       -- scrollable : TInterface (Name {namespace = "Gtk", name = "Scrollable"})
    CUInt ->                                -- policy : TInterface (Name {namespace = "Gtk", name = "ScrollablePolicy"})
    IO ()

{- |
Sets the 'GI.Gtk.Enums.ScrollablePolicy' to determine whether
vertical scrolling should start below the minimum height or
below the natural height.

@since 3.0
-}
scrollableSetVscrollPolicy ::
    (B.CallStack.HasCallStack, MonadIO m, IsScrollable a) =>
    a
    {- ^ /@scrollable@/: a 'GI.Gtk.Interfaces.Scrollable.Scrollable' -}
    -> Gtk.Enums.ScrollablePolicy
    {- ^ /@policy@/: the vertical 'GI.Gtk.Enums.ScrollablePolicy' -}
    -> m ()
scrollableSetVscrollPolicy scrollable policy = liftIO $ do
    scrollable' <- unsafeManagedPtrCastPtr scrollable
    let policy' = (fromIntegral . fromEnum) policy
    gtk_scrollable_set_vscroll_policy scrollable' policy'
    touchManagedPtr scrollable
    return ()

#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data ScrollableSetVscrollPolicyMethodInfo
instance (signature ~ (Gtk.Enums.ScrollablePolicy -> m ()), MonadIO m, IsScrollable a) => O.MethodInfo ScrollableSetVscrollPolicyMethodInfo a signature where
    overloadedMethod _ = scrollableSetVscrollPolicy

#endif