diff --git a/Cargo.toml b/Cargo.toml index 05ad2c93..95985fbc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,8 +8,10 @@ license = "MIT OR Apache-2.0" repository = "https://github.com/servo/core-foundation-rs" rust-version = "1.65" -# TODO: Remove most of these by fixing the actual issues. [workspace.lints] +clippy.doc_markdown = "warn" + +# TODO: Remove most of these by fixing the actual issues. clippy.assertions_on_constants = "allow" clippy.len_without_is_empty = "allow" clippy.manual_range_contains = "allow" diff --git a/clippy.toml b/clippy.toml index 0c939de2..2645ae1e 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1 @@ -doc-valid-idents = ["CoreFoundation", ".."] +doc-valid-idents = ["ACEScg", "CoreFoundation", ".."] diff --git a/core-graphics/src/event.rs b/core-graphics/src/event.rs index 625702d8..96c3e967 100644 --- a/core-graphics/src/event.rs +++ b/core-graphics/src/event.rs @@ -677,10 +677,12 @@ impl CGEvent { #[cfg_attr(feature = "link", link(name = "CoreGraphics", kind = "framework"))] extern "C" { - /// Return the type identifier for the opaque type `CGEventRef'. + /// Return the type identifier for the opaque type [`CGEventRef`]. + /// + /// [`CGEventRef`]: crate::sys::CGEventRef fn CGEventGetTypeID() -> CFTypeID; - /// Return a new event using the event source `source'. If `source' is NULL, + /// Return a new event using the event source `source`. If `source` is NULL, /// the default source is used. fn CGEventCreate(source: crate::sys::CGEventSourceRef) -> crate::sys::CGEventRef; @@ -703,11 +705,11 @@ extern "C" { /// Return a new mouse event. /// /// The event source may be taken from another event, or may be NULL. - /// `mouseType' should be one of the mouse event types. `mouseCursorPosition' + /// `mouseType` should be one of the mouse event types. `mouseCursorPosition` /// should be the position of the mouse cursor in global coordinates. - /// `mouseButton' should be the button that's changing state; `mouseButton' - /// is ignored unless `mouseType' is one of `kCGEventOtherMouseDown', - /// `kCGEventOtherMouseDragged', or `kCGEventOtherMouseUp'. + /// `mouseButton` should be the button that's changing state; `mouseButton` + /// is ignored unless `mouseType` is one of `kCGEventOtherMouseDown`, + /// `kCGEventOtherMouseDragged`, or `kCGEventOtherMouseUp`. /// /// The current implementation of the event system supports a maximum of /// thirty-two buttons. Mouse button 0 is the primary button on the mouse. @@ -720,7 +722,7 @@ extern "C" { mouseButton: CGMouseButton, ) -> crate::sys::CGEventRef; - /// A non-variadic variant version of CGEventCreateScrollWheelEvent. + /// A non-variadic variant version of [`CGEventCreateScrollWheelEvent`]. /// /// Returns a new Quartz scrolling event. /// @@ -756,7 +758,9 @@ extern "C" { fn CGEventGetFlags(event: crate::sys::CGEventRef) -> CGEventFlags; /// Return the location of an event in global display coordinates. - /// CGPointZero is returned if event is not a valid crate::sys::CGEventRef. + /// `CGPointZero` is returned if event is not a valid [`CGEventRef`]. + /// + /// [`CGEventRef`]: crate::sys::CGEventRef fn CGEventGetLocation(event: crate::sys::CGEventRef) -> CGPoint; /// Set the event type of an event. @@ -785,13 +789,13 @@ extern "C" { /// Set the integer value of a field in an event. /// /// Before calling this function, the event type must be set using a typed - /// event creation function such as `CGEventCreateMouseEvent', or by - /// calling `CGEventSetType'. + /// event creation function such as [`CGEventCreateMouseEvent`], or by + /// calling [`CGEventSetType`]. /// /// If you are creating a mouse event generated by a tablet, call this - /// function and specify the field `kCGMouseEventSubtype' with a value of - /// `kCGEventMouseSubtypeTabletPoint' or - /// `kCGEventMouseSubtypeTabletProximity' before setting other parameters. + /// function and specify the field `kCGMouseEventSubtype` with a value of + /// `kCGEventMouseSubtypeTabletPoint` or + /// `kCGEventMouseSubtypeTabletProximity` before setting other parameters. fn CGEventSetIntegerValueField(event: crate::sys::CGEventRef, field: CGEventField, value: i64); /// Return the floating-point value of a field in an event. @@ -804,8 +808,8 @@ extern "C" { /// Set the floating-point value of a field in an event. /// /// Before calling this function, the event type must be set using a typed - /// event creation function such as `CGEventCreateMouseEvent', or by calling - /// `CGEventSetType'. + /// event creation function such as [`CGEventCreateMouseEvent`], or by calling + /// [`CGEventSetType`]. /// /// In cases where the field’s value is represented within the event by a /// fixed point number or integer, the value parameter is scaled as needed diff --git a/core-graphics/src/event_source.rs b/core-graphics/src/event_source.rs index ed3c6541..ff8dc290 100644 --- a/core-graphics/src/event_source.rs +++ b/core-graphics/src/event_source.rs @@ -38,7 +38,9 @@ impl CGEventSource { #[cfg_attr(feature = "link", link(name = "CoreGraphics", kind = "framework"))] extern "C" { - /// Return the type identifier for the opaque type `CGEventSourceRef'. + /// Return the type identifier for the opaque type [`CGEventSourceRef`]. + /// + /// [`CGEventSourceRef`]: crate::sys::CGEventSourceRef fn CGEventSourceGetTypeID() -> CFTypeID; /// Return a Quartz event source created with a specified source state.