Merge branch 'master' of git://factorcode.org/git/factor
commit
afc7a20ab8
|
@ -60,6 +60,8 @@ GENERIC: c-type ( name -- c-type ) foldable
|
|||
|
||||
GENERIC: resolve-pointer-type ( name -- c-type )
|
||||
|
||||
<< \ void \ void* "pointer-c-type" set-word-prop >>
|
||||
|
||||
M: word resolve-pointer-type
|
||||
dup "pointer-c-type" word-prop
|
||||
[ ] [ drop void* ] ?if ;
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
! (c)2009 Joe Groff bsd license
|
||||
USING: accessors alien.c-types alien.parser alien.syntax
|
||||
tools.test vocabs.parser ;
|
||||
IN: alien.parser.tests
|
||||
|
||||
TYPEDEF: char char2
|
||||
|
||||
[ int ] [ "int" parse-c-type ] unit-test
|
||||
[ { int 5 } ] [ "int[5]" parse-c-type ] unit-test
|
||||
[ { int 5 10 11 } ] [ "int[5][10][11]" parse-c-type ] unit-test
|
||||
[ void* ] [ "int*" parse-c-type ] unit-test
|
||||
[ void* ] [ "int**" parse-c-type ] unit-test
|
||||
[ void* ] [ "int***" parse-c-type ] unit-test
|
||||
[ void* ] [ "int****" parse-c-type ] unit-test
|
||||
[ char* ] [ "char*" parse-c-type ] unit-test
|
||||
[ void* ] [ "char**" parse-c-type ] unit-test
|
||||
[ void* ] [ "char***" parse-c-type ] unit-test
|
||||
[ void* ] [ "char****" parse-c-type ] unit-test
|
||||
[ char2 ] [ "char2" parse-c-type ] unit-test
|
||||
[ char* ] [ "char2*" parse-c-type ] unit-test
|
||||
|
||||
SYMBOL: not-c-type
|
||||
|
||||
[ "not-c-type" parse-c-type ] [ no-c-type? ] must-fail-with
|
||||
! uncomment this when string C type parsing goes away
|
||||
! [ "not-word" parse-c-type ] [ error>> no-word-error? ] must-fail-with
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
! Copyright (C) 2006, 2007 Slava Pestov
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.syntax classes.struct ;
|
||||
USING: alien.c-types alien.syntax classes.struct ;
|
||||
IN: cocoa.runtime
|
||||
|
||||
TYPEDEF: void* SEL
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2006, 2009 Slava Pestov
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.c-types alien.syntax combinators kernel layouts
|
||||
classes.struct core-graphics.types ;
|
||||
classes.struct cocoa.runtime core-graphics.types ;
|
||||
IN: cocoa.types
|
||||
|
||||
TYPEDEF: long NSInteger
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
! Copyright (C) 2009 Marc Fauconneau.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors arrays assocs byte-arrays
|
||||
byte-vectors combinators fry grouping hashtables
|
||||
compression.huffman images io.binary kernel locals
|
||||
math math.bitwise math.order math.ranges multiline sequences
|
||||
sorting ;
|
||||
USING: accessors arrays assocs byte-vectors combinators
|
||||
compression.huffman fry hashtables io.binary kernel locals math
|
||||
math.bitwise math.order math.ranges sequences sorting ;
|
||||
QUALIFIED-WITH: bitstreams bs
|
||||
IN: compression.inflate
|
||||
|
||||
QUALIFIED-WITH: bitstreams bs
|
||||
|
@ -178,41 +177,8 @@ CONSTANT: dist-table
|
|||
]
|
||||
[ produce ] keep call suffix concat ;
|
||||
|
||||
! [ produce ] keep dip swap suffix
|
||||
|
||||
:: paeth ( a b c -- p )
|
||||
a b + c - { a b c } [ [ - abs ] keep 2array ] with map
|
||||
sort-keys first second ;
|
||||
|
||||
:: png-unfilter-line ( prev curr filter -- curr' )
|
||||
prev :> c
|
||||
prev 3 tail-slice :> b
|
||||
curr :> a
|
||||
curr 3 tail-slice :> x
|
||||
x length [0,b)
|
||||
filter {
|
||||
{ 0 [ drop ] }
|
||||
{ 1 [ [| n | n x nth n a nth + 256 wrap n x set-nth ] each ] }
|
||||
{ 2 [ [| n | n x nth n b nth + 256 wrap n x set-nth ] each ] }
|
||||
{ 3 [ [| n | n x nth n a nth n b nth + 2/ + 256 wrap n x set-nth ] each ] }
|
||||
{ 4 [ [| n | n x nth n a nth n b nth n c nth paeth + 256 wrap n x set-nth ] each ] }
|
||||
} case
|
||||
curr 3 tail ;
|
||||
|
||||
PRIVATE>
|
||||
|
||||
: reverse-png-filter' ( lines -- byte-array )
|
||||
[ first ] [ 1 tail ] [ map ] bi-curry@ bi nip
|
||||
concat [ 128 + ] B{ } map-as ;
|
||||
|
||||
: reverse-png-filter ( lines -- byte-array )
|
||||
dup first length 0 <array> prefix
|
||||
[ { 0 0 } prepend ] map
|
||||
2 clump [
|
||||
first2 dup [ third ] [ [ 0 2 ] dip set-nth ] bi
|
||||
png-unfilter-line
|
||||
] map B{ } concat-as ;
|
||||
|
||||
: zlib-inflate ( bytes -- bytes )
|
||||
bs:<lsb0-bit-reader>
|
||||
[ check-zlib-header ] [ inflate-loop ] bi
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
! Copyright (C) 2009 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien alien.syntax combinators system alien.libraries ;
|
||||
USING: alien alien.c-types alien.syntax combinators system
|
||||
alien.libraries ;
|
||||
IN: compression.zlib.ffi
|
||||
|
||||
<< "zlib" {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
! Copyright (C) 2008, 2009 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.syntax kernel sequences fry ;
|
||||
USING: alien.c-types alien.syntax core-foundation kernel
|
||||
sequences fry ;
|
||||
IN: core-foundation.arrays
|
||||
|
||||
TYPEDEF: void* CFArrayRef
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
! Copyright (C) 2009 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.syntax kernel destructors core-foundation
|
||||
USING: alien.c-types alien.syntax kernel destructors
|
||||
core-foundation core-foundation.dictionaries
|
||||
core-foundation.strings
|
||||
core-foundation.utilities ;
|
||||
IN: core-foundation.attributed-strings
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2008 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.syntax kernel sequences core-foundation
|
||||
core-foundation.urls ;
|
||||
USING: alien.c-types alien.syntax kernel sequences
|
||||
core-foundation core-foundation.urls ;
|
||||
IN: core-foundation.bundles
|
||||
|
||||
TYPEDEF: void* CFBundleRef
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
! Copyright (C) 2008 Joe Groff.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.c-types alien.syntax kernel math sequences ;
|
||||
USING: alien.c-types alien.syntax core-foundation kernel math
|
||||
sequences ;
|
||||
IN: core-foundation.data
|
||||
|
||||
TYPEDEF: void* CFDataRef
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
! Copyright (C) 2009 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.syntax core-foundation kernel assocs
|
||||
USING: alien.c-types alien.syntax core-foundation kernel assocs
|
||||
specialized-arrays math sequences accessors ;
|
||||
IN: core-foundation.dictionaries
|
||||
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
! Copyright (C) 2008 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.syntax kernel math.bitwise core-foundation ;
|
||||
USING: alien.c-types alien.syntax kernel math.bitwise core-foundation ;
|
||||
IN: core-foundation.file-descriptors
|
||||
|
||||
TYPEDEF: void* CFFileDescriptorRef
|
||||
TYPEDEF: int CFFileDescriptorNativeDescriptor
|
||||
TYPEDEF: void* CFFileDescriptorCallBack
|
||||
TYPEDEF: void* CFFileDescriptorContext*
|
||||
|
||||
FUNCTION: CFFileDescriptorRef CFFileDescriptorCreate (
|
||||
CFAllocatorRef allocator,
|
||||
|
|
|
@ -4,8 +4,8 @@ USING: alien alien.c-types alien.strings alien.syntax kernel
|
|||
math sequences namespaces make assocs init accessors
|
||||
continuations combinators io.encodings.utf8 destructors locals
|
||||
arrays specialized-arrays classes.struct core-foundation
|
||||
core-foundation.run-loop core-foundation.strings
|
||||
core-foundation.time ;
|
||||
core-foundation.arrays core-foundation.run-loop
|
||||
core-foundation.strings core-foundation.time unix.types ;
|
||||
IN: core-foundation.fsevents
|
||||
|
||||
SPECIALIZED-ARRAY: void*
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
! Copyright (C) 2008 Slava Pestov
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors alien alien.syntax kernel math namespaces
|
||||
sequences destructors combinators threads heaps deques calendar
|
||||
core-foundation core-foundation.strings
|
||||
USING: accessors alien alien.c-types alien.syntax kernel math
|
||||
namespaces sequences destructors combinators threads heaps
|
||||
deques calendar core-foundation core-foundation.strings
|
||||
core-foundation.file-descriptors core-foundation.timers
|
||||
core-foundation.time ;
|
||||
IN: core-foundation.run-loop
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2008, 2009 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.syntax alien.strings io.encodings.string kernel
|
||||
sequences byte-arrays io.encodings.utf8 math core-foundation
|
||||
USING: alien.c-types alien.syntax alien.strings io.encodings.string
|
||||
kernel sequences byte-arrays io.encodings.utf8 math core-foundation
|
||||
core-foundation.arrays destructors parser fry alien words ;
|
||||
IN: core-foundation.strings
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
! Copyright (C) 2008 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: calendar alien.syntax ;
|
||||
USING: calendar alien.c-types alien.syntax ;
|
||||
IN: core-foundation.time
|
||||
|
||||
TYPEDEF: double CFTimeInterval
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2008 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.syntax system math kernel calendar core-foundation
|
||||
core-foundation.time ;
|
||||
USING: alien.c-types alien.syntax system math kernel calendar
|
||||
core-foundation core-foundation.time ;
|
||||
IN: core-foundation.timers
|
||||
|
||||
TYPEDEF: void* CFRunLoopTimerRef
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2008 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.syntax kernel core-foundation.strings
|
||||
core-foundation ;
|
||||
USING: alien.c-types alien.syntax kernel core-foundation.strings
|
||||
core-foundation core-foundation.urls ;
|
||||
IN: core-foundation.urls
|
||||
|
||||
CONSTANT: kCFURLPOSIXPathStyle 0
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien alien.c-types alien.destructors alien.syntax accessors
|
||||
destructors fry kernel math math.bitwise sequences libc colors
|
||||
images images.memory core-graphics.types core-foundation.utilities ;
|
||||
images images.memory core-graphics.types core-foundation.utilities
|
||||
opengl.gl ;
|
||||
IN: core-graphics
|
||||
|
||||
! CGImageAlphaInfo
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
! Copyright (C) 2009 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors alien.c-types alien.syntax classes.struct kernel layouts
|
||||
math math.rectangles arrays ;
|
||||
math math.rectangles arrays literals ;
|
||||
FROM: alien.c-types => float ;
|
||||
IN: core-graphics.types
|
||||
|
||||
<< cell 4 = "float" "double" ? "CGFloat" typedef >>
|
||||
SYMBOL: CGFloat
|
||||
<< cell 4 = float double ? \ CGFloat typedef >>
|
||||
|
||||
: <CGFloat> ( x -- alien )
|
||||
cell 4 = [ <float> ] [ <double> ] if ; inline
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
! Copyright (C) 2009 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors alien.syntax assocs core-foundation
|
||||
core-foundation.strings core-text.utilities destructors init
|
||||
kernel math memoize fonts combinators ;
|
||||
USING: accessors alien.c-types alien.syntax assocs core-foundation
|
||||
core-foundation.dictionaries core-foundation.strings
|
||||
core-graphics.types core-text.utilities destructors init
|
||||
kernel math memoize fonts combinators unix.types ;
|
||||
IN: core-text.fonts
|
||||
|
||||
TYPEDEF: void* CTFontRef
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
! Copyright (C) 2007, 2008 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
! tested on debian linux with postgresql 8.1
|
||||
USING: alien alien.syntax combinators system alien.libraries ;
|
||||
USING: alien alien.c-types alien.syntax combinators system
|
||||
alien.libraries ;
|
||||
IN: db.postgresql.ffi
|
||||
|
||||
<< "postgresql" {
|
||||
|
@ -68,8 +69,8 @@ TYPEDEF: void* PQconninfoOption*
|
|||
TYPEDEF: void* PGnotify*
|
||||
TYPEDEF: void* PQArgBlock*
|
||||
TYPEDEF: void* PQprintOpt*
|
||||
TYPEDEF: void* FILE*
|
||||
TYPEDEF: void* SSL*
|
||||
TYPEDEF: void* FILE*
|
||||
|
||||
LIBRARY: postgresql
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
! Copyright (C) 2008 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.syntax system environment.unix ;
|
||||
USING: alien.c-types alien.syntax system environment.unix ;
|
||||
IN: environment.unix.macosx
|
||||
|
||||
FUNCTION: void* _NSGetEnviron ( ) ;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
! Copyright (C) 2008 Matthew Willis.
|
||||
! Copyright (C) 2009 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license
|
||||
USING: alien alien.syntax alien.destructors combinators system
|
||||
alien.libraries ;
|
||||
USING: alien alien.c-types alien.syntax alien.destructors
|
||||
combinators system alien.libraries ;
|
||||
IN: glib
|
||||
|
||||
<<
|
||||
|
@ -27,12 +27,10 @@ TYPEDEF: void* gpointer
|
|||
TYPEDEF: int gint
|
||||
TYPEDEF: bool gboolean
|
||||
|
||||
FUNCTION: void
|
||||
g_free ( gpointer mem ) ;
|
||||
FUNCTION: void g_free ( gpointer mem ) ;
|
||||
|
||||
LIBRARY: gobject
|
||||
|
||||
FUNCTION: void
|
||||
g_object_unref ( gpointer object ) ;
|
||||
FUNCTION: void g_object_unref ( gpointer object ) ;
|
||||
|
||||
DESTRUCTOR: g_object_unref
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
! Copyright (C) 2009 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors arrays byte-arrays combinators
|
||||
USING: accessors alien.c-types arrays byte-arrays combinators
|
||||
compression.run-length fry grouping images images.loader io
|
||||
io.binary io.encodings.8-bit io.encodings.binary
|
||||
io.encodings.string io.streams.limited kernel math math.bitwise
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
! Copyright (C) 2009 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors images io io.binary io.encodings.ascii
|
||||
io.encodings.binary io.encodings.string io.files io.files.info kernel
|
||||
sequences io.streams.limited fry combinators arrays math checksums
|
||||
checksums.crc32 compression.inflate grouping byte-arrays images.loader ;
|
||||
USING: accessors arrays checksums checksums.crc32 combinators
|
||||
compression.inflate fry grouping images images.loader io
|
||||
io.binary io.encodings.ascii io.encodings.string kernel locals
|
||||
math math.bitwise math.ranges sequences sorting ;
|
||||
IN: images.png
|
||||
|
||||
SINGLETON: png-image
|
||||
|
@ -78,27 +78,52 @@ ERROR: bad-checksum ;
|
|||
|
||||
ERROR: unknown-color-type n ;
|
||||
ERROR: unimplemented-color-type image ;
|
||||
ERROR: unknown-filter-method image ;
|
||||
|
||||
: inflate-data ( loading-png -- bytes )
|
||||
find-compressed-bytes zlib-inflate ;
|
||||
|
||||
: png-group-width ( loading-png -- n )
|
||||
dup color-type>> {
|
||||
{ 2 [ [ bit-depth>> 8 / 3 * ] [ width>> ] bi * 1 + ] }
|
||||
{ 6 [ [ bit-depth>> 8 / 4 * ] [ width>> ] bi * 1 + ] }
|
||||
[ unknown-color-type ]
|
||||
} case ;
|
||||
: scale-bit-depth ( loading-png -- n ) bit-depth>> 8 / ; inline
|
||||
|
||||
: filter-png ( groups loading-png -- byte-array )
|
||||
filter-method>> {
|
||||
{ filter-none [ reverse-png-filter ] }
|
||||
[ unknown-filter-method ]
|
||||
} case ;
|
||||
: png-bytes-per-pixel ( loading-png -- n )
|
||||
dup color-type>> {
|
||||
{ 2 [ scale-bit-depth 3 * ] }
|
||||
{ 6 [ scale-bit-depth 4 * ] }
|
||||
[ unknown-color-type ]
|
||||
} case ; inline
|
||||
|
||||
: png-group-width ( loading-png -- n )
|
||||
! 1 + is for the filter type, 1 byte preceding each line
|
||||
[ png-bytes-per-pixel ] [ width>> ] bi * 1 + ;
|
||||
|
||||
:: paeth ( a b c -- p )
|
||||
a b + c - { a b c } [ [ - abs ] keep 2array ] with map
|
||||
sort-keys first second ;
|
||||
|
||||
:: png-unfilter-line ( prev curr filter -- curr' )
|
||||
prev :> c
|
||||
prev 3 tail-slice :> b
|
||||
curr :> a
|
||||
curr 3 tail-slice :> x
|
||||
x length [0,b)
|
||||
filter {
|
||||
{ filter-none [ drop ] }
|
||||
{ filter-sub [ [| n | n x nth n a nth + 256 wrap n x set-nth ] each ] }
|
||||
{ filter-up [ [| n | n x nth n b nth + 256 wrap n x set-nth ] each ] }
|
||||
{ filter-average [ [| n | n x nth n a nth n b nth + 2/ + 256 wrap n x set-nth ] each ] }
|
||||
{ filter-paeth [ [| n | n x nth n a nth n b nth n c nth paeth + 256 wrap n x set-nth ] each ] }
|
||||
} case
|
||||
curr 3 tail ;
|
||||
|
||||
: reverse-png-filter ( lines -- byte-array )
|
||||
dup first length 0 <array> prefix
|
||||
[ { 0 0 } prepend ] map
|
||||
2 clump [
|
||||
first2 dup [ third ] [ [ 0 2 ] dip set-nth ] bi
|
||||
png-unfilter-line
|
||||
] map B{ } concat-as ;
|
||||
|
||||
: png-image-bytes ( loading-png -- byte-array )
|
||||
[ [ inflate-data ] [ png-group-width ] bi group ]
|
||||
[ filter-png ] bi ;
|
||||
[ inflate-data ] [ png-group-width ] bi group reverse-png-filter ;
|
||||
|
||||
: decode-greyscale ( loading-png -- loading-png )
|
||||
unimplemented-color-type ;
|
||||
|
|
|
@ -7,6 +7,7 @@ io.encodings.string io.encodings.utf8 io.files kernel math
|
|||
math.bitwise math.order math.parser pack prettyprint sequences
|
||||
strings math.vectors specialized-arrays locals
|
||||
images.loader ;
|
||||
FROM: alien.c-types => float ;
|
||||
SPECIALIZED-ARRAY: float
|
||||
IN: images.tiff
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
! Copyright (C) 2008 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: system kernel unix math sequences
|
||||
USING: alien.c-types system kernel unix math sequences
|
||||
io.backend.unix io.ports specialized-arrays accessors ;
|
||||
QUALIFIED: io.pipes
|
||||
SPECIALIZED-ARRAY: int
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
USING: iokit alien alien.syntax alien.c-types kernel
|
||||
system core-foundation core-foundation.data
|
||||
core-foundation.dictionaries ;
|
||||
USING: iokit alien alien.syntax alien.c-types kernel system
|
||||
core-foundation core-foundation.arrays core-foundation.data
|
||||
core-foundation.dictionaries core-foundation.run-loop
|
||||
core-foundation.strings core-foundation.time ;
|
||||
IN: iokit.hid
|
||||
|
||||
CONSTANT: kIOHIDDeviceKey "IOHIDDevice"
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
USING: accessors alien alien.c-types alien.data arrays
|
||||
byte-arrays combinators combinators.short-circuit fry
|
||||
kernel locals macros math math.blas.ffi math.blas.vectors
|
||||
math.blas.vectors.private math.complex math.functions
|
||||
math.order functors words sequences sequences.merged
|
||||
sequences.private shuffle parser prettyprint.backend
|
||||
prettyprint.custom ascii specialized-arrays ;
|
||||
USING: accessors alien alien.c-types alien.complex
|
||||
alien.data arrays byte-arrays combinators
|
||||
combinators.short-circuit fry kernel locals macros math
|
||||
math.blas.ffi math.blas.vectors math.blas.vectors.private
|
||||
math.complex math.functions math.order functors words
|
||||
sequences sequences.merged sequences.private shuffle
|
||||
parser prettyprint.backend prettyprint.custom ascii
|
||||
specialized-arrays ;
|
||||
FROM: alien.c-types => float ;
|
||||
SPECIALIZED-ARRAY: float
|
||||
SPECIALIZED-ARRAY: double
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
USING: accessors alien alien.c-types arrays ascii byte-arrays combinators
|
||||
combinators.short-circuit fry kernel math math.blas.ffi
|
||||
math.complex math.functions math.order sequences sequences.private
|
||||
functors words locals parser prettyprint.backend prettyprint.custom
|
||||
specialized-arrays ;
|
||||
USING: accessors alien alien.c-types alien.complex arrays ascii
|
||||
byte-arrays combinators combinators.short-circuit fry kernel
|
||||
math math.blas.ffi math.complex math.functions math.order
|
||||
sequences sequences.private functors words locals parser
|
||||
prettyprint.backend prettyprint.custom specialized-arrays ;
|
||||
FROM: alien.c-types => float ;
|
||||
SPECIALIZED-ARRAY: float
|
||||
SPECIALIZED-ARRAY: double
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
USING: accessors alien.syntax arrays assocs biassocs
|
||||
classes.struct combinators cpu.x86.features kernel literals
|
||||
math math.bitwise math.floats.env math.floats.env.private
|
||||
system ;
|
||||
USING: accessors alien.c-types alien.syntax arrays assocs
|
||||
biassocs classes.struct combinators cpu.x86.features kernel
|
||||
literals math math.bitwise math.floats.env
|
||||
math.floats.env.private system ;
|
||||
IN: math.floats.env.x86
|
||||
|
||||
STRUCT: sse-env
|
||||
|
|
|
@ -55,11 +55,33 @@ PRIVATE>
|
|||
[ drop call ]
|
||||
} case ; inline
|
||||
|
||||
: fp-bitwise-unary ( x seq quot -- z )
|
||||
swap element-type {
|
||||
{ c:double [ [ double>bits ] dip call bits>double ] }
|
||||
{ c:float [ [ float>bits ] dip call bits>float ] }
|
||||
[ drop call ]
|
||||
} case ; inline
|
||||
|
||||
PRIVATE>
|
||||
|
||||
: vbitand ( u v -- w ) over '[ _ [ bitand ] fp-bitwise-op ] 2map ;
|
||||
: vbitor ( u v -- w ) over '[ _ [ bitor ] fp-bitwise-op ] 2map ;
|
||||
: vbitxor ( u v -- w ) over '[ _ [ bitxor ] fp-bitwise-op ] 2map ;
|
||||
: vbitnot ( u -- w ) dup '[ _ [ bitnot ] fp-bitwise-unary ] map ;
|
||||
|
||||
: vand ( u v -- w ) [ and ] 2map ;
|
||||
: vor ( u v -- w ) [ or ] 2map ;
|
||||
: vxor ( u v -- w ) [ xor ] 2map ;
|
||||
: vnot ( u -- w ) [ not ] map ;
|
||||
|
||||
: v< ( u v -- w ) [ < ] { } 2map-as ;
|
||||
: v<= ( u v -- w ) [ <= ] { } 2map-as ;
|
||||
: v>= ( u v -- w ) [ >= ] { } 2map-as ;
|
||||
: v> ( u v -- w ) [ > ] { } 2map-as ;
|
||||
: vunordered? ( u v -- w ) [ unordered? ] { } 2map-as ;
|
||||
: v= ( u v -- w ) [ = ] { } 2map-as ;
|
||||
|
||||
: v? ( ? u v -- w ) [ ? ] pick 3map-as ;
|
||||
|
||||
: vlshift ( u n -- w ) '[ _ shift ] map ;
|
||||
: vrshift ( u n -- w ) neg '[ _ shift ] map ;
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
|
||||
! This file is based on the gl.h that comes with xorg-x11 6.8.2
|
||||
|
||||
USING: alien alien.syntax combinators kernel parser sequences
|
||||
system words opengl.gl.extensions ;
|
||||
|
||||
USING: alien alien.c-types alien.syntax combinators kernel parser
|
||||
sequences system words opengl.gl.extensions ;
|
||||
FROM: alien.c-types => short ;
|
||||
IN: opengl.gl
|
||||
|
||||
TYPEDEF: uint GLenum
|
||||
|
|
|
@ -5,6 +5,7 @@ kernel opengl opengl.gl opengl.capabilities combinators images
|
|||
images.tesselation grouping sequences math math.vectors
|
||||
math.matrices generalizations fry arrays namespaces system
|
||||
locals literals specialized-arrays ;
|
||||
FROM: alien.c-types => float ;
|
||||
SPECIALIZED-ARRAY: float
|
||||
IN: opengl.textures
|
||||
|
||||
|
|
|
@ -103,15 +103,15 @@ FUNCTION: void* BIO_f_buffer ( ) ;
|
|||
|
||||
CONSTANT: EVP_MAX_MD_SIZE 64
|
||||
|
||||
TYPEDEF: void* EVP_MD*
|
||||
TYPEDEF: void* ENGINE*
|
||||
|
||||
STRUCT: EVP_MD_CTX
|
||||
{ digest EVP_MD* }
|
||||
{ engine ENGINE* }
|
||||
{ flags ulong }
|
||||
{ md_data void* } ;
|
||||
|
||||
TYPEDEF: void* EVP_MD*
|
||||
TYPEDEF: void* ENGINE*
|
||||
|
||||
! Initialize ciphers and digest tables
|
||||
FUNCTION: void OpenSSL_add_all_ciphers ( ) ;
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
! Copyright (C) 2007 Elie CHAFTARI
|
||||
! Portions copyright (C) 2008 Slava Pestov
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien alien.syntax combinators kernel system namespaces
|
||||
assocs parser lexer sequences words quotations math.bitwise
|
||||
alien.libraries ;
|
||||
USING: alien alien.c-types alien.syntax combinators kernel
|
||||
system namespaces assocs parser lexer sequences words
|
||||
quotations math.bitwise alien.libraries ;
|
||||
|
||||
IN: openssl.libssl
|
||||
|
||||
|
@ -95,6 +95,17 @@ TYPEDEF: void* SSL*
|
|||
|
||||
LIBRARY: libssl
|
||||
|
||||
! ===============================================
|
||||
! x509.h
|
||||
! ===============================================
|
||||
|
||||
TYPEDEF: void* X509_NAME*
|
||||
|
||||
TYPEDEF: void* X509*
|
||||
|
||||
FUNCTION: int X509_NAME_get_text_by_NID ( X509_NAME* name, int nid, void* buf, int len ) ;
|
||||
FUNCTION: X509_NAME* X509_get_subject_name ( X509* a ) ;
|
||||
|
||||
! ===============================================
|
||||
! ssl.h
|
||||
! ===============================================
|
||||
|
@ -258,17 +269,6 @@ CONSTANT: SSL_SESS_CACHE_NO_INTERNAL_STORE HEX: 0200
|
|||
: SSL_SESS_CACHE_NO_INTERNAL ( -- n )
|
||||
{ SSL_SESS_CACHE_NO_INTERNAL_LOOKUP SSL_SESS_CACHE_NO_INTERNAL_STORE } flags ; inline
|
||||
|
||||
! ===============================================
|
||||
! x509.h
|
||||
! ===============================================
|
||||
|
||||
TYPEDEF: void* X509_NAME*
|
||||
|
||||
TYPEDEF: void* X509*
|
||||
|
||||
FUNCTION: int X509_NAME_get_text_by_NID ( X509_NAME* name, int nid, void* buf, int len ) ;
|
||||
FUNCTION: X509_NAME* X509_get_subject_name ( X509* a ) ;
|
||||
|
||||
! ===============================================
|
||||
! x509_vfy.h
|
||||
! ===============================================
|
||||
|
|
|
@ -3,8 +3,12 @@
|
|||
! See http://factorcode.org/license.txt for BSD license.
|
||||
!
|
||||
! pangocairo bindings, from pango/pangocairo.h
|
||||
USING: alien alien.syntax combinators system cairo.ffi
|
||||
alien.libraries ;
|
||||
USING: arrays sequences alien alien.c-types alien.destructors
|
||||
alien.libraries alien.syntax math math.functions math.vectors
|
||||
destructors combinators colors fonts accessors assocs namespaces
|
||||
kernel pango pango.fonts pango.layouts glib unicode.data images
|
||||
cache init system math.rectangles fry memoize io.encodings.utf8
|
||||
classes.struct cairo cairo.ffi ;
|
||||
IN: pango.cairo
|
||||
|
||||
<< {
|
||||
|
@ -15,6 +19,9 @@ IN: pango.cairo
|
|||
|
||||
LIBRARY: pangocairo
|
||||
|
||||
TYPEDEF: void* PangoCairoFontMap*
|
||||
TYPEDEF: void* PangoCairoFont*
|
||||
|
||||
FUNCTION: PangoFontMap*
|
||||
pango_cairo_font_map_new ( ) ;
|
||||
|
||||
|
@ -87,3 +94,150 @@ pango_cairo_layout_path ( cairo_t* cr, PangoLayout* layout ) ;
|
|||
|
||||
FUNCTION: void
|
||||
pango_cairo_error_underline_path ( cairo_t* cr, double x, double y, double width, double height ) ;
|
||||
|
||||
TUPLE: layout < disposable font string selection layout metrics ink-rect logical-rect image ;
|
||||
|
||||
SYMBOL: dpi
|
||||
|
||||
72 dpi set-global
|
||||
|
||||
: set-layout-font ( font layout -- )
|
||||
swap cache-font-description pango_layout_set_font_description ;
|
||||
|
||||
: set-layout-text ( str layout -- )
|
||||
#! Replace nulls with something else since Pango uses null-terminated
|
||||
#! strings
|
||||
swap -1 pango_layout_set_text ;
|
||||
|
||||
: layout-extents ( layout -- ink-rect logical-rect )
|
||||
PangoRectangle <struct>
|
||||
PangoRectangle <struct>
|
||||
[ pango_layout_get_extents ] 2keep
|
||||
[ PangoRectangle>rect ] bi@ ;
|
||||
|
||||
: layout-baseline ( layout -- baseline )
|
||||
pango_layout_get_iter &pango_layout_iter_free
|
||||
pango_layout_iter_get_baseline
|
||||
pango>float ;
|
||||
|
||||
: set-foreground ( cr font -- )
|
||||
foreground>> set-source-color ;
|
||||
|
||||
: fill-background ( cr font dim -- )
|
||||
[ background>> set-source-color ]
|
||||
[ [ { 0 0 } ] dip <rect> fill-rect ] bi-curry* bi ;
|
||||
|
||||
: rect-translate-x ( rect x -- rect' )
|
||||
'[ _ 0 2array v- ] change-loc ;
|
||||
|
||||
: first-line ( layout -- line )
|
||||
layout>> 0 pango_layout_get_line_readonly ;
|
||||
|
||||
: line-offset>x ( layout n -- x )
|
||||
#! n is an index into the UTF8 encoding of the text
|
||||
[ drop first-line ] [ swap string>> >utf8-index ] 2bi
|
||||
0 0 <int> [ pango_layout_line_index_to_x ] keep
|
||||
*int pango>float ;
|
||||
|
||||
: x>line-offset ( layout x -- n )
|
||||
#! n is an index into the UTF8 encoding of the text
|
||||
[
|
||||
[ first-line ] dip
|
||||
float>pango 0 <int> 0 <int>
|
||||
[ pango_layout_line_x_to_index drop ] 2keep
|
||||
[ *int ] bi@ swap
|
||||
] [ drop string>> ] 2bi utf8-index> + ;
|
||||
|
||||
: selection-start/end ( selection -- start end )
|
||||
selection>> [ start>> ] [ end>> ] bi ;
|
||||
|
||||
: selection-rect ( layout -- rect )
|
||||
[ ink-rect>> dim>> ] [ ] [ selection-start/end ] tri [ line-offset>x ] bi-curry@ bi
|
||||
[ drop nip 0 2array ] [ swap - swap second 2array ] 3bi <rect> ;
|
||||
|
||||
: fill-selection-background ( cr layout -- )
|
||||
dup selection>> [
|
||||
[ selection>> color>> set-source-color ]
|
||||
[
|
||||
[ selection-rect ] [ ink-rect>> loc>> first ] bi
|
||||
rect-translate-x
|
||||
fill-rect
|
||||
] 2bi
|
||||
] [ 2drop ] if ;
|
||||
|
||||
: text-position ( layout -- loc )
|
||||
[ logical-rect>> ] [ ink-rect>> ] bi [ loc>> ] bi@ v- ;
|
||||
|
||||
: set-text-position ( cr loc -- )
|
||||
first2 cairo_move_to ;
|
||||
|
||||
: draw-layout ( layout -- image )
|
||||
dup ink-rect>> dim>> [ >fixnum ] map [
|
||||
swap {
|
||||
[ layout>> pango_cairo_update_layout ]
|
||||
[ [ font>> ] [ ink-rect>> dim>> ] bi fill-background ]
|
||||
[ fill-selection-background ]
|
||||
[ text-position set-text-position ]
|
||||
[ font>> set-foreground ]
|
||||
[ layout>> pango_cairo_show_layout ]
|
||||
} 2cleave
|
||||
] make-bitmap-image ;
|
||||
|
||||
: escape-nulls ( str -- str' )
|
||||
{ { 0 CHAR: zero-width-no-break-space } } substitute ;
|
||||
|
||||
: unpack-selection ( layout string/selection -- layout )
|
||||
dup selection? [
|
||||
[ string>> escape-nulls >>string ] [ >>selection ] bi
|
||||
] [ escape-nulls >>string ] if ; inline
|
||||
|
||||
: set-layout-resolution ( layout -- )
|
||||
pango_layout_get_context dpi get pango_cairo_context_set_resolution ;
|
||||
|
||||
: <PangoLayout> ( text font -- layout )
|
||||
dummy-cairo pango_cairo_create_layout |g_object_unref
|
||||
[ set-layout-resolution ] keep
|
||||
[ set-layout-font ] keep
|
||||
[ set-layout-text ] keep ;
|
||||
|
||||
: glyph-height ( font string -- y )
|
||||
swap <PangoLayout> &g_object_unref layout-extents drop dim>> second ;
|
||||
|
||||
MEMO: missing-font-metrics ( font -- metrics )
|
||||
#! Pango doesn't provide x-height and cap-height but Core Text does, so we
|
||||
#! simulate them on Pango.
|
||||
[
|
||||
[ metrics new ] dip
|
||||
[ "x" glyph-height >>x-height ]
|
||||
[ "Y" glyph-height >>cap-height ] bi
|
||||
] with-destructors ;
|
||||
|
||||
: layout-metrics ( layout -- metrics )
|
||||
dup font>> missing-font-metrics clone
|
||||
swap
|
||||
[ layout>> layout-baseline >>ascent ]
|
||||
[ logical-rect>> dim>> [ first >>width ] [ second >>height ] bi ] bi
|
||||
dup [ height>> ] [ ascent>> ] bi - >>descent ;
|
||||
|
||||
: <layout> ( font string -- line )
|
||||
[
|
||||
layout new-disposable
|
||||
swap unpack-selection
|
||||
swap >>font
|
||||
dup [ string>> ] [ font>> ] bi <PangoLayout> >>layout
|
||||
dup layout>> layout-extents [ >>ink-rect ] [ >>logical-rect ] bi*
|
||||
dup layout-metrics >>metrics
|
||||
dup draw-layout >>image
|
||||
] with-destructors ;
|
||||
|
||||
M: layout dispose* layout>> g_object_unref ;
|
||||
|
||||
SYMBOL: cached-layouts
|
||||
|
||||
: cached-layout ( font string -- layout )
|
||||
cached-layouts get [ <layout> ] 2cache ;
|
||||
|
||||
: cached-line ( font string -- line )
|
||||
cached-layout layout>> first-line ;
|
||||
|
||||
[ <cache-assoc> cached-layouts set-global ] "pango.cairo" add-init-hook
|
||||
|
|
|
@ -15,6 +15,15 @@ PANGO_STYLE_OBLIQUE
|
|||
PANGO_STYLE_ITALIC ;
|
||||
|
||||
TYPEDEF: int PangoWeight
|
||||
TYPEDEF: void* PangoFont*
|
||||
TYPEDEF: void* PangoFontFamily*
|
||||
TYPEDEF: void* PangoFontFace*
|
||||
TYPEDEF: void* PangoFontMap*
|
||||
TYPEDEF: void* PangoFontMetrics*
|
||||
TYPEDEF: void* PangoFontDescription*
|
||||
TYPEDEF: void* PangoGlyphString*
|
||||
TYPEDEF: void* PangoLanguage*
|
||||
|
||||
CONSTANT: PANGO_WEIGHT_THIN 100
|
||||
CONSTANT: PANGO_WEIGHT_ULTRALIGHT 200
|
||||
CONSTANT: PANGO_WEIGHT_LIGHT 300
|
||||
|
|
|
@ -4,12 +4,16 @@
|
|||
USING: arrays sequences alien alien.c-types alien.destructors
|
||||
alien.syntax math math.functions math.vectors destructors combinators
|
||||
colors fonts accessors assocs namespaces kernel pango pango.fonts
|
||||
pango.cairo cairo cairo.ffi glib unicode.data images cache init
|
||||
glib unicode.data images cache init
|
||||
math.rectangles fry memoize io.encodings.utf8 classes.struct ;
|
||||
IN: pango.layouts
|
||||
|
||||
LIBRARY: pango
|
||||
|
||||
TYPEDEF: void* PangoLayout*
|
||||
TYPEDEF: void* PangoLayoutIter*
|
||||
TYPEDEF: void* PangoLayoutLine*
|
||||
|
||||
FUNCTION: PangoLayout*
|
||||
pango_layout_new ( PangoContext* context ) ;
|
||||
|
||||
|
@ -60,149 +64,3 @@ pango_layout_iter_free ( PangoLayoutIter* iter ) ;
|
|||
|
||||
DESTRUCTOR: pango_layout_iter_free
|
||||
|
||||
TUPLE: layout < disposable font string selection layout metrics ink-rect logical-rect image ;
|
||||
|
||||
SYMBOL: dpi
|
||||
|
||||
72 dpi set-global
|
||||
|
||||
: set-layout-font ( font layout -- )
|
||||
swap cache-font-description pango_layout_set_font_description ;
|
||||
|
||||
: set-layout-text ( str layout -- )
|
||||
#! Replace nulls with something else since Pango uses null-terminated
|
||||
#! strings
|
||||
swap -1 pango_layout_set_text ;
|
||||
|
||||
: set-layout-resolution ( layout -- )
|
||||
pango_layout_get_context dpi get pango_cairo_context_set_resolution ;
|
||||
|
||||
: <PangoLayout> ( text font -- layout )
|
||||
dummy-cairo pango_cairo_create_layout |g_object_unref
|
||||
[ set-layout-resolution ] keep
|
||||
[ set-layout-font ] keep
|
||||
[ set-layout-text ] keep ;
|
||||
|
||||
: layout-extents ( layout -- ink-rect logical-rect )
|
||||
PangoRectangle <struct>
|
||||
PangoRectangle <struct>
|
||||
[ pango_layout_get_extents ] 2keep
|
||||
[ PangoRectangle>rect ] bi@ ;
|
||||
|
||||
: glyph-height ( font string -- y )
|
||||
swap <PangoLayout> &g_object_unref layout-extents drop dim>> second ;
|
||||
|
||||
MEMO: missing-font-metrics ( font -- metrics )
|
||||
#! Pango doesn't provide x-height and cap-height but Core Text does, so we
|
||||
#! simulate them on Pango.
|
||||
[
|
||||
[ metrics new ] dip
|
||||
[ "x" glyph-height >>x-height ]
|
||||
[ "Y" glyph-height >>cap-height ] bi
|
||||
] with-destructors ;
|
||||
|
||||
: layout-baseline ( layout -- baseline )
|
||||
pango_layout_get_iter &pango_layout_iter_free
|
||||
pango_layout_iter_get_baseline
|
||||
pango>float ;
|
||||
|
||||
: set-foreground ( cr font -- )
|
||||
foreground>> set-source-color ;
|
||||
|
||||
: fill-background ( cr font dim -- )
|
||||
[ background>> set-source-color ]
|
||||
[ [ { 0 0 } ] dip <rect> fill-rect ] bi-curry* bi ;
|
||||
|
||||
: rect-translate-x ( rect x -- rect' )
|
||||
'[ _ 0 2array v- ] change-loc ;
|
||||
|
||||
: first-line ( layout -- line )
|
||||
layout>> 0 pango_layout_get_line_readonly ;
|
||||
|
||||
: line-offset>x ( layout n -- x )
|
||||
#! n is an index into the UTF8 encoding of the text
|
||||
[ drop first-line ] [ swap string>> >utf8-index ] 2bi
|
||||
0 0 <int> [ pango_layout_line_index_to_x ] keep
|
||||
*int pango>float ;
|
||||
|
||||
: x>line-offset ( layout x -- n )
|
||||
#! n is an index into the UTF8 encoding of the text
|
||||
[
|
||||
[ first-line ] dip
|
||||
float>pango 0 <int> 0 <int>
|
||||
[ pango_layout_line_x_to_index drop ] 2keep
|
||||
[ *int ] bi@ swap
|
||||
] [ drop string>> ] 2bi utf8-index> + ;
|
||||
|
||||
: selection-start/end ( selection -- start end )
|
||||
selection>> [ start>> ] [ end>> ] bi ;
|
||||
|
||||
: selection-rect ( layout -- rect )
|
||||
[ ink-rect>> dim>> ] [ ] [ selection-start/end ] tri [ line-offset>x ] bi-curry@ bi
|
||||
[ drop nip 0 2array ] [ swap - swap second 2array ] 3bi <rect> ;
|
||||
|
||||
: fill-selection-background ( cr layout -- )
|
||||
dup selection>> [
|
||||
[ selection>> color>> set-source-color ]
|
||||
[
|
||||
[ selection-rect ] [ ink-rect>> loc>> first ] bi
|
||||
rect-translate-x
|
||||
fill-rect
|
||||
] 2bi
|
||||
] [ 2drop ] if ;
|
||||
|
||||
: text-position ( layout -- loc )
|
||||
[ logical-rect>> ] [ ink-rect>> ] bi [ loc>> ] bi@ v- ;
|
||||
|
||||
: set-text-position ( cr loc -- )
|
||||
first2 cairo_move_to ;
|
||||
|
||||
: layout-metrics ( layout -- metrics )
|
||||
dup font>> missing-font-metrics clone
|
||||
swap
|
||||
[ layout>> layout-baseline >>ascent ]
|
||||
[ logical-rect>> dim>> [ first >>width ] [ second >>height ] bi ] bi
|
||||
dup [ height>> ] [ ascent>> ] bi - >>descent ;
|
||||
|
||||
: draw-layout ( layout -- image )
|
||||
dup ink-rect>> dim>> [ >fixnum ] map [
|
||||
swap {
|
||||
[ layout>> pango_cairo_update_layout ]
|
||||
[ [ font>> ] [ ink-rect>> dim>> ] bi fill-background ]
|
||||
[ fill-selection-background ]
|
||||
[ text-position set-text-position ]
|
||||
[ font>> set-foreground ]
|
||||
[ layout>> pango_cairo_show_layout ]
|
||||
} 2cleave
|
||||
] make-bitmap-image ;
|
||||
|
||||
: escape-nulls ( str -- str' )
|
||||
{ { 0 CHAR: zero-width-no-break-space } } substitute ;
|
||||
|
||||
: unpack-selection ( layout string/selection -- layout )
|
||||
dup selection? [
|
||||
[ string>> escape-nulls >>string ] [ >>selection ] bi
|
||||
] [ escape-nulls >>string ] if ; inline
|
||||
|
||||
: <layout> ( font string -- line )
|
||||
[
|
||||
layout new-disposable
|
||||
swap unpack-selection
|
||||
swap >>font
|
||||
dup [ string>> ] [ font>> ] bi <PangoLayout> >>layout
|
||||
dup layout>> layout-extents [ >>ink-rect ] [ >>logical-rect ] bi*
|
||||
dup layout-metrics >>metrics
|
||||
dup draw-layout >>image
|
||||
] with-destructors ;
|
||||
|
||||
M: layout dispose* layout>> g_object_unref ;
|
||||
|
||||
SYMBOL: cached-layouts
|
||||
|
||||
: cached-layout ( font string -- layout )
|
||||
cached-layouts get [ <layout> ] 2cache ;
|
||||
|
||||
: cached-line ( font string -- line )
|
||||
cached-layout layout>> first-line ;
|
||||
|
||||
[ <cache-assoc> cached-layouts set-global ] "pango.layouts" add-init-hook
|
||||
|
|
|
@ -23,8 +23,9 @@ CONSTANT: PANGO_SCALE 1024
|
|||
: pango>float ( n -- x ) PANGO_SCALE /f ; inline
|
||||
: float>pango ( x -- n ) PANGO_SCALE * >integer ; inline
|
||||
|
||||
FUNCTION: PangoContext*
|
||||
pango_context_new ( ) ;
|
||||
TYPEDEF: void* PangoContext*
|
||||
|
||||
FUNCTION: PangoContext* pango_context_new ( ) ;
|
||||
|
||||
STRUCT: PangoRectangle
|
||||
{ x int }
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
! See http://factorcode.org/license.txt for BSD license.
|
||||
! mersenne twister based on
|
||||
! http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.c
|
||||
USING: kernel math namespaces sequences sequences.private system
|
||||
init accessors math.ranges random math.bitwise combinators
|
||||
specialized-arrays fry ;
|
||||
USING: alien.c-types kernel math namespaces sequences
|
||||
sequences.private system init accessors math.ranges random
|
||||
math.bitwise combinators specialized-arrays fry ;
|
||||
SPECIALIZED-ARRAY: uint
|
||||
IN: random.mersenne-twister
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ STRUCT: ud
|
|||
{ inp_hook void* }
|
||||
{ inp_curr uchar }
|
||||
{ inp_fill uchar }
|
||||
{ inp_file FILE* }
|
||||
{ inp_file void* }
|
||||
{ inp_ctr uchar }
|
||||
{ inp_buff uchar* }
|
||||
{ inp_buff_end uchar* }
|
||||
|
@ -68,7 +68,7 @@ STRUCT: ud
|
|||
{ c3 uchar }
|
||||
{ inp_cache uchar[256] }
|
||||
{ inp_sess uchar[64] }
|
||||
{ itab_entry ud_itab_entry* } ;
|
||||
{ itab_entry void* } ;
|
||||
|
||||
FUNCTION: void ud_translate_intel ( ud* u ) ;
|
||||
FUNCTION: void ud_translate_att ( ud* u ) ;
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
USING: kernel accessors math math.vectors locals sequences
|
||||
specialized-arrays colors arrays combinators
|
||||
opengl opengl.gl ui.pens ui.pens.caching ;
|
||||
FROM: alien.c-types => float ;
|
||||
SPECIALIZED-ARRAY: float
|
||||
IN: ui.pens.gradient
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
! Copyright (C) 2009 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors colors help.markup help.syntax kernel opengl
|
||||
opengl.gl sequences math.vectors ui.gadgets ui.pens
|
||||
specialized-arrays ;
|
||||
USING: accessors alien.c-types colors help.markup help.syntax
|
||||
kernel opengl opengl.gl sequences math.vectors ui.gadgets
|
||||
ui.pens specialized-arrays ;
|
||||
SPECIALIZED-ARRAY: float
|
||||
IN: ui.pens.polygon
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
USING: accessors assocs classes destructors functors kernel
|
||||
lexer math parser sequences specialized-arrays ui.backend
|
||||
words ;
|
||||
USING: alien.c-types accessors assocs classes destructors
|
||||
functors kernel lexer math parser sequences specialized-arrays
|
||||
ui.backend words ;
|
||||
SPECIALIZED-ARRAY: int
|
||||
IN: ui.pixel-formats
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2005, 2006 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.syntax classes.struct combinators system
|
||||
vocabs.loader ;
|
||||
USING: alien.c-types alien.syntax classes.struct combinators
|
||||
system unix.types vocabs.loader ;
|
||||
IN: unix
|
||||
|
||||
CONSTANT: MAXPATHLEN 1024
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
! Copyright (C) 2008 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.syntax ;
|
||||
USING: alien.c-types alien.syntax unix.statfs.macosx ;
|
||||
IN: unix.getfsstat.macosx
|
||||
|
||||
CONSTANT: MNT_WAIT 1 ! synchronously wait for I/O to complete
|
||||
CONSTANT: MNT_NOWAIT 2 ! start all I/O, but do not wait for it
|
||||
|
||||
FUNCTION: int getfsstat64 ( statfs* buf, int bufsize, int flags ) ;
|
||||
FUNCTION: int getfsstat64 ( statfs64* buf, int bufsize, int flags ) ;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
! Copyright (C) 2008 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.syntax system sequences vocabs.loader words
|
||||
USING: alien.c-types alien.syntax system sequences vocabs.loader words
|
||||
accessors ;
|
||||
IN: unix.kqueue
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
USING: alien.syntax classes.struct ;
|
||||
USING: alien.c-types alien.syntax classes.struct unix.time ;
|
||||
IN: unix.kqueue
|
||||
|
||||
STRUCT: kevent
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
USING: kernel alien.c-types alien.data alien.strings sequences
|
||||
math alien.syntax unix namespaces continuations threads assocs
|
||||
io.backend.unix io.encodings.utf8 unix.utilities fry ;
|
||||
io.backend.unix io.encodings.utf8 unix.types unix.utilities fry ;
|
||||
IN: unix.process
|
||||
|
||||
! Low-level Unix process launching utilities. These are used
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
USING: alien.c-types arrays accessors combinators classes.struct
|
||||
alien.syntax ;
|
||||
alien.syntax unix.time unix.types ;
|
||||
IN: unix.stat
|
||||
|
||||
! Mac OS X ppc
|
||||
! Mac OS X
|
||||
|
||||
! stat64 structure
|
||||
STRUCT: stat
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
! Copyright (C) 2008 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.syntax classes.struct ;
|
||||
USING: alien.c-types alien.syntax classes.struct unix.types ;
|
||||
IN: unix.statvfs.macosx
|
||||
|
||||
STRUCT: statvfs
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
USING: kernel system alien.syntax combinators vocabs.loader ;
|
||||
USING: kernel system alien.c-types alien.syntax combinators vocabs.loader ;
|
||||
IN: unix.types
|
||||
|
||||
TYPEDEF: char int8_t
|
||||
|
@ -37,6 +37,12 @@ TYPEDEF: fsfilcnt_t __fsfilcnt_t
|
|||
TYPEDEF: __uint64_t rlim_t
|
||||
TYPEDEF: uint32_t id_t
|
||||
|
||||
TYPEDEF: void* DIR*
|
||||
TYPEDEF: void* FILE*
|
||||
TYPEDEF: void* rlimit*
|
||||
TYPEDEF: void* rusage*
|
||||
TYPEDEF: void* sockaddr*
|
||||
|
||||
os {
|
||||
{ linux [ "unix.types.linux" require ] }
|
||||
{ macosx [ "unix.types.macosx" require ] }
|
||||
|
@ -45,3 +51,4 @@ os {
|
|||
{ netbsd [ "unix.types.netbsd" require ] }
|
||||
{ winnt [ ] }
|
||||
} case
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ USING: alien alien.c-types alien.syntax kernel libc
|
|||
sequences continuations byte-arrays strings math namespaces
|
||||
system combinators vocabs.loader accessors
|
||||
stack-checker macros locals generalizations unix.types
|
||||
io vocabs classes.struct ;
|
||||
io vocabs classes.struct unix.time ;
|
||||
IN: unix
|
||||
|
||||
CONSTANT: PROT_NONE 0
|
||||
|
@ -35,12 +35,6 @@ CONSTANT: DT_LNK 10
|
|||
CONSTANT: DT_SOCK 12
|
||||
CONSTANT: DT_WHT 14
|
||||
|
||||
STRUCT: group
|
||||
{ gr_name char* }
|
||||
{ gr_passwd char* }
|
||||
{ gr_gid int }
|
||||
{ gr_mem char** } ;
|
||||
|
||||
LIBRARY: libc
|
||||
|
||||
FUNCTION: char* strerror ( int errno ) ;
|
||||
|
@ -68,6 +62,26 @@ MACRO:: unix-system-call ( quot -- )
|
|||
]
|
||||
] ;
|
||||
|
||||
<<
|
||||
|
||||
{
|
||||
{ [ os linux? ] [ "unix.linux" require ] }
|
||||
{ [ os bsd? ] [ "unix.bsd" require ] }
|
||||
{ [ os solaris? ] [ "unix.solaris" require ] }
|
||||
} cond
|
||||
|
||||
"debugger" vocab [
|
||||
"unix.debugger" require
|
||||
] when
|
||||
|
||||
>>
|
||||
|
||||
STRUCT: group
|
||||
{ gr_name char* }
|
||||
{ gr_passwd char* }
|
||||
{ gr_gid int }
|
||||
{ gr_mem char** } ;
|
||||
|
||||
FUNCTION: int accept ( int s, void* sockaddr, socklen_t* socklen ) ;
|
||||
FUNCTION: int bind ( int s, void* name, socklen_t namelen ) ;
|
||||
FUNCTION: int chdir ( char* path ) ;
|
||||
|
@ -86,7 +100,7 @@ FUNCTION: int dup2 ( int oldd, int newd ) ;
|
|||
! FUNCTION: int dup ( int oldd ) ;
|
||||
: _exit ( status -- * )
|
||||
#! We throw to give this a terminating stack effect.
|
||||
"int" f "_exit" { "int" } alien-invoke "Exit failed" throw ;
|
||||
int f "_exit" { int } alien-invoke "Exit failed" throw ;
|
||||
FUNCTION: void endpwent ( ) ;
|
||||
FUNCTION: int fchdir ( int fd ) ;
|
||||
FUNCTION: int fchown ( int fd, uid_t owner, gid_t group ) ;
|
||||
|
@ -207,12 +221,3 @@ FUNCTION: int utimes ( char* path, timeval[2] times ) ;
|
|||
|
||||
FUNCTION: ssize_t write ( int fd, void* buf, size_t nbytes ) ;
|
||||
|
||||
{
|
||||
{ [ os linux? ] [ "unix.linux" require ] }
|
||||
{ [ os bsd? ] [ "unix.bsd" require ] }
|
||||
{ [ os solaris? ] [ "unix.solaris" require ] }
|
||||
} cond
|
||||
|
||||
"debugger" vocab [
|
||||
"unix.debugger" require
|
||||
] when
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
! Copyright (C) 2009 Phil Dawes.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: classes.struct alien.syntax ;
|
||||
USING: classes.struct alien.c-types alien.syntax ;
|
||||
IN: vm
|
||||
|
||||
TYPEDEF: void* cell
|
||||
TYPEDEF: void* context*
|
||||
|
||||
STRUCT: zone
|
||||
{ start cell }
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
! Based on X.h
|
||||
|
||||
USING: alien alien.syntax math x11.xlib ;
|
||||
USING: alien alien.c-types alien.syntax math x11.xlib ;
|
||||
IN: x11.constants
|
||||
|
||||
TYPEDEF: ulong Mask
|
||||
|
|
|
@ -410,10 +410,6 @@ STRUCT: XCharStruct
|
|||
{ descent short }
|
||||
{ attributes ushort } ;
|
||||
|
||||
X-FUNCTION: Font XLoadFont ( Display* display, char* name ) ;
|
||||
X-FUNCTION: XFontStruct* XQueryFont ( Display* display, XID font_ID ) ;
|
||||
X-FUNCTION: XFontStruct* XLoadQueryFont ( Display* display, char* name ) ;
|
||||
|
||||
STRUCT: XFontStruct
|
||||
{ ext_data XExtData* }
|
||||
{ fid Font }
|
||||
|
@ -432,6 +428,10 @@ STRUCT: XFontStruct
|
|||
{ ascent int }
|
||||
{ descent int } ;
|
||||
|
||||
X-FUNCTION: Font XLoadFont ( Display* display, char* name ) ;
|
||||
X-FUNCTION: XFontStruct* XQueryFont ( Display* display, XID font_ID ) ;
|
||||
X-FUNCTION: XFontStruct* XLoadQueryFont ( Display* display, char* name ) ;
|
||||
|
||||
X-FUNCTION: int XTextWidth ( XFontStruct* font_struct, char* string, int count ) ;
|
||||
|
||||
! 8.6 - Drawing Text
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
USING: sequences kernel math specialized-arrays fry ;
|
||||
USING: alien.c-types sequences kernel math specialized-arrays
|
||||
fry ;
|
||||
SPECIALIZED-ARRAY: int
|
||||
IN: benchmark.dawes
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
USING: make math sequences splitting grouping
|
||||
USING: alien.c-types make math sequences splitting grouping
|
||||
kernel columns specialized-arrays bit-arrays ;
|
||||
SPECIALIZED-ARRAY: double
|
||||
IN: benchmark.dispatch2
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
USING: sequences math mirrors splitting grouping
|
||||
USING: alien.c-types sequences math mirrors splitting grouping
|
||||
kernel make assocs alien.syntax columns
|
||||
specialized-arrays bit-arrays ;
|
||||
SPECIALIZED-ARRAY: double
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Based on http://shootout.alioth.debian.org/gp4/benchmark.php?test=fasta&lang=java&id=2
|
||||
USING: math kernel io io.files locals multiline assocs sequences
|
||||
sequences.private benchmark.reverse-complement hints
|
||||
io.encodings.ascii byte-arrays specialized-arrays ;
|
||||
USING: alien.c-types math kernel io io.files locals multiline
|
||||
assocs sequences sequences.private benchmark.reverse-complement
|
||||
hints io.encodings.ascii byte-arrays specialized-arrays ;
|
||||
SPECIALIZED-ARRAY: double
|
||||
IN: benchmark.fasta
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
! Copyright (C) 2008, 2009 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors fry kernel locals math math.constants
|
||||
math.functions math.vectors math.vectors.simd prettyprint
|
||||
combinators.smart sequences hints classes.struct
|
||||
USING: accessors alien.c-types fry kernel locals math
|
||||
math.constants math.functions math.vectors math.vectors.simd
|
||||
prettyprint combinators.smart sequences hints classes.struct
|
||||
specialized-arrays ;
|
||||
SIMD: double
|
||||
IN: benchmark.nbody-simd
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
! Copyright (C) 2008, 2009 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors specialized-arrays fry kernel locals math
|
||||
math.constants math.functions math.vectors prettyprint
|
||||
combinators.smart sequences hints arrays ;
|
||||
USING: accessors specialized-arrays fry kernel
|
||||
locals math math.constants math.functions math.vectors
|
||||
prettyprint combinators.smart sequences hints arrays ;
|
||||
FROM: alien.c-types => double ;
|
||||
SPECIALIZED-ARRAY: double
|
||||
IN: benchmark.nbody
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
! Factor port of the raytracer benchmark from
|
||||
! http://www.ffconsultancy.com/free/ray_tracer/languages.html
|
||||
|
||||
USING: arrays accessors specialized-arrays io io.files
|
||||
io.files.temp io.encodings.binary kernel math math.constants
|
||||
math.functions math.vectors math.parser make sequences
|
||||
sequences.private words hints ;
|
||||
USING: arrays accessors specialized-arrays io
|
||||
io.files io.files.temp io.encodings.binary kernel math
|
||||
math.constants math.functions math.vectors math.parser make
|
||||
sequences sequences.private words hints ;
|
||||
FROM: alien.c-types => double ;
|
||||
SPECIALIZED-ARRAY: double
|
||||
IN: benchmark.raytracer
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
! Factor port of
|
||||
! http://shootout.alioth.debian.org/gp4/benchmark.php?test=spectralnorm&lang=all
|
||||
USING: specialized-arrays kernel math math.functions
|
||||
math.vectors sequences prettyprint words hints locals ;
|
||||
USING: alien.c-types specialized-arrays kernel math
|
||||
math.functions math.vectors sequences prettyprint words hints
|
||||
locals ;
|
||||
SPECIALIZED-ARRAY: double
|
||||
IN: benchmark.spectral-norm
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
USING: accessors classes.struct combinators.smart fry kernel
|
||||
math math.functions math.order math.parser sequences
|
||||
specialized-arrays io ;
|
||||
FROM: alien.c-types => float ;
|
||||
IN: benchmark.struct-arrays
|
||||
|
||||
STRUCT: point { x float } { y float } { z float } ;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
! Copyright (C) 2005, 2007 Slava Pestov.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien alien.syntax kernel system combinators
|
||||
USING: alien alien.c-types alien.syntax kernel system combinators
|
||||
alien.libraries classes.struct ;
|
||||
IN: freetype
|
||||
|
||||
|
@ -38,8 +38,8 @@ TYPEDEF: long FT_F26Dot6
|
|||
FUNCTION: FT_Error FT_Init_FreeType ( void* library ) ;
|
||||
|
||||
! circular reference between glyph and face
|
||||
TYPEDEF: void face
|
||||
TYPEDEF: void glyph
|
||||
TYPEDEF: void* face*
|
||||
TYPEDEF: void* glyph*
|
||||
|
||||
STRUCT: glyph
|
||||
{ library void* }
|
||||
|
@ -166,6 +166,8 @@ STRUCT: FT_Bitmap
|
|||
{ palette_mode char }
|
||||
{ palette void* } ;
|
||||
|
||||
TYPEDEF: void* FT_Face*
|
||||
|
||||
FUNCTION: FT_Error FT_New_Face ( void* library, FT_Char* font, FT_Long index, face* face ) ;
|
||||
|
||||
FUNCTION: FT_Error FT_New_Memory_Face ( void* library, FT_Byte* file_base, FT_Long file_size, FT_Long face_index, FT_Face* aface ) ;
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
! (c)2009 Joe Groff bsd license
|
||||
USING: alien alien.syntax byte-arrays classes gpu.buffers
|
||||
gpu.framebuffers gpu.shaders gpu.textures help.markup
|
||||
USING: alien alien.c-types alien.syntax byte-arrays classes
|
||||
gpu.buffers gpu.framebuffers gpu.shaders gpu.textures help.markup
|
||||
help.syntax images kernel math sequences
|
||||
specialized-arrays strings ;
|
||||
SPECIALIZED-ARRAY: float
|
||||
QUALIFIED-WITH: alien.c-types c
|
||||
QUALIFIED-WITH: math m
|
||||
SPECIALIZED-ARRAY: c:float
|
||||
SPECIALIZED-ARRAY: int
|
||||
SPECIALIZED-ARRAY: uint
|
||||
SPECIALIZED-ARRAY: ulong
|
||||
|
@ -49,7 +51,7 @@ $nl
|
|||
"Uniform parameters are passed from Factor to the shader program through the uniform tuple as follows:"
|
||||
{ $list
|
||||
{ { $link int-uniform } "s and " { $link uint-uniform } "s take their values from Factor " { $link integer } "s." }
|
||||
{ { $link float-uniform } "s take their values from Factor " { $link float } "s." }
|
||||
{ { $link float-uniform } "s take their values from Factor " { $link m:float } "s." }
|
||||
{ { $link bool-uniform } "s take their values from Factor " { $link boolean } "s." }
|
||||
{ { $link texture-uniform } "s take their values from " { $link texture } " objects." }
|
||||
{ "Vector uniforms take their values from Factor " { $link sequence } "s of the corresponding component type."
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
! (c)2009 Joe Groff bsd license
|
||||
USING: gpu.buffers gpu.render gpu.shaders gpu.textures images kernel
|
||||
specialized-arrays ;
|
||||
FROM: alien.c-types => float ;
|
||||
SPECIALIZED-ARRAY: float
|
||||
IN: gpu.util
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ gpu.render gpu.state kernel literals
|
|||
locals math math.constants math.functions math.matrices
|
||||
math.order math.vectors opengl.gl sequences
|
||||
ui ui.gadgets.worlds specialized-arrays ;
|
||||
FROM: alien.c-types => float ;
|
||||
SPECIALIZED-ARRAY: float
|
||||
IN: gpu.util.wasd
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
! (c)2009 Joe Groff bsd license
|
||||
USING: accessors arrays destructors kernel math opengl
|
||||
opengl.gl sequences sequences.product specialized-arrays ;
|
||||
FROM: alien.c-types => float ;
|
||||
SPECIALIZED-ARRAY: float
|
||||
IN: grid-meshes
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
! Copyright (C) 2009 Doug Coleman
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: kernel accessors grouping sequences combinators math
|
||||
byte-arrays fry images half-floats specialized-arrays ;
|
||||
USING: alien.c-types kernel accessors grouping sequences
|
||||
combinators math byte-arrays fry images half-floats
|
||||
specialized-arrays ;
|
||||
FROM: alien.c-types => float ;
|
||||
SPECIALIZED-ARRAY: uint
|
||||
SPECIALIZED-ARRAY: ushort
|
||||
SPECIALIZED-ARRAY: float
|
||||
|
|
|
@ -4,7 +4,8 @@ USING: accessors colors.constants combinators jamshred.log
|
|||
jamshred.oint jamshred.sound jamshred.tunnel kernel locals math
|
||||
math.constants math.order math.ranges math.vectors math.matrices
|
||||
sequences shuffle specialized-arrays strings system ;
|
||||
SPECIALIZED-ARRAY: float
|
||||
QUALIFIED-WITH: alien.c-types c
|
||||
SPECIALIZED-ARRAY: c:float
|
||||
IN: jamshred.player
|
||||
|
||||
TUPLE: player < oint
|
||||
|
|
|
@ -5,6 +5,7 @@ kernel literals locals math math.constants math.matrices
|
|||
math.order math.quadratic math.ranges math.vectors random
|
||||
sequences specialized-arrays vectors ;
|
||||
FROM: jamshred.oint => distance ;
|
||||
FROM: alien.c-types => float ;
|
||||
SPECIALIZED-ARRAY: float
|
||||
IN: jamshred.tunnel
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
USING: alien.syntax io io.encodings.utf16n io.encodings.utf8 io.files
|
||||
kernel namespaces sequences system threads unix.utilities ;
|
||||
USING: alien.c-types alien.syntax io io.encodings.utf16n
|
||||
io.encodings.utf8 io.files kernel namespaces sequences system threads
|
||||
unix.utilities ;
|
||||
IN: native-thread-test
|
||||
|
||||
FUNCTION: void* start_standalone_factor_in_new_thread ( int argc, char** argv ) ;
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
! (c)2009 Joe Groff bsd license
|
||||
USING: accessors arrays grouping kernel locals math math.order
|
||||
math.ranges math.vectors math.vectors.homogeneous sequences
|
||||
specialized-arrays ;
|
||||
USING: accessors alien.c-types arrays grouping kernel locals
|
||||
math math.order math.ranges math.vectors
|
||||
math.vectors.homogeneous sequences specialized-arrays ;
|
||||
FROM: alien.c-types => float ;
|
||||
SPECIALIZED-ARRAY: float
|
||||
IN: nurbs
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ FUNCTION: int ogg_sync_pageout ( ogg-sync-state* oy, ogg-page* og ) ;
|
|||
FUNCTION: int ogg_stream_pagein ( ogg-stream-state* os, ogg-page* og ) ;
|
||||
FUNCTION: int ogg_stream_packetout ( ogg-stream-state* os, ogg-packet* op ) ;
|
||||
FUNCTION: int ogg_stream_packetpeek ( ogg-stream-state* os, ogg-packet* op ) ;
|
||||
FUNCTION: int ogg_stream_init (ogg-stream-state* os, int serialno ) ;
|
||||
FUNCTION: int ogg_stream_init ( ogg-stream-state* os, int serialno ) ;
|
||||
FUNCTION: int ogg_stream_clear ( ogg-stream-state* os ) ;
|
||||
FUNCTION: int ogg_stream_reset ( ogg-stream-state* os ) ;
|
||||
FUNCTION: int ogg_stream_reset_serialno ( ogg-stream-state* os, int serialno ) ;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2007 Chris Double.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.c-types kernel alien alien.syntax shuffle
|
||||
openal.backend namespaces system generalizations ;
|
||||
openal openal.backend namespaces system generalizations ;
|
||||
IN: openal.macosx
|
||||
|
||||
LIBRARY: alut
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2007 Chris Double.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien.c-types alien.syntax combinators generalizations
|
||||
kernel openal.backend ;
|
||||
kernel openal openal.backend ;
|
||||
IN: openal.other
|
||||
|
||||
LIBRARY: alut
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2005 Alex Chapman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: alien alien.libraries alien.syntax kernel sequences words system
|
||||
combinators ;
|
||||
USING: alien alien.c-types alien.libraries alien.syntax kernel
|
||||
sequences words system combinators opengl.gl ;
|
||||
IN: opengl.glu
|
||||
|
||||
<<
|
||||
|
|
|
@ -9,6 +9,7 @@ terrain.generation terrain.shaders ui ui.gadgets
|
|||
ui.gadgets.worlds ui.pixel-formats game-worlds method-chains
|
||||
math.affine-transforms noise ui.gestures combinators.short-circuit
|
||||
destructors grid-meshes ;
|
||||
FROM: alien.c-types => float ;
|
||||
SPECIALIZED-ARRAY: float
|
||||
IN: terrain
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ IN: tokyo.alien.tchdb
|
|||
|
||||
LIBRARY: tokyocabinet
|
||||
|
||||
TYPEDEF: void* TCXSTR*
|
||||
TYPEDEF: void* TCHDB*
|
||||
|
||||
CONSTANT: HDBFOPEN 1
|
||||
|
|
|
@ -8,6 +8,7 @@ LIBRARY: tokyocabinet
|
|||
|
||||
TYPEDEF: void* TDBIDX*
|
||||
TYPEDEF: void* TCTDB*
|
||||
TYPEDEF: void* TCMAP*
|
||||
|
||||
CONSTANT: TDBFOPEN HDBFOPEN
|
||||
CONSTANT: TDBFFATAL HDBFFATAL
|
||||
|
|
|
@ -23,11 +23,11 @@ else
|
|||
set iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
|
||||
endif
|
||||
|
||||
syn cluster factorCluster contains=factorComment,factorKeyword,factorRepeat,factorConditional,factorBoolean,factorCompileDirective,factorString,factorSbuf,@factorNumber,@factorNumErr,factorDelimiter,factorChar,factorCharErr,factorBackslash,@factorWordOps,factorAlien,factorTuple
|
||||
syn cluster factorCluster contains=factorComment,factorKeyword,factorRepeat,factorConditional,factorBoolean,factorCompileDirective,factorString,factorSbuf,@factorNumber,@factorNumErr,factorDelimiter,factorChar,factorCharErr,factorBackslash,@factorWordOps,factorAlien,factorTuple,factorStruct
|
||||
|
||||
syn match factorTodo /\(TODO\|FIXME\|XXX\):\=/ contained
|
||||
syn match factorComment /\<#! .*/ contains=factorTodo
|
||||
syn match factorComment /\<! .*/ contains=factorTodo
|
||||
syn match factorComment /\<#!\>.*/ contains=factorTodo
|
||||
syn match factorComment /\<!\>.*/ contains=factorTodo
|
||||
|
||||
syn cluster factorDefnContents contains=@factorCluster,factorStackEffect,factorLiteralStackEffect,factorArray0,factorQuotation0
|
||||
|
||||
|
@ -84,13 +84,18 @@ syn match factorChar /\<CHAR:\s\+\\\=\S\>/
|
|||
syn match factorBackslash /\<\\\>\s\+\S\+\>/
|
||||
|
||||
syn region factorUsing start=/\<USING:\>/ end=/;/
|
||||
syn match factorQualified /\<QUALIFIED:\s\+\S\+\>/
|
||||
syn match factorQualifiedWith /\<QUALIFIED-WITH:\s\+\S\+\s\+\S\+\>/
|
||||
syn region factorFrom start=/\<FROM:\>/ end=/;/
|
||||
syn region factorSingletons start=/\<SINGLETONS:\>/ end=/;/
|
||||
syn match factorSymbol /\<SYMBOL:\s\+\S\+\>/
|
||||
syn region factorSymbols start=/\<SYMBOLS:\>/ end=/;/
|
||||
syn region factorConstructor2 start=/\<CONSTRUCTOR:\?/ end=/;/
|
||||
syn region factorTuple start=/\<TUPLE:\>/ end=/\<;\>/
|
||||
syn region factorStruct start=/\<\(UNION-STRUCT:\|STRUCT:\)\>/ end=/\<;\>/
|
||||
|
||||
syn match factorConstant /\<CONSTANT:\s\+\S\+\>/
|
||||
syn match factorAlias /\<ALIAS:\s\+\S\+\>/
|
||||
syn match factorSingleton /\<SINGLETON:\s\+\S\+\>/
|
||||
syn match factorPostpone /\<POSTPONE:\s\+\S\+\>/
|
||||
syn match factorDefer /\<DEFER:\s\+\S\+\>/
|
||||
|
@ -102,8 +107,7 @@ syn match factorMain /\<MAIN:\s\+\S\+\>/
|
|||
syn match factorConstructor /\<C:\s\+\S\+\s\+\S\+\>/
|
||||
syn match factorAlien /\<ALIEN:\s\+\d\+\>/
|
||||
|
||||
syn cluster factorWordOps contains=factorSymbol,factorPostpone,factorDefer,factorForget,factorMixin,factorInstance,factorHook,factorMain,factorConstructor
|
||||
|
||||
syn cluster factorWordOps contains=factorConstant,factorAlias,factorSingleton,factorSingletons,factorSymbol,factorSymbols,factorPostpone,factorDefer,factorForget,factorMixin,factorInstance,factorHook,factorMain,factorConstructor
|
||||
|
||||
"TODO:
|
||||
"misc:
|
||||
|
@ -113,20 +117,10 @@ syn cluster factorWordOps contains=factorSymbol,factorPostpone,factorDefer
|
|||
" PRIMITIVE:
|
||||
|
||||
"C interface:
|
||||
" FIELD:
|
||||
" BEGIN-STRUCT:
|
||||
" C-ENUM:
|
||||
" FUNCTION:
|
||||
" END-STRUCT
|
||||
" DLL"
|
||||
" TYPEDEF:
|
||||
" LIBRARY:
|
||||
" C-UNION:
|
||||
"QUALIFIED:
|
||||
"QUALIFIED-WITH:
|
||||
"FROM:
|
||||
"ALIAS:
|
||||
"! POSTPONE: "
|
||||
"#\ "
|
||||
|
||||
syn region factorString start=/"/ skip=/\\"/ end=/"/ oneline
|
||||
|
@ -143,18 +137,18 @@ syn match factorLiteralStackEffect /\<(( .*--.* ))\>/
|
|||
|
||||
"adapted from lisp.vim
|
||||
if exists("g:factor_norainbow")
|
||||
syn region factorQuotation matchgroup=factorDelimiter start=/\<\(\('\|\$\|\)\[\)\|\[\(let\||\)\>/ matchgroup=factorDelimiter end=/\<\]\>/ contains=ALL
|
||||
syn region factorQuotation matchgroup=factorDelimiter start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/ matchgroup=factorDelimiter end=/\<\]\>/ contains=ALL
|
||||
else
|
||||
syn region factorQuotation0 matchgroup=hlLevel0 start=/\<\(\('\|\$\|\)\[\)\|\[\(let\||\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation1,factorArray1
|
||||
syn region factorQuotation1 contained matchgroup=hlLevel1 start=/\<\(\('\|\$\|\)\[\)\|\[\(let\||\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation2,factorArray2
|
||||
syn region factorQuotation2 contained matchgroup=hlLevel2 start=/\<\(\('\|\$\|\)\[\)\|\[\(let\||\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation3,factorArray3
|
||||
syn region factorQuotation3 contained matchgroup=hlLevel3 start=/\<\(\('\|\$\|\)\[\)\|\[\(let\||\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation4,factorArray4
|
||||
syn region factorQuotation4 contained matchgroup=hlLevel4 start=/\<\(\('\|\$\|\)\[\)\|\[\(let\||\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation5,factorArray5
|
||||
syn region factorQuotation5 contained matchgroup=hlLevel5 start=/\<\(\('\|\$\|\)\[\)\|\[\(let\||\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation6,factorArray6
|
||||
syn region factorQuotation6 contained matchgroup=hlLevel6 start=/\<\(\('\|\$\|\)\[\)\|\[\(let\||\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation7,factorArray7
|
||||
syn region factorQuotation7 contained matchgroup=hlLevel7 start=/\<\(\('\|\$\|\)\[\)\|\[\(let\||\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation8,factorArray8
|
||||
syn region factorQuotation8 contained matchgroup=hlLevel8 start=/\<\(\('\|\$\|\)\[\)\|\[\(let\||\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation9,factorArray9
|
||||
syn region factorQuotation9 contained matchgroup=hlLevel9 start=/\<\(\('\|\$\|\)\[\)\|\[\(let\||\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation0,factorArray0
|
||||
syn region factorQuotation0 matchgroup=hlLevel0 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation1,factorArray1
|
||||
syn region factorQuotation1 contained matchgroup=hlLevel1 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation2,factorArray2
|
||||
syn region factorQuotation2 contained matchgroup=hlLevel2 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation3,factorArray3
|
||||
syn region factorQuotation3 contained matchgroup=hlLevel3 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation4,factorArray4
|
||||
syn region factorQuotation4 contained matchgroup=hlLevel4 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation5,factorArray5
|
||||
syn region factorQuotation5 contained matchgroup=hlLevel5 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation6,factorArray6
|
||||
syn region factorQuotation6 contained matchgroup=hlLevel6 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation7,factorArray7
|
||||
syn region factorQuotation7 contained matchgroup=hlLevel7 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation8,factorArray8
|
||||
syn region factorQuotation8 contained matchgroup=hlLevel8 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation9,factorArray9
|
||||
syn region factorQuotation9 contained matchgroup=hlLevel9 start=/\<\(\(\('\|\$\|\)\[\)\|\[\(let\||\)\)\>/ end=/\<\]\>/ contains=@factorCluster,factorQuotation0,factorArray0
|
||||
endif
|
||||
|
||||
if exists("g:factor_norainbow")
|
||||
|
@ -222,6 +216,9 @@ if version >= 508 || !exists("did_factor_syn_inits")
|
|||
HiLink factorFloat Float
|
||||
HiLink factorInt Number
|
||||
HiLink factorUsing Include
|
||||
HiLink factorQualified Include
|
||||
HiLink factorQualifiedWith Include
|
||||
HiLink factorFrom Include
|
||||
HiLink factorUse Include
|
||||
HiLink factorUnuse Include
|
||||
HiLink factorIn Define
|
||||
|
@ -243,6 +240,7 @@ if version >= 508 || !exists("did_factor_syn_inits")
|
|||
HiLink factorForget Define
|
||||
HiLink factorAlien Define
|
||||
HiLink factorTuple Typedef
|
||||
HiLink factorStruct Typedef
|
||||
|
||||
if &bg == "dark"
|
||||
hi hlLevel0 ctermfg=red guifg=red1
|
||||
|
|
Loading…
Reference in New Issue