pointer_constraints

package
v0.0.0-...-0ad78d1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: BSD-2-Clause Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfinedPointer

type ConfinedPointer struct {
	client.BaseProxy
	// contains filtered or unexported fields
}

ConfinedPointer : confined pointer object

The wp_confined_pointer interface represents a confined pointer state.

This object will send the event 'confined' when the confinement is activated. Whenever the confinement is activated, it is guaranteed that the surface the pointer is confined to will already have received pointer focus and that the pointer will be within the region passed to the request creating this object. It is up to the compositor to decide whether this requires some user interaction and if the pointer will warp to within the passed region if outside.

To unconfine the pointer, send the destroy request. This will also destroy the wp_confined_pointer object.

If the compositor decides to unconfine the pointer the unconfined event is sent. The wp_confined_pointer object is at this point defunct and should be destroyed.

func NewConfinedPointer

func NewConfinedPointer(ctx *client.Context) *ConfinedPointer

NewConfinedPointer : confined pointer object

The wp_confined_pointer interface represents a confined pointer state.

This object will send the event 'confined' when the confinement is activated. Whenever the confinement is activated, it is guaranteed that the surface the pointer is confined to will already have received pointer focus and that the pointer will be within the region passed to the request creating this object. It is up to the compositor to decide whether this requires some user interaction and if the pointer will warp to within the passed region if outside.

To unconfine the pointer, send the destroy request. This will also destroy the wp_confined_pointer object.

If the compositor decides to unconfine the pointer the unconfined event is sent. The wp_confined_pointer object is at this point defunct and should be destroyed.

func (*ConfinedPointer) Destroy

func (i *ConfinedPointer) Destroy() error

Destroy : destroy the confined pointer object

Destroy the confined pointer object. If applicable, the compositor will unconfine the pointer.

func (*ConfinedPointer) Dispatch

func (i *ConfinedPointer) Dispatch(opcode uint32, fd int, data []byte)

func (*ConfinedPointer) SetConfinedHandler

func (i *ConfinedPointer) SetConfinedHandler(f ConfinedPointerConfinedHandlerFunc)

SetConfinedHandler : sets handler for ConfinedPointerConfinedEvent

func (*ConfinedPointer) SetRegion

func (i *ConfinedPointer) SetRegion(region *client.Region) error

SetRegion : set a new confine region

Set a new region used to confine the pointer.

The new confine region is double-buffered. The new confine region will only take effect when the associated surface gets its pending state applied. See wl_surface.commit for details.

If the confinement is active when the new confinement region is applied and the pointer ends up outside of newly applied region, the pointer may warped to a position within the new confinement region. If warped, a wl_pointer.motion event will be emitted, but no wp_relative_pointer.relative_motion event.

The compositor may also, instead of using the new region, unconfine the pointer.

For details about the confine region, see wp_confined_pointer.

region: region of surface

func (*ConfinedPointer) SetUnconfinedHandler

func (i *ConfinedPointer) SetUnconfinedHandler(f ConfinedPointerUnconfinedHandlerFunc)

SetUnconfinedHandler : sets handler for ConfinedPointerUnconfinedEvent

type ConfinedPointerConfinedEvent

type ConfinedPointerConfinedEvent struct{}

ConfinedPointerConfinedEvent : pointer confined

Notification that the pointer confinement of the seat's pointer is activated.

type ConfinedPointerConfinedHandlerFunc

type ConfinedPointerConfinedHandlerFunc func(ConfinedPointerConfinedEvent)

type ConfinedPointerUnconfinedEvent

type ConfinedPointerUnconfinedEvent struct{}

ConfinedPointerUnconfinedEvent : pointer unconfined

Notification that the pointer confinement of the seat's pointer is no longer active. If this is a oneshot pointer confinement (see wp_pointer_constraints.lifetime) this object is now defunct and should be destroyed. If this is a persistent pointer confinement (see wp_pointer_constraints.lifetime) this pointer confinement may again reactivate in the future.

type ConfinedPointerUnconfinedHandlerFunc

type ConfinedPointerUnconfinedHandlerFunc func(ConfinedPointerUnconfinedEvent)

type LockedPointer

type LockedPointer struct {
	client.BaseProxy
	// contains filtered or unexported fields
}

LockedPointer : receive relative pointer motion events

The wp_locked_pointer interface represents a locked pointer state.

While the lock of this object is active, the wl_pointer objects of the associated seat will not emit any wl_pointer.motion events.

This object will send the event 'locked' when the lock is activated. Whenever the lock is activated, it is guaranteed that the locked surface will already have received pointer focus and that the pointer will be within the region passed to the request creating this object.

To unlock the pointer, send the destroy request. This will also destroy the wp_locked_pointer object.

