From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- .../core-foundation-sys/src/attributed_string.rs | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 vendor/core-foundation-sys/src/attributed_string.rs (limited to 'vendor/core-foundation-sys/src/attributed_string.rs') diff --git a/vendor/core-foundation-sys/src/attributed_string.rs b/vendor/core-foundation-sys/src/attributed_string.rs new file mode 100644 index 000000000..c91bf5be3 --- /dev/null +++ b/vendor/core-foundation-sys/src/attributed_string.rs @@ -0,0 +1,55 @@ +// Copyright 2013 The Servo Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +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; + +extern { + /* CFAttributedString */ + + pub fn CFAttributedStringCreate( + allocator: CFAllocatorRef, + str: CFStringRef, + attributes: CFDictionaryRef, + ) -> CFAttributedStringRef; + + pub fn CFAttributedStringGetLength(astr: CFAttributedStringRef) -> CFIndex; + + pub fn CFAttributedStringGetTypeID() -> CFTypeID; + + /* CFMutableAttributedString */ + + pub fn CFAttributedStringCreateMutableCopy( + allocator: CFAllocatorRef, max_length: CFIndex, astr: CFAttributedStringRef + ) -> CFMutableAttributedStringRef; + + pub fn CFAttributedStringCreateMutable( + allocator: CFAllocatorRef, + max_length: CFIndex, + ) -> CFMutableAttributedStringRef; + + pub fn CFAttributedStringReplaceString( + astr: CFMutableAttributedStringRef, range: CFRange, replacement: CFStringRef); + + pub fn CFAttributedStringSetAttribute( + astr: CFMutableAttributedStringRef, + range: CFRange, + attr_name: CFStringRef, + value: CFTypeRef, + ); + +} -- cgit v1.2.3