dnd/session.go

Functions Structs

Functions

func CurrentPos

CurrentPos returns the current cursor position during the drag.

func (s *Session) CurrentPos() geometry.Point {
	return s.currentPos
}

func CurrentTarget

CurrentTarget returns the DropTarget currently under the cursor, or nil.

func (s *Session) CurrentTarget() DropTarget {
	return s.target
}

func Data

Data returns the drag data for this session.

func (s *Session) Data() DragData {
	return s.data
}

func Feedback

Feedback returns the current visual feedback for the drag.

func (s *Session) Feedback() Feedback {
	return s.feedback
}

func IsActive

IsActive returns true if the drag session is currently active.

func (s *Session) IsActive() bool {
	return s.active
}

func Source

Source returns the DragSource that initiated this session.

func (s *Session) Source() DragSource {
	return s.source
}

func StartPos

StartPos returns the position where the drag was initiated.

func (s *Session) StartPos() geometry.Point {
	return s.startPos
}

Structs

type Session struct

Session represents an active drag operation.

 

A Session is created by the Manager when a drag is initiated (mouse press

on a DragSource followed by movement beyond the drag threshold). It tracks

the drag data, source widget, positions, and current hover target.

 

Session is not safe for concurrent access. It is managed exclusively

by the Manager, which provides its own synchronization.

type Session struct {
	data		DragData
	source		DragSource
	startPos	geometry.Point
	currentPos	geometry.Point
	active		bool
	target		DropTarget
	feedback	Feedback
}