diff options
Diffstat (limited to 'vendor/core-foundation-sys/src/attributed_string.rs')
-rw-r--r-- | vendor/core-foundation-sys/src/attributed_string.rs | 99 |
1 files changed, 82 insertions, 17 deletions
diff --git a/vendor/core-foundation-sys/src/attributed_string.rs b/vendor/core-foundation-sys/src/attributed_string.rs index c91bf5be3..54c27ec41 100644 --- a/vendor/core-foundation-sys/src/attributed_string.rs +++ b/vendor/core-foundation-sys/src/attributed_string.rs @@ -7,49 +7,114 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use crate::base::{Boolean, CFAllocatorRef, CFIndex, CFRange, CFTypeID, CFTypeRef}; +use crate::dictionary::CFDictionaryRef; +use crate::string::CFMutableStringRef; +use crate::string::CFStringRef; use std::os::raw::c_void; -use base::{CFAllocatorRef, CFTypeRef, CFIndex, CFRange, CFTypeID}; -use string::CFStringRef; -use dictionary::CFDictionaryRef; #[repr(C)] pub struct __CFAttributedString(c_void); pub type CFAttributedStringRef = *const __CFAttributedString; -pub type CFMutableAttributedStringRef = *const __CFAttributedString; +pub type CFMutableAttributedStringRef = *mut __CFAttributedString; -extern { - /* CFAttributedString */ +extern "C" { + /* + * CFAttributedString.h + */ + /* CFAttributedString */ + /* Creating a CFAttributedString */ pub fn CFAttributedStringCreate( allocator: CFAllocatorRef, str: CFStringRef, attributes: CFDictionaryRef, ) -> CFAttributedStringRef; - + pub fn CFAttributedStringCreateCopy( + alloc: CFAllocatorRef, + aStr: CFAttributedStringRef, + ) -> CFAttributedStringRef; + pub fn CFAttributedStringCreateWithSubstring( + alloc: CFAllocatorRef, + aStr: CFAttributedStringRef, + range: CFRange, + ) -> CFAttributedStringRef; pub fn CFAttributedStringGetLength(astr: CFAttributedStringRef) -> CFIndex; + pub fn CFAttributedStringGetString(aStr: CFAttributedStringRef) -> CFStringRef; + + /* Accessing Attributes */ + pub fn CFAttributedStringGetAttribute( + aStr: CFAttributedStringRef, + loc: CFIndex, + attrName: CFStringRef, + effectiveRange: *mut CFRange, + ) -> CFTypeRef; + pub fn CFAttributedStringGetAttributes( + aStr: CFAttributedStringRef, + loc: CFIndex, + effectiveRange: *mut CFRange, + ) -> CFDictionaryRef; + pub fn CFAttributedStringGetAttributeAndLongestEffectiveRange( + aStr: CFAttributedStringRef, + loc: CFIndex, + attrName: CFStringRef, + inRange: CFRange, + longestEffectiveRange: *mut CFRange, + ) -> CFTypeRef; + pub fn CFAttributedStringGetAttributesAndLongestEffectiveRange( + aStr: CFAttributedStringRef, + loc: CFIndex, + inRange: CFRange, + longestEffectiveRange: *mut CFRange, + ) -> CFDictionaryRef; + /* Getting Attributed String Properties */ pub fn CFAttributedStringGetTypeID() -> CFTypeID; /* CFMutableAttributedString */ - - pub fn CFAttributedStringCreateMutableCopy( - allocator: CFAllocatorRef, max_length: CFIndex, astr: CFAttributedStringRef - ) -> CFMutableAttributedStringRef; - + /* Creating a CFMutableAttributedString */ pub fn CFAttributedStringCreateMutable( allocator: CFAllocatorRef, max_length: CFIndex, ) -> CFMutableAttributedStringRef; + pub fn CFAttributedStringCreateMutableCopy( + allocator: CFAllocatorRef, + max_length: CFIndex, + astr: CFAttributedStringRef, + ) -> CFMutableAttributedStringRef; + /* Modifying a CFMutableAttributedString */ + pub fn CFAttributedStringBeginEditing(aStr: CFMutableAttributedStringRef); + pub fn CFAttributedStringEndEditing(aStr: CFMutableAttributedStringRef); + pub fn CFAttributedStringGetMutableString( + aStr: CFMutableAttributedStringRef, + ) -> CFMutableStringRef; + pub fn CFAttributedStringRemoveAttribute( + aStr: CFMutableAttributedStringRef, + range: CFRange, + attrName: CFStringRef, + ); pub fn CFAttributedStringReplaceString( - astr: CFMutableAttributedStringRef, range: CFRange, replacement: CFStringRef); - + aStr: CFMutableAttributedStringRef, + range: CFRange, + replacement: CFStringRef, + ); + pub fn CFAttributedStringReplaceAttributedString( + aStr: CFMutableAttributedStringRef, + range: CFRange, + replacement: CFAttributedStringRef, + ); pub fn CFAttributedStringSetAttribute( - astr: CFMutableAttributedStringRef, + aStr: CFMutableAttributedStringRef, range: CFRange, - attr_name: CFStringRef, + attrName: CFStringRef, value: CFTypeRef, ); - + pub fn CFAttributedStringSetAttributes( + aStr: CFMutableAttributedStringRef, + range: CFRange, + replacement: CFDictionaryRef, + clearOtherAttributes: Boolean, + ); } |