Merge branch 'master' of git://factorcode.org/git/factor
commit
312fe46848
|
@ -3,7 +3,7 @@ kernel cocoa.enumeration destructors math.parser cocoa.application
|
|||
sequences locals combinators.short-circuit threads
|
||||
namespaces assocs vectors arrays combinators hints alien
|
||||
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
|
||||
|
||||
SINGLETON: iokit-game-input-backend
|
||||
|
@ -186,7 +186,7 @@ HINTS: record-controller { controller-state alien } ;
|
|||
rot ?set-nth
|
||||
] [ 3drop ] if ;
|
||||
|
||||
HINTS: record-keyboard { array alien } ;
|
||||
HINTS: record-keyboard { bit-array alien } ;
|
||||
|
||||
: record-mouse ( mouse-state value -- )
|
||||
dup IOHIDValueGetElement {
|
||||
|
@ -285,7 +285,7 @@ M: iokit-game-input-backend reset-mouse
|
|||
4 <vector> +controller-states+ set-global
|
||||
0 0 0 0 2 <vector> mouse-state boa
|
||||
+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)
|
||||
hid-manager-matching-game-devices {
|
||||
|
|
|
@ -20,7 +20,7 @@ DEFER: copy-tree-into
|
|||
{
|
||||
{ +symbolic-link+ [ copy-link ] }
|
||||
{ +directory+ [ '[ [ _ copy-tree-into ] each ] with-directory-files ] }
|
||||
[ drop copy-file ]
|
||||
[ drop copy-file-and-info ]
|
||||
} case ;
|
||||
|
||||
: copy-tree-into ( from to -- )
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
! Copyright (C) 2008 Doug Coleman, Eduardo Cavazos.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: accessors kernel system sequences combinators
|
||||
vocabs.loader io.files.types math ;
|
||||
vocabs.loader io.files.types io.directories math ;
|
||||
IN: io.files.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 windows? ] [ "io.files.info.windows" ] }
|
||||
} cond require
|
||||
|
||||
HOOK: copy-file-and-info os ( from to -- )
|
||||
|
||||
M: object copy-file-and-info copy-file ;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
USING: accessors kernel system math math.bitwise strings arrays
|
||||
sequences combinators combinators.short-circuit alien.c-types
|
||||
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 ;
|
||||
IN: io.files.info.unix
|
||||
|
||||
|
@ -174,6 +174,9 @@ CONSTANT: OTHER-EXECUTE OCT: 0000001
|
|||
: file-permissions ( path -- n )
|
||||
normalize-path file-info permissions>> ;
|
||||
|
||||
M: unix copy-file-and-info ( from to -- )
|
||||
[ copy-file ] [ swap file-permissions set-file-permissions ] 2bi ;
|
||||
|
||||
<PRIVATE
|
||||
|
||||
: make-timeval-array ( array -- byte-array )
|
||||
|
|
|
@ -99,7 +99,9 @@ M: cocoa-ui-backend set-title ( string world -- )
|
|||
drop ;
|
||||
|
||||
: exit-fullscreen ( world -- )
|
||||
handle>> view>> f -> exitFullScreenModeWithOptions: ;
|
||||
handle>>
|
||||
[ view>> f -> exitFullScreenModeWithOptions: ]
|
||||
[ [ window>> ] [ view>> ] bi -> makeFirstResponder: drop ] bi ;
|
||||
|
||||
M: cocoa-ui-backend (set-fullscreen) ( world ? -- )
|
||||
[ enter-fullscreen ] [ exit-fullscreen ] if ;
|
||||
|
@ -120,7 +122,11 @@ M:: cocoa-ui-backend (open-window) ( world -- )
|
|||
window f -> makeKeyAndOrderFront: ;
|
||||
|
||||
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 -- )
|
||||
0 CGAssociateMouseAndMouseCursorPosition drop
|
||||
|
|
|
@ -391,7 +391,10 @@ CLASS: {
|
|||
{ "windowDidResignKey:" "void" { "id" "SEL" "id" }
|
||||
[
|
||||
forget-rollover
|
||||
2nip -> object -> contentView window unfocus-world
|
||||
2nip -> object -> contentView
|
||||
dup -> isInFullScreenMode zero?
|
||||
[ window unfocus-world ]
|
||||
[ drop ] if
|
||||
]
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue