docs: Fix various markdown issues. (#639)
This commit is contained in:
@@ -0,0 +1 @@
|
||||
doc-valid-idents = ["CoreFoundation", ".."]
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
/// Creates a Cocoa delegate to use e.g. with `NSWindow.setDelegate_`.
|
||||
/// Adds instance variables and methods to the definition.
|
||||
///
|
||||
/// # Example with NSWindowDelegate
|
||||
/// # Example with `NSWindowDelegate`
|
||||
/// ``` no_run
|
||||
/// #[macro_use] extern crate cocoa;
|
||||
/// #[macro_use] extern crate objc;
|
||||
|
||||
@@ -158,7 +158,7 @@ pub trait TCFType {
|
||||
/// The reference type wrapped inside this type.
|
||||
type Ref: TCFTypeRef;
|
||||
|
||||
/// Returns the object as its concrete TypeRef.
|
||||
/// Returns the object as its concrete `TypeRef`.
|
||||
fn as_concrete_TypeRef(&self) -> Self::Ref;
|
||||
|
||||
/// Returns an instance of the object, wrapping the underlying `CFTypeRef` subclass. Use this
|
||||
@@ -211,7 +211,7 @@ pub trait TCFType {
|
||||
unsafe { CFShow(self.as_CFTypeRef()) }
|
||||
}
|
||||
|
||||
/// Returns true if this value is an instance of another type.
|
||||
/// Returns `true` if this value is an instance of another type.
|
||||
#[inline]
|
||||
fn instance_of<OtherCFType: TCFType>(&self) -> bool {
|
||||
self.type_of() == OtherCFType::type_id()
|
||||
@@ -303,7 +303,7 @@ impl<'a, T: PartialEq> PartialEq for ItemMutRef<'a, T> {
|
||||
}
|
||||
}
|
||||
|
||||
/// A trait describing how to convert from the stored *mut c_void to the desired T
|
||||
/// A trait describing how to convert from the stored `*mut c_void` to the desired `T`
|
||||
pub unsafe trait FromMutVoid {
|
||||
unsafe fn from_mut_void<'a>(x: *mut c_void) -> ItemMutRef<'a, Self>
|
||||
where
|
||||
@@ -331,7 +331,7 @@ unsafe impl<T: TCFType> FromMutVoid for T {
|
||||
}
|
||||
}
|
||||
|
||||
/// A trait describing how to convert from the stored *const c_void to the desired T
|
||||
/// A trait describing how to convert from the stored `*const c_void` to the desired `T`
|
||||
pub unsafe trait FromVoid {
|
||||
unsafe fn from_void<'a>(x: *const c_void) -> ItemRef<'a, Self>
|
||||
where
|
||||
@@ -361,7 +361,7 @@ unsafe impl<T: TCFType> FromVoid for T {
|
||||
}
|
||||
}
|
||||
|
||||
/// A trait describing how to convert from the stored *const c_void to the desired T
|
||||
/// A trait describing how to convert from the stored `*const c_void` to the desired `T`
|
||||
pub unsafe trait ToVoid<T> {
|
||||
fn to_void(&self) -> *const c_void;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ impl_TCFType!(CFData, CFDataRef, CFDataGetTypeID);
|
||||
impl_CFTypeDescription!(CFData);
|
||||
|
||||
impl CFData {
|
||||
/// Creates a CFData around a copy `buffer`
|
||||
/// Creates a [`CFData`] around a copy `buffer`
|
||||
pub fn from_buffer(buffer: &[u8]) -> CFData {
|
||||
unsafe {
|
||||
let data_ref = CFDataCreate(
|
||||
@@ -38,7 +38,7 @@ impl CFData {
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates a CFData referencing `buffer` without creating a copy
|
||||
/// Creates a [`CFData`] referencing `buffer` without creating a copy
|
||||
pub fn from_arc<T: AsRef<[u8]> + Sync + Send>(buffer: Arc<T>) -> Self {
|
||||
use crate::base::{CFAllocator, CFAllocatorContext};
|
||||
use std::os::raw::c_void;
|
||||
|
||||
@@ -163,8 +163,8 @@ impl CFPropertyList {
|
||||
unsafe { CFGetRetainCount(self.as_CFTypeRef()) }
|
||||
}
|
||||
|
||||
/// Returns the type ID of this object. Will be one of CFData, CFString, CFArray, CFDictionary,
|
||||
/// CFDate, CFBoolean, or CFNumber.
|
||||
/// Returns the type ID of this object. Will be one of `CFData`, `CFString`, `CFArray`,
|
||||
/// `CFDictionary`, `CFDate`, `CFBoolean`, or `CFNumber`.
|
||||
#[inline]
|
||||
pub fn type_of(&self) -> CFTypeID {
|
||||
unsafe { CFGetTypeID(self.as_CFTypeRef()) }
|
||||
@@ -175,7 +175,7 @@ impl CFPropertyList {
|
||||
unsafe { CFShow(self.as_CFTypeRef()) }
|
||||
}
|
||||
|
||||
/// Returns true if this value is an instance of another type.
|
||||
/// Returns `true` if this value is an instance of another type.
|
||||
#[inline]
|
||||
pub fn instance_of<OtherCFType: TCFType>(&self) -> bool {
|
||||
self.type_of() == OtherCFType::type_id()
|
||||
|
||||
@@ -30,7 +30,7 @@ impl_TCFType!(CFString, CFStringRef, CFStringGetTypeID);
|
||||
impl FromStr for CFString {
|
||||
type Err = ();
|
||||
|
||||
/// See also CFString::new for a variant of this which does not return a Result
|
||||
/// See also [`CFString::new()`] for a variant of this which does not return a `Result`.
|
||||
#[inline]
|
||||
fn from_str(string: &str) -> Result<CFString, ()> {
|
||||
Ok(CFString::new(string))
|
||||
|
||||
@@ -67,8 +67,8 @@ impl CFTimeZone {
|
||||
CFTimeZone::new(offset.local_minus_utc() as f64)
|
||||
}
|
||||
|
||||
/// The timezone database ID that identifies the time zone. E.g. "America/Los_Angeles" or
|
||||
/// "Europe/Paris".
|
||||
/// The timezone database ID that identifies the time zone. E.g. `"America/Los_Angeles" `or
|
||||
/// `"Europe/Paris"`.
|
||||
pub fn name(&self) -> CFString {
|
||||
unsafe { CFString::wrap_under_get_rule(CFTimeZoneGetName(self.0)) }
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ impl ScreenCaptureAccess {
|
||||
unsafe { CGRequestScreenCaptureAccess() == 1 }
|
||||
}
|
||||
|
||||
/// Return true if has access
|
||||
/// Return `true` if has access
|
||||
#[inline]
|
||||
pub fn preflight(&self) -> bool {
|
||||
unsafe { CGPreflightScreenCaptureAccess() == 1 }
|
||||
|
||||
@@ -106,10 +106,10 @@ impl CGDataProviderRef {
|
||||
/// Encapsulates custom data that can be wrapped.
|
||||
pub trait CustomData {
|
||||
/// Returns a pointer to the start of the custom data. This pointer *must not change* during
|
||||
/// the lifespan of this CustomData.
|
||||
/// the lifespan of this `CustomData`.
|
||||
unsafe fn ptr(&self) -> *const u8;
|
||||
/// Returns the length of this custom data. This value must not change during the lifespan of
|
||||
/// this CustomData.
|
||||
/// this `CustomData`.
|
||||
unsafe fn len(&self) -> usize;
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +177,7 @@ impl EventField {
|
||||
pub const MOUSE_EVENT_INSTANT_MOUSER: CGEventField = 6;
|
||||
|
||||
/// Key to access an integer field that encodes the mouse event subtype as
|
||||
/// a `kCFNumberIntType'.
|
||||
/// a `kCFNumberIntType`.
|
||||
pub const MOUSE_EVENT_SUB_TYPE: CGEventField = 7;
|
||||
|
||||
/// Key to access an integer field, non-zero when this is an autorepeat of
|
||||
@@ -208,7 +208,7 @@ impl EventField {
|
||||
/// since the last scrolling event from a Mighty Mouse scroller or a
|
||||
/// single-wheel mouse scroller. The scrolling data uses a fixed-point
|
||||
/// 16.16 signed integer format. If this key is passed to
|
||||
/// `CGEventGetDoubleValueField', the fixed-point value is converted to a
|
||||
/// `CGEventGetDoubleValueField`, the fixed-point value is converted to a
|
||||
/// double value.
|
||||
pub const SCROLL_WHEEL_EVENT_FIXED_POINT_DELTA_AXIS_1: CGEventField = 93;
|
||||
|
||||
@@ -216,7 +216,7 @@ impl EventField {
|
||||
/// represents a line-based or pixel-based change in horizontal position
|
||||
/// since the last scrolling event from a Mighty Mouse scroller. The
|
||||
/// scrolling data uses a fixed-point 16.16 signed integer format. If this
|
||||
/// key is passed to `CGEventGetDoubleValueField', the fixed-point value is
|
||||
/// key is passed to `CGEventGetDoubleValueField`, the fixed-point value is
|
||||
/// converted to a double value.
|
||||
pub const SCROLL_WHEEL_EVENT_FIXED_POINT_DELTA_AXIS_2: CGEventField = 94;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user