{-# LINE 2 "./Graphics/UI/Gtk/Gdk/DisplayManager.chs" #-}
module Graphics.UI.Gtk.Gdk.DisplayManager (
DisplayManager,
DisplayManagerClass,
castToDisplayManager,
toDisplayManager,
displayManagerGet,
displayManagerListDisplays,
displayManagerDefaultDisplay,
displayManagerOpened,
) where
import System.Glib.FFI
import System.Glib.Attributes
import System.Glib.Properties
import System.Glib.GList
import Graphics.UI.Gtk.Types
{-# LINE 70 "./Graphics/UI/Gtk/Gdk/DisplayManager.chs" #-}
import Graphics.UI.Gtk.Signals
{-# LINE 71 "./Graphics/UI/Gtk/Gdk/DisplayManager.chs" #-}
{-# LINE 73 "./Graphics/UI/Gtk/Gdk/DisplayManager.chs" #-}
displayManagerGet :: IO DisplayManager
displayManagerGet :: IO DisplayManager
displayManagerGet =
(ForeignPtr DisplayManager -> DisplayManager,
FinalizerPtr DisplayManager)
-> IO (Ptr DisplayManager) -> IO DisplayManager
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
constructNewGObject (ForeignPtr DisplayManager -> DisplayManager,
FinalizerPtr DisplayManager)
forall {a}.
(ForeignPtr DisplayManager -> DisplayManager, FinalizerPtr a)
mkDisplayManager (IO (Ptr DisplayManager) -> IO DisplayManager)
-> IO (Ptr DisplayManager) -> IO DisplayManager
forall a b. (a -> b) -> a -> b
$
IO (Ptr DisplayManager)
gdk_display_manager_get
{-# LINE 85 "./Graphics/UI/Gtk/Gdk/DisplayManager.chs" #-}
displayManagerListDisplays :: DisplayManagerClass self => self
-> IO [Display]
displayManagerListDisplays :: forall self. DisplayManagerClass self => self -> IO [Display]
displayManagerListDisplays self
self =
(\(DisplayManager ForeignPtr DisplayManager
arg1) -> ForeignPtr DisplayManager
-> (Ptr DisplayManager -> IO (Ptr ())) -> IO (Ptr ())
forall a b. ForeignPtr a -> (Ptr a -> IO b) -> IO b
withForeignPtr ForeignPtr DisplayManager
arg1 ((Ptr DisplayManager -> IO (Ptr ())) -> IO (Ptr ()))
-> (Ptr DisplayManager -> IO (Ptr ())) -> IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ \Ptr DisplayManager
argPtr1 ->Ptr DisplayManager -> IO (Ptr ())
gdk_display_manager_list_displays Ptr DisplayManager
argPtr1)
{-# LINE 92 "./Graphics/UI/Gtk/Gdk/DisplayManager.chs" #-}
(toDisplayManager self)
IO (Ptr ()) -> (Ptr () -> IO [Ptr Display]) -> IO [Ptr Display]
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Ptr () -> IO [Ptr Display]
forall a. Ptr () -> IO [Ptr a]
fromGSList
IO [Ptr Display] -> ([Ptr Display] -> IO [Display]) -> IO [Display]
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (Ptr Display -> IO Display) -> [Ptr Display] -> IO [Display]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM ((ForeignPtr Display -> Display, FinalizerPtr Display)
-> IO (Ptr Display) -> IO Display
forall obj.
GObjectClass obj =>
(ForeignPtr obj -> obj, FinalizerPtr obj) -> IO (Ptr obj) -> IO obj
makeNewGObject (ForeignPtr Display -> Display, FinalizerPtr Display)
forall {a}. (ForeignPtr Display -> Display, FinalizerPtr a)
mkDisplay (IO (Ptr Display) -> IO Display)
-> (Ptr Display -> IO (Ptr Display)) -> Ptr Display -> IO Display
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ptr Display -> IO (Ptr Display)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return)
displayManagerDefaultDisplay :: DisplayManagerClass self => Attr self Display
displayManagerDefaultDisplay :: forall self. DisplayManagerClass self => Attr self Display
displayManagerDefaultDisplay = String -> GType -> ReadWriteAttr self Display Display
forall gobj gobj' gobj''.
(GObjectClass gobj, GObjectClass gobj', GObjectClass gobj'') =>
String -> GType -> ReadWriteAttr gobj gobj' gobj''
newAttrFromObjectProperty String
"default-display"
GType
gdk_display_get_type
{-# LINE 104 "./Graphics/UI/Gtk/Gdk/DisplayManager.chs" #-}
displayManagerOpened :: DisplayManagerClass self => Signal self (Display -> IO ())
displayManagerOpened :: forall self.
DisplayManagerClass self =>
Signal self (Display -> IO ())
displayManagerOpened = (Bool -> self -> (Display -> IO ()) -> IO (ConnectId self))
-> Signal self (Display -> IO ())
forall object handler.
(Bool -> object -> handler -> IO (ConnectId object))
-> Signal object handler
Signal (String -> Bool -> self -> (Display -> IO ()) -> IO (ConnectId self)
forall a' obj.
(GObjectClass a', GObjectClass obj) =>
String -> Bool -> obj -> (a' -> IO ()) -> IO (ConnectId obj)
connect_OBJECT__NONE String
"display_opened")
foreign import ccall safe "gdk_display_manager_get"
gdk_display_manager_get :: (IO (Ptr DisplayManager))
foreign import ccall safe "gdk_display_manager_list_displays"
gdk_display_manager_list_displays :: ((Ptr DisplayManager) -> (IO (Ptr ())))
foreign import ccall unsafe "gdk_display_get_type"
gdk_display_get_type :: CULong