If the compositor decides to unlock the pointer the unlocked event is sent. See wp_locked_pointer.unlock for details.

When unlocking, the compositor may warp the cursor position to the set cursor position hint. If it does, it will not result in any relative motion events emitted via wp_relative_pointer.

If the surface the lock was requested on is destroyed and the lock is not yet activated, the wp_locked_pointer object is now defunct and must be destroyed.

func NewLockedPointer

func NewLockedPointer(ctx *client.Context) *LockedPointer

NewLockedPointer : receive relative pointer motion events

The wp_locked_pointer interface represents a locked pointer state.

While the lock of this object is active, the wl_pointer objects of the associated seat will not emit any wl_pointer.motion events.

This object will send the event 'locked' when the lock is activated. Whenever the lock is activated, it is guaranteed that the locked surface will already have received pointer focus and that the pointer will be within the region passed to the request creating this object.

To unlock the pointer, send the destroy request. This will also destroy the wp_locked_pointer object.

If the compositor decides to unlock the pointer the unlocked event is sent. See wp_locked_pointer.unlock for details.

When unlocking, the compositor may warp the cursor position to the set cursor position hint. If it does, it will not result in any relative motion events emitted via wp_relative_pointer.

If the surface the lock was requested on is destroyed and the lock is not yet activated, the wp_locked_pointer object is now defunct and must be destroyed.

func (*LockedPointer) Destroy

func (i *LockedPointer) Destroy() error

Destroy : destroy the locked pointer object

Destroy the locked pointer object. If applicable, the compositor will unlock the pointer.

func (*LockedPointer) Dispatch

func (i *LockedPointer) Dispatch(opcode uint32, fd int, data []byte)

func (*LockedPointer) SetCursorPositionHint

func (i *LockedPointer) SetCursorPositionHint(surfaceX, surfaceY float64) error

SetCursorPositionHint : set the pointer cursor position hint

Set the cursor position hint relative to the top left corner of the surface.

If the client is drawing its own cursor, it should update the position hint to the position of its own cursor. A compositor may use this information to warp the pointer upon unlock in order to avoid pointer jumps.

The cursor position hint is double buffered. The new hint will only take effect when the associated surface gets it pending state applied. See wl_surface.commit for details.

surfaceX: surface-local x coordinate
surfaceY: surface-local y coordinate

func (*LockedPointer) SetLockedHandler

func (i *LockedPointer) SetLockedHandler(f LockedPointerLockedHandlerFunc)

SetLockedHandler : sets handler for LockedPointerLockedEvent

func (*LockedPointer) SetRegion

func (i *LockedPointer) SetRegion(region *client.Region) error

SetRegion : set a new lock region

Set a new region used to lock the pointer.

The new lock region is double-buffered. The new lock region will only take effect when the associated surface gets its pending state applied. See wl_surface.commit for details.

For details about the lock region, see wp_locked_pointer.

region: region of surface

func (*LockedPointer) SetUnlockedHandler

func (i *LockedPointer) SetUnlockedHandler(f LockedPointerUnlockedHandlerFunc)

SetUnlockedHandler : sets handler for LockedPointerUnlockedEvent

type LockedPointerLockedEvent

type LockedPointerLockedEvent struct{}

LockedPointerLockedEvent : lock activation event

Notification that the pointer lock of the seat's pointer is activated.

type LockedPointerLockedHandlerFunc

type LockedPointerLockedHandlerFunc func(LockedPointerLockedEvent)

type LockedPointerUnlockedEvent

type LockedPointerUnlockedEvent struct{}

LockedPointerUnlockedEvent : lock deactivation event

Notification that the pointer lock of the seat's pointer is no longer active. If this is a oneshot pointer lock (see wp_pointer_constraints.lifetime) this object is now defunct and should be destroyed. If this is a persistent pointer lock (see wp_pointer_constraints.lifetime) this pointer lock may again reactivate in the future.

type LockedPointerUnlockedHandlerFunc

type LockedPointerUnlockedHandlerFunc func(LockedPointerUnlockedEvent)

type PointerConstraints

type PointerConstraints struct {
	client.BaseProxy
}

PointerConstraints : constrain the movement of a pointer

The global interface exposing pointer constraining functionality. It exposes two requests: lock_pointer for locking the pointer to its position, and confine_pointer for locking the pointer to a region.

The lock_pointer and confine_pointer requests create the objects wp_locked_pointer and wp_confined_pointer respectively, and the client can use these objects to interact with the lock.

For any surface, only one lock or confinement may be active across all wl_pointer objects of the same seat. If a lock or confinement is requested when another lock or confinement is active or requested on the same surface and with any of the wl_pointer objects of the same seat, an 'already_constrained' error will be raised.

func NewPointerConstraints

