diff options
Diffstat (limited to 'components/embedder_traits/lib.rs')
-rw-r--r-- | components/embedder_traits/lib.rs | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/components/embedder_traits/lib.rs b/components/embedder_traits/lib.rs index e25ad11d13e..fbf1102dec3 100644 --- a/components/embedder_traits/lib.rs +++ b/components/embedder_traits/lib.rs @@ -7,6 +7,8 @@ extern crate lazy_static; #[macro_use] extern crate log; #[macro_use] +extern crate num_derive; +#[macro_use] extern crate serde; pub mod resources; @@ -17,9 +19,50 @@ use keyboard_types::KeyboardEvent; use msg::constellation_msg::{InputMethodType, PipelineId, TopLevelBrowsingContextId}; use servo_url::ServoUrl; use std::fmt::{Debug, Error, Formatter}; -use style_traits::cursor::CursorKind; use webrender_api::{DeviceIntPoint, DeviceIntSize}; +/// A cursor for the window. This is different from a CSS cursor (see +/// `CursorKind`) in that it has no `Auto` value. +#[repr(u8)] +#[derive(Copy, Clone, FromPrimitive, PartialEq, Eq, Deserialize, Serialize)] +pub enum Cursor { + None, + Default, + Pointer, + ContextMenu, + Help, + Progress, + Wait, + Cell, + Crosshair, + Text, + VerticalText, + Alias, + Copy, + Move, + NoDrop, + NotAllowed, + Grab, + Grabbing, + EResize, + NResize, + NeResize, + NwResize, + SResize, + SeResize, + SwResize, + WResize, + EwResize, + NsResize, + NeswResize, + NwseResize, + ColResize, + RowResize, + AllScroll, + ZoomIn, + ZoomOut, +} + /// Used to wake up the event loop, provided by the servo port/embedder. pub trait EventLoopWaker: 'static + Send { fn clone(&self) -> Box<EventLoopWaker + Send>; @@ -90,7 +133,7 @@ pub enum EmbedderMsg { /// Sends an unconsumed key event back to the embedder. Keyboard(KeyboardEvent), /// Changes the cursor. - SetCursor(CursorKind), + SetCursor(Cursor), /// A favicon was detected NewFavicon(ServoUrl), /// <head> tag finished parsing |