module Graphics.UI.Gtk.Windows.WindowGroup (
WindowGroup,
WindowGroupClass,
castToWindowGroup, gTypeWindowGroup,
toWindowGroup,
windowGroupNew,
windowGroupAddWindow,
windowGroupRemoveWindow,
windowGroupListWindows,
) where
import System.Glib.FFI
import System.Glib.GObject (wrapNewGObject)
import System.Glib.GList (fromGList)
import Graphics.UI.Gtk.Types
windowGroupNew :: IO WindowGroup
windowGroupNew =
wrapNewGObject mkWindowGroup $
gtk_window_group_new
windowGroupAddWindow :: (WindowGroupClass self, WindowClass window) => self
-> window
-> IO ()
windowGroupAddWindow self window =
(\(WindowGroup arg1) (Window arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_window_group_add_window argPtr1 argPtr2)
(toWindowGroup self)
(toWindow window)
windowGroupRemoveWindow :: (WindowGroupClass self, WindowClass window) => self
-> window
-> IO ()
windowGroupRemoveWindow self window =
(\(WindowGroup arg1) (Window arg2) -> withForeignPtr arg1 $ \argPtr1 ->withForeignPtr arg2 $ \argPtr2 ->gtk_window_group_remove_window argPtr1 argPtr2)
(toWindowGroup self)
(toWindow window)
windowGroupListWindows :: WindowGroupClass self
=> self
-> IO [Window]
windowGroupListWindows self = do
glist <- (\(WindowGroup arg1) -> withForeignPtr arg1 $ \argPtr1 ->gtk_window_group_list_windows argPtr1) (toWindowGroup self)
ptrList <- fromGList glist
mapM (makeNewGObject mkWindow . return) ptrList
foreign import ccall safe "gtk_window_group_new"
gtk_window_group_new :: (IO (Ptr WindowGroup))
foreign import ccall safe "gtk_window_group_add_window"
gtk_window_group_add_window :: ((Ptr WindowGroup) -> ((Ptr Window) -> (IO ())))
foreign import ccall safe "gtk_window_group_remove_window"
gtk_window_group_remove_window :: ((Ptr WindowGroup) -> ((Ptr Window) -> (IO ())))
foreign import ccall safe "gtk_window_group_list_windows"
gtk_window_group_list_windows :: ((Ptr WindowGroup) -> (IO (Ptr ())))