All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.nacular.doodle.event.PointerEvent.kt Maven / Gradle / Ivy

There is a newer version: 0.10.4
Show newest version
package io.nacular.doodle.event

import io.nacular.doodle.core.Internal
import io.nacular.doodle.core.View
import io.nacular.doodle.geometry.Point
import io.nacular.doodle.system.SystemInputEvent.Modifier
import io.nacular.doodle.system.SystemPointerEvent
import io.nacular.doodle.system.SystemPointerEvent.Button
import io.nacular.doodle.system.SystemPointerEvent.Type

/**
 * Represents a pointing device (Mouse, Pen, Touch, etc.).
 */
public inline class Pointer(internal val id: Int)

/**
 * Represents an interaction with a View by a [Pointer].
 *
 * @constructor
 * @param pointer responsible for the interaction
 * @param target of the interaction
 * @param state the Pointer is in
 * @param location of the Pointer within its [target]
 * @param absoluteLocation of the Pointer within the Display
 *
 * @property pointer responsible for the interaction
 * @property target of the interaction
 * @property state the Pointer is in
 * @property location of the Pointer within its [target]
 * @property absoluteLocation of the Pointer within the Display
 */
public class Interaction internal constructor(
        public   val pointer         : Pointer,
        public   val target          : View,
        public   val state           : Type,
        public   val location        : Point,
        internal val absoluteLocation: Point
)

/**
 * Event triggered when a pointing device (Mouse, Pen, Touch, etc.) interacts with a View.
 *
 * @constructor
 * @param source receiving the notification
 * @param target where the Pointer interaction occurred
 * @param buttons that are pressed (applicable for Mouse)
 * @param targetInteractions active Pointers that started within the [target]
 * @param changedInteractions active Pointers that changed since the last event
 * @param allInteractions that are currently active (even those not directed at the [target])
 * @param modifiers that are pressed
 *
 * @property target where the Pointer interaction occurred
 * @property buttons that are pressed (applicable for Mouse)
 * @property targetInteractions active Pointers that started within the [target]
 * @property changedInteractions active Pointers that changed since the last event
 */
public class PointerEvent internal constructor(
                   source             : View,
        public val target             : View,
        public val buttons            : Set




© 2015 - 2025 Weber Informatics LLC | Privacy Policy