func NewPointerConstraints(ctx *client.Context) *PointerConstraints

NewPointerConstraints : constrain the movement of a pointer

The global interface exposing pointer constraining functionality. It exposes two requests: lock_pointer for locking the pointer to its position, and confine_pointer for locking the pointer to a region.

The lock_pointer and confine_pointer requests create the objects wp_locked_pointer and wp_confined_pointer respectively, and the client can use these objects to interact with the lock.

For any surface, only one lock or confinement may be active across all wl_pointer objects of the same seat. If a lock or confinement is requested when another lock or confinement is active or requested on the same surface and with any of the wl_pointer objects of the same seat, an 'already_constrained' error will be raised.

func (*PointerConstraints) ConfinePointer

func (i *PointerConstraints) ConfinePointer(surface *client.Surface, pointer *client.Pointer, region *client.Region, lifetime uint32) (*ConfinedPointer, error)

ConfinePointer : confine pointer to a region

The confine_pointer request lets the client request to confine the pointer cursor to a given region. This request may not take effect immediately; in the future, when the compositor deems implementation- specific constraints are satisfied, the pointer confinement will be activated and the compositor sends a confined event.

The intersection of the region passed with this request and the input region of the surface is used to determine where the pointer must be in order for the confinement to activate. It is up to the compositor whether to warp the pointer or require some kind of user interaction for the confinement to activate. If the region is null the surface input region is used.

The request will create a new object wp_confined_pointer which is used to interact with the confinement as well as receive updates about its state. See the the description of wp_confined_pointer for further information.

surface: surface to lock pointer to
pointer: the pointer that should be confined
region: region of surface
lifetime: confinement lifetime

func (*PointerConstraints) Destroy

func (i *PointerConstraints) Destroy() error

Destroy : destroy the pointer constraints manager object

Used by the client to notify the server that it will no longer use this pointer constraints object.

func (*PointerConstraints) LockPointer

func (i *PointerConstraints) LockPointer(surface *client.Surface, pointer *client.Pointer, region *client.Region, lifetime uint32) (*LockedPointer, error)

LockPointer : lock pointer to a position

The lock_pointer request lets the client request to disable movements of the virtual pointer (i.e. the cursor), effectively locking the pointer to a position. This request may not take effect immediately; in the future, when the compositor deems implementation-specific constraints are satisfied, the pointer lock will be activated and the compositor sends a locked event.

The protocol provides no guarantee that the constraints are ever satisfied, and does not require the compositor to send an error if the constraints cannot ever be satisfied. It is thus possible to request a lock that will never activate.

There may not be another pointer constraint of any kind requested or active on the surface for any of the wl_pointer objects of the seat of the passed pointer when requesting a lock. If there is, an error will be raised. See general pointer lock documentation for more details.

The intersection of the region passed with this request and the input region of the surface is used to determine where the pointer must be in order for the lock to activate. It is up to the compositor whether to warp the pointer or require some kind of user interaction for the lock to activate. If the region is null the surface input region is used.

A surface may receive pointer focus without the lock being activated.

The request creates a new object wp_locked_pointer which is used to interact with the lock as well as receive updates about its state. See the the description of wp_locked_pointer for further information.

Note that while a pointer is locked, the wl_pointer objects of the corresponding seat will not emit any wl_pointer.motion events, but relative motion events will still be emitted via wp_relative_pointer objects of the same seat. wl_pointer.axis and wl_pointer.button events are unaffected.

surface: surface to lock pointer to
pointer: the pointer that should be locked
region: region of surface
lifetime: lock lifetime

type PointerConstraintsError

type PointerConstraintsError uint32
const (
	// PointerConstraintsErrorAlreadyConstrained : pointer constraint already requested on that surface
	PointerConstraintsErrorAlreadyConstrained PointerConstraintsError = 1
)

PointerConstraintsError : wp_pointer_constraints error values

These errors can be emitted in response to wp_pointer_constraints requests.

func (PointerConstraintsError) Name

func (PointerConstraintsError) String

func (e PointerConstraintsError) String() string

func (PointerConstraintsError) Value

func (e PointerConstraintsError) Value() string

type PointerConstraintsLifetime

type PointerConstraintsLifetime uint32
const (
	PointerConstraintsLifetimeOneshot    PointerConstraintsLifetime = 1
	PointerConstraintsLifetimePersistent PointerConstraintsLifetime = 2
)

PointerConstraintsLifetime : constraint lifetime

These values represent different lifetime semantics. They are passed as arguments to the factory requests to specify how the constraint lifetimes should be managed.

func (PointerConstraintsLifetime) Name

func (PointerConstraintsLifetime) String

func (PointerConstraintsLifetime) Value

Jump to

Keyboard shortcuts

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