Minor refactoring of mouse event types

* Move some types into the `msg` crate so they can be shared more.
* Use MouseEventType instead of duplicating it in other enums.
This commit is contained in:
Matt Brubeck 2015-12-02 11:49:37 -08:00
parent 2be60be062
commit 8c4fed42b0
13 changed files with 43 additions and 64 deletions

View file

@ -307,6 +307,24 @@ pub enum ScriptMsg {
ViewportConstrained(PipelineId, ViewportConstraints),
}
#[derive(Deserialize, HeapSizeOf, Serialize)]
pub enum MouseEventType {
Click,
MouseDown,
MouseUp,
}
/// The mouse button involved in the event.
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub enum MouseButton {
/// The left mouse button.
Left,
/// The middle mouse button.
Middle,
/// The right mouse button.
Right,
}
/// Messages from the paint task to the constellation.
#[derive(Deserialize, Serialize)]
pub enum PaintMsg {