gi-gdk-4.0.1: Gdk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gdk.Objects.Display

Description

GdkDisplay objects are the GDK representation of a workstation.

Their purpose are two-fold:

  • To manage and provide information about input devices (pointers, keyboards, etc)
  • To manage and provide information about output devices (monitors, projectors, etc)

Most of the input device handling has been factored out into separate Seat objects. Every display has a one or more seats, which can be accessed with displayGetDefaultSeat and displayListSeats.

Output devices are represented by Monitor objects, which can be accessed with displayGetMonitor and similar APIs.

Synopsis

Exported types

newtype Display Source #

Memory-managed wrapper type.

Constructors

Display (ManagedPtr Display) 

Instances

Instances details
Eq Display Source # 
Instance details

Defined in GI.Gdk.Objects.Display

Methods

(==) :: Display -> Display -> Bool #

(/=) :: Display -> Display -> Bool #

GObject Display Source # 
Instance details

Defined in GI.Gdk.Objects.Display

Methods

gobjectType :: IO GType #

IsGValue Display Source #

Convert Display to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gdk.Objects.Display

HasParentTypes Display Source # 
Instance details

Defined in GI.Gdk.Objects.Display

type ParentTypes Display Source # 
Instance details

Defined in GI.Gdk.Objects.Display

class (GObject o, IsDescendantOf Display o) => IsDisplay o Source #

Type class for types which can be safely cast to Display, for instance with toDisplay.

Instances

Instances details
(GObject o, IsDescendantOf Display o) => IsDisplay o Source # 
Instance details

Defined in GI.Gdk.Objects.Display

toDisplay :: (MonadIO m, IsDisplay o) => o -> m Display Source #

Cast to Display, for types for which this is known to be safe. For general casts, use castTo.

noDisplay :: Maybe Display Source #

A convenience alias for Nothing :: Maybe Display.

Methods

Overloaded methods

beep

displayBeep Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m () 

Emits a short beep on display

close

displayClose Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m () 

Closes the connection to the windowing system for the given display, and cleans up associated resources.

deviceIsGrabbed

displayDeviceIsGrabbed Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a, IsDevice b) 
=> a

display: a Display

-> b

device: a Device

-> m Bool

Returns: True if there is a grab in effect for device.

Returns True if there is an ongoing grab on device for display.

flush

displayFlush Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m () 

Flushes any requests queued for the windowing system; this happens automatically when the main loop blocks waiting for new events, but if your application is drawing without returning control to the main loop, you may need to call this function explicitly. A common case where this function needs to be called is when an application is executing drawing commands from a thread other than the thread where the main loop is running.

This is most useful for X11. On windowing systems where requests are handled synchronously, this function will do nothing.

getAppLaunchContext

displayGetAppLaunchContext Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m AppLaunchContext

Returns: a new AppLaunchContext for display. Free with objectUnref when done

Returns a AppLaunchContext suitable for launching applications on the given display.

getClipboard

displayGetClipboard Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m Clipboard

Returns: the display's clipboard

Gets the clipboard used for copy/paste operations.

getDefault

displayGetDefault Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m (Maybe Display)

Returns: a Display, or Nothing if there is no default display.

Gets the default Display. This is a convenience function for: gdk_display_manager_get_default_display (gdk_display_manager_get ()).

getDefaultGroup

displayGetDefaultGroup Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m Surface

Returns: The default group leader surface for display

Returns the default group leader surface for all toplevel surfaces on display. This surface is implicitly created by GDK. See gdk_surface_set_group().

getDefaultSeat

displayGetDefaultSeat Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m Seat

Returns: the default seat.

Returns the default Seat for this display.

getEvent

displayGetEvent Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m (Maybe Event)

Returns: the next GdkEvent to be processed, or Nothing if no events are pending

Gets the next GdkEvent to be processed for display, fetching events from the windowing system if necessary.

getKeymap

displayGetKeymap Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: the Display

-> m Keymap

Returns: the Keymap attached to display.

Returns the Keymap attached to display.

getMonitor

displayGetMonitor Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> Int32

monitorNum: number of the monitor

-> m (Maybe Monitor)

Returns: the Monitor, or Nothing if monitorNum is not a valid monitor number

Gets a monitor associated with this display.

getMonitorAtPoint

displayGetMonitorAtPoint Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> Int32

x: the x coordinate of the point

-> Int32

y: the y coordinate of the point

-> m Monitor

Returns: the monitor containing the point

Gets the monitor in which the point (x, y) is located, or a nearby monitor if the point is not in any monitor.

getMonitorAtSurface

displayGetMonitorAtSurface Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a, IsSurface b) 
=> a

display: a Display

-> b

surface: a Surface

-> m Monitor

Returns: the monitor with the largest overlap with surface

Gets the monitor in which the largest area of surface resides, or a monitor close to surface if it is outside of all monitors.

getNMonitors

displayGetNMonitors Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m Int32

Returns: the number of monitors

Gets the number of monitors that belong to display.

The returned number is valid until the next emission of the monitorAdded or monitorRemoved signal.

getName

displayGetName Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m Text

Returns: a string representing the display name. This string is owned by GDK and should not be modified or freed.

