Graphics.UI.Gtk.Gdk.Display

gtk3-0.14.5: Binding to the Gtk+ 3 graphical user interface library

Maintainer | gtk2hs-users@lists.sourceforge.net
Stability | provisional
Portability | portable (depends on GHC)
Safe Haskell | None
Language | Haskell98

Graphics.UI.Gtk.Gdk.Display

Contents

- Detail
- Class Hierarchy
- Types
- Methods
- Signals

Description

Controls the keyboard/mouse/monitors combination.

- Module available since Gdk version 2.2

Synopsis

- data Display
- class GObjectClass o => DisplayClass o
- castToDisplay :: GObjectClass obj => obj -> Display
- gTypeDisplay :: GType
- toDisplay :: DisplayClass o => o -> Display
- displayOpen :: GlibString string => string -> IO (Maybe Display)
- displayGetDefault :: IO (Maybe Display)
- displayGetName :: GlibString string => Display -> IO string
- displayGetNScreens :: Display -> IO Int
- displayGetScreen :: Display -> Int -> IO Screen
- displayGetDefaultScreen :: Display -> IO Screen
- displayPointerUngrab :: Display -> TimeStamp -> IO ()
- displayKeyboardUngrab :: Display -> TimeStamp -> IO ()
- displayPointerIsGrabbed :: Display -> IO Bool
- displayBeep :: Display -> IO ()
- displaySync :: Display -> IO ()
- displayFlush :: Display -> IO ()
- displayClose :: Display -> IO ()
- displayListDevices :: Display -> IO [Device]
- displaySetDoubleClickTime :: Display -> Int -> IO ()
- displaySetDoubleClickDistance :: Display -> Int -> IO ()
- displayGetPointer :: Display -> IO (Screen, [Modifier], Int, Int)
- displayGetWindowAtPointer :: Display -> IO (Maybe (DrawWindow, Int, Int))
- displayWarpPointer :: Display -> Screen -> Int -> Int -> IO ()
- displaySupportsCursorColor :: Display -> IO Bool
- displaySupportsCursorAlpha :: Display -> IO Bool
- displayGetDefaultCursorSize :: Display -> IO Int
- displayGetMaximalCursorSize :: Display -> IO (Int, Int)
- displayGetDefaultGroup :: Display -> IO DrawWindow
- displaySupportsSelectionNotification :: Display -> IO Bool
- displayRequestSelectionNotification :: Display -> SelectionTag -> IO Bool
- displaySupportsClipboardPersistence :: Display -> IO Bool
- displayStoreClipboard :: Display -> DrawWindow -> Word32 -> Maybe [TargetTag] -> IO ()
- displaySupportsShapes :: Display -> IO Bool
- displaySupportsInputShapes :: Display -> IO Bool
- displaySupportsComposite :: Display -> IO Bool
- displayClosed :: DisplayClass self => Signal self (Bool -> IO ())

# Detail

`Display` objects purpose are two fold:

- To grab/ungrab keyboard focus and mouse pointer
- To manage and provide information about the `Screen`(s) available for this `Display`

`Display` objects are the GDK representation of the X Display which can be described as /a workstation consisting of a keyboard a pointing device (such as a mouse) and one or more screens/. It is used to open and keep track of various `Screen` objects currently instanciated by the application. It is also used to grab and release the keyboard and the mouse pointer.

# Class Hierarchy

    | GObject
    | +----Display

# Types

data Display #

Instances

Eq Display # |
Methods (==) :: Display -> Display -> Bool # (/=) :: Display -> Display -> Bool #
Ord Display # |
Methods compare :: Display -> Display -> Ordering # (<) :: Display -> Display -> Bool # (<=) :: Display -> Display -> Bool # (>) :: Display -> Display -> Bool # (>=) :: Display -> Display -> Bool # max :: Display -> Display -> Display # min :: Display -> Display -> Display #
GObjectClass Display # |
Methods toGObject :: Display -> GObject # unsafeCastGObject :: GObject -> Display #
DisplayClass Display # |

