gdkx11

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GTypeX11AppLaunchContext = coreglib.Type(C.gdk_x11_app_launch_context_get_type())
	GTypeX11DeviceManagerXI2 = coreglib.Type(C.gdk_x11_device_manager_xi2_get_type())
	GTypeX11DeviceXI2        = coreglib.Type(C.gdk_x11_device_xi2_get_type())
	GTypeX11Display          = coreglib.Type(C.gdk_x11_display_get_type())
	GTypeX11Drag             = coreglib.Type(C.gdk_x11_drag_get_type())
	GTypeX11GLContext        = coreglib.Type(C.gdk_x11_gl_context_get_type())
	GTypeX11Monitor          = coreglib.Type(C.gdk_x11_monitor_get_type())
	GTypeX11Screen           = coreglib.Type(C.gdk_x11_screen_get_type())
	GTypeX11Surface          = coreglib.Type(C.gdk_x11_surface_get_type())
)

GType values.

Functions

func X11DeviceGetID

func X11DeviceGetID(device *X11DeviceXI2) int

X11DeviceGetID returns the device ID as seen by XInput2.

The function takes the following parameters:

  • device: Device.

The function returns the following values:

  • gint: XInput2 device ID.

func X11DisplayOpen

func X11DisplayOpen(displayName string) *gdk.Display

X11DisplayOpen tries to open a new display to the X server given by display_name. If opening the display fails, NULL is returned.

The function takes the following parameters:

  • displayName (optional): name of the X display. See the XOpenDisplay() for details.

The function returns the following values:

  • display (optional): new display or NULL on error.

func X11DisplaySetProgramClass

func X11DisplaySetProgramClass(display *gdk.Display, programClass string)

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

The function takes the following parameters:

  • display: Display.
  • programClass: string.

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 X11GetServerTime

func X11GetServerTime(surface *X11Surface) uint32

X11GetServerTime: routine to get the current X server time stamp.

The function takes the following parameters:

  • surface used for communication with the server. The surface 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 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.

Types

type X11AppLaunchContext

type X11AppLaunchContext struct {
	gdk.AppLaunchContext
	// contains filtered or unexported fields
}

type X11DeviceManagerXI2

type X11DeviceManagerXI2 struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

type X11DeviceType

type X11DeviceType C.gint
const (
	X11DeviceTypeLogical X11DeviceType = iota
	X11DeviceTypePhysical
	X11DeviceTypeFloating
)

func (X11DeviceType) String

func (x X11DeviceType) String() string

String returns the name in string for X11DeviceType.

type X11DeviceXI2

type X11DeviceXI2 struct {
	gdk.Device
	// contains filtered or unexported fields
}

func X11DeviceManagerLookup

func X11DeviceManagerLookup(deviceManager *X11DeviceManagerXI2, deviceId int) *X11DeviceXI2

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:

  • x11DeviceXI2 (optional) wrapping the device ID, or NULL if the given ID doesn’t currently represent a device.

type X11Display

type X11Display struct {
	gdk.Display
	// contains filtered or unexported fields
}

func (*X11Display) ConnectXevent

func (display *X11Display) ConnectXevent(f func(xevent unsafe.Pointer) (ok bool)) coreglib.SignalHandle

ConnectXevent 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 Event, you can use gdk_display_put_event().

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.

func (*X11Display) DefaultGroup

func (display *X11Display) DefaultGroup() gdk.Surfacer

DefaultGroup returns the default group leader surface for all toplevel surfaces on display. This surface is implicitly created by GDK. See gdk_x11_surface_set_group().

The function returns the following values:

  • surface: default group leader surface for display.

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.

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.

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.

func (*X11Display) GLXVersion

func (display *X11Display) GLXVersion() (major, minor int, ok bool)

GLXVersion retrieves the version of the GLX implementation.

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 (*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) PrimaryMonitor

func (display *X11Display) PrimaryMonitor() *gdk.Monitor

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

The function returns the following values:

  • monitor: primary monitor, or any monitor if no primary monitor is configured by the user.

func (*X11Display) Screen

func (display *X11Display) Screen() *X11Screen

Screen retrieves the X11Screen of the display.

The function returns the following values:

  • x11Screen: X11Screen.

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_from_name() are updated to reflect the theme change. Custom cursors constructed with gdk_cursor_new_from_texture() 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_display_notify_startup_complete()).

The function takes the following parameters:

  • startupId: startup notification ID (must be valid utf8).

func (*X11Display) SetSurfaceScale

func (display *X11Display) SetSurfaceScale(scale int)

SetSurfaceScale 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) StringToCompoundText

func (display *X11Display) StringToCompoundText(str string) (encoding string, format int, ctext []byte, gint int)

StringToCompoundText: convert a string from the encoding of the current locale into a form suitable for storing in a window property.

The function takes the following parameters:

  • str: nul-terminated string.

The function returns the following values:

  • encoding: location to store the encoding (to be used as the type for the property).
  • format: location to store the format of the property.
  • ctext: location to store newly allocated data for the property.
  • gint: 0 upon success, non-zero upon failure.

func (*X11Display) UTF8ToCompoundText

func (display *X11Display) UTF8ToCompoundText(str string) (string, int, []byte, bool)

UTF8ToCompoundText converts from UTF-8 to compound text.

The function takes the following parameters:

  • str: UTF-8 string.

The function returns the following values:

  • encoding: location to store resulting encoding.
  • format: location to store format of the result.
  • ctext: location to store the data of the result.
  • ok: TRUE if the conversion succeeded, otherwise FALSE.

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_surface_set_user_time().

The function returns the following values:

  • guint32: timestamp of the last user interaction.

type X11Drag

type X11Drag struct {
	gdk.Drag
	// contains filtered or unexported fields
}

type X11GLContext

type X11GLContext struct {
	gdk.GLContext
	// contains filtered or unexported fields
}

type X11Monitor

type X11Monitor struct {
	gdk.Monitor
	// contains filtered or unexported fields
}

func (*X11Monitor) Workarea

func (monitor *X11Monitor) Workarea() *gdk.Rectangle

Workarea retrieves the size and position of the “work area” on a monitor within the display coordinate space. The returned geometry is in ”application pixels”, not in ”device pixels” (see gdk_monitor_get_scale_factor()).

The function returns the following values:

  • workarea to be filled with the monitor workarea.

type X11Screen

type X11Screen struct {
	*coreglib.Object
	// contains filtered or unexported fields
}

func (*X11Screen) ConnectWindowManagerChanged

func (screen *X11Screen) ConnectWindowManagerChanged(f func()) coreglib.SignalHandle

func (*X11Screen) CurrentDesktop

func (screen *X11Screen) CurrentDesktop() uint32

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

func (screen *X11Screen) NumberOfDesktops() uint32

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

func (screen *X11Screen) ScreenNumber() int

ScreenNumber returns the index of a X11Screen.

The function returns the following values:

  • gint: position of screen among the screens of its display.

func (*X11Screen) SupportsNetWmHint

func (screen *X11Screen) SupportsNetWmHint(propertyName string) bool

SupportsNetWmHint: this function is specific to the X11 backend of GDK, and indicates whether the window manager supports a certain hint from the Extended Window Manager Hints (http://www.freedesktop.org/Standards/wm-spec) specification.

When using this function, keep in mind that the window manager can change over time; so you shouldn’t use this function in a way that impacts persistent application state. A common bug is that your application can start up before the window manager does when the user logs in, and before the window manager starts gdk_x11_screen_supports_net_wm_hint() will return FALSE for every property. You can monitor the window_manager_changed signal on X11Screen to detect a window manager change.

The function takes the following parameters:

  • propertyName: name of the WM property.

The function returns the following values:

  • ok: TRUE if the window manager supports property.

func (*X11Screen) WindowManagerName

func (screen *X11Screen) WindowManagerName() string

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 X11Surface

type X11Surface struct {
	gdk.Surface
	// contains filtered or unexported fields
}

func (*X11Surface) Desktop

func (surface *X11Surface) Desktop() uint32

Desktop gets the number of the workspace surface is on.

The function returns the following values:

  • guint32: current workspace of surface.

func (*X11Surface) Group

func (surface *X11Surface) Group() gdk.Surfacer

Group returns the group this surface belongs to.

The function returns the following values:

  • ret: group of this surface;.

func (*X11Surface) MoveToCurrentDesktop

func (surface *X11Surface) MoveToCurrentDesktop()

MoveToCurrentDesktop moves the surface 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 surface is already on all workspaces.

func (*X11Surface) MoveToDesktop

func (surface *X11Surface) MoveToDesktop(desktop uint32)

MoveToDesktop moves the surface 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 surface to.

func (*X11Surface) SetFrameSyncEnabled

func (surface *X11Surface) SetFrameSyncEnabled(frameSyncEnabled bool)

SetFrameSyncEnabled: this function can be used to disable frame synchronization for a surface. Normally frame synchronziation will be enabled or disabled based on whether the system has a compositor that supports frame synchronization, but if the surface is not directly managed by the window manager, then frame synchronziation may need to be disabled. This is the case for a surface embedded via the XEMBED protocol.

The function takes the following parameters:

  • frameSyncEnabled: whether frame-synchronization should be enabled.

func (*X11Surface) SetGroup

func (surface *X11Surface) SetGroup(leader gdk.Surfacer)

SetGroup sets the group leader of surface to be leader. See the ICCCM for details.

The function takes the following parameters:

  • leader: Surface.

func (*X11Surface) SetSkipPagerHint

func (surface *X11Surface) SetSkipPagerHint(skipsPager bool)

SetSkipPagerHint sets a hint on surface that pagers should not display it. See the EWMH for details.

The function takes the following parameters:

  • skipsPager: TRUE to skip pagers.

func (*X11Surface) SetSkipTaskbarHint

func (surface *X11Surface) SetSkipTaskbarHint(skipsTaskbar bool)

SetSkipTaskbarHint sets a hint on surface that taskbars should not display it. See the EWMH for details.

The function takes the following parameters:

  • skipsTaskbar: TRUE to skip taskbars.

func (*X11Surface) SetThemeVariant

func (surface *X11Surface) SetThemeVariant(variant string)

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

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

The function takes the following parameters:

  • variant: theme variant to export.

func (*X11Surface) SetUTF8Property

func (surface *X11Surface) SetUTF8Property(name, value string)

SetUTF8Property: this function modifies or removes an arbitrary X11 window property of type UTF8_STRING. If the given surface is not a toplevel surface, 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 (*X11Surface) SetUrgencyHint

func (surface *X11Surface) SetUrgencyHint(urgent bool)

SetUrgencyHint sets a hint on surface that it needs user attention. See the ICCCM for details.

The function takes the following parameters:

  • urgent: TRUE to indicate urgenct attention needed.

func (*X11Surface) SetUserTime

func (surface *X11Surface) SetUserTime(timestamp uint32)

SetUserTime: application can use this call to update the _NET_WM_USER_TIME property on a toplevel surface. This property stores an Xserver time which represents the time of the last user input event received for this surface. This property may be used by the window manager to alter the focus, stacking, and/or placement behavior of surfaces when they are mapped depending on whether the new surface was created by a user action or is a "pop-up" surface 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL