diff --git a/basis/cocoa/plists/plists-tests.factor b/basis/cocoa/plists/plists-tests.factor index beb766561f..4f74cd850a 100644 --- a/basis/cocoa/plists/plists-tests.factor +++ b/basis/cocoa/plists/plists-tests.factor @@ -7,4 +7,34 @@ assocs cocoa.enumeration ; [ V{ } ] [ H{ } >cf &CFRelease [ ] NSFastEnumeration-map ] unit-test [ V{ "A" } ] [ { "A" } >cf &CFRelease plist> ] unit-test [ H{ { "A" "B" } } ] [ "B" "A" associate >cf &CFRelease plist> ] unit-test + [ H{ { "A" "B" } } ] [ "B" "A" associate >cf &CFRelease plist> ] unit-test + + [ t ] [ + { + H{ { "DeviceUsagePage" 1 } { "DeviceUsage" 4 } } + H{ { "DeviceUsagePage" 1 } { "DeviceUsage" 5 } } + H{ { "DeviceUsagePage" 1 } { "DeviceUsage" 6 } } + } [ >cf &CFRelease ] [ >cf &CFRelease ] bi + [ plist> ] bi@ = + ] unit-test + + [ t ] [ + { "DeviceUsagePage" 1 } + [ >cf &CFRelease ] [ >cf &CFRelease ] bi + [ plist> ] bi@ = + ] unit-test + + [ V{ "DeviceUsagePage" "Yes" } ] [ + { "DeviceUsagePage" "Yes" } + >cf &CFRelease plist> + ] unit-test + + [ V{ 2.0 1.0 } ] [ + { 2.0 1.0 } + >cf &CFRelease plist> + ] unit-test + + [ 3.5 ] [ + 3.5 >cf &CFRelease plist> + ] unit-test ] with-destructors \ No newline at end of file diff --git a/basis/core-foundation/arrays/arrays.factor b/basis/core-foundation/arrays/arrays.factor index 3708059f2b..1205352fcb 100644 --- a/basis/core-foundation/arrays/arrays.factor +++ b/basis/core-foundation/arrays/arrays.factor @@ -1,6 +1,6 @@ -! Copyright (C) 2008 Slava Pestov. +! Copyright (C) 2008, 2009 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: alien.syntax kernel sequences ; +USING: alien.syntax kernel sequences fry ; IN: core-foundation.arrays TYPEDEF: void* CFArrayRef @@ -17,6 +17,5 @@ FUNCTION: CFIndex CFArrayGetCount ( CFArrayRef array ) ; dup CFArrayGetCount [ CFArrayGetValueAtIndex ] with map ; : ( seq -- alien ) - [ f swap length f CFArrayCreateMutable ] keep - [ length ] keep - [ [ dupd ] dip CFArraySetValueAtIndex ] 2each ; + f over length &: kCFTypeArrayCallBacks CFArrayCreateMutable + [ '[ [ _ ] 2dip swap CFArraySetValueAtIndex ] each-index ] keep ; diff --git a/basis/core-text/fonts/tags.txt b/basis/core-text/fonts/tags.txt new file mode 100644 index 0000000000..2320bdd648 --- /dev/null +++ b/basis/core-text/fonts/tags.txt @@ -0,0 +1,2 @@ +unportable +bindings diff --git a/basis/ui/gadgets/panes/panes.factor b/basis/ui/gadgets/panes/panes.factor index d322cb995b..c52c361b86 100644 --- a/basis/ui/gadgets/panes/panes.factor +++ b/basis/ui/gadgets/panes/panes.factor @@ -104,7 +104,7 @@ M: pane draw-gadget* dup gadget-selection? [ [ selection-color>> gl-color ] [ - [ [ origin get ] dip loc>> v- ] keep selected-children + [ loc>> vneg ] keep selected-children [ draw-selection ] with each ] bi ] [ drop ] if ; diff --git a/basis/ui/pens/polygon/polygon.factor b/basis/ui/pens/polygon/polygon.factor index 4d7793dd65..d244cc71d2 100644 --- a/basis/ui/pens/polygon/polygon.factor +++ b/basis/ui/pens/polygon/polygon.factor @@ -1,7 +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 specialized-arrays.float ui.pens ; +opengl.gl sequences specialized-arrays.float math.vectors +ui.gadgets ui.pens ; IN: ui.pens.polygon ! Polygon pen @@ -30,4 +31,8 @@ M: polygon draw-interior [ color>> gl-color ] [ interior-vertices>> gl-vertex-pointer ] [ [ GL_POLYGON 0 ] dip interior-count>> glDrawArrays ] - tri ; \ No newline at end of file + tri ; + +: ( color points -- gadget ) + [ ] [ { 0 0 } [ vmax ] reduce ] bi + [ ] 2dip [ >>interior ] [ >>dim ] bi* ; \ No newline at end of file diff --git a/basis/validators/validators-docs.factor b/basis/validators/validators-docs.factor index 8f5a587569..45444889de 100644 --- a/basis/validators/validators-docs.factor +++ b/basis/validators/validators-docs.factor @@ -1,5 +1,5 @@ USING: help.markup help.syntax io.streams.string quotations -strings math regexp regexp.backend ; +strings math regexp ; IN: validators HELP: v-checkbox diff --git a/basis/validators/validators.factor b/basis/validators/validators.factor index f0ee13dd38..740cf7db13 100644 --- a/basis/validators/validators.factor +++ b/basis/validators/validators.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2006, 2008 Slava Pestov ! See http://factorcode.org/license.txt for BSD license. USING: kernel continuations sequences math namespaces make sets -math.parser math.ranges assocs regexp unicode.categories arrays +math.parser math.ranges assocs regexp regexp.matchers unicode.categories arrays hashtables words classes quotations xmode.catalog unicode.case ; IN: validators diff --git a/core/assocs/assocs.factor b/core/assocs/assocs.factor index 0c0667e730..ec56cffff7 100755 --- a/core/assocs/assocs.factor +++ b/core/assocs/assocs.factor @@ -20,7 +20,7 @@ GENERIC: >alist ( assoc -- newassoc ) M: assoc assoc-like drop ; : ?at ( key assoc -- value/key ? ) - dupd at* [ [ nip ] [ drop ] if ] keep ; inline + 2dup at* [ 2nip t ] [ 2drop f ] if ; inline > mailbox-put ; [ (>>nick) ] [ (>>parameter) ] [ +mode+ >>action ] tri ] dip to-chat ] 3bi ; ! FIXME -DEFER: me? - ! ====================================== ! IRC client messages ! ======================================