Remove usages of extern crate. (#672)

This commit is contained in:
Bruce Mitchener
2024-05-27 13:40:54 +07:00
committed by GitHub
parent a496791d62
commit 8d2b732db5
38 changed files with 37 additions and 101 deletions
+1
View File
@@ -11,6 +11,7 @@ use super::sys::CGColorRef;
use crate::base::CGFloat;
use core_foundation::base::CFTypeID;
use core_foundation::base::TCFType;
use core_foundation::{declare_TCFType, impl_TCFType};
pub use super::sys::CGColorRef as SysCGColorRef;
+1 -1
View File
@@ -9,7 +9,7 @@
use core_foundation::base::{CFRelease, CFRetain, CFTypeID};
use core_foundation::string::CFStringRef;
use foreign_types::ForeignType;
use foreign_types::{foreign_type, ForeignType};
foreign_type! {
#[doc(hidden)]
+1 -1
View File
@@ -20,7 +20,7 @@ use std::os::raw::c_void;
use crate::geometry::{CGAffineTransform, CGRect};
use crate::image::CGImage;
use foreign_types::{ForeignType, ForeignTypeRef};
use foreign_types::{foreign_type, ForeignType, ForeignTypeRef};
use std::cmp;
use std::ptr;
use std::slice;
+1 -1
View File
@@ -16,7 +16,7 @@ use std::os::raw::c_void;
use std::ptr;
use std::sync::Arc;
use foreign_types::{ForeignType, ForeignTypeRef};
use foreign_types::{foreign_type, ForeignType, ForeignTypeRef};
pub type CGDataProviderGetBytesCallback =
Option<unsafe extern "C" fn(*mut c_void, *mut c_void, size_t) -> size_t>;
+1 -1
View File
@@ -19,7 +19,7 @@ pub use crate::geometry::{CGPoint, CGRect, CGSize};
use crate::image::CGImage;
use core_foundation::base::{CFRetain, TCFType};
use core_foundation::string::{CFString, CFStringRef};
use foreign_types::ForeignType;
use foreign_types::{foreign_type, ForeignType};
pub type CGDirectDisplayID = u32;
pub type CGWindowID = u32;
+3 -2
View File
@@ -1,11 +1,13 @@
#![allow(non_upper_case_globals)]
use crate::event_source::CGEventSource;
use crate::geometry::CGPoint;
use bitflags::bitflags;
use core_foundation::{
base::{CFRelease, CFRetain, CFTypeID, TCFType},
mach_port::{CFMachPort, CFMachPortRef},
};
use foreign_types::ForeignType;
use foreign_types::{foreign_type, ForeignType};
use libc::c_void;
use std::mem::ManuallyDrop;
@@ -441,7 +443,6 @@ unsafe extern "C" fn cg_event_tap_callback_internal(
}
/// ```no_run
///extern crate core_foundation;
///use core_foundation::runloop::{kCFRunLoopCommonModes, CFRunLoop};
///use core_graphics::event::{CGEventTap, CGEventTapLocation, CGEventTapPlacement, CGEventTapOptions, CGEventType};
///let current = CFRunLoop::get_current();
+1 -1
View File
@@ -1,5 +1,5 @@
use core_foundation::base::{CFRelease, CFRetain, CFTypeID};
use foreign_types::ForeignType;
use foreign_types::{foreign_type, ForeignType};
/// Possible source states of an event source.
#[repr(C)]
+1 -1
View File
@@ -17,7 +17,7 @@ use core_foundation::number::CFNumber;
use core_foundation::string::{CFString, CFStringRef};
use std::ptr::NonNull;
use foreign_types::ForeignType;
use foreign_types::{foreign_type, ForeignType};
use libc::{c_int, size_t};
+2 -1
View File
@@ -13,9 +13,10 @@ use crate::base::CGFloat;
use crate::color::CGColor;
use crate::color_space::CGColorSpace;
use bitflags::bitflags;
use core_foundation::array::{CFArray, CFArrayRef};
use core_foundation::base::{CFRelease, CFRetain, TCFType};
use foreign_types::ForeignType;
use foreign_types::{foreign_type, ForeignType};
use libc::size_t;
+1 -1
View File
@@ -6,7 +6,7 @@ use crate::data_provider::{CGDataProvider, CGDataProviderRef};
use crate::geometry::CGRect;
use core_foundation::base::{CFRetain, CFTypeID};
use core_foundation::data::CFData;
use foreign_types::{ForeignType, ForeignTypeRef};
use foreign_types::{foreign_type, ForeignType, ForeignTypeRef};
use libc::size_t;
#[repr(C)]
-13
View File
@@ -7,19 +7,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
extern crate libc;
#[macro_use]
extern crate core_foundation;
#[macro_use]
extern crate bitflags;
#[macro_use]
extern crate foreign_types;
extern crate core_graphics_types;
#[cfg(target_os = "macos")]
pub mod access;
pub mod base;
+1 -1
View File
@@ -11,7 +11,7 @@ pub use crate::sys::CGPathRef as SysCGPathRef;
use crate::geometry::{CGAffineTransform, CGPoint, CGRect};
use core_foundation::base::{CFRelease, CFRetain, CFTypeID};
use foreign_types::ForeignType;
use foreign_types::{foreign_type, ForeignType};
use libc::c_void;
use std::fmt::{self, Debug, Formatter};
use std::marker::PhantomData;