Merge branch 'master' of git://factorcode.org/git/factor

db4
Doug Coleman 2009-03-10 00:15:17 -05:00
commit 7a6ae79ed9
9 changed files with 47 additions and 13 deletions

View File

@ -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

View File

@ -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 ;
: <CFArray> ( 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 ;

View File

@ -0,0 +1,2 @@
unportable
bindings

View File

@ -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 ;

View File

@ -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 ;
tri ;
: <polygon-gadget> ( color points -- gadget )
[ <polygon> ] [ { 0 0 } [ vmax ] reduce ] bi
[ <gadget> ] 2dip [ >>interior ] [ >>dim ] bi* ;

View File

@ -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

View File

@ -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

View File

@ -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
<PRIVATE

View File

@ -152,8 +152,6 @@ M: irc-chat to-chat in-messages>> mailbox-put ;
[ (>>nick) ] [ (>>parameter) ] [ +mode+ >>action ] tri ] dip to-chat ]
3bi ; ! FIXME
DEFER: me?
! ======================================
! IRC client messages
! ======================================