Working on core-foundation.attributed-strings
							parent
							
								
									e1e01e5c8d
								
							
						
					
					
						commit
						c0362a57db
					
				| 
						 | 
				
			
			@ -0,0 +1,7 @@
 | 
			
		|||
! Copyright (C) 2009 Slava Pestov.
 | 
			
		||||
! See http://factorcode.org/license.txt for BSD license.
 | 
			
		||||
USING: tools.test core-foundation.attributed-strings
 | 
			
		||||
core-foundation ;
 | 
			
		||||
IN: core-foundation.attributed-strings.tests
 | 
			
		||||
 | 
			
		||||
[ ] [ "Hello world" { } <CFAttributedString> CFRelease ] unit-test
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,19 @@
 | 
			
		|||
! Copyright (C) 2009 Slava Pestov.
 | 
			
		||||
! See http://factorcode.org/license.txt for BSD license.
 | 
			
		||||
USING: alien.syntax kernel core-foundation
 | 
			
		||||
core-foundation.strings core-foundation.dictionaries ;
 | 
			
		||||
IN: core-foundation.attributed-strings
 | 
			
		||||
 | 
			
		||||
TYPEDEF: void* CFAttributedStringRef
 | 
			
		||||
 | 
			
		||||
FUNCTION: CFAttributedStringRef CFAttributedStringCreate (
 | 
			
		||||
   CFAllocatorRef alloc,
 | 
			
		||||
   CFStringRef str,
 | 
			
		||||
   CFDictionaryRef attributes
 | 
			
		||||
) ;
 | 
			
		||||
 | 
			
		||||
: <CFAttributedString> ( string alist -- alien )
 | 
			
		||||
    [ <CFString> ] [ <CFDictionary> ] bi*
 | 
			
		||||
    [ [ kCFAllocatorDefault ] 2dip CFAttributedStringCreate ]
 | 
			
		||||
    [ [ CFRelease ] bi@ ]
 | 
			
		||||
    2bi ;
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
Slava Pestov
 | 
			
		||||
		Loading…
	
		Reference in New Issue