{- |
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.Interfaces.Buildable
    ( 

-- * Exported types
    Buildable(..)                           ,
    noBuildable                             ,
    BuildableK                              ,
    toBuildable                             ,


 -- * Methods
-- ** buildableAddChild
    buildableAddChild                       ,


-- ** buildableConstructChild
    buildableConstructChild                 ,


-- ** buildableCustomFinished
    buildableCustomFinished                 ,


-- ** buildableCustomTagEnd
    buildableCustomTagEnd                   ,


-- ** buildableCustomTagStart
    buildableCustomTagStart                 ,


-- ** buildableGetInternalChild
    buildableGetInternalChild               ,


-- ** buildableGetName
    buildableGetName                        ,


-- ** buildableParserFinished
    buildableParserFinished                 ,


-- ** buildableSetBuildableProperty
    buildableSetBuildableProperty           ,


-- ** buildableSetName
    buildableSetName                        ,




    ) where

import Prelude ()
import Data.GI.Base.ShortPrelude

import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map

import GI.Gtk.Types
import GI.Gtk.Callbacks
import qualified GI.GLib as GLib
import qualified GI.GObject as GObject

-- interface Buildable 

newtype Buildable = Buildable (ForeignPtr Buildable)
noBuildable :: Maybe Buildable
noBuildable = Nothing

type instance AttributeList Buildable = BuildableAttributeList
type BuildableAttributeList = ('[ ] :: [(Symbol, *)])

type instance SignalList Buildable = BuildableSignalList
type BuildableSignalList = ('[ '("notify", GObject.ObjectNotifySignalInfo), '("notify::[property]", GObjectNotifySignalInfo)] :: [(Symbol, *)])

foreign import ccall "gtk_buildable_get_type"
    c_gtk_buildable_get_type :: IO GType

type instance ParentTypes Buildable = BuildableParentTypes
type BuildableParentTypes = '[GObject.Object]

instance GObject Buildable where
    gobjectIsInitiallyUnowned _ = False
    gobjectType _ = c_gtk_buildable_get_type
    

class GObject o => BuildableK o
instance (GObject o, IsDescendantOf Buildable o) => BuildableK o

toBuildable :: BuildableK o => o -> IO Buildable
toBuildable = unsafeCastTo Buildable

-- method Buildable::add_child
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "Buildable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "builder", argType = TInterface "Gtk" "Builder", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "child", argType = TInterface "GObject" "Object", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "type", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "Buildable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "builder", argType = TInterface "Gtk" "Builder", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "child", argType = TInterface "GObject" "Object", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "type", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "gtk_buildable_add_child" gtk_buildable_add_child :: 
    Ptr Buildable ->                        -- _obj : TInterface "Gtk" "Buildable"
    Ptr Builder ->                          -- builder : TInterface "Gtk" "Builder"
    Ptr GObject.Object ->                   -- child : TInterface "GObject" "Object"
    CString ->                              -- type : TBasicType TUTF8
    IO ()


buildableAddChild ::
    (MonadIO m, BuildableK a, BuilderK b, GObject.ObjectK c) =>
    a ->                                    -- _obj
    b ->                                    -- builder
    c ->                                    -- child
    Maybe (T.Text) ->                       -- type
    m ()
buildableAddChild _obj builder child type_ = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let builder' = unsafeManagedPtrCastPtr builder
    let child' = unsafeManagedPtrCastPtr child
    maybeType_ <- case type_ of
        Nothing -> return nullPtr
        Just jType_ -> do
            jType_' <- textToCString jType_
            return jType_'
    gtk_buildable_add_child _obj' builder' child' maybeType_
    touchManagedPtr _obj
    touchManagedPtr builder
    touchManagedPtr child
    freeMem maybeType_
    return ()

-- method Buildable::construct_child
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "Buildable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "builder", argType = TInterface "Gtk" "Builder", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "Buildable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "builder", argType = TInterface "Gtk" "Builder", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TInterface "GObject" "Object"
-- throws : False
-- Skip return : False

foreign import ccall "gtk_buildable_construct_child" gtk_buildable_construct_child :: 
    Ptr Buildable ->                        -- _obj : TInterface "Gtk" "Buildable"
    Ptr Builder ->                          -- builder : TInterface "Gtk" "Builder"
    CString ->                              -- name : TBasicType TUTF8
    IO (Ptr GObject.Object)


buildableConstructChild ::
    (MonadIO m, BuildableK a, BuilderK b) =>
    a ->                                    -- _obj
    b ->                                    -- builder
    T.Text ->                               -- name
    m GObject.Object
buildableConstructChild _obj builder name = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let builder' = unsafeManagedPtrCastPtr builder
    name' <- textToCString name
    result <- gtk_buildable_construct_child _obj' builder' name'
    checkUnexpectedReturnNULL "gtk_buildable_construct_child" result
    result' <- (wrapObject GObject.Object) result
    touchManagedPtr _obj
    touchManagedPtr builder
    freeMem name'
    return result'

-- method Buildable::custom_finished
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "Buildable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "builder", argType = TInterface "Gtk" "Builder", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "child", argType = TInterface "GObject" "Object", direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "tagname", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "data", argType = TBasicType TVoid, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "Buildable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "builder", argType = TInterface "Gtk" "Builder", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "child", argType = TInterface "GObject" "Object", direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "tagname", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "data", argType = TBasicType TVoid, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "gtk_buildable_custom_finished" gtk_buildable_custom_finished :: 
    Ptr Buildable ->                        -- _obj : TInterface "Gtk" "Buildable"
    Ptr Builder ->                          -- builder : TInterface "Gtk" "Builder"
    Ptr GObject.Object ->                   -- child : TInterface "GObject" "Object"
    CString ->                              -- tagname : TBasicType TUTF8
    Ptr () ->                               -- data : TBasicType TVoid
    IO ()


buildableCustomFinished ::
    (MonadIO m, BuildableK a, BuilderK b, GObject.ObjectK c) =>
    a ->                                    -- _obj
    b ->                                    -- builder
    Maybe (c) ->                            -- child
    T.Text ->                               -- tagname
    Ptr () ->                               -- data
    m ()
buildableCustomFinished _obj builder child tagname data_ = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let builder' = unsafeManagedPtrCastPtr builder
    maybeChild <- case child of
        Nothing -> return nullPtr
        Just jChild -> do
            let jChild' = unsafeManagedPtrCastPtr jChild
            return jChild'
    tagname' <- textToCString tagname
    gtk_buildable_custom_finished _obj' builder' maybeChild tagname' data_
    touchManagedPtr _obj
    touchManagedPtr builder
    whenJust child touchManagedPtr
    freeMem tagname'
    return ()

-- method Buildable::custom_tag_end
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "Buildable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "builder", argType = TInterface "Gtk" "Builder", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "child", argType = TInterface "GObject" "Object", direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "tagname", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "data", argType = TBasicType TVoid, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "Buildable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "builder", argType = TInterface "Gtk" "Builder", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "child", argType = TInterface "GObject" "Object", direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "tagname", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "data", argType = TBasicType TVoid, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "gtk_buildable_custom_tag_end" gtk_buildable_custom_tag_end :: 
    Ptr Buildable ->                        -- _obj : TInterface "Gtk" "Buildable"
    Ptr Builder ->                          -- builder : TInterface "Gtk" "Builder"
    Ptr GObject.Object ->                   -- child : TInterface "GObject" "Object"
    CString ->                              -- tagname : TBasicType TUTF8
    Ptr () ->                               -- data : TBasicType TVoid
    IO ()


buildableCustomTagEnd ::
    (MonadIO m, BuildableK a, BuilderK b, GObject.ObjectK c) =>
    a ->                                    -- _obj
    b ->                                    -- builder
    Maybe (c) ->                            -- child
    T.Text ->                               -- tagname
    Ptr () ->                               -- data
    m ()
buildableCustomTagEnd _obj builder child tagname data_ = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let builder' = unsafeManagedPtrCastPtr builder
    maybeChild <- case child of
        Nothing -> return nullPtr
        Just jChild -> do
            let jChild' = unsafeManagedPtrCastPtr jChild
            return jChild'
    tagname' <- textToCString tagname
    gtk_buildable_custom_tag_end _obj' builder' maybeChild tagname' data_
    touchManagedPtr _obj
    touchManagedPtr builder
    whenJust child touchManagedPtr
    freeMem tagname'
    return ()

-- method Buildable::custom_tag_start
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "Buildable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "builder", argType = TInterface "Gtk" "Builder", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "child", argType = TInterface "GObject" "Object", direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "tagname", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "parser", argType = TInterface "GLib" "MarkupParser", direction = DirectionOut, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "data", argType = TBasicType TVoid, direction = DirectionOut, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferEverything}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "Buildable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "builder", argType = TInterface "Gtk" "Builder", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "child", argType = TInterface "GObject" "Object", direction = DirectionIn, mayBeNull = True, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "tagname", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TBoolean
-- throws : False
-- Skip return : False

foreign import ccall "gtk_buildable_custom_tag_start" gtk_buildable_custom_tag_start :: 
    Ptr Buildable ->                        -- _obj : TInterface "Gtk" "Buildable"
    Ptr Builder ->                          -- builder : TInterface "Gtk" "Builder"
    Ptr GObject.Object ->                   -- child : TInterface "GObject" "Object"
    CString ->                              -- tagname : TBasicType TUTF8
    Ptr GLib.MarkupParser ->                -- parser : TInterface "GLib" "MarkupParser"
    Ptr (Ptr ()) ->                         -- data : TBasicType TVoid
    IO CInt


buildableCustomTagStart ::
    (MonadIO m, BuildableK a, BuilderK b, GObject.ObjectK c) =>
    a ->                                    -- _obj
    b ->                                    -- builder
    Maybe (c) ->                            -- child
    T.Text ->                               -- tagname
    m (Bool,GLib.MarkupParser,(Ptr ()))
buildableCustomTagStart _obj builder child tagname = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let builder' = unsafeManagedPtrCastPtr builder
    maybeChild <- case child of
        Nothing -> return nullPtr
        Just jChild -> do
            let jChild' = unsafeManagedPtrCastPtr jChild
            return jChild'
    tagname' <- textToCString tagname
    parser <- callocBytes 40 :: IO (Ptr GLib.MarkupParser)
    data_ <- allocMem :: IO (Ptr (Ptr ()))
    result <- gtk_buildable_custom_tag_start _obj' builder' maybeChild tagname' parser data_
    let result' = (/= 0) result
    parser' <- (wrapPtr GLib.MarkupParser) parser
    data_' <- peek data_
    touchManagedPtr _obj
    touchManagedPtr builder
    whenJust child touchManagedPtr
    freeMem tagname'
    freeMem data_
    return (result', parser', data_')

-- method Buildable::get_internal_child
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "Buildable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "builder", argType = TInterface "Gtk" "Builder", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "childname", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "Buildable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "builder", argType = TInterface "Gtk" "Builder", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "childname", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TInterface "GObject" "Object"
-- throws : False
-- Skip return : False

foreign import ccall "gtk_buildable_get_internal_child" gtk_buildable_get_internal_child :: 
    Ptr Buildable ->                        -- _obj : TInterface "Gtk" "Buildable"
    Ptr Builder ->                          -- builder : TInterface "Gtk" "Builder"
    CString ->                              -- childname : TBasicType TUTF8
    IO (Ptr GObject.Object)


buildableGetInternalChild ::
    (MonadIO m, BuildableK a, BuilderK b) =>
    a ->                                    -- _obj
    b ->                                    -- builder
    T.Text ->                               -- childname
    m GObject.Object
buildableGetInternalChild _obj builder childname = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let builder' = unsafeManagedPtrCastPtr builder
    childname' <- textToCString childname
    result <- gtk_buildable_get_internal_child _obj' builder' childname'
    checkUnexpectedReturnNULL "gtk_buildable_get_internal_child" result
    result' <- (newObject GObject.Object) result
    touchManagedPtr _obj
    touchManagedPtr builder
    freeMem childname'
    return result'

-- method Buildable::get_name
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "Buildable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "Buildable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TUTF8
-- throws : False
-- Skip return : False

foreign import ccall "gtk_buildable_get_name" gtk_buildable_get_name :: 
    Ptr Buildable ->                        -- _obj : TInterface "Gtk" "Buildable"
    IO CString


buildableGetName ::
    (MonadIO m, BuildableK a) =>
    a ->                                    -- _obj
    m T.Text
buildableGetName _obj = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    result <- gtk_buildable_get_name _obj'
    checkUnexpectedReturnNULL "gtk_buildable_get_name" result
    result' <- cstringToText result
    touchManagedPtr _obj
    return result'

-- method Buildable::parser_finished
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "Buildable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "builder", argType = TInterface "Gtk" "Builder", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "Buildable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "builder", argType = TInterface "Gtk" "Builder", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "gtk_buildable_parser_finished" gtk_buildable_parser_finished :: 
    Ptr Buildable ->                        -- _obj : TInterface "Gtk" "Buildable"
    Ptr Builder ->                          -- builder : TInterface "Gtk" "Builder"
    IO ()


buildableParserFinished ::
    (MonadIO m, BuildableK a, BuilderK b) =>
    a ->                                    -- _obj
    b ->                                    -- builder
    m ()
buildableParserFinished _obj builder = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let builder' = unsafeManagedPtrCastPtr builder
    gtk_buildable_parser_finished _obj' builder'
    touchManagedPtr _obj
    touchManagedPtr builder
    return ()

-- method Buildable::set_buildable_property
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "Buildable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "builder", argType = TInterface "Gtk" "Builder", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "value", argType = TInterface "GObject" "Value", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "Buildable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "builder", argType = TInterface "Gtk" "Builder", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "value", argType = TInterface "GObject" "Value", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "gtk_buildable_set_buildable_property" gtk_buildable_set_buildable_property :: 
    Ptr Buildable ->                        -- _obj : TInterface "Gtk" "Buildable"
    Ptr Builder ->                          -- builder : TInterface "Gtk" "Builder"
    CString ->                              -- name : TBasicType TUTF8
    Ptr GValue ->                           -- value : TInterface "GObject" "Value"
    IO ()


buildableSetBuildableProperty ::
    (MonadIO m, BuildableK a, BuilderK b) =>
    a ->                                    -- _obj
    b ->                                    -- builder
    T.Text ->                               -- name
    GValue ->                               -- value
    m ()
buildableSetBuildableProperty _obj builder name value = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    let builder' = unsafeManagedPtrCastPtr builder
    name' <- textToCString name
    let value' = unsafeManagedPtrGetPtr value
    gtk_buildable_set_buildable_property _obj' builder' name' value'
    touchManagedPtr _obj
    touchManagedPtr builder
    touchManagedPtr value
    freeMem name'
    return ()

-- method Buildable::set_name
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "Buildable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "Buildable", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing},Arg {argName = "name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False

foreign import ccall "gtk_buildable_set_name" gtk_buildable_set_name :: 
    Ptr Buildable ->                        -- _obj : TInterface "Gtk" "Buildable"
    CString ->                              -- name : TBasicType TUTF8
    IO ()


buildableSetName ::
    (MonadIO m, BuildableK a) =>
    a ->                                    -- _obj
    T.Text ->                               -- name
    m ()
buildableSetName _obj name = liftIO $ do
    let _obj' = unsafeManagedPtrCastPtr _obj
    name' <- textToCString name
    gtk_buildable_set_name _obj' name'
    touchManagedPtr _obj
    freeMem name'
    return ()