{-# LINE 2 "./Graphics/UI/Gtk/Layout/Fixed.chs" #-}
module Graphics.UI.Gtk.Layout.Fixed (
Fixed,
FixedClass,
castToFixed, gTypeFixed,
toFixed,
fixedNew,
fixedPut,
fixedMove,
fixedChildX,
fixedChildY,
) where
import Control.Monad (liftM)
import System.Glib.FFI
import System.Glib.Attributes
import Graphics.UI.Gtk.Abstract.Object (makeNewObject)
import Graphics.UI.Gtk.Types
{-# LINE 105 "./Graphics/UI/Gtk/Layout/Fixed.chs" #-}
import Graphics.UI.Gtk.Abstract.ContainerChildProperties
{-# LINE 108 "./Graphics/UI/Gtk/Layout/Fixed.chs" #-}
fixedNew :: IO Fixed
fixedNew :: IO Fixed
fixedNew =
(ForeignPtr Fixed -> Fixed, FinalizerPtr Fixed)
-> IO (Ptr Fixed) -> IO Fixed
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewObject (ForeignPtr Fixed -> Fixed, FinalizerPtr Fixed)
forall {a}. (ForeignPtr Fixed -> Fixed, FinalizerPtr a)
mkFixed (IO (Ptr Fixed) -> IO Fixed) -> IO (Ptr Fixed) -> IO Fixed
forall a b. (a -> b) -> a -> b
$
(Ptr Widget -> Ptr Fixed) -> IO (Ptr Widget) -> IO (Ptr Fixed)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
liftM (Ptr Widget -> Ptr Fixed
forall a b. Ptr a -> Ptr b
castPtr :: Ptr Widget -> Ptr Fixed) (IO (Ptr Widget) -> IO (Ptr Fixed))
-> IO (Ptr Widget) -> IO (Ptr Fixed)
forall a b. (a -> b) -> a -> b
$
IO (Ptr Widget)
gtk_fixed_new
{-# LINE 119 "./Graphics/UI/Gtk/Layout/Fixed.chs" #-}
fixedPut :: (FixedClass self, WidgetClass widget) => self
-> widget
-> (Int, Int)
-> IO ()
fixedPut :: forall self widget.
(FixedClass self, WidgetClass widget) =>
self -> widget -> (Int, Int) -> IO ()
fixedPut self
self widget
widget (Int
x, Int
y) =
(\(Fixed ForeignPtr Fixed
arg1) (Widget ForeignPtr Widget
arg2) CInt
arg3 CInt
arg4 -> ForeignPtr Fixed -> (Ptr Fixed -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Fixed
arg1 ((Ptr Fixed -> IO ()) -> IO ()) -> (Ptr Fixed -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Fixed
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 Fixed -> Ptr Widget -> CInt -> CInt -> IO ()
gtk_fixed_put Ptr Fixed
argPtr1 Ptr Widget
argPtr2 CInt
arg3 CInt
arg4)
{-# LINE 132 "./Graphics/UI/Gtk/Layout/Fixed.chs" #-}
(toFixed self)
(widget -> Widget
forall o. WidgetClass o => o -> Widget
toWidget widget
widget)
(Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x)
(Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
y)
fixedMove :: (FixedClass self, WidgetClass widget) => self
-> widget
-> (Int, Int)
-> IO ()
fixedMove :: forall self widget.
(FixedClass self, WidgetClass widget) =>
self -> widget -> (Int, Int) -> IO ()
fixedMove self
self widget
widget (Int
x, Int
y) =
(\(Fixed ForeignPtr Fixed
arg1) (Widget ForeignPtr Widget
arg2) CInt
arg3 CInt
arg4 -> ForeignPtr Fixed -> (Ptr Fixed -> IO ()) -> IO ()
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr Fixed
arg1 ((Ptr Fixed -> IO ()) -> IO ()) -> (Ptr Fixed -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Fixed
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 Fixed -> Ptr Widget -> CInt -> CInt -> IO ()
gtk_fixed_move Ptr Fixed
argPtr1 Ptr Widget
argPtr2 CInt
arg3 CInt
arg4)
{-# LINE 146 "./Graphics/UI/Gtk/Layout/Fixed.chs" #-}
(toFixed self)
(widget -> Widget
forall o. WidgetClass o => o -> Widget
toWidget widget
widget)
(Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
x)
(Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
y)
{-# LINE 188 "./Graphics/UI/Gtk/Layout/Fixed.chs" #-}
fixedChildX :: (FixedClass self, WidgetClass child) => child -> Attr self Int
fixedChildX :: forall self child.
(FixedClass self, WidgetClass child) =>
child -> Attr self Int
fixedChildX = String -> child -> Attr self Int
forall container child.
(ContainerClass container, WidgetClass child) =>
String -> child -> Attr container Int
newAttrFromContainerChildIntProperty String
"x"
fixedChildY :: (FixedClass self, WidgetClass child) => child -> Attr self Int
fixedChildY :: forall self child.
(FixedClass self, WidgetClass child) =>
child -> Attr self Int
fixedChildY = String -> child -> Attr self Int
forall container child.
(ContainerClass container, WidgetClass child) =>
String -> child -> Attr container Int
newAttrFromContainerChildIntProperty String
"y"
foreign import ccall unsafe "gtk_fixed_new"
gtk_fixed_new :: (IO (Ptr Widget))
foreign import ccall safe "gtk_fixed_put"
gtk_fixed_put :: ((Ptr Fixed) -> ((Ptr Widget) -> (CInt -> (CInt -> (IO ())))))
foreign import ccall safe "gtk_fixed_move"
gtk_fixed_move :: ((Ptr Fixed) -> ((Ptr Widget) -> (CInt -> (CInt -> (IO ())))))