Gets the name of the display.

getPrimaryClipboard

displayGetPrimaryClipboard Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m Clipboard

Returns: the primary clipboard

Gets the clipboard used for the primary selection. On backends where the primary clipboard is not supported natively, GDK emulates this clipboard locally.

getPrimaryMonitor

displayGetPrimaryMonitor Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m Monitor

Returns: the primary monitor, or any monitor if no primary monitor is configured by the user

Gets the primary monitor for the display.

The primary monitor is considered the monitor where the “main desktop” lives. While normal application surfaces typically allow the window manager to place the surfaces, specialized desktop applications such as panels should place themselves on the primary monitor.

If no monitor is the designated primary monitor, any monitor (usually the first) may be returned. To make sure there is a dedicated primary monitor, use monitorIsPrimary on the returned monitor.

getSetting

displayGetSetting Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> Text

name: the name of the setting

-> GValue

value: location to store the value of the setting

-> m Bool

Returns: True if the setting existed and a value was stored in value, False otherwise

Retrieves a desktop-wide setting such as double-click time for the display.

getStartupNotificationId

displayGetStartupNotificationId Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m Text

Returns: the startup notification ID for display, or Nothing

Gets the startup notification ID for a Wayland display, or Nothing if no ID has been defined.

hasPending

displayHasPending Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m Bool

Returns: True if there are events ready to be processed.

Returns whether the display has events that are waiting to be processed.

isClosed

displayIsClosed Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m Bool

Returns: True if the display is closed.

Finds out if the display has been closed.

isComposited

displayIsComposited Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m Bool

Returns: Whether surfaces with RGBA visuals can reasonably be expected to have their alpha channels drawn correctly on the screen.

Returns whether surfaces can reasonably be expected to have their alpha channel drawn correctly on the screen. Check displayIsRgba for wether the display supports an alpha channel.

On X11 this function returns whether a compositing manager is compositing on display.

On modern displays, this value is always True.

isRgba

displayIsRgba Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m Bool

Returns: True if surfaces are created with an alpha channel or False if the display does not support this functionality.

Returns wether surfaces on this display are created with an alpha channel.

Even if a True is returned, it is possible that the surface’s alpha channel won’t be honored when displaying the surface on the screen: in particular, for X an appropriate windowing manager and compositing manager must be running to provide appropriate display. Use displayIsComposited to check if that is the case.

For setting an overall opacity for a top-level surface, see surfaceSetOpacity.

On modern displays, this value is always True.

listSeats

displayListSeats Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m [Seat]

Returns: the list of seats known to the Display

Returns the list of seats known to display.

notifyStartupComplete

displayNotifyStartupComplete Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> Text

startupId: a startup-notification identifier, for which notification process should be completed

-> m () 

Indicates to the GUI environment that the application has finished loading, using a given identifier.

GTK+ will call this function automatically for GtkWindow with custom startup-notification identifier unless gtk_window_set_auto_startup_notification() is called to disable that feature.

open

displayOpen Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

displayName: the name of the display to open

-> m (Maybe Display)

Returns: a Display, or Nothing if the display could not be opened

Opens a display.

peekEvent

displayPeekEvent Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m (Maybe Event)

Returns: the first GdkEvent on the event queue

Gets a copy of the first GdkEvent in the display’s event queue, without removing the event from the queue. (Note that this function will not get more events from the windowing system. It only checks the events that have already been moved to the GDK event queue.)

putEvent

displayPutEvent Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a, IsEvent b) 
=> a

display: a Display

-> b

event: a GdkEvent.

-> m () 

Appends a copy of the given event onto the front of the event queue for display.

supportsInputShapes

displaySupportsInputShapes Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m Bool

Returns: True if surfaces with modified input shape are supported

Returns True if gdk_surface_input_shape_combine_mask() can be used to modify the input shape of surfaces on display.

supportsShapes

displaySupportsShapes Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m Bool

Returns: True if shaped windows are supported

Returns True if gdk_surface_shape_combine_mask() can be used to create shaped windows on display.

sync

displaySync Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: a Display

-> m () 

Flushes any requests queued for the windowing system and waits until all requests have been handled. This is often used for making sure that the display is synchronized with the current state of the program. Calling displaySync before gdk_error_trap_pop() makes sure that any errors generated from earlier requests are handled before the error trap is removed.

This is most useful for X11. On windowing systems where requests are handled synchronously, this function will do nothing.

Properties

composited

True if the display properly composits the alpha channel. See displayIsComposited for details.

getDisplayComposited :: (MonadIO m, IsDisplay o) => o -> m Bool Source #

Get the value of the “composited” property. When overloading is enabled, this is equivalent to

get display #composited

rgba

True if the display supports an alpha channel. See displayIsRgba for details.

getDisplayRgba :: (MonadIO m, IsDisplay o) => o -> m Bool Source #

Get the value of the “rgba” property. When overloading is enabled, this is equivalent to

get display #rgba

Signals

closed

type C_DisplayClosedCallback = Ptr () -> CInt -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type DisplayClosedCallback Source #

Arguments

 = Bool

isError: True if the display was closed due to an error

-> IO () 