class GObjectClass o => DisplayClass o #

Instances

DisplayClass Display # |

castToDisplay :: GObjectClass obj => obj -> Display #

gTypeDisplay :: GType #

toDisplay :: DisplayClass o => o -> Display #

# Methods

displayOpen #

Arguments

:: GlibString string |
=> string | `displayName` - the name of the display to open
-> IO (Maybe Display) | returns a `Display`, or `Nothing` if the display could not be opened.

Opens a display.

displayGetDefault #

Arguments

:: IO (Maybe Display) | returns a `Display`, or `Nothing` if there is no default display.

Gets the default `Display`. This is a convenience function for `displayManagerGetDefaultDisplay displayManagerGet`.

displayGetName #

Arguments

:: GlibString string |
=> Display |
-> IO string | returns a string representing the display name

Gets the name of the display.

displayGetNScreens #

Arguments

:: Display |
-> IO Int | returns number of screens.

Gets the number of screen managed by the `display`.

displayGetScreen #

Arguments

:: Display |
-> Int | `screenNum` - the screen number
-> IO Screen | returns the `Screen` object

Returns a screen object for one of the screens of the display.

displayGetDefaultScreen #

Arguments

:: Display |
-> IO Screen | returns the default `Screen` object for `display`

Get the default `Screen` for `display`.

displayPointerUngrab #

Arguments

:: Display |
-> TimeStamp | `time` - a timestap (e.g. `currentTime`).
-> IO () |

Release any pointer grab.

displayKeyboardUngrab #

Arguments

:: Display |
-> TimeStamp | `time` - a timestap (e.g `currentTime`).
-> IO () |

Release any keyboard grab

displayPointerIsGrabbed #

Arguments

:: Display |
-> IO Bool | returns `True` if an active X pointer grab is in effect

Test if the pointer is grabbed.

displayBeep :: Display -> IO () #

Emits a short beep on `display`

displaySync :: Display -> IO () #

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 `errorTrapPop` 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.

displayFlush :: Display -> IO () #

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 explicitely. 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.

- Available since Gdk version 2.4

displayClose :: Display -> IO () #

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

displayListDevices #

Arguments

:: Display |
-> IO [Device] | returns a list of `Device`

Returns the list of available input devices attached to `display`.

displaySetDoubleClickTime #

Arguments

:: Display |
-> Int | `msec` - double click time in milliseconds (thousandths of a second)
-> IO () |

Sets the double click time (two clicks within this time interval count as a double click and result in an `eventButton` where `eventClick` is `DoubleClick`). Applications should not set this, it is a global user-configured setting.

displaySetDoubleClickDistance #

Arguments

:: Display |
-> Int | `distance` - distance in pixels
-> IO () |

Sets the double click distance (two clicks within this distance count as a double click and result in an `eventButton` where `eventClick` is `DoubleClick`). See also `displaySetDoubleClickTime`. Applications should not set this, it is a global user-configured setting.

- Available since Gdk version 2.4

displayGetPointer #

Arguments

:: Display |
-> IO (Screen, [Modifier], Int, Int) | `(s, m, x, y)` - the screen `s`, the modifier mask `m` and the `x` and `y` coordinates of the pointer

Gets the current location of the pointer and the current modifier mask for a given display.

displayGetWindowAtPointer #

Arguments

:: Display |
-> IO (Maybe (DrawWindow, Int, Int)) | `(screen, winX, winY)` returns the window under the mouse pointer, or `Nothing`. The `winX` and `winY` denote the pointer location relative to the window origin

Obtains the window underneath the mouse pointer, returning the location of the pointer in that window in `winX`, `winY` for `screen`. Returns `Nothing` if the window under the mouse pointer is not known to GDK (for example, belongs to another application).

displayWarpPointer #

Arguments

:: Display |
-> Screen | `screen` - the screen of `display` to warp the pointer to
-> Int | `x` - the x coordinate of the destination
-> Int | `y` - the y coordinate of the destination
-> IO () |

Moves the pointer of `display` to the point `x`,`y` on the screen `screen`, unless the pointer is confined to a window by a grab, in which case it will be moved as far as allowed by the grab. Warping the pointer creates events as if the user had moved the mouse instantaneously to the destination.

Note that the pointer should normally be under the control of the user. This function was added to cover some rare use cases like keyboard navigation support for the color picker in the `ColorSelectionDialog`.

- Available since Gdk version 2.8

displaySupportsCursorColor #

Arguments

:: Display |
-> IO Bool | returns whether cursors can have multiple colors.

Returns `True` if multicolored cursors are supported on `display`. Otherwise, cursors have only a forground and a background color.

- Available since Gdk version 2.4

displaySupportsCursorAlpha #

Arguments

:: Display |
-> IO Bool | returns whether cursors can have alpha channels.

Returns `True` if cursors can use an 8bit alpha channel on `display`. Otherwise, cursors are restricted to bilevel alpha (i.e. a mask).

- Available since Gdk version 2.4

displayGetDefaultCursorSize #

Arguments

:: Display |
-> IO Int | returns the default cursor size.

Returns the default size to use for cursors on `display`.

- Available since Gdk version 2.4

displayGetMaximalCursorSize #

Arguments

:: Display |
-> IO (Int, Int) | `(width, height)` maximal `width` and `height` of the cursor

Gets the maximal size to use for cursors on `display`.

- Available since Gdk version 2.4

displayGetDefaultGroup #

Arguments

:: Display |
-> IO DrawWindow | returns The default group leader window for `display`

Returns the default group leader window for all toplevel windows on `display`. This window is implicitly created by GDK. See `windowSetGroup`.

- Available since Gdk version 2.4

displaySupportsSelectionNotification #

Arguments

:: Display |
-> IO Bool | returns whether `EOwnerChange` events will be sent.

Returns whether `EOwnerChange` events will be sent when the owner of a selection changes.

- Available since Gdk version 2.6

displayRequestSelectionNotification #

Arguments

:: Display |
-> SelectionTag | `selection` - the `Atom` naming the selection for which ownership change notification is requested
-> IO Bool | returns whether `EOwnerChange` events will be sent.

Request `EOwnerChange` events for ownership changes of the selection named by the given atom.

- Available since Gdk version 2.6

displaySupportsClipboardPersistence #

Arguments

:: Display |
-> IO Bool | returns `True` if the display supports clipboard persistance.

Returns whether the speicifed display supports clipboard persistance; i.e. if it's possible to store the clipboard data after an application has quit. On X11 this checks if a clipboard daemon is running.

- Available since Gdk version 2.6

displayStoreClipboard #

Arguments

:: Display |
-> DrawWindow | `clipboardWindow` - a `DrawWindow` belonging to the clipboard owner
-> Word32 | `time` - a timestamp
-> Maybe [TargetTag] | `targets` - an array of targets that should be saved, or `Nothing` if all available targets should be saved.
-> IO () |

Issues a request to the clipboard manager to store the clipboard data. On X11, this is a special program that works according to the freedesktop clipboard specification, available at http://www.freedesktop.org/Standards/clipboard-manager-spec.

- Available since Gdk version 2.6

displaySupportsShapes #

Arguments

:: Display |
-> IO Bool | returns `True` if shaped windows are supported

Returns `True` if `windowShapeCombineMask` can be used to create shaped windows on `display`.

- Available since Gdk version 2.10

displaySupportsInputShapes #

Arguments

:: Display |
-> IO Bool | returns `True` if windows with modified input shape are supported

Returns `True` if `windowInputShapeCombineMask` can be used to modify the input shape of windows on `display`.

- Available since Gdk version 2.10

displaySupportsComposite #

Arguments

:: Display |
-> IO Bool | returns `True` if windows may be composited.

Returns `True` if `windowSetComposited` can be used to redirect drawing on the window using compositing.

Currently this only works on X11 with XComposite and XDamage extensions available.

- Available since Gdk version 2.12

# Signals

displayClosed :: DisplayClass self => Signal self (Bool -> IO ()) #

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