aboutsummaryrefslogtreecommitdiffstats
path: root/components/embedder_traits/lib.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2019-01-20 15:38:14 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2019-01-20 16:31:01 +0100
commit90c0ec0cf77f37d2e3da838ee25bca137733f3ce (patch)
tree7d02a1e496343ee068e8416e3b996cadd4869c23 /components/embedder_traits/lib.rs
parent05881b5ab4bf6f18d09763978ee5924a5b0dd895 (diff)
downloadservo-90c0ec0cf77f37d2e3da838ee25bca137733f3ce.tar.gz
servo-90c0ec0cf77f37d2e3da838ee25bca137733f3ce.zip
Fix servo build and rustfmt recent changes.
We need to introduce another Cursor enum that is specific to embedder_traits and that layout converts to to avoid dependency hell.
Diffstat (limited to 'components/embedder_traits/lib.rs')
-rw-r--r--components/embedder_traits/lib.rs47
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