The closed signal is emitted when the connection to the windowing system for display is closed.

afterDisplayClosed :: (IsDisplay a, MonadIO m) => a -> DisplayClosedCallback -> m SignalHandlerId Source #

Connect a signal handler for the closed signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after display #closed callback

mk_DisplayClosedCallback :: C_DisplayClosedCallback -> IO (FunPtr C_DisplayClosedCallback) Source #

Generate a function pointer callable from C code, from a C_DisplayClosedCallback.

onDisplayClosed :: (IsDisplay a, MonadIO m) => a -> DisplayClosedCallback -> m SignalHandlerId Source #

Connect a signal handler for the closed signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on display #closed callback

monitorAdded

type C_DisplayMonitorAddedCallback = Ptr () -> Ptr Monitor -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type DisplayMonitorAddedCallback Source #

Arguments

 = Monitor

monitor: the monitor that was just added

-> IO () 

The monitorAdded signal is emitted whenever a monitor is added.

afterDisplayMonitorAdded :: (IsDisplay a, MonadIO m) => a -> DisplayMonitorAddedCallback -> m SignalHandlerId Source #

Connect a signal handler for the monitorAdded signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after display #monitorAdded callback

onDisplayMonitorAdded :: (IsDisplay a, MonadIO m) => a -> DisplayMonitorAddedCallback -> m SignalHandlerId Source #

Connect a signal handler for the monitorAdded signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on display #monitorAdded callback

monitorRemoved

type C_DisplayMonitorRemovedCallback = Ptr () -> Ptr Monitor -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type DisplayMonitorRemovedCallback Source #

Arguments

 = Monitor

monitor: the monitor that was just removed

-> IO () 

The monitorRemoved signal is emitted whenever a monitor is removed.

afterDisplayMonitorRemoved :: (IsDisplay a, MonadIO m) => a -> DisplayMonitorRemovedCallback -> m SignalHandlerId Source #

Connect a signal handler for the monitorRemoved signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after display #monitorRemoved callback

onDisplayMonitorRemoved :: (IsDisplay a, MonadIO m) => a -> DisplayMonitorRemovedCallback -> m SignalHandlerId Source #

Connect a signal handler for the monitorRemoved signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on display #monitorRemoved callback

opened

type C_DisplayOpenedCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type DisplayOpenedCallback = IO () Source #

The opened signal is emitted when the connection to the windowing system for display is opened.

afterDisplayOpened :: (IsDisplay a, MonadIO m) => a -> DisplayOpenedCallback -> m SignalHandlerId Source #

Connect a signal handler for the opened signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after display #opened callback

mk_DisplayOpenedCallback :: C_DisplayOpenedCallback -> IO (FunPtr C_DisplayOpenedCallback) Source #

Generate a function pointer callable from C code, from a C_DisplayOpenedCallback.

onDisplayOpened :: (IsDisplay a, MonadIO m) => a -> DisplayOpenedCallback -> m SignalHandlerId Source #

Connect a signal handler for the opened signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on display #opened callback

seatAdded

type C_DisplaySeatAddedCallback = Ptr () -> Ptr Seat -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type DisplaySeatAddedCallback Source #

Arguments

 = Seat

seat: the seat that was just added

-> IO () 

The seatAdded signal is emitted whenever a new seat is made known to the windowing system.

afterDisplaySeatAdded :: (IsDisplay a, MonadIO m) => a -> DisplaySeatAddedCallback -> m SignalHandlerId Source #

Connect a signal handler for the seatAdded signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after display #seatAdded callback

onDisplaySeatAdded :: (IsDisplay a, MonadIO m) => a -> DisplaySeatAddedCallback -> m SignalHandlerId Source #

Connect a signal handler for the seatAdded signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on display #seatAdded callback

seatRemoved

type C_DisplaySeatRemovedCallback = Ptr () -> Ptr Seat -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type DisplaySeatRemovedCallback Source #

Arguments

 = Seat

seat: the seat that was just removed

-> IO () 

The seatRemoved signal is emitted whenever a seat is removed by the windowing system.

afterDisplaySeatRemoved :: (IsDisplay a, MonadIO m) => a -> DisplaySeatRemovedCallback -> m SignalHandlerId Source #

Connect a signal handler for the seatRemoved signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after display #seatRemoved callback

onDisplaySeatRemoved :: (IsDisplay a, MonadIO m) => a -> DisplaySeatRemovedCallback -> m SignalHandlerId Source #

Connect a signal handler for the seatRemoved signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on display #seatRemoved callback

settingChanged

type C_DisplaySettingChangedCallback = Ptr () -> CString -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type DisplaySettingChangedCallback Source #

Arguments

 = Text

setting: the name of the setting that changed

-> IO () 

The settingChanged signal is emitted whenever a setting changes its value.

afterDisplaySettingChanged :: (IsDisplay a, MonadIO m) => a -> DisplaySettingChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the settingChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after display #settingChanged callback

onDisplaySettingChanged :: (IsDisplay a, MonadIO m) => a -> DisplaySettingChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the settingChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on display #settingChanged callback