mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Auto merge of #11696 - mrmiywj:rename-to-less-repetitive, r=ConnorGBrewster
use less repetitive name <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #11689 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because just renaming <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11696) <!-- Reviewable:end -->
This commit is contained in:
commit
b5115fc895
6 changed files with 162 additions and 162 deletions
|
@ -105,27 +105,27 @@ impl Window {
|
|||
|
||||
fn cursor_type_for_cursor(&self, cursor: Cursor) -> cef_cursor_type_t {
|
||||
match cursor {
|
||||
Cursor::NoCursor => return cef_cursor_type_t::CT_NONE,
|
||||
Cursor::ContextMenuCursor => return cef_cursor_type_t::CT_CONTEXTMENU,
|
||||
Cursor::GrabbingCursor => return cef_cursor_type_t::CT_GRABBING,
|
||||
Cursor::CrosshairCursor => return cef_cursor_type_t::CT_CROSS,
|
||||
Cursor::CopyCursor => return cef_cursor_type_t::CT_COPY,
|
||||
Cursor::AliasCursor => return cef_cursor_type_t::CT_ALIAS,
|
||||
Cursor::TextCursor => return cef_cursor_type_t::CT_IBEAM,
|
||||
Cursor::GrabCursor | Cursor::AllScrollCursor =>
|
||||
Cursor::None => return cef_cursor_type_t::CT_NONE,
|
||||
Cursor::ContextMenu => return cef_cursor_type_t::CT_CONTEXTMENU,
|
||||
Cursor::Grabbing => return cef_cursor_type_t::CT_GRABBING,
|
||||
Cursor::Crosshair => return cef_cursor_type_t::CT_CROSS,
|
||||
Cursor::Copy => return cef_cursor_type_t::CT_COPY,
|
||||
Cursor::Alias => return cef_cursor_type_t::CT_ALIAS,
|
||||
Cursor::Text => return cef_cursor_type_t::CT_IBEAM,
|
||||
Cursor::Grab | Cursor::AllScroll =>
|
||||
return cef_cursor_type_t::CT_GRAB,
|
||||
Cursor::NoDropCursor => return cef_cursor_type_t::CT_NODROP,
|
||||
Cursor::NotAllowedCursor => return cef_cursor_type_t::CT_NOTALLOWED,
|
||||
Cursor::PointerCursor => return cef_cursor_type_t::CT_POINTER,
|
||||
Cursor::SResizeCursor => return cef_cursor_type_t::CT_SOUTHRESIZE,
|
||||
Cursor::WResizeCursor => return cef_cursor_type_t::CT_WESTRESIZE,
|
||||
Cursor::EwResizeCursor => return cef_cursor_type_t::CT_EASTWESTRESIZE,
|
||||
Cursor::ColResizeCursor => return cef_cursor_type_t::CT_COLUMNRESIZE,
|
||||
Cursor::EResizeCursor => return cef_cursor_type_t::CT_EASTRESIZE,
|
||||
Cursor::NResizeCursor => return cef_cursor_type_t::CT_NORTHRESIZE,
|
||||
Cursor::NsResizeCursor => return cef_cursor_type_t::CT_NORTHSOUTHRESIZE,
|
||||
Cursor::RowResizeCursor => return cef_cursor_type_t::CT_ROWRESIZE,
|
||||
Cursor::VerticalTextCursor => return cef_cursor_type_t::CT_VERTICALTEXT,
|
||||
Cursor::NoDrop => return cef_cursor_type_t::CT_NODROP,
|
||||
Cursor::NotAllowed => return cef_cursor_type_t::CT_NOTALLOWED,
|
||||
Cursor::Pointer => return cef_cursor_type_t::CT_POINTER,
|
||||
Cursor::SResize => return cef_cursor_type_t::CT_SOUTHRESIZE,
|
||||
Cursor::WResize => return cef_cursor_type_t::CT_WESTRESIZE,
|
||||
Cursor::EwResize => return cef_cursor_type_t::CT_EASTWESTRESIZE,
|
||||
Cursor::ColResize => return cef_cursor_type_t::CT_COLUMNRESIZE,
|
||||
Cursor::EResize => return cef_cursor_type_t::CT_EASTRESIZE,
|
||||
Cursor::NResize => return cef_cursor_type_t::CT_NORTHRESIZE,
|
||||
Cursor::NsResize => return cef_cursor_type_t::CT_NORTHSOUTHRESIZE,
|
||||
Cursor::RowResize => return cef_cursor_type_t::CT_ROWRESIZE,
|
||||
Cursor::VerticalText => return cef_cursor_type_t::CT_VERTICALTEXT,
|
||||
_ => return cef_cursor_type_t::CT_POINTER,
|
||||
}
|
||||
}
|
||||
|
@ -138,27 +138,27 @@ impl Window {
|
|||
|
||||
unsafe {
|
||||
match cursor {
|
||||
Cursor::NoCursor => return 0 as cef_cursor_handle_t,
|
||||
Cursor::ContextMenuCursor => msg_send![class("NSCursor"), contextualMenuCursor],
|
||||
Cursor::GrabbingCursor => msg_send![class("NSCursor"), closedHandCursor],
|
||||
Cursor::CrosshairCursor => msg_send![class("NSCursor"), crosshairCursor],
|
||||
Cursor::CopyCursor => msg_send![class("NSCursor"), dragCopyCursor],
|
||||
Cursor::AliasCursor => msg_send![class("NSCursor"), dragLinkCursor],
|
||||
Cursor::TextCursor => msg_send![class("NSCursor"), IBeamCursor],
|
||||
Cursor::GrabCursor | Cursor::AllScrollCursor =>
|
||||
Cursor::None => return 0 as cef_cursor_handle_t,
|
||||
Cursor::ContextMenu => msg_send![class("NSCursor"), contextualMenuCursor],
|
||||
Cursor::Grabbing => msg_send![class("NSCursor"), closedHandCursor],
|
||||
Cursor::Crosshair => msg_send![class("NSCursor"), crosshairCursor],
|
||||
Cursor::Copy => msg_send![class("NSCursor"), dragCopyCursor],
|
||||
Cursor::Alias => msg_send![class("NSCursor"), dragLinkCursor],
|
||||
Cursor::Text => msg_send![class("NSCursor"), IBeamCursor],
|
||||
Cursor::Grab | Cursor::AllScroll =>
|
||||
msg_send![class("NSCursor"), openHandCursor],
|
||||
Cursor::NoDropCursor | Cursor::NotAllowedCursor =>
|
||||
Cursor::NoDrop | Cursor::NotAllowed =>
|
||||
msg_send![class("NSCursor"), operationNotAllowedCursor],
|
||||
Cursor::PointerCursor => msg_send![class("NSCursor"), pointingHandCursor],
|
||||
Cursor::SResizeCursor => msg_send![class("NSCursor"), resizeDownCursor],
|
||||
Cursor::WResizeCursor => msg_send![class("NSCursor"), resizeLeftCursor],
|
||||
Cursor::EwResizeCursor | Cursor::ColResizeCursor =>
|
||||
Cursor::Pointer => msg_send![class("NSCursor"), pointingHandCursor],
|
||||
Cursor::SResize => msg_send![class("NSCursor"), resizeDownCursor],
|
||||
Cursor::WResize => msg_send![class("NSCursor"), resizeLeftCursor],
|
||||
Cursor::EwResize | Cursor::ColResize =>
|
||||
msg_send![class("NSCursor"), resizeLeftRightCursor],
|
||||
Cursor::EResizeCursor => msg_send![class("NSCursor"), resizeRightCursor],
|
||||
Cursor::NResizeCursor => msg_send![class("NSCursor"), resizeUpCursor],
|
||||
Cursor::NsResizeCursor | Cursor::RowResizeCursor =>
|
||||
Cursor::EResize => msg_send![class("NSCursor"), resizeRightCursor],
|
||||
Cursor::NResize => msg_send![class("NSCursor"), resizeUpCursor],
|
||||
Cursor::NsResize | Cursor::RowResize =>
|
||||
msg_send![class("NSCursor"), resizeUpDownCursor],
|
||||
Cursor::VerticalTextCursor => msg_send![class("NSCursor"), IBeamCursorForVerticalLayout],
|
||||
Cursor::VerticalText => msg_send![class("NSCursor"), IBeamCursorForVerticalLayout],
|
||||
_ => msg_send![class("NSCursor"), arrowCursor],
|
||||
}
|
||||
}
|
||||
|
|
|
@ -977,41 +977,41 @@ fn static_assert() {
|
|||
self.gecko.mCursor = match v {
|
||||
T::AutoCursor => structs::NS_STYLE_CURSOR_AUTO,
|
||||
T::SpecifiedCursor(cursor) => match cursor {
|
||||
Cursor::NoCursor => structs::NS_STYLE_CURSOR_NONE,
|
||||
Cursor::DefaultCursor => structs::NS_STYLE_CURSOR_DEFAULT,
|
||||
Cursor::PointerCursor => structs::NS_STYLE_CURSOR_POINTER,
|
||||
Cursor::ContextMenuCursor => structs::NS_STYLE_CURSOR_CONTEXT_MENU,
|
||||
Cursor::HelpCursor => structs::NS_STYLE_CURSOR_HELP,
|
||||
Cursor::ProgressCursor => structs::NS_STYLE_CURSOR_DEFAULT, // Gecko doesn't support "progress" yet
|
||||
Cursor::WaitCursor => structs::NS_STYLE_CURSOR_WAIT,
|
||||
Cursor::CellCursor => structs::NS_STYLE_CURSOR_CELL,
|
||||
Cursor::CrosshairCursor => structs::NS_STYLE_CURSOR_CROSSHAIR,
|
||||
Cursor::TextCursor => structs::NS_STYLE_CURSOR_TEXT,
|
||||
Cursor::VerticalTextCursor => structs::NS_STYLE_CURSOR_VERTICAL_TEXT,
|
||||
Cursor::AliasCursor => structs::NS_STYLE_CURSOR_ALIAS,
|
||||
Cursor::CopyCursor => structs::NS_STYLE_CURSOR_COPY,
|
||||
Cursor::MoveCursor => structs::NS_STYLE_CURSOR_MOVE,
|
||||
Cursor::NoDropCursor => structs::NS_STYLE_CURSOR_NO_DROP,
|
||||
Cursor::NotAllowedCursor => structs::NS_STYLE_CURSOR_NOT_ALLOWED,
|
||||
Cursor::GrabCursor => structs::NS_STYLE_CURSOR_GRAB,
|
||||
Cursor::GrabbingCursor => structs::NS_STYLE_CURSOR_GRABBING,
|
||||
Cursor::EResizeCursor => structs::NS_STYLE_CURSOR_E_RESIZE,
|
||||
Cursor::NResizeCursor => structs::NS_STYLE_CURSOR_N_RESIZE,
|
||||
Cursor::NeResizeCursor => structs::NS_STYLE_CURSOR_NE_RESIZE,
|
||||
Cursor::NwResizeCursor => structs::NS_STYLE_CURSOR_NW_RESIZE,
|
||||
Cursor::SResizeCursor => structs::NS_STYLE_CURSOR_S_RESIZE,
|
||||
Cursor::SeResizeCursor => structs::NS_STYLE_CURSOR_SE_RESIZE,
|
||||
Cursor::SwResizeCursor => structs::NS_STYLE_CURSOR_SW_RESIZE,
|
||||
Cursor::WResizeCursor => structs::NS_STYLE_CURSOR_W_RESIZE,
|
||||
Cursor::EwResizeCursor => structs::NS_STYLE_CURSOR_EW_RESIZE,
|
||||
Cursor::NsResizeCursor => structs::NS_STYLE_CURSOR_NS_RESIZE,
|
||||
Cursor::NeswResizeCursor => structs::NS_STYLE_CURSOR_NESW_RESIZE,
|
||||
Cursor::NwseResizeCursor => structs::NS_STYLE_CURSOR_NWSE_RESIZE,
|
||||
Cursor::ColResizeCursor => structs::NS_STYLE_CURSOR_COL_RESIZE,
|
||||
Cursor::RowResizeCursor => structs::NS_STYLE_CURSOR_ROW_RESIZE,
|
||||
Cursor::AllScrollCursor => structs::NS_STYLE_CURSOR_ALL_SCROLL,
|
||||
Cursor::ZoomInCursor => structs::NS_STYLE_CURSOR_ZOOM_IN,
|
||||
Cursor::ZoomOutCursor => structs::NS_STYLE_CURSOR_ZOOM_OUT,
|
||||
Cursor::None => structs::NS_STYLE_CURSOR_NONE,
|
||||
Cursor::Default => structs::NS_STYLE_CURSOR_DEFAULT,
|
||||
Cursor::Pointer => structs::NS_STYLE_CURSOR_POINTER,
|
||||
Cursor::ContextMenu => structs::NS_STYLE_CURSOR_CONTEXT_MENU,
|
||||
Cursor::Help => structs::NS_STYLE_CURSOR_HELP,
|
||||
Cursor::Progress => structs::NS_STYLE_CURSOR_DEFAULT, // Gecko doesn't support "progress" yet
|
||||
Cursor::Wait => structs::NS_STYLE_CURSOR_WAIT,
|
||||
Cursor::Cell => structs::NS_STYLE_CURSOR_CELL,
|
||||
Cursor::Crosshair => structs::NS_STYLE_CURSOR_CROSSHAIR,
|
||||
Cursor::Text => structs::NS_STYLE_CURSOR_TEXT,
|
||||
Cursor::VerticalText => structs::NS_STYLE_CURSOR_VERTICAL_TEXT,
|
||||
Cursor::Alias => structs::NS_STYLE_CURSOR_ALIAS,
|
||||
Cursor::Copy => structs::NS_STYLE_CURSOR_COPY,
|
||||
Cursor::Move => structs::NS_STYLE_CURSOR_MOVE,
|
||||
Cursor::NoDrop => structs::NS_STYLE_CURSOR_NO_DROP,
|
||||
Cursor::NotAllowed => structs::NS_STYLE_CURSOR_NOT_ALLOWED,
|
||||
Cursor::Grab => structs::NS_STYLE_CURSOR_GRAB,
|
||||
Cursor::Grabbing => structs::NS_STYLE_CURSOR_GRABBING,
|
||||
Cursor::EResize => structs::NS_STYLE_CURSOR_E_RESIZE,
|
||||
Cursor::NResize => structs::NS_STYLE_CURSOR_N_RESIZE,
|
||||
Cursor::NeResize => structs::NS_STYLE_CURSOR_NE_RESIZE,
|
||||
Cursor::NwResize => structs::NS_STYLE_CURSOR_NW_RESIZE,
|
||||
Cursor::SResize => structs::NS_STYLE_CURSOR_S_RESIZE,
|
||||
Cursor::SeResize => structs::NS_STYLE_CURSOR_SE_RESIZE,
|
||||
Cursor::SwResize => structs::NS_STYLE_CURSOR_SW_RESIZE,
|
||||
Cursor::WResize => structs::NS_STYLE_CURSOR_W_RESIZE,
|
||||
Cursor::EwResize => structs::NS_STYLE_CURSOR_EW_RESIZE,
|
||||
Cursor::NsResize => structs::NS_STYLE_CURSOR_NS_RESIZE,
|
||||
Cursor::NeswResize => structs::NS_STYLE_CURSOR_NESW_RESIZE,
|
||||
Cursor::NwseResize => structs::NS_STYLE_CURSOR_NWSE_RESIZE,
|
||||
Cursor::ColResize => structs::NS_STYLE_CURSOR_COL_RESIZE,
|
||||
Cursor::RowResize => structs::NS_STYLE_CURSOR_ROW_RESIZE,
|
||||
Cursor::AllScroll => structs::NS_STYLE_CURSOR_ALL_SCROLL,
|
||||
Cursor::ZoomIn => structs::NS_STYLE_CURSOR_ZOOM_IN,
|
||||
Cursor::ZoomOut => structs::NS_STYLE_CURSOR_ZOOM_OUT,
|
||||
}
|
||||
} as u8;
|
||||
}
|
||||
|
|
|
@ -727,41 +727,41 @@ impl WindowMethods for Window {
|
|||
use glutin::MouseCursor;
|
||||
|
||||
let glutin_cursor = match c {
|
||||
Cursor::NoCursor => MouseCursor::NoneCursor,
|
||||
Cursor::DefaultCursor => MouseCursor::Default,
|
||||
Cursor::PointerCursor => MouseCursor::Hand,
|
||||
Cursor::ContextMenuCursor => MouseCursor::ContextMenu,
|
||||
Cursor::HelpCursor => MouseCursor::Help,
|
||||
Cursor::ProgressCursor => MouseCursor::Progress,
|
||||
Cursor::WaitCursor => MouseCursor::Wait,
|
||||
Cursor::CellCursor => MouseCursor::Cell,
|
||||
Cursor::CrosshairCursor => MouseCursor::Crosshair,
|
||||
Cursor::TextCursor => MouseCursor::Text,
|
||||
Cursor::VerticalTextCursor => MouseCursor::VerticalText,
|
||||
Cursor::AliasCursor => MouseCursor::Alias,
|
||||
Cursor::CopyCursor => MouseCursor::Copy,
|
||||
Cursor::MoveCursor => MouseCursor::Move,
|
||||
Cursor::NoDropCursor => MouseCursor::NoDrop,
|
||||
Cursor::NotAllowedCursor => MouseCursor::NotAllowed,
|
||||
Cursor::GrabCursor => MouseCursor::Grab,
|
||||
Cursor::GrabbingCursor => MouseCursor::Grabbing,
|
||||
Cursor::EResizeCursor => MouseCursor::EResize,
|
||||
Cursor::NResizeCursor => MouseCursor::NResize,
|
||||
Cursor::NeResizeCursor => MouseCursor::NeResize,
|
||||
Cursor::NwResizeCursor => MouseCursor::NwResize,
|
||||
Cursor::SResizeCursor => MouseCursor::SResize,
|
||||
Cursor::SeResizeCursor => MouseCursor::SeResize,
|
||||
Cursor::SwResizeCursor => MouseCursor::SwResize,
|
||||
Cursor::WResizeCursor => MouseCursor::WResize,
|
||||
Cursor::EwResizeCursor => MouseCursor::EwResize,
|
||||
Cursor::NsResizeCursor => MouseCursor::NsResize,
|
||||
Cursor::NeswResizeCursor => MouseCursor::NeswResize,
|
||||
Cursor::NwseResizeCursor => MouseCursor::NwseResize,
|
||||
Cursor::ColResizeCursor => MouseCursor::ColResize,
|
||||
Cursor::RowResizeCursor => MouseCursor::RowResize,
|
||||
Cursor::AllScrollCursor => MouseCursor::AllScroll,
|
||||
Cursor::ZoomInCursor => MouseCursor::ZoomIn,
|
||||
Cursor::ZoomOutCursor => MouseCursor::ZoomOut,
|
||||
Cursor::None => MouseCursor::NoneCursor,
|
||||
Cursor::Default => MouseCursor::Default,
|
||||
Cursor::Pointer => MouseCursor::Hand,
|
||||
Cursor::ContextMenu => MouseCursor::ContextMenu,
|
||||
Cursor::Help => MouseCursor::Help,
|
||||
Cursor::Progress => MouseCursor::Progress,
|
||||
Cursor::Wait => MouseCursor::Wait,
|
||||
Cursor::Cell => MouseCursor::Cell,
|
||||
Cursor::Crosshair => MouseCursor::Crosshair,
|
||||
Cursor::Text => MouseCursor::Text,
|
||||
Cursor::VerticalText => MouseCursor::VerticalText,
|
||||
Cursor::Alias => MouseCursor::Alias,
|
||||
Cursor::Copy => MouseCursor::Copy,
|
||||
Cursor::Move => MouseCursor::Move,
|
||||
Cursor::NoDrop => MouseCursor::NoDrop,
|
||||
Cursor::NotAllowed => MouseCursor::NotAllowed,
|
||||
Cursor::Grab => MouseCursor::Grab,
|
||||
Cursor::Grabbing => MouseCursor::Grabbing,
|
||||
Cursor::EResize => MouseCursor::EResize,
|
||||
Cursor::NResize => MouseCursor::NResize,
|
||||
Cursor::NeResize => MouseCursor::NeResize,
|
||||
Cursor::NwResize => MouseCursor::NwResize,
|
||||
Cursor::SResize => MouseCursor::SResize,
|
||||
Cursor::SeResize => MouseCursor::SeResize,
|
||||
Cursor::SwResize => MouseCursor::SwResize,
|
||||
Cursor::WResize => MouseCursor::WResize,
|
||||
Cursor::EwResize => MouseCursor::EwResize,
|
||||
Cursor::NsResize => MouseCursor::NsResize,
|
||||
Cursor::NeswResize => MouseCursor::NeswResize,
|
||||
Cursor::NwseResize => MouseCursor::NwseResize,
|
||||
Cursor::ColResize => MouseCursor::ColResize,
|
||||
Cursor::RowResize => MouseCursor::RowResize,
|
||||
Cursor::AllScroll => MouseCursor::AllScroll,
|
||||
Cursor::ZoomIn => MouseCursor::ZoomIn,
|
||||
Cursor::ZoomOut => MouseCursor::ZoomOut,
|
||||
};
|
||||
self.window.set_cursor(glutin_cursor);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue