gtklayershell

package
v0.0.0-...-6efa9f6 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MPL-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoExclusiveZoneEnable

func AutoExclusiveZoneEnable(window *gtk.Window)

AutoExclusiveZoneEnable: when auto exclusive zone is enabled, exclusive zone is automatically set to the size of the window + relevant margin. To disable auto exclusive zone, just set the exclusive zone to 0 or any other fixed value.

NOTE: you can control the auto exclusive zone by changing the margin on the non-anchored edge. This behavior is specific to gtk-layer-shell and not part of the underlying protocol.

The function takes the following parameters:

  • window: layer surface.

func AutoExclusiveZoneIsEnabled

func AutoExclusiveZoneIsEnabled(window *gtk.Window) bool

The function takes the following parameters:

  • window: layer surface.

The function returns the following values:

  • ok: if the surface's exclusive zone is set to change based on the window's size.

func GetAnchor

func GetAnchor(window *gtk.Window, edge Edge) bool

The function takes the following parameters:

  • window: layer surface.
  • edge

The function returns the following values:

  • ok: if this surface is anchored to the given edge.

func GetExclusiveZone

func GetExclusiveZone(window *gtk.Window) int

The function takes the following parameters:

  • window: layer surface.

The function returns the following values:

  • gint window's exclusive zone (which may have been set manually or automatically).

func GetKeyboardInteractivity

func GetKeyboardInteractivity(window *gtk.Window) bool

GetKeyboardInteractivity: deprecated: Use gtk_layer_get_keyboard_mode () instead.

The function takes the following parameters:

  • window: layer surface.

The function returns the following values:

  • ok: if keyboard interactivity is enabled.

func GetMajorVersion

func GetMajorVersion() uint

The function returns the following values:

  • guint: major version number of the GTK Layer Shell library.

func GetMargin

func GetMargin(window *gtk.Window, edge Edge) int

The function takes the following parameters:

  • window: layer surface.
  • edge

The function returns the following values:

  • gint: size of the margin for the given edge.

func GetMicroVersion

func GetMicroVersion() uint

The function returns the following values:

  • guint: micro/patch version number of the GTK Layer Shell library.

func GetMinorVersion

func GetMinorVersion() uint

The function returns the following values:

  • guint: minor version number of the GTK Layer Shell library.

func GetMonitor

func GetMonitor(window *gtk.Window) *gdk.Monitor

GetMonitor: NOTE: To get which monitor the surface is actually on, use gdk_display_get_monitor_at_window().

The function takes the following parameters:

  • window: layer surface.

The function returns the following values:

  • monitor this surface will/has requested to be on, can be NULL.

func GetNamespace

func GetNamespace(window *gtk.Window) string

GetNamespace: NOTE: this function does not return ownership of the string. Do not free the returned string. Future calls into the library may invalidate the returned string.

The function takes the following parameters:

  • window: layer surface.

The function returns the following values:

  • utf8: reference to the namespace property. If namespace is unset, returns the default namespace ("gtk-layer-shell"). Never returns NULL.

func GetProtocolVersion

func GetProtocolVersion() uint

GetProtocolVersion: may block for a Wayland roundtrip the first time it's called.

The function returns the following values:

  • guint: version of the zwlr_layer_shell_v1 protocol supported by the compositor or 0 if the protocol is not supported.

func InitForWindow

func InitForWindow(window *gtk.Window)

InitForWindow: set the window up to be a layer surface once it is mapped. this must be called before the window is realized.

The function takes the following parameters:

  • window to be turned into a layer surface.

func IsLayerWindow

func IsLayerWindow(window *gtk.Window) bool

The function takes the following parameters:

  • window that may or may not have a layer surface.

The function returns the following values:

  • ok: if window has been initialized as a layer surface.

func IsSupported

func IsSupported() bool

IsSupported: may block for a Wayland roundtrip the first time it's called.

The function returns the following values:

  • ok: TRUE if the platform is Wayland and Wayland compositor supports the zwlr_layer_shell_v1 protocol.

func SetAnchor

func SetAnchor(window *gtk.Window, edge Edge, anchorToEdge bool)

SetAnchor: set whether window should be anchored to edge.

- If two perpendicular edges are anchored, the surface with be anchored to that corner

- If two opposite edges are anchored, the window will be stretched across the screen in that direction

Default is FALSE for each LayerShellEdge.

The function takes the following parameters:

  • window: layer surface.
  • edge this layer surface may be anchored to.
  • anchorToEdge: whether or not to anchor this layer surface to edge.

func SetExclusiveZone

func SetExclusiveZone(window *gtk.Window, exclusiveZone int)

SetExclusiveZone has no effect unless the surface is anchored to an edge. Requests that the compositor does not place other surfaces within the given exclusive zone of the anchored edge. For example, a panel can request to not be covered by maximized windows. See wlr-layer-shell-unstable-v1.xml for details.

Default is 0.

The function takes the following parameters:

  • window: layer surface.
  • exclusiveZone: size of the exclusive zone.

func SetKeyboardInteractivity deprecated

func SetKeyboardInteractivity(window *gtk.Window, interactivity bool)

SetKeyboardInteractivity: whether the window should receive keyboard events from the compositor.

Default is FALSE

Deprecated: Use gtk_layer_set_keyboard_mode () instead.

The function takes the following parameters:

  • window: layer surface.
  • interactivity: whether the layer surface should receive keyboard events.

func SetKeyboardMode

func SetKeyboardMode(window *gtk.Window, mode KeyboardMode)

SetKeyboardMode sets if/when window should receive keyboard events from the compositor, see GtkLayerShellKeyboardMode for details.

Default is GTK_LAYER_SHELL_KEYBOARD_MODE_NONE.

The function takes the following parameters:

  • window: layer surface.
  • mode: type of keyboard interactivity requested.

func SetLayer

func SetLayer(window *gtk.Window, layer Layer)

SetLayer: set the "layer" on which the surface appears (controls if it is over top of or below other surfaces). The layer may be changed on-the-fly in the current version of the layer shell protocol, but on compositors that only support an older version the window is remapped so the change can take effect.

Default is GTK_LAYER_SHELL_LAYER_TOP.

The function takes the following parameters:

  • window: layer surface.
  • layer on which this surface appears.

func SetMargin

func SetMargin(window *gtk.Window, edge Edge, marginSize int)

SetMargin: set the margin for a specific edge of a window. Effects both surface's distance from the edge and its exclusive zone size (if auto exclusive zone enabled).

Default is 0 for each LayerShellEdge.

The function takes the following parameters:

  • window: layer surface.
  • edge for which to set the margin.
  • marginSize: margin for edge to be set.

func SetMonitor

func SetMonitor(window *gtk.Window, monitor *gdk.Monitor)

SetMonitor: set the output for the window to be placed on, or NULL to let the compositor choose. If the window is currently mapped, it will get remapped so the change can take effect.

Default is NULL.

The function takes the following parameters:

  • window: layer surface.
  • monitor: output this layer surface will be placed on (NULL to let the compositor decide).

func SetNamespace

func SetNamespace(window *gtk.Window, nameSpace string)

SetNamespace: set the "namespace" of the surface.

No one is quite sure what this is for, but it probably should be something generic ("panel", "osk", etc). The name_space string is copied, and caller maintains ownership of original. If the window is currently mapped, it will get remapped so the change can take effect.

Default is "gtk-layer-shell" (which will be used if set to NULL).

The function takes the following parameters:

  • window: layer surface.
  • nameSpace: namespace of this layer surface.

Types

type Edge

type Edge C.gint
const (
	// LayerShellEdgeLeft: left edge of the screen.
	LayerShellEdgeLeft Edge = iota
	// LayerShellEdgeRight: right edge of the screen.
	LayerShellEdgeRight
	// LayerShellEdgeTop: top edge of the screen.
	LayerShellEdgeTop
	// LayerShellEdgeBottom: bottom edge of the screen.
	LayerShellEdgeBottom
	// LayerShellEdgeEntryNumber: should not be used except to get the number of
	// entries. (NOTE: may change in future releases as more entries are added).
	LayerShellEdgeEntryNumber
)

func (Edge) String

func (e Edge) String() string

String returns the name in string for Edge.

type KeyboardMode

type KeyboardMode C.gint

KeyboardMode: GTK_LAYER_SHELL_KEYBOARD_MODE_NONE: This window should not receive keyboard events. GTK_LAYER_SHELL_KEYBOARD_MODE_EXCLUSIVE: This window should have exclusive focus if it is on the top or overlay layer. GTK_LAYER_SHELL_KEYBOARD_MODE_ON_DEMAND: The user should be able to focus and unfocues this window in an implementation defined way. Not supported for protocol version < 4. GTK_LAYER_SHELL_KEYBOARD_MODE_ENTRY_NUMBER: Should not be used except to get the number of entries. (NOTE: may change in future releases as more entries are added).

const (
	LayerShellKeyboardModeNone KeyboardMode = iota
	LayerShellKeyboardModeExclusive
	LayerShellKeyboardModeOnDemand
	LayerShellKeyboardModeEntryNumber
)

func GetKeyboardMode

func GetKeyboardMode(window *gtk.Window) KeyboardMode

The function takes the following parameters:

  • window: layer surface.

The function returns the following values:

  • keyboardMode: current keyboard interactivity mode for window.

func (KeyboardMode) String

func (k KeyboardMode) String() string

String returns the name in string for KeyboardMode.

type Layer

type Layer C.gint
const (
	// LayerShellLayerBackground: background layer.
	LayerShellLayerBackground Layer = iota
	// LayerShellLayerBottom: bottom layer.
	LayerShellLayerBottom
	// LayerShellLayerTop: top layer.
	LayerShellLayerTop
	// LayerShellLayerOverlay: overlay layer.
	LayerShellLayerOverlay
	// LayerShellLayerEntryNumber: should not be used except to get the number
	// of entries. (NOTE: may change in future releases as more entries are
	// added).
	LayerShellLayerEntryNumber
)

func GetLayer

func GetLayer(window *gtk.Window) Layer

The function takes the following parameters:

  • window: layer surface.

The function returns the following values:

  • layer: current layer.

func (Layer) String

func (l Layer) String() string

String returns the name in string for Layer.

Jump to

Keyboard shortcuts

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