Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
- Exported types
- Methods
- errorTrapPop
- errorTrapPopIgnored
- errorTrapPush
- getDefaultGroup
- getEglDisplay
- getEglVersion
- getGlxVersion
- getPrimaryMonitor
- getScreen
- getStartupNotificationId
- getUserTime
- getXcursor
- getXdisplay
- getXrootwindow
- getXscreen
- grab
- open
- setCursorTheme
- setProgramClass
- setStartupNotificationId
- setSurfaceScale
- stringToCompoundText
- textPropertyToTextList
- ungrab
- utf8ToCompoundText
- Signals
No description available in the introspection data.
Synopsis
- newtype X11Display = X11Display (ManagedPtr X11Display)
- class (GObject o, IsDescendantOf X11Display o) => IsX11Display o
- toX11Display :: (MonadIO m, IsX11Display o) => o -> m X11Display
- x11DisplayErrorTrapPop :: (HasCallStack, MonadIO m, IsX11Display a) => a -> m Int32
- x11DisplayErrorTrapPopIgnored :: (HasCallStack, MonadIO m, IsX11Display a) => a -> m ()
- x11DisplayErrorTrapPush :: (HasCallStack, MonadIO m, IsX11Display a) => a -> m ()
- x11DisplayGetDefaultGroup :: (HasCallStack, MonadIO m, IsX11Display a) => a -> m Surface
- x11DisplayGetEglDisplay :: (HasCallStack, MonadIO m, IsX11Display a) => a -> m (Ptr ())
- x11DisplayGetEglVersion :: (HasCallStack, MonadIO m, IsX11Display a) => a -> m (Bool, Int32, Int32)
- x11DisplayGetGlxVersion :: (HasCallStack, MonadIO m, IsX11Display a) => a -> m (Bool, Int32, Int32)
- x11DisplayGetPrimaryMonitor :: (HasCallStack, MonadIO m, IsX11Display a) => a -> m Monitor
- x11DisplayGetScreen :: (HasCallStack, MonadIO m, IsX11Display a) => a -> m X11Screen
- x11DisplayGetStartupNotificationId :: (HasCallStack, MonadIO m, IsX11Display a) => a -> m Text
- x11DisplayGetUserTime :: (HasCallStack, MonadIO m, IsX11Display a) => a -> m Word32
- x11DisplayGetXcursor :: (HasCallStack, MonadIO m, IsX11Display a, IsCursor b) => a -> b -> m CULong
- x11DisplayGetXdisplay :: (HasCallStack, MonadIO m, IsX11Display a) => a -> m Display
- x11DisplayGetXrootwindow :: (HasCallStack, MonadIO m, IsX11Display a) => a -> m CULong
- x11DisplayGetXscreen :: (HasCallStack, MonadIO m, IsX11Display a) => a -> m Screen
- x11DisplayGrab :: (HasCallStack, MonadIO m, IsX11Display a) => a -> m ()
- x11DisplayOpen :: (HasCallStack, MonadIO m) => Maybe Text -> m (Maybe Display)
- x11DisplaySetCursorTheme :: (HasCallStack, MonadIO m, IsX11Display a) => a -> Maybe Text -> Int32 -> m ()
- x11DisplaySetProgramClass :: (HasCallStack, MonadIO m, IsDisplay a) => a -> Text -> m ()
- x11DisplaySetStartupNotificationId :: (HasCallStack, MonadIO m, IsX11Display a) => a -> Text -> m ()
- x11DisplaySetSurfaceScale :: (HasCallStack, MonadIO m, IsX11Display a) => a -> Int32 -> m ()
- x11DisplayStringToCompoundText :: (HasCallStack, MonadIO m, IsX11Display a) => a -> Text -> m (Int32, Text, Int32, ByteString)
- x11DisplayTextPropertyToTextList :: (HasCallStack, MonadIO m, IsX11Display a) => a -> Text -> Int32 -> Word8 -> Int32 -> Text -> m Int32
- x11DisplayUngrab :: (HasCallStack, MonadIO m, IsX11Display a) => a -> m ()
- x11DisplayUtf8ToCompoundText :: (HasCallStack, MonadIO m, IsX11Display a) => a -> Text -> m (Bool, Text, Int32, ByteString)
- type X11DisplayXeventCallback = Ptr () -> IO Bool
- afterX11DisplayXevent :: (IsX11Display a, MonadIO m) => a -> ((?self :: a) => X11DisplayXeventCallback) -> m SignalHandlerId
- onX11DisplayXevent :: (IsX11Display a, MonadIO m) => a -> ((?self :: a) => X11DisplayXeventCallback) -> m SignalHandlerId
Exported types
newtype X11Display Source #
Memory-managed wrapper type.
X11Display (ManagedPtr X11Display) |
Instances
Eq X11Display Source # | |
Defined in GI.GdkX11.Objects.X11Display (==) :: X11Display -> X11Display -> Bool # (/=) :: X11Display -> X11Display -> Bool # | |
GObject X11Display Source # | |
Defined in GI.GdkX11.Objects.X11Display | |
ManagedPtrNewtype X11Display Source # | |
Defined in GI.GdkX11.Objects.X11Display toManagedPtr :: X11Display -> ManagedPtr X11Display | |
TypedObject X11Display Source # | |
Defined in GI.GdkX11.Objects.X11Display | |
HasParentTypes X11Display Source # | |
Defined in GI.GdkX11.Objects.X11Display | |
IsGValue (Maybe X11Display) Source # | Convert |
Defined in GI.GdkX11.Objects.X11Display gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe X11Display -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe X11Display) | |
type ParentTypes X11Display Source # | |
Defined in GI.GdkX11.Objects.X11Display type ParentTypes X11Display = '[Display, Object] |
class (GObject o, IsDescendantOf X11Display o) => IsX11Display o Source #
Type class for types which can be safely cast to X11Display
, for instance with toX11Display
.
Instances
(GObject o, IsDescendantOf X11Display o) => IsX11Display o Source # | |
Defined in GI.GdkX11.Objects.X11Display |
toX11Display :: (MonadIO m, IsX11Display o) => o -> m X11Display Source #
Cast to X11Display
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Click to display all available methods, including inherited ones
Methods
beep, bindProperty, bindPropertyFull, close, createGlContext, deviceIsGrabbed, errorTrapPop, errorTrapPopIgnored, errorTrapPush, flush, forceFloating, freezeNotify, getv, grab, isClosed, isComposited, isFloating, isRgba, listSeats, mapKeycode, mapKeyval, notify, notifyByPspec, notifyStartupComplete, prepareGl, putEvent, ref, refSink, runDispose, stealData, stealQdata, stringToCompoundText, supportsInputShapes, sync, textPropertyToTextList, thawNotify, translateKey, ungrab, unref, utf8ToCompoundText, watchClosure.
Getters
getAppLaunchContext, getClipboard, getData, getDefaultGroup, getDefaultSeat, getEglDisplay, getEglVersion, getGlxVersion, getMonitorAtSurface, getMonitors, getName, getPrimaryClipboard, getPrimaryMonitor, getProperty, getQdata, getScreen, getSetting, getStartupNotificationId, getUserTime, getXcursor, getXdisplay, getXrootwindow, getXscreen.
Setters
setCursorTheme, setData, setDataFull, setProperty, setStartupNotificationId, setSurfaceScale.
errorTrapPop
x11DisplayErrorTrapPop Source #
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> m Int32 | Returns: X error code or 0 on success |
Pops the error trap pushed by x11DisplayErrorTrapPush
.
Will XSync()
if necessary and will always block until
the error is known to have occurred or not occurred,
so the error code can be returned.
If you don’t need to use the return value,
x11DisplayErrorTrapPopIgnored
would be more efficient.
errorTrapPopIgnored
x11DisplayErrorTrapPopIgnored Source #
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> m () |
Pops the error trap pushed by x11DisplayErrorTrapPush
.
Does not block to see if an error occurred; merely records the
range of requests to ignore errors for, and ignores those errors
if they arrive asynchronously.
errorTrapPush
x11DisplayErrorTrapPush Source #
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> m () |
Begins a range of X requests on display
for which X error events
will be ignored. Unignored errors (when no trap is pushed) will abort
the application. Use x11DisplayErrorTrapPop
or
x11DisplayErrorTrapPopIgnored
to lift a trap pushed
with this function.
getDefaultGroup
x11DisplayGetDefaultGroup Source #
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> m Surface | Returns: The default group leader surface
for |
Returns the default group leader surface for all toplevel surfaces
on display
. This surface is implicitly created by GDK.
See x11SurfaceSetGroup
.
getEglDisplay
x11DisplayGetEglDisplay Source #
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> m (Ptr ()) | Returns: the EGL display object |
Retrieves the EGL display connection object for the given GDK display.
This function returns NULL
if GDK is using GLX.
Since: 4.4
getEglVersion
x11DisplayGetEglVersion Source #
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> m (Bool, Int32, Int32) | Returns: |
Retrieves the version of the EGL implementation.
Since: 4.4
getGlxVersion
x11DisplayGetGlxVersion Source #
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> m (Bool, Int32, Int32) | Returns: |
Retrieves the version of the GLX implementation.
getPrimaryMonitor
x11DisplayGetPrimaryMonitor Source #
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> 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.
getScreen
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> m X11Screen | Returns: the |
Retrieves the GdkX11Screen
of the display
.
getStartupNotificationId
x11DisplayGetStartupNotificationId Source #
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> m Text | Returns: the startup notification ID for |
Gets the startup notification ID for a display.
getUserTime
x11DisplayGetUserTime Source #
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> m Word32 | Returns: the timestamp of the last user interaction |
Returns the timestamp of the last user interaction on
display
. The timestamp is taken from events caused
by user interaction such as key presses or pointer
movements. See x11SurfaceSetUserTime
.
getXcursor
:: (HasCallStack, MonadIO m, IsX11Display a, IsCursor b) | |
=> a |
|
-> b |
|
-> m CULong | Returns: an Xlib Cursor. |
Returns the X cursor belonging to a GdkCursor
, potentially
creating the cursor.
Be aware that the returned cursor may not be unique to cursor
.
It may for example be shared with its fallback cursor. On old
X servers that don't support the XCursor extension, all cursors
may even fall back to a few default cursors.
getXdisplay
x11DisplayGetXdisplay Source #
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> m Display | Returns: an X display |
Returns the X display of a GdkDisplay
.
getXrootwindow
x11DisplayGetXrootwindow Source #
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> m CULong | Returns: an X Window |
Returns the root X window used by GdkDisplay
.
getXscreen
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> m Screen | Returns: an X Screen |
Returns the X Screen used by GdkDisplay
.
grab
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> m () |
Call XGrabServer()
on display
.
To ungrab the display again, use x11DisplayUngrab
.
x11DisplayGrab
/x11DisplayUngrab
calls can be nested.
open
:: (HasCallStack, MonadIO m) | |
=> Maybe Text |
|
-> m (Maybe Display) | Returns: The new display |
Tries to open a new display to the X server given by
displayName
. If opening the display fails, Nothing
is
returned.
setCursorTheme
x11DisplaySetCursorTheme Source #
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> Maybe Text |
|
-> Int32 |
|
-> m () |
Sets the cursor theme from which the images for cursor should be taken.
If the windowing system supports it, existing cursors created
with cursorNewFromName
are updated to reflect the theme
change. Custom cursors constructed with cursorNewFromTexture
will have to be handled by the application (GTK applications can learn
about cursor theme changes by listening for change notification
for the corresponding GtkSetting
).
setProgramClass
x11DisplaySetProgramClass Source #
:: (HasCallStack, MonadIO m, IsDisplay a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the program class.
The X11 backend uses the program class to set the class name part
of the WM_CLASS
property on toplevel windows; see the ICCCM.
setStartupNotificationId
x11DisplaySetStartupNotificationId Source #
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the startup notification ID for a display.
This is usually taken from the value of the DESKTOP_STARTUP_ID
environment variable, but in some cases (such as the application not
being launched using exec()
) it can come from other sources.
If the ID contains the string "_TIME" then the portion following that string is taken to be the X11 timestamp of the event that triggered the application to be launched and the GDK current event time is set accordingly.
The startup ID is also what is used to signal that the startup is
complete (for example, when opening a window or when calling
displayNotifyStartupComplete
).
setSurfaceScale
x11DisplaySetSurfaceScale Source #
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> Int32 |
|
-> m () |
Forces a specific window scale for all windows on this display,
instead of using the default or user configured scale. This
is can be used to disable scaling support by setting scale
to
1, or to programmatically set the window scale.
Once the scale is set by this call it will not change in response to later user configuration changes.
stringToCompoundText
x11DisplayStringToCompoundText Source #
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> Text |
|
-> m (Int32, Text, Int32, ByteString) | Returns: 0 upon success, non-zero upon failure |
Convert a string from the encoding of the current locale into a form suitable for storing in a window property.
textPropertyToTextList
x11DisplayTextPropertyToTextList Source #
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> Text |
|
-> Int32 |
|
-> Word8 |
|
-> Int32 |
|
-> Text |
|
-> m Int32 | Returns: the number of strings stored in list, or 0, if the conversion failed |
Convert a text string from the encoding as it is stored in a property into an array of strings in the encoding of the current locale. (The elements of the array represent the nul-separated elements of the original text string.)
ungrab
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> m () |
Ungrab display
after it has been grabbed with
x11DisplayGrab
.
utf8ToCompoundText
x11DisplayUtf8ToCompoundText Source #
:: (HasCallStack, MonadIO m, IsX11Display a) | |
=> a |
|
-> Text |
|
-> m (Bool, Text, Int32, ByteString) |
Converts from UTF-8 to compound text.
Signals
xevent
type X11DisplayXeventCallback Source #
= Ptr () |
|
-> IO Bool | Returns: |
The xevent signal is a low level signal that is emitted whenever an XEvent has been received.
When handlers to this signal return True
, no other handlers will be
invoked. In particular, the default handler for this function is
GDK's own event handling mechanism, so by returning True
for an event
that GDK expects to translate, you may break GDK and/or GTK+ in
interesting ways. You have been warned.
If you want this signal handler to queue a GdkEvent
, you can use
displayPutEvent
.
If you are interested in X GenericEvents, bear in mind that
XGetEventData()
has been already called on the event, and
XFreeEventData()
will be called afterwards.
afterX11DisplayXevent :: (IsX11Display a, MonadIO m) => a -> ((?self :: a) => X11DisplayXeventCallback) -> m SignalHandlerId Source #
Connect a signal handler for the xevent signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
x11Display #xevent callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onX11DisplayXevent :: (IsX11Display a, MonadIO m) => a -> ((?self :: a) => X11DisplayXeventCallback) -> m SignalHandlerId Source #
Connect a signal handler for the xevent signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
x11Display #xevent callback