diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:43:14 +0000 |
commit | 8dd16259287f58f9273002717ec4d27e97127719 (patch) | |
tree | 3863e62a53829a84037444beab3abd4ed9dfc7d0 /third_party/rust/core-foundation-sys/src/attributed_string.rs | |
parent | Releasing progress-linux version 126.0.1-1~progress7.99u1. (diff) | |
download | firefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz firefox-8dd16259287f58f9273002717ec4d27e97127719.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/core-foundation-sys/src/attributed_string.rs')
-rw-r--r-- | third_party/rust/core-foundation-sys/src/attributed_string.rs | 99 |
1 files changed, 82 insertions, 17 deletions
diff --git a/third_party/rust/core-foundation-sys/src/attributed_string.rs b/third_party/rust/core-foundation-sys/src/attributed_string.rs index c91bf5be38..54c27ec416 100644 --- a/third_party/rust/core-foundation-sys/src/attributed_string.rs +++ b/third_party/rust/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, + ); } |