{-# LINE 2 "./Graphics/UI/Gtk/Abstract/ButtonBox.chs" #-}
module Graphics.UI.Gtk.Abstract.ButtonBox (
ButtonBox,
ButtonBoxClass,
castToButtonBox, gTypeButtonBox,
toButtonBox,
ButtonBoxStyle(..),
buttonBoxGetLayout,
buttonBoxSetLayout,
buttonBoxSetChildSecondary,
buttonBoxGetChildSecondary,
buttonBoxSetChildNonHomogeneous,
buttonBoxGetChildNonHomogeneous,
buttonBoxLayoutStyle,
buttonBoxChildSecondary,
buttonBoxChildNonHomogeneous,
) where
import Control.Monad (liftM)
import System.Glib.FFI
import System.Glib.Attributes
import Graphics.UI.Gtk.Types
{-# LINE 100 "./Graphics/UI/Gtk/Abstract/ButtonBox.chs" #-}
import Graphics.UI.Gtk.General.Enums (ButtonBoxStyle(..))
import Graphics.UI.Gtk.Abstract.ContainerChildProperties
{-# LINE 104 "./Graphics/UI/Gtk/Abstract/ButtonBox.chs" #-}
buttonBoxGetLayout :: ButtonBoxClass self => self -> IO ButtonBoxStyle
buttonBoxGetLayout :: forall self. ButtonBoxClass self => self -> IO ButtonBoxStyle
buttonBoxGetLayout self
self =
(CInt -> ButtonBoxStyle) -> IO CInt -> IO ButtonBoxStyle
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Int -> ButtonBoxStyle
forall a. Enum a => Int -> a
toEnum (Int -> ButtonBoxStyle) -> (CInt -> Int) -> CInt -> ButtonBoxStyle
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) (IO CInt -> IO ButtonBoxStyle) -> IO CInt -> IO ButtonBoxStyle
forall a b. (a -> b) -> a -> b
$
(\(ButtonBox ForeignPtr ButtonBox
arg1) -> ForeignPtr ButtonBox -> (Ptr ButtonBox -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr ButtonBox
arg1 ((Ptr ButtonBox -> IO CInt) -> IO CInt)
-> (Ptr ButtonBox -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr ButtonBox
argPtr1 ->Ptr ButtonBox -> IO CInt
gtk_button_box_get_layout Ptr ButtonBox
argPtr1)
{-# LINE 114 "./Graphics/UI/Gtk/Abstract/ButtonBox.chs" #-}
(toButtonBox self)
buttonBoxGetChildSecondary :: (ButtonBoxClass self, WidgetClass child) => self
-> child
-> IO Bool
buttonBoxGetChildSecondary :: forall self child.
(ButtonBoxClass self, WidgetClass child) =>
self -> child -> IO Bool
buttonBoxGetChildSecondary self
self child
child =
(CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
(\(ButtonBox ForeignPtr ButtonBox
arg1) (Widget ForeignPtr Widget
arg2) -> ForeignPtr ButtonBox -> (Ptr ButtonBox -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr ButtonBox
arg1 ((Ptr ButtonBox -> IO CInt) -> IO CInt)
-> (Ptr ButtonBox -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr ButtonBox
argPtr1 ->ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg2 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr2 ->Ptr ButtonBox -> Ptr Widget -> IO CInt
gtk_button_box_get_child_secondary Ptr ButtonBox
argPtr1 Ptr Widget
argPtr2)
{-# LINE 128 "./Graphics/UI/Gtk/Abstract/ButtonBox.chs" #-}
(toButtonBox self)
(child -> Widget
forall o. WidgetClass o => o -> Widget
toWidget child
child)
buttonBoxSetChildNonHomogeneous :: (ButtonBoxClass self, WidgetClass child) => self
-> child
-> Bool
-> IO ()
buttonBoxSetChildNonHomogeneous :: forall self child.
(ButtonBoxClass self, WidgetClass child) =>
self -> child -> Bool -> IO ()
buttonBoxSetChildNonHomogeneous self
self child
child Bool
nonHomogeneous =
(\(ButtonBox ForeignPtr ButtonBox
arg1) (Widget ForeignPtr Widget
arg2) CInt
arg3 -> ForeignPtr ButtonBox -> (Ptr ButtonBox -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr ButtonBox
arg1 ((Ptr ButtonBox -> IO ()) -> IO ())
-> (Ptr ButtonBox -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr ButtonBox
argPtr1 ->ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg2 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr2 ->Ptr ButtonBox -> Ptr Widget -> CInt -> IO ()
gtk_button_box_set_child_non_homogeneous Ptr ButtonBox
argPtr1 Ptr Widget
argPtr2 CInt
arg3)
{-# LINE 141 "./Graphics/UI/Gtk/Abstract/ButtonBox.chs" #-}
(toButtonBox self)
(child -> Widget
forall o. WidgetClass o => o -> Widget
toWidget child
child)
(Bool -> CInt
forall a. Num a => Bool -> a
fromBool Bool
nonHomogeneous)
buttonBoxGetChildNonHomogeneous :: (ButtonBoxClass self, WidgetClass child) => self
-> child
-> IO Bool
buttonBoxGetChildNonHomogeneous :: forall self child.
(ButtonBoxClass self, WidgetClass child) =>
self -> child -> IO Bool
buttonBoxGetChildNonHomogeneous self
self child
child =
(CInt -> Bool) -> IO CInt -> IO Bool
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM CInt -> Bool
forall a. (Eq a, Num a) => a -> Bool
toBool (IO CInt -> IO Bool) -> IO CInt -> IO Bool
forall a b. (a -> b) -> a -> b
$
(\(ButtonBox ForeignPtr ButtonBox
arg1) (Widget ForeignPtr Widget
arg2) -> ForeignPtr ButtonBox -> (Ptr ButtonBox -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr ButtonBox
arg1 ((Ptr ButtonBox -> IO CInt) -> IO CInt)
-> (Ptr ButtonBox -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr ButtonBox
argPtr1 ->ForeignPtr Widget -> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg2 ((Ptr Widget -> IO CInt) -> IO CInt)
-> (Ptr Widget -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr2 ->Ptr ButtonBox -> Ptr Widget -> IO CInt
gtk_button_box_get_child_non_homogeneous Ptr ButtonBox
argPtr1 Ptr Widget
argPtr2)
{-# LINE 153 "./Graphics/UI/Gtk/Abstract/ButtonBox.chs" #-}
(toButtonBox self)
(child -> Widget
forall o. WidgetClass o => o -> Widget
toWidget child
child)
buttonBoxSetLayout :: ButtonBoxClass self => self
-> ButtonBoxStyle
-> IO ()
buttonBoxSetLayout :: forall self. ButtonBoxClass self => self -> ButtonBoxStyle -> IO ()
buttonBoxSetLayout self
self ButtonBoxStyle
layoutStyle =
(\(ButtonBox ForeignPtr ButtonBox
arg1) CInt
arg2 -> ForeignPtr ButtonBox -> (Ptr ButtonBox -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr ButtonBox
arg1 ((Ptr ButtonBox -> IO ()) -> IO ())
-> (Ptr ButtonBox -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr ButtonBox
argPtr1 ->Ptr ButtonBox -> CInt -> IO ()
gtk_button_box_set_layout Ptr ButtonBox
argPtr1 CInt
arg2)
{-# LINE 164 "./Graphics/UI/Gtk/Abstract/ButtonBox.chs" #-}
(toButtonBox self)
((Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (ButtonBoxStyle -> Int) -> ButtonBoxStyle -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ButtonBoxStyle -> Int
forall a. Enum a => a -> Int
fromEnum) ButtonBoxStyle
layoutStyle)
buttonBoxSetChildSecondary :: (ButtonBoxClass self, WidgetClass child) => self
-> child
-> Bool
-> IO ()
buttonBoxSetChildSecondary :: forall self child.
(ButtonBoxClass self, WidgetClass child) =>
self -> child -> Bool -> IO ()
buttonBoxSetChildSecondary self
self child
child Bool
isSecondary =
(\(ButtonBox ForeignPtr ButtonBox
arg1) (Widget ForeignPtr Widget
arg2) CInt
arg3 -> ForeignPtr ButtonBox -> (Ptr ButtonBox -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr ButtonBox
arg1 ((Ptr ButtonBox -> IO ()) -> IO ())
-> (Ptr ButtonBox -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr ButtonBox
argPtr1 ->ForeignPtr Widget -> (Ptr Widget -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Widget
arg2 ((Ptr Widget -> IO ()) -> IO ()) -> (Ptr Widget -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Widget
argPtr2 ->Ptr ButtonBox -> Ptr Widget -> CInt -> IO ()
gtk_button_box_set_child_secondary Ptr ButtonBox
argPtr1 Ptr Widget
argPtr2 CInt
arg3)
{-# LINE 186 "./Graphics/UI/Gtk/Abstract/ButtonBox.chs" #-}
(toButtonBox self)
(child -> Widget
forall o. WidgetClass o => o -> Widget
toWidget child
child)
(Bool -> CInt
forall a. Num a => Bool -> a
fromBool Bool
isSecondary)
buttonBoxLayoutStyle :: ButtonBoxClass self => Attr self ButtonBoxStyle
buttonBoxLayoutStyle :: forall self. ButtonBoxClass self => Attr self ButtonBoxStyle
buttonBoxLayoutStyle = (self -> IO ButtonBoxStyle)
-> (self -> ButtonBoxStyle -> IO ())
-> ReadWriteAttr self ButtonBoxStyle ButtonBoxStyle
forall o a b.
(o -> IO a) -> (o -> b -> IO ()) -> ReadWriteAttr o a b
newAttr
self -> IO ButtonBoxStyle
forall self. ButtonBoxClass self => self -> IO ButtonBoxStyle
buttonBoxGetLayout
self -> ButtonBoxStyle -> IO ()
forall self. ButtonBoxClass self => self -> ButtonBoxStyle -> IO ()
buttonBoxSetLayout
buttonBoxChildSecondary :: (ButtonBoxClass self, WidgetClass child) => child -> Attr self Bool
buttonBoxChildSecondary :: forall self child.
(ButtonBoxClass self, WidgetClass child) =>
child -> Attr self Bool
buttonBoxChildSecondary = String -> child -> Attr self Bool
forall container child.
(ContainerClass container, WidgetClass child) =>
String -> child -> Attr container Bool
newAttrFromContainerChildBoolProperty String
"secondary"
buttonBoxChildNonHomogeneous :: (ButtonBoxClass self, WidgetClass child) => child -> Attr self Bool
buttonBoxChildNonHomogeneous :: forall self child.
(ButtonBoxClass self, WidgetClass child) =>
child -> Attr self Bool
buttonBoxChildNonHomogeneous = String -> child -> Attr self Bool
forall container child.
(ContainerClass container, WidgetClass child) =>
String -> child -> Attr container Bool
newAttrFromContainerChildBoolProperty String
"non-homogeneous"
foreign import ccall safe "gtk_button_box_get_layout"
gtk_button_box_get_layout :: ((Ptr ButtonBox) -> (IO CInt))
foreign import ccall safe "gtk_button_box_get_child_secondary"
gtk_button_box_get_child_secondary :: ((Ptr ButtonBox) -> ((Ptr Widget) -> (IO CInt)))
foreign import ccall safe "gtk_button_box_set_child_non_homogeneous"
gtk_button_box_set_child_non_homogeneous :: ((Ptr ButtonBox) -> ((Ptr Widget) -> (CInt -> (IO ()))))
foreign import ccall safe "gtk_button_box_get_child_non_homogeneous"
gtk_button_box_get_child_non_homogeneous :: ((Ptr ButtonBox) -> ((Ptr Widget) -> (IO CInt)))
foreign import ccall safe "gtk_button_box_set_layout"
gtk_button_box_set_layout :: ((Ptr ButtonBox) -> (CInt -> (IO ())))
foreign import ccall safe "gtk_button_box_set_child_secondary"
gtk_button_box_set_child_secondary :: ((Ptr ButtonBox) -> ((Ptr Widget) -> (CInt -> (IO ()))))