Merge commit 'origin/master'

db4
Chris Double 2008-03-27 15:51:20 +13:00
commit 8bd7c51c10
5 changed files with 34 additions and 8 deletions

View File

@ -21,8 +21,6 @@ M: object normalize-directory ;
HOOK: normalize-pathname io-backend ( str -- newstr ) HOOK: normalize-pathname io-backend ( str -- newstr )
M: object normalize-pathname ;
: set-io-backend ( io-backend -- ) : set-io-backend ( io-backend -- )
io-backend set-global init-io init-stdio ; io-backend set-global init-io init-stdio ;

View File

@ -1,6 +1,7 @@
IN: io.files.tests IN: io.files.tests
USING: tools.test io.files io threads kernel continuations io.encodings.ascii USING: tools.test io.files io threads kernel continuations
io.files.unique sequences strings accessors ; io.encodings.ascii io.files.unique sequences strings accessors
io.encodings.utf8 ;
[ ] [ "blahblah" temp-file dup exists? [ delete-directory ] [ drop ] if ] unit-test [ ] [ "blahblah" temp-file dup exists? [ delete-directory ] [ drop ] if ] unit-test
[ ] [ "blahblah" temp-file make-directory ] unit-test [ ] [ "blahblah" temp-file make-directory ] unit-test
@ -130,6 +131,18 @@ io.files.unique sequences strings accessors ;
[ t ] [ cwd "misc" resource-path [ ] with-directory cwd = ] unit-test [ t ] [ cwd "misc" resource-path [ ] with-directory cwd = ] unit-test
[ t ] [
temp-directory [ "hi" "test41" utf8 set-file-contents ] with-directory
temp-directory "test41" append-path utf8 file-contents "hi41" =
] unit-test
[ t ] [
temp-directory [
"test43" utf8 <file-writer> [ "hi43" write ] with-stream
] with-directory
temp-directory "test43" append-path utf8 file-contents "hi43" =
] unit-test
[ ] [ "append-test" temp-file dup exists? [ delete-file ] [ drop ] if ] unit-test [ ] [ "append-test" temp-file dup exists? [ delete-file ] [ drop ] if ] unit-test
[ ] [ "append-test" temp-file ascii <file-appender> dispose ] unit-test [ ] [ "append-test" temp-file ascii <file-appender> dispose ] unit-test

View File

@ -272,6 +272,9 @@ DEFER: copy-tree-into
: temp-file ( name -- path ) temp-directory prepend-path ; : temp-file ( name -- path ) temp-directory prepend-path ;
M: object normalize-pathname ( path -- path' )
current-directory get prepend-path ;
! Pathname presentations ! Pathname presentations
TUPLE: pathname string ; TUPLE: pathname string ;

View File

@ -3,13 +3,14 @@
USING: arrays ui.gadgets USING: arrays ui.gadgets
ui.gadgets.viewports ui.gadgets.frames ui.gadgets.grids ui.gadgets.viewports ui.gadgets.frames ui.gadgets.grids
ui.gadgets.theme ui.gadgets.sliders ui.gestures kernel math ui.gadgets.theme ui.gadgets.sliders ui.gestures kernel math
namespaces sequences models combinators math.vectors ; namespaces sequences models combinators math.vectors
tuples ;
IN: ui.gadgets.scrollers IN: ui.gadgets.scrollers
TUPLE: scroller viewport x y follows ; TUPLE: scroller viewport x y follows ;
: find-scroller ( gadget -- scroller/f ) : find-scroller ( gadget -- scroller/f )
[ scroller? ] find-parent ; [ [ scroller? ] is? ] find-parent ;
: scroll-up-page scroller-y -1 swap slide-by-page ; : scroll-up-page scroller-y -1 swap slide-by-page ;

View File

@ -6,7 +6,8 @@ kernel models namespaces parser quotations sequences ui.commands
ui.gadgets ui.gadgets.editors ui.gadgets.labelled ui.gadgets ui.gadgets.editors ui.gadgets.labelled
ui.gadgets.panes ui.gadgets.buttons ui.gadgets.scrollers ui.gadgets.panes ui.gadgets.buttons ui.gadgets.scrollers
ui.gadgets.tracks ui.gestures ui.operations vocabs words ui.gadgets.tracks ui.gestures ui.operations vocabs words
prettyprint listener debugger threads boxes concurrency.flags ; prettyprint listener debugger threads boxes concurrency.flags
math arrays ;
IN: ui.tools.listener IN: ui.tools.listener
TUPLE: listener-gadget input output stack ; TUPLE: listener-gadget input output stack ;
@ -23,9 +24,19 @@ TUPLE: listener-gadget input output stack ;
: <listener-input> ( listener -- gadget ) : <listener-input> ( listener -- gadget )
listener-gadget-output <pane-stream> <interactor> ; listener-gadget-output <pane-stream> <interactor> ;
TUPLE: input-scroller ;
: <input-scroller> ( interactor -- scroller )
<scroller>
input-scroller construct-empty
[ set-gadget-delegate ] keep ;
M: input-scroller pref-dim*
drop { 0 100 } ;
: listener-input, ( -- ) : listener-input, ( -- )
g <listener-input> g-> set-listener-gadget-input g <listener-input> g-> set-listener-gadget-input
<scroller> "Input" <labelled-gadget> f track, ; <input-scroller> "Input" <labelled-gadget> f track, ;
: welcome. ( -- ) : welcome. ( -- )
"If this is your first time with Factor, please read the " print "If this is your first time with Factor, please read the " print