{-# LINE 2 "./Graphics/UI/Gtk/Abstract/Box.chs" #-}
module Graphics.UI.Gtk.Abstract.Box (
Box,
BoxClass,
castToBox, gTypeBox,
toBox,
Packing(..),
boxPackStart,
boxPackEnd,
boxGetHomogeneous,
boxSetHomogeneous,
boxGetSpacing,
boxSetSpacing,
boxReorderChild,
boxQueryChildPacking,
boxSetChildPacking,
boxGetBaselinePosition,
boxSetBaselinePosition,
boxGetCenterWidget,
boxSetCenterWidget,
boxSpacing,
boxHomogeneous,
boxBaselinePosition,
boxCenterWidget,
boxChildPacking,
boxChildPadding,
boxChildPackType,
boxChildPosition,
) where
import Control.Monad (liftM)
import System.Glib.FFI
import System.Glib.Attributes
import Graphics.UI.Gtk.Types
{-# LINE 150 "./Graphics/UI/Gtk/Abstract/Box.chs" #-}
import Graphics.UI.Gtk.General.Enums (PackType(..), Packing(..),
toPacking, fromPacking)
import Graphics.UI.Gtk.Abstract.ContainerChildProperties
import Graphics.UI.Gtk.General.Enums (BaselinePosition)
import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
{-# LINE 162 "./Graphics/UI/Gtk/Abstract/Box.chs" #-}
boxPackStart :: (BoxClass self, WidgetClass child) => self
-> child
-> Packing
-> Int
-> IO ()
boxPackStart self child packing padding =
(\(Box arg1) (Widget arg2) arg3 arg4 arg5 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_box_pack_start argPtr1 argPtr2 arg3 arg4 arg5)
{-# LINE 184 "./Graphics/UI/Gtk/Abstract/Box.chs" #-}
(toBox self)
(toWidget child)
(fromBool expand)
(fromBool fill)
(fromIntegral padding)
where (expand, fill) = fromPacking packing
boxPackEnd :: (BoxClass self, WidgetClass child) => self
-> child
-> Packing
-> Int
-> IO ()
boxPackEnd self child packing padding =
(\(Box arg1) (Widget arg2) arg3 arg4 arg5 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_box_pack_end argPtr1 argPtr2 arg3 arg4 arg5)
{-# LINE 212 "./Graphics/UI/Gtk/Abstract/Box.chs" #-}
(toBox self)
(toWidget child)
(fromBool expand)
(fromBool fill)
(fromIntegral padding)
where (expand, fill) = fromPacking packing
{-# LINE 245 "./Graphics/UI/Gtk/Abstract/Box.chs" #-}
boxSetHomogeneous :: BoxClass self => self
-> Bool
-> IO ()
boxSetHomogeneous self homogeneous =
(\(Box arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_box_set_homogeneous argPtr1 arg2)
{-# LINE 254 "./Graphics/UI/Gtk/Abstract/Box.chs" #-}
(toBox self)
(fromBool homogeneous)
boxGetHomogeneous :: BoxClass self => self
-> IO Bool
boxGetHomogeneous self =
liftM toBool $
(\(Box arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_box_get_homogeneous argPtr1)
{-# LINE 265 "./Graphics/UI/Gtk/Abstract/Box.chs" #-}
(toBox self)
boxSetSpacing :: BoxClass self => self
-> Int
-> IO ()
boxSetSpacing self spacing =
(\(Box arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_box_set_spacing argPtr1 arg2)
{-# LINE 277 "./Graphics/UI/Gtk/Abstract/Box.chs" #-}
(toBox self)
(fromIntegral spacing)
boxReorderChild :: (BoxClass self, WidgetClass child) => self
-> child
-> Int
-> IO ()
boxReorderChild self child position =
(\(Box arg1) (Widget arg2) arg3 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_box_reorder_child argPtr1 argPtr2 arg3)
{-# LINE 296 "./Graphics/UI/Gtk/Abstract/Box.chs" #-}
(toBox self)
(toWidget child)
(fromIntegral position)
boxQueryChildPacking :: (BoxClass self, WidgetClass child) => self
-> child
-> IO (Packing,Int,PackType)
boxQueryChildPacking self child =
alloca $ \expandPtr ->
alloca $ \fillPtr ->
alloca $ \paddingPtr ->
alloca $ \packPtr -> do
(\(Box arg1) (Widget arg2) arg3 arg4 arg5 arg6 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_box_query_child_packing argPtr1 argPtr2 arg3 arg4 arg5 arg6)
{-# LINE 315 "./Graphics/UI/Gtk/Abstract/Box.chs" #-}
(toBox self)
(toWidget child)
expandPtr
fillPtr
paddingPtr
packPtr
expand <- liftM toBool $ peek expandPtr
fill <- liftM toBool $ peek fillPtr
padding <- liftM fromIntegral $ peek paddingPtr
pack <- liftM (toEnum.fromIntegral) $ peek packPtr
return (toPacking expand fill, padding, pack)
boxSetChildPacking :: (BoxClass self, WidgetClass child) => self
-> child
-> Packing
-> Int
-> PackType
-> IO ()
boxSetChildPacking self child packing padding packType =
(\(Box arg1) (Widget arg2) arg3 arg4 arg5 arg6 -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_box_set_child_packing argPtr1 argPtr2 arg3 arg4 arg5 arg6)
{-# LINE 337 "./Graphics/UI/Gtk/Abstract/Box.chs" #-}
(toBox self)
(toWidget child)
(fromBool expand)
(fromBool fill)
(fromIntegral padding)
((fromIntegral . fromEnum) packType)
where (expand, fill) = fromPacking packing
boxGetBaselinePosition :: BoxClass self => self
-> IO BaselinePosition
boxGetBaselinePosition self =
liftM (toEnum . fromIntegral) $
(\(Box arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_box_get_baseline_position argPtr1)
{-# LINE 352 "./Graphics/UI/Gtk/Abstract/Box.chs" #-}
(toBox self)
boxSetBaselinePosition :: BoxClass self => self
-> BaselinePosition
-> IO ()
boxSetBaselinePosition self position =
(\(Box arg1) arg2 -> withForeignPtr arg1 $ \argPtr1 ->gtk_box_set_baseline_position argPtr1 arg2)
{-# LINE 365 "./Graphics/UI/Gtk/Abstract/Box.chs" #-}
(toBox self)
(fromIntegral $ fromEnum position)
boxGetCenterWidget :: BoxClass self => self
-> IO Widget
boxGetCenterWidget self =
makeNewObject mkWidget $
(\(Box arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_box_get_center_widget argPtr1)
{-# LINE 376 "./Graphics/UI/Gtk/Abstract/Box.chs" #-}
(toBox self)
boxSetCenterWidget :: (BoxClass self, WidgetClass widget) => self
-> widget
-> IO ()
boxSetCenterWidget self position =
(\(Box arg1) (Widget arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_box_set_center_widget argPtr1 argPtr2)
{-# LINE 386 "./Graphics/UI/Gtk/Abstract/Box.chs" #-}
(toBox self)
(toWidget position)
boxGetSpacing :: BoxClass self => self
-> IO Int
boxGetSpacing self =
liftM fromIntegral $
(\(Box arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_box_get_spacing argPtr1)
{-# LINE 397 "./Graphics/UI/Gtk/Abstract/Box.chs" #-}
(toBox self)
boxSpacing :: BoxClass self => Attr self Int
boxSpacing = newAttr
boxGetSpacing
boxSetSpacing
boxHomogeneous :: BoxClass self => Attr self Bool
boxHomogeneous = newAttr
boxGetHomogeneous
boxSetHomogeneous
boxBaselinePosition :: BoxClass self => Attr self BaselinePosition
boxBaselinePosition = newAttr
boxGetBaselinePosition
boxSetBaselinePosition
boxCenterWidget :: (BoxClass self, WidgetClass widget) => ReadWriteAttr self Widget widget
boxCenterWidget = newAttr
boxGetCenterWidget
boxSetCenterWidget
boxChildPacking :: (BoxClass self, WidgetClass child) => child -> Attr self Packing
boxChildPacking child = newAttr
(\container -> do
expand <- containerChildGetPropertyBool "expand" child container
fill <- containerChildGetPropertyBool "fill" child container
return (toPacking expand fill))
(\container packing ->
case fromPacking packing of
(expand, fill) -> do
containerChildSetPropertyBool "expand" child container expand
containerChildSetPropertyBool "fill" child container fill)
boxChildPadding :: (BoxClass self, WidgetClass child) => child -> Attr self Int
boxChildPadding = newAttrFromContainerChildUIntProperty "padding"
boxChildPackType :: (BoxClass self, WidgetClass child) => child -> Attr self PackType
boxChildPackType = newAttrFromContainerChildEnumProperty "pack-type"
gtk_pack_type_get_type
{-# LINE 477 "./Graphics/UI/Gtk/Abstract/Box.chs" #-}
boxChildPosition :: (BoxClass self, WidgetClass child) => child -> Attr self Int
boxChildPosition = newAttrFromContainerChildIntProperty "position"
foreign import ccall safe "gtk_box_pack_start"
gtk_box_pack_start :: ((Ptr Box) -> ((Ptr Widget) -> (CInt -> (CInt -> (CUInt -> (IO ()))))))
foreign import ccall safe "gtk_box_pack_end"
gtk_box_pack_end :: ((Ptr Box) -> ((Ptr Widget) -> (CInt -> (CInt -> (CUInt -> (IO ()))))))
foreign import ccall safe "gtk_box_set_homogeneous"
gtk_box_set_homogeneous :: ((Ptr Box) -> (CInt -> (IO ())))
foreign import ccall safe "gtk_box_get_homogeneous"
gtk_box_get_homogeneous :: ((Ptr Box) -> (IO CInt))
foreign import ccall safe "gtk_box_set_spacing"
gtk_box_set_spacing :: ((Ptr Box) -> (CInt -> (IO ())))
foreign import ccall safe "gtk_box_reorder_child"
gtk_box_reorder_child :: ((Ptr Box) -> ((Ptr Widget) -> (CInt -> (IO ()))))
foreign import ccall unsafe "gtk_box_query_child_packing"
gtk_box_query_child_packing :: ((Ptr Box) -> ((Ptr Widget) -> ((Ptr CInt) -> ((Ptr CInt) -> ((Ptr CUInt) -> ((Ptr CInt) -> (IO ())))))))
foreign import ccall safe "gtk_box_set_child_packing"
gtk_box_set_child_packing :: ((Ptr Box) -> ((Ptr Widget) -> (CInt -> (CInt -> (CUInt -> (CInt -> (IO ())))))))
foreign import ccall unsafe "gtk_box_get_baseline_position"
gtk_box_get_baseline_position :: ((Ptr Box) -> (IO CInt))
foreign import ccall unsafe "gtk_box_set_baseline_position"
gtk_box_set_baseline_position :: ((Ptr Box) -> (CInt -> (IO ())))
foreign import ccall unsafe "gtk_box_get_center_widget"
gtk_box_get_center_widget :: ((Ptr Box) -> (IO (Ptr Widget)))
foreign import ccall unsafe "gtk_box_set_center_widget"
gtk_box_set_center_widget :: ((Ptr Box) -> ((Ptr Widget) -> (IO ())))
foreign import ccall unsafe "gtk_box_get_spacing"
gtk_box_get_spacing :: ((Ptr Box) -> (IO CInt))
foreign import ccall unsafe "gtk_pack_type_get_type"
gtk_pack_type_get_type :: CUInt