gi-gtk-0.3.18.12: GI/Gtk/Structs/Border.hs
{- |
Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)
A struct that specifies a border around a rectangular area
that can be of different width on each side.
-}
module GI.Gtk.Structs.Border
(
-- * Exported types
Border(..) ,
noBorder ,
-- * Methods
-- ** borderCopy
borderCopy ,
-- ** borderFree
borderFree ,
-- ** borderNew
borderNew ,
-- * Properties
-- ** Bottom
borderReadBottom ,
-- ** Left
borderReadLeft ,
-- ** Right
borderReadRight ,
-- ** Top
borderReadTop ,
) 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
newtype Border = Border (ForeignPtr Border)
foreign import ccall "gtk_border_get_type" c_gtk_border_get_type ::
IO GType
instance BoxedObject Border where
boxedType _ = c_gtk_border_get_type
noBorder :: Maybe Border
noBorder = Nothing
borderReadLeft :: Border -> IO Int16
borderReadLeft s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO Int16
return val
borderReadRight :: Border -> IO Int16
borderReadRight s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 2) :: IO Int16
return val
borderReadTop :: Border -> IO Int16
borderReadTop s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 4) :: IO Int16
return val
borderReadBottom :: Border -> IO Int16
borderReadBottom s = withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 6) :: IO Int16
return val
-- method Border::new
-- method type : Constructor
-- Args : []
-- Lengths : []
-- hInArgs : []
-- returnType : TInterface "Gtk" "Border"
-- throws : False
-- Skip return : False
foreign import ccall "gtk_border_new" gtk_border_new ::
IO (Ptr Border)
borderNew ::
(MonadIO m) =>
m Border
borderNew = liftIO $ do
result <- gtk_border_new
checkUnexpectedReturnNULL "gtk_border_new" result
result' <- (wrapBoxed Border) result
return result'
-- method Border::copy
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "Border", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "Border", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TInterface "Gtk" "Border"
-- throws : False
-- Skip return : False
foreign import ccall "gtk_border_copy" gtk_border_copy ::
Ptr Border -> -- _obj : TInterface "Gtk" "Border"
IO (Ptr Border)
borderCopy ::
(MonadIO m) =>
Border -> -- _obj
m Border
borderCopy _obj = liftIO $ do
let _obj' = unsafeManagedPtrGetPtr _obj
result <- gtk_border_copy _obj'
checkUnexpectedReturnNULL "gtk_border_copy" result
result' <- (wrapBoxed Border) result
touchManagedPtr _obj
return result'
-- method Border::free
-- method type : OrdinaryMethod
-- Args : [Arg {argName = "_obj", argType = TInterface "Gtk" "Border", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- Lengths : []
-- hInArgs : [Arg {argName = "_obj", argType = TInterface "Gtk" "Border", direction = DirectionIn, mayBeNull = False, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, transfer = TransferNothing}]
-- returnType : TBasicType TVoid
-- throws : False
-- Skip return : False
foreign import ccall "gtk_border_free" gtk_border_free ::
Ptr Border -> -- _obj : TInterface "Gtk" "Border"
IO ()
borderFree ::
(MonadIO m) =>
Border -> -- _obj
m ()
borderFree _obj = liftIO $ do
let _obj' = unsafeManagedPtrGetPtr _obj
gtk_border_free _obj'
touchManagedPtr _obj
return ()