Documentation ¶
Index ¶
- Variables
- func X11DeviceGetID(device *X11DeviceCore) int
- func X11DisplayGetGLXVersion(display *gdk.Display) (major, minor int, ok bool)
- func X11FreeCompoundText(ctext *byte)
- func X11GetDefaultScreen() int
- func X11GetParentRelativePattern() *cairo.Patterndeprecated
- func X11GetServerTime(window *X11Window) uint32
- func X11GrabServer()
- func X11RegisterStandardEventType(display *X11Display, eventBase, nEvents int)
- func X11SetSmClientID(smClientId string)
- func X11UngrabServer()
- type X11AppLaunchContext
- type X11Cursor
- type X11DeviceCore
- type X11DeviceManagerCore
- type X11DeviceManagerXI2
- type X11DeviceXI2
- type X11Display
- func (display *X11Display) ErrorTrapPop() int
- func (display *X11Display) ErrorTrapPopIgnored()
- func (display *X11Display) ErrorTrapPush()
- func (display *X11Display) Grab()
- func (display *X11Display) SetCursorTheme(theme string, size int)
- func (display *X11Display) SetStartupNotificationID(startupId string)
- func (display *X11Display) SetWindowScale(scale int)
- func (display *X11Display) StartupNotificationID() string
- func (display *X11Display) Ungrab()
- func (display *X11Display) UserTime() uint32
- type X11DisplayManager
- type X11DragContext
- type X11GLContext
- type X11Keymap
- type X11Monitor
- type X11Screen
- type X11Visual
- type X11Window
- func (window *X11Window) Desktop() uint32
- func (window *X11Window) MoveToCurrentDesktop()
- func (window *X11Window) MoveToDesktop(desktop uint32)
- func (window *X11Window) SetFrameExtents(left, right, top, bottom int)deprecated
- func (window *X11Window) SetFrameSyncEnabled(frameSyncEnabled bool)
- func (window *X11Window) SetHideTitlebarWhenMaximized(hideTitlebarWhenMaximized bool)
- func (window *X11Window) SetThemeVariant(variant string)
- func (window *X11Window) SetUTF8Property(name, value string)
- func (window *X11Window) SetUserTime(timestamp uint32)
Constants ¶
This section is empty.
Variables ¶
var (
GTypeX11AppLaunchContext = coreglib.Type(C.gdk_x11_app_launch_context_get_type())
)
GType values.
var (
GTypeX11Cursor = coreglib.Type(C.gdk_x11_cursor_get_type())
)
GType values.
var (
GTypeX11DeviceCore = coreglib.Type(C.gdk_x11_device_core_get_type())
)
GType values.
var (
GTypeX11DeviceManagerCore = coreglib.Type(C.gdk_x11_device_manager_core_get_type())
)
GType values.
var (
GTypeX11DeviceManagerXI2 = coreglib.Type(C.gdk_x11_device_manager_xi2_get_type())
)
GType values.
var (
GTypeX11DeviceXI2 = coreglib.Type(C.gdk_x11_device_xi2_get_type())
)
GType values.
var (
GTypeX11Display = coreglib.Type(C.gdk_x11_display_get_type())
)
GType values.
var (
GTypeX11DisplayManager = coreglib.Type(C.gdk_x11_display_manager_get_type())
)
GType values.
var (
GTypeX11DragContext = coreglib.Type(C.gdk_x11_drag_context_get_type())
)
GType values.
var (
GTypeX11GLContext = coreglib.Type(C.gdk_x11_gl_context_get_type())
)
GType values.
var (
GTypeX11Keymap = coreglib.Type(C.gdk_x11_keymap_get_type())
)
GType values.
var (
GTypeX11Monitor = coreglib.Type(C.gdk_x11_monitor_get_type())
)
GType values.
var (
GTypeX11Screen = coreglib.Type(C.gdk_x11_screen_get_type())
)
GType values.
var (
GTypeX11Visual = coreglib.Type(C.gdk_x11_visual_get_type())
)
GType values.
var (
GTypeX11Window = coreglib.Type(C.gdk_x11_window_get_type())
)
GType values.
Functions ¶
func X11DeviceGetID ¶
func X11DeviceGetID(device *X11DeviceCore) int
X11DeviceGetID returns the device ID as seen by XInput2.
> If gdk_disable_multidevice() has been called, this function > will respectively return 2/3 for the core pointer and keyboard, > (matching the IDs for the Virtual Core Pointer and Keyboard in > XInput 2), but calling this function on any slave devices (i.e. > those managed via XInput 1.x), will return 0.
The function takes the following parameters:
- device: Device.
The function returns the following values:
- gint: XInput2 device ID.
func X11DisplayGetGLXVersion ¶
X11DisplayGetGLXVersion retrieves the version of the GLX implementation.
The function takes the following parameters:
- display: Display.
The function returns the following values:
- major: return location for the GLX major version.
- minor: return location for the GLX minor version.
- ok: TRUE if GLX is available.
func X11FreeCompoundText ¶
func X11FreeCompoundText(ctext *byte)
X11FreeCompoundText frees the data returned from gdk_x11_display_string_to_compound_text().
The function takes the following parameters:
- ctext: pointer stored in ctext from a call to gdk_x11_display_string_to_compound_text().
func X11GetDefaultScreen ¶
func X11GetDefaultScreen() int
X11GetDefaultScreen gets the default GTK+ screen number.
The function returns the following values:
- gint returns the screen number specified by the --display command line option or the DISPLAY environment variable when gdk_init() calls XOpenDisplay().
func X11GetParentRelativePattern
deprecated
X11GetParentRelativePattern: used with gdk_window_set_background_pattern() to inherit background from parent window. Useful for imitating transparency when compositing is not available. Otherwise behaves like a transparent pattern.
Deprecated: Don't use this function.
The function returns the following values:
func X11GetServerTime ¶
X11GetServerTime: routine to get the current X server time stamp.
The function takes the following parameters:
- window used for communication with the server. The window must have GDK_PROPERTY_CHANGE_MASK in its events mask or a hang will result.
The function returns the following values:
- guint32: time stamp.
func X11GrabServer ¶
func X11GrabServer()
X11GrabServer: call gdk_x11_display_grab() on the default display. To ungrab the server again, use gdk_x11_ungrab_server().
gdk_x11_grab_server()/gdk_x11_ungrab_server() calls can be nested.
func X11RegisterStandardEventType ¶
func X11RegisterStandardEventType(display *X11Display, eventBase, nEvents int)
X11RegisterStandardEventType registers interest in receiving extension events with type codes between event_base and event_base + n_events - 1. The registered events must have the window field in the same place as core X events (this is not the case for e.g. XKB extension events).
If an event type is registered, events of this type will go through global and window-specific filters (see gdk_window_add_filter()). Unregistered events will only go through global filters. GDK may register the events of some X extensions on its own.
This function should only be needed in unusual circumstances, e.g. when filtering XInput extension events on the root window.
The function takes the following parameters:
- display: Display.
- eventBase: first event type code to register.
- nEvents: number of event type codes to register.
func X11SetSmClientID ¶
func X11SetSmClientID(smClientId string)
X11SetSmClientID sets the SM_CLIENT_ID property on the application’s leader window so that the window manager can save the application’s state using the X11R6 ICCCM session management protocol.
See the X Session Management Library documentation for more information on session management and the Inter-Client Communication Conventions Manual.
The function takes the following parameters:
- smClientId (optional): client id assigned by the session manager when the connection was opened, or NULL to remove the property.
func X11UngrabServer ¶
func X11UngrabServer()
X11UngrabServer: ungrab the default display after it has been grabbed with gdk_x11_grab_server().
Types ¶
type X11AppLaunchContext ¶
type X11AppLaunchContext struct { gdk.AppLaunchContext // contains filtered or unexported fields }
type X11DeviceCore ¶
type X11DeviceCore struct { gdk.Device // contains filtered or unexported fields }
func X11DeviceManagerLookup ¶
func X11DeviceManagerLookup(deviceManager *X11DeviceManagerCore, deviceId int) *X11DeviceCore
X11DeviceManagerLookup returns the Device that wraps the given device ID.
The function takes the following parameters:
- deviceManager: DeviceManager.
- deviceId: device ID, as understood by the XInput2 protocol.
The function returns the following values:
- x11DeviceCore (optional) wrapping the device ID, or NULL if the given ID doesn’t currently represent a device.
type X11DeviceManagerCore ¶
type X11DeviceManagerCore struct { gdk.DeviceManager // contains filtered or unexported fields }
type X11DeviceManagerXI2 ¶
type X11DeviceManagerXI2 struct { X11DeviceManagerCore // contains filtered or unexported fields }
type X11DeviceXI2 ¶
type X11DeviceXI2 struct { gdk.Device // contains filtered or unexported fields }
type X11Display ¶
type X11Display struct { gdk.Display // contains filtered or unexported fields }
func (*X11Display) ErrorTrapPop ¶
func (display *X11Display) ErrorTrapPop() int
ErrorTrapPop pops the error trap pushed by gdk_x11_display_error_trap_push(). 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, gdk_x11_display_error_trap_pop_ignored() would be more efficient.
See gdk_error_trap_pop() for the all-displays-at-once equivalent.
The function returns the following values:
- gint: x error code or 0 on success.
func (*X11Display) ErrorTrapPopIgnored ¶
func (display *X11Display) ErrorTrapPopIgnored()
ErrorTrapPopIgnored pops the error trap pushed by gdk_x11_display_error_trap_push(). 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.
See gdk_error_trap_pop_ignored() for the all-displays-at-once equivalent.
func (*X11Display) ErrorTrapPush ¶
func (display *X11Display) ErrorTrapPush()
ErrorTrapPush 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 gdk_x11_display_error_trap_pop() or gdk_x11_display_error_trap_pop_ignored()to lift a trap pushed with this function.
See also gdk_error_trap_push() to push a trap on all displays.
func (*X11Display) Grab ¶
func (display *X11Display) Grab()
Grab: call XGrabServer() on display. To ungrab the display again, use gdk_x11_display_ungrab().
gdk_x11_display_grab()/gdk_x11_display_ungrab() calls can be nested.
func (*X11Display) SetCursorTheme ¶
func (display *X11Display) SetCursorTheme(theme string, size int)
SetCursorTheme sets the cursor theme from which the images for cursor should be taken.
If the windowing system supports it, existing cursors created with gdk_cursor_new(), gdk_cursor_new_for_display() and gdk_cursor_new_from_name() are updated to reflect the theme change. Custom cursors constructed with gdk_cursor_new_from_pixbuf() will have to be handled by the application (GTK+ applications can learn about cursor theme changes by listening for change notification for the corresponding Setting).
The function takes the following parameters:
- theme (optional): name of the cursor theme to use, or NULL to unset a previously set value.
- size: cursor size to use, or 0 to keep the previous size.
func (*X11Display) SetStartupNotificationID ¶
func (display *X11Display) SetStartupNotificationID(startupId string)
SetStartupNotificationID 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 gdk_notify_startup_complete()).
The function takes the following parameters:
- startupId: startup notification ID (must be valid utf8).
func (*X11Display) SetWindowScale ¶
func (display *X11Display) SetWindowScale(scale int)
SetWindowScale 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.
The function takes the following parameters:
- scale: new scale value.
func (*X11Display) StartupNotificationID ¶
func (display *X11Display) StartupNotificationID() string
StartupNotificationID gets the startup notification ID for a display.
The function returns the following values:
- utf8: startup notification ID for display.
func (*X11Display) Ungrab ¶
func (display *X11Display) Ungrab()
Ungrab display after it has been grabbed with gdk_x11_display_grab().
func (*X11Display) UserTime ¶
func (display *X11Display) UserTime() uint32
UserTime 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 gdk_x11_window_set_user_time().
The function returns the following values:
- guint32: timestamp of the last user interaction.
type X11DisplayManager ¶
type X11DisplayManager struct { gdk.DisplayManager // contains filtered or unexported fields }
type X11DragContext ¶
type X11DragContext struct { gdk.DragContext // contains filtered or unexported fields }
type X11GLContext ¶
type X11GLContext struct { gdk.GLContext // contains filtered or unexported fields }
type X11Keymap ¶
type X11Keymap struct { gdk.Keymap // contains filtered or unexported fields }
func (*X11Keymap) GroupForState ¶
GroupForState extracts the group from the state field sent in an X Key event. This is only needed for code processing raw X events, since EventKey directly includes an is_modifier field.
The function takes the following parameters:
- state: raw state returned from X.
The function returns the following values:
- gint: index of the active keyboard group for the event.
func (*X11Keymap) KeyIsModifier ¶
KeyIsModifier determines whether a particular key code represents a key that is a modifier. That is, it’s a key that normally just affects the keyboard state and the behavior of other keys rather than producing a direct effect itself. This is only needed for code processing raw X events, since EventKey directly includes an is_modifier field.
The function takes the following parameters:
- keycode: hardware keycode from a key event.
The function returns the following values:
- ok: TRUE if the hardware keycode is a modifier key.
type X11Monitor ¶
type X11Monitor struct { gdk.Monitor // contains filtered or unexported fields }
type X11Screen ¶
type X11Screen struct { gdk.Screen // contains filtered or unexported fields }
func (*X11Screen) ConnectWindowManagerChanged ¶
func (screen *X11Screen) ConnectWindowManagerChanged(f func()) coreglib.SignalHandle
func (*X11Screen) CurrentDesktop ¶
CurrentDesktop returns the current workspace for screen when running under a window manager that supports multiple workspaces, as described in the Extended Window Manager Hints (http://www.freedesktop.org/Standards/wm-spec) specification.
The function returns the following values:
- guint32: current workspace, or 0 if workspaces are not supported.
func (*X11Screen) NumberOfDesktops ¶
NumberOfDesktops returns the number of workspaces for screen when running under a window manager that supports multiple workspaces, as described in the Extended Window Manager Hints (http://www.freedesktop.org/Standards/wm-spec) specification.
The function returns the following values:
- guint32: number of workspaces, or 0 if workspaces are not supported.
func (*X11Screen) ScreenNumber ¶
ScreenNumber returns the index of a Screen.
The function returns the following values:
- gint: position of screen among the screens of its display.
func (*X11Screen) WindowManagerName ¶
WindowManagerName returns the name of the window manager for screen.
The function returns the following values:
- utf8: name of the window manager screen screen, or "unknown" if the window manager is unknown. The string is owned by GDK and should not be freed.
type X11Window ¶
type X11Window struct { gdk.Window // contains filtered or unexported fields }
func (*X11Window) Desktop ¶
Desktop gets the number of the workspace window is on.
The function returns the following values:
- guint32: current workspace of window.
func (*X11Window) MoveToCurrentDesktop ¶
func (window *X11Window) MoveToCurrentDesktop()
MoveToCurrentDesktop moves the window to the correct workspace when running under a window manager that supports multiple workspaces, as described in the Extended Window Manager Hints (http://www.freedesktop.org/Standards/wm-spec) specification. Will not do anything if the window is already on all workspaces.
func (*X11Window) MoveToDesktop ¶
MoveToDesktop moves the window to the given workspace when running unde a window manager that supports multiple workspaces, as described in the Extended Window Manager Hints (http://www.freedesktop.org/Standards/wm-spec) specification.
The function takes the following parameters:
- desktop: number of the workspace to move the window to.
func (*X11Window) SetFrameExtents
deprecated
SetFrameExtents: this is the same as gdk_window_set_shadow_width() but it only works on GdkX11Window.
Deprecated: Use gdk_window_set_shadow_width() instead.
The function takes the following parameters:
- left extent.
- right extent.
- top extent.
- bottom extent.
func (*X11Window) SetFrameSyncEnabled ¶
SetFrameSyncEnabled: this function can be used to disable frame synchronization for a window. Normally frame synchronziation will be enabled or disabled based on whether the system has a compositor that supports frame synchronization, but if the window is not directly managed by the window manager, then frame synchronziation may need to be disabled. This is the case for a window embedded via the XEMBED protocol.
The function takes the following parameters:
- frameSyncEnabled: whether frame-synchronization should be enabled.
func (*X11Window) SetHideTitlebarWhenMaximized ¶
SetHideTitlebarWhenMaximized: set a hint for the window manager, requesting that the titlebar should be hidden when the window is maximized.
Note that this property is automatically updated by GTK+, so this function should only be used by applications which do not use GTK+ to create toplevel windows.
The function takes the following parameters:
- hideTitlebarWhenMaximized: whether to hide the titlebar when maximized.
func (*X11Window) SetThemeVariant ¶
SetThemeVariant: GTK+ applications can request a dark theme variant. In order to make other applications - namely window managers using GTK+ for themeing - aware of this choice, GTK+ uses this function to export the requested theme variant as _GTK_THEME_VARIANT property on toplevel windows.
Note that this property is automatically updated by GTK+, so this function should only be used by applications which do not use GTK+ to create toplevel windows.
The function takes the following parameters:
- variant: theme variant to export.
func (*X11Window) SetUTF8Property ¶
SetUTF8Property: this function modifies or removes an arbitrary X11 window property of type UTF8_STRING. If the given window is not a toplevel window, it is ignored.
The function takes the following parameters:
- name: property name, will be interned as an X atom.
- value (optional): property value, or NULL to delete.
func (*X11Window) SetUserTime ¶
SetUserTime: application can use this call to update the _NET_WM_USER_TIME property on a toplevel window. This property stores an Xserver time which represents the time of the last user input event received for this window. This property may be used by the window manager to alter the focus, stacking, and/or placement behavior of windows when they are mapped depending on whether the new window was created by a user action or is a "pop-up" window activated by a timer or some other event.
Note that this property is automatically updated by GDK, so this function should only be used by applications which handle input events bypassing GDK.
The function takes the following parameters:
- timestamp: XServer timestamp to which the property should be set.
Source Files ¶
- gdkx11.go
- gdkx11_export.go
- gdkx11applaunchcontext.go
- gdkx11cursor.go
- gdkx11device-core.go
- gdkx11device-xi2.go
- gdkx11device_3_2.go
- gdkx11devicemanager-core.go
- gdkx11devicemanager-xi2.go
- gdkx11devicemanager_3_2.go
- gdkx11display.go
- gdkx11display_2_24.go
- gdkx11display_2_4.go
- gdkx11displaymanager.go
- gdkx11dnd.go
- gdkx11glcontext.go
- gdkx11glcontext_3_16.go
- gdkx11keys.go
- gdkx11monitor.go
- gdkx11screen.go
- gdkx11selection_2_24.go
- gdkx11utils.go
- gdkx11utils_3_24_2.go
- gdkx11visual.go
- gdkx11window.go