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

db4
Doug Coleman 2009-05-14 23:33:48 -05:00
commit 312fe46848
6 changed files with 25 additions and 9 deletions

View File

@ -3,7 +3,7 @@ kernel cocoa.enumeration destructors math.parser cocoa.application
sequences locals combinators.short-circuit threads sequences locals combinators.short-circuit threads
namespaces assocs vectors arrays combinators hints alien namespaces assocs vectors arrays combinators hints alien
core-foundation.run-loop accessors sequences.private core-foundation.run-loop accessors sequences.private
alien.c-types math parser game-input vectors ; alien.c-types math parser game-input vectors bit-arrays ;
IN: game-input.iokit IN: game-input.iokit
SINGLETON: iokit-game-input-backend SINGLETON: iokit-game-input-backend
@ -186,7 +186,7 @@ HINTS: record-controller { controller-state alien } ;
rot ?set-nth rot ?set-nth
] [ 3drop ] if ; ] [ 3drop ] if ;
HINTS: record-keyboard { array alien } ; HINTS: record-keyboard { bit-array alien } ;
: record-mouse ( mouse-state value -- ) : record-mouse ( mouse-state value -- )
dup IOHIDValueGetElement { dup IOHIDValueGetElement {
@ -285,7 +285,7 @@ M: iokit-game-input-backend reset-mouse
4 <vector> +controller-states+ set-global 4 <vector> +controller-states+ set-global
0 0 0 0 2 <vector> mouse-state boa 0 0 0 0 2 <vector> mouse-state boa
+mouse-state+ set-global +mouse-state+ set-global
256 f <array> +keyboard-state+ set-global ; 256 <bit-array> +keyboard-state+ set-global ;
M: iokit-game-input-backend (open-game-input) M: iokit-game-input-backend (open-game-input)
hid-manager-matching-game-devices { hid-manager-matching-game-devices {

View File

@ -20,7 +20,7 @@ DEFER: copy-tree-into
{ {
{ +symbolic-link+ [ copy-link ] } { +symbolic-link+ [ copy-link ] }
{ +directory+ [ '[ [ _ copy-tree-into ] each ] with-directory-files ] } { +directory+ [ '[ [ _ copy-tree-into ] each ] with-directory-files ] }
[ drop copy-file ] [ drop copy-file-and-info ]
} case ; } case ;
: copy-tree-into ( from to -- ) : copy-tree-into ( from to -- )

View File

@ -1,7 +1,7 @@
! Copyright (C) 2008 Doug Coleman, Eduardo Cavazos. ! Copyright (C) 2008 Doug Coleman, Eduardo Cavazos.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors kernel system sequences combinators USING: accessors kernel system sequences combinators
vocabs.loader io.files.types math ; vocabs.loader io.files.types io.directories math ;
IN: io.files.info IN: io.files.info
! File info ! File info
@ -29,3 +29,7 @@ HOOK: file-system-info os ( path -- file-system-info )
{ [ os unix? ] [ "io.files.info.unix." os name>> append ] } { [ os unix? ] [ "io.files.info.unix." os name>> append ] }
{ [ os windows? ] [ "io.files.info.windows" ] } { [ os windows? ] [ "io.files.info.windows" ] }
} cond require } cond require
HOOK: copy-file-and-info os ( from to -- )
M: object copy-file-and-info copy-file ;

View File

@ -3,7 +3,7 @@
USING: accessors kernel system math math.bitwise strings arrays USING: accessors kernel system math math.bitwise strings arrays
sequences combinators combinators.short-circuit alien.c-types sequences combinators combinators.short-circuit alien.c-types
vocabs.loader calendar calendar.unix io.files.info vocabs.loader calendar calendar.unix io.files.info
io.files.types io.backend unix unix.stat unix.time unix.users io.files.types io.backend io.directories unix unix.stat unix.time unix.users
unix.groups ; unix.groups ;
IN: io.files.info.unix IN: io.files.info.unix
@ -174,6 +174,9 @@ CONSTANT: OTHER-EXECUTE OCT: 0000001
: file-permissions ( path -- n ) : file-permissions ( path -- n )
normalize-path file-info permissions>> ; normalize-path file-info permissions>> ;
M: unix copy-file-and-info ( from to -- )
[ copy-file ] [ swap file-permissions set-file-permissions ] 2bi ;
<PRIVATE <PRIVATE
: make-timeval-array ( array -- byte-array ) : make-timeval-array ( array -- byte-array )

View File

@ -99,7 +99,9 @@ M: cocoa-ui-backend set-title ( string world -- )
drop ; drop ;
: exit-fullscreen ( world -- ) : exit-fullscreen ( world -- )
handle>> view>> f -> exitFullScreenModeWithOptions: ; handle>>
[ view>> f -> exitFullScreenModeWithOptions: ]
[ [ window>> ] [ view>> ] bi -> makeFirstResponder: drop ] bi ;
M: cocoa-ui-backend (set-fullscreen) ( world ? -- ) M: cocoa-ui-backend (set-fullscreen) ( world ? -- )
[ enter-fullscreen ] [ exit-fullscreen ] if ; [ enter-fullscreen ] [ exit-fullscreen ] if ;
@ -120,7 +122,11 @@ M:: cocoa-ui-backend (open-window) ( world -- )
window f -> makeKeyAndOrderFront: ; window f -> makeKeyAndOrderFront: ;
M: cocoa-ui-backend (close-window) ( handle -- ) M: cocoa-ui-backend (close-window) ( handle -- )
window>> -> release ; [
view>> dup -> isInFullScreenMode zero?
[ drop ]
[ f -> exitFullScreenModeWithOptions: ] if
] [ window>> -> release ] bi ;
M: cocoa-ui-backend (grab-input) ( handle -- ) M: cocoa-ui-backend (grab-input) ( handle -- )
0 CGAssociateMouseAndMouseCursorPosition drop 0 CGAssociateMouseAndMouseCursorPosition drop

View File

@ -391,7 +391,10 @@ CLASS: {
{ "windowDidResignKey:" "void" { "id" "SEL" "id" } { "windowDidResignKey:" "void" { "id" "SEL" "id" }
[ [
forget-rollover forget-rollover
2nip -> object -> contentView window unfocus-world 2nip -> object -> contentView
dup -> isInFullScreenMode zero?
[ window unfocus-world ]
[ drop ] if
] ]
} }