Portability | portable (depends on GHC) |
---|---|
Stability | provisional |
Maintainer | gtk2hs-users@lists.sourceforge.net |
Safe Haskell | Safe-Infered |
Controls the keyboard/mouse/monitors combination.
- Module available since Gdk version 2.2
- 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 thisDisplay
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
class GObjectClass o => DisplayClass o Source
castToDisplay :: GObjectClass obj => obj -> DisplaySource
toDisplay :: DisplayClass o => o -> DisplaySource
Methods
:: String |
|
-> IO (Maybe Display) | returns a |
Opens a display.
Gets the default Display
. This is a convenience function for
displayManagerGetDefaultDisplay displayManagerGet
.
Gets the name of the display.
Gets the number of screen managed by the display
.
Returns a screen object for one of the screens of the display.
Get the default Screen
for display
.
:: Display | |
-> TimeStamp |
|
-> IO () |
Release any pointer grab.
:: Display | |
-> TimeStamp |
|
-> IO () |
Release any keyboard grab
Test if the pointer is grabbed.
displayBeep :: Display -> IO ()Source
Emits a short beep on display
displaySync :: Display -> IO ()Source
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 ()Source
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 ()Source
Closes the connection to the windowing system for the given display, and cleans up associated resources.
Returns the list of available input devices attached to display
.
displaySetDoubleClickTimeSource
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.
displaySetDoubleClickDistanceSource
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
:: Display | |
-> IO (Screen, [Modifier], Int, Int) |
|
Gets the current location of the pointer and the current modifier mask for a given display.
displayGetWindowAtPointerSource
:: Display | |
-> IO (Maybe (DrawWindow, Int, Int)) |
|
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).
:: Display | |
-> Screen |
|
-> Int |
|
-> Int |
|
-> 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
displaySupportsCursorColorSource
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
displaySupportsCursorAlphaSource
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
displayGetDefaultCursorSizeSource
Returns the default size to use for cursors on display
.
- Available since Gdk version 2.4
displayGetMaximalCursorSizeSource
Gets the maximal size to use for cursors on display
.
- Available since Gdk version 2.4
:: Display | |
-> IO DrawWindow | returns The default group leader window for |
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
displaySupportsSelectionNotificationSource
:: Display | |
-> IO Bool | returns whether |
Returns whether EOwnerChange
events will be
sent when the owner of a selection changes.
- Available since Gdk version 2.6
displayRequestSelectionNotificationSource
:: Display | |
-> SelectionTag |
|
-> IO Bool | returns whether |
Request EOwnerChange
events for ownership
changes of the selection named by the given atom.
- Available since Gdk version 2.6
displaySupportsClipboardPersistenceSource
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
:: Display | |
-> DrawWindow |
|
-> Word32 |
|
-> Maybe [TargetTag] |
|
-> 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
Returns True
if windowShapeCombineMask
can be used to create shaped
windows on display
.
- Available since Gdk version 2.10
displaySupportsInputShapesSource
Returns True
if windowInputShapeCombineMask
can be used to modify the
input shape of windows on display
.
- Available since Gdk version 2.10
displaySupportsCompositeSource
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 ())Source
The displayClosed
signal is emitted when the connection to the windowing
system for display
is closed.