gtk-0.11.0: Binding to the Gtk+ graphical user interface library.ContentsIndex
Graphics.UI.Gtk.Gdk.Display
Portabilityportable (depends on GHC)
Stabilityprovisional
Maintainergtk2hs-users@lists.sourceforge.net
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 :: String -> IO (Maybe Display)
displayGetDefault :: IO (Maybe Display)
displayGetName :: 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
show/hide Instances
class GObjectClass o => DisplayClass o
show/hide Instances
castToDisplay :: GObjectClass obj => obj -> Display
gTypeDisplay :: GType
toDisplay :: DisplayClass o => o -> Display
Methods
displayOpen
:: StringdisplayName - 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
:: 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
:: Display
-> IO Stringreturns a string representing the display name
Gets the name of the display.
displayGetNScreens
:: Display
-> IO Intreturns number of screens.
Gets the number of screen managed by the display.
displayGetScreen
:: Display
-> IntscreenNum - the screen number
-> IO Screenreturns the Screen object
Returns a screen object for one of the screens of the display.
displayGetDefaultScreen
:: Display
-> IO Screenreturns the default Screen object for display
Get the default Screen for display.
displayPointerUngrab
:: Display
-> TimeStamptime - a timestap (e.g. currentTime).
-> IO ()
Release any pointer grab.
displayKeyboardUngrab
:: Display
-> TimeStamptime - a timestap (e.g currentTime).
-> IO ()
Release any keyboard grab
displayPointerIsGrabbed
:: Display
-> IO Boolreturns 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
:: Display
-> IO [Device]returns a list of Device
Returns the list of available input devices attached to display.
displaySetDoubleClickTime
:: Display
-> Intmsec - 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
:: Display
-> Intdistance - 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
:: 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
:: 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
:: Display
-> Screenscreen - the screen of display to warp the pointer to
-> Intx - the x coordinate of the destination
-> Inty - 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
:: Display
-> IO Boolreturns 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
:: Display
-> IO Boolreturns 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
:: Display
-> IO Intreturns the default cursor size.

Returns the default size to use for cursors on display.

  • Available since Gdk version 2.4
displayGetMaximalCursorSize
:: 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
:: Display
-> IO DrawWindowreturns 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
:: Display
-> IO Boolreturns 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
:: Display
-> SelectionTagselection - the Atom naming the selection for which ownership change notification is requested
-> IO Boolreturns 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
:: Display
-> IO Boolreturns 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
:: Display
-> DrawWindowclipboardWindow - a DrawWindow belonging to the clipboard owner
-> Word32time - 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
:: Display
-> IO Boolreturns 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
:: Display
-> IO Boolreturns 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
:: Display
-> IO Boolreturns 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.
Produced by Haddock version 2.4.2