diff --git a/extra/help/handbook/handbook.factor b/extra/help/handbook/handbook.factor index 246ad56e51..b13ac630b3 100755 --- a/extra/help/handbook/handbook.factor +++ b/extra/help/handbook/handbook.factor @@ -88,6 +88,7 @@ $nl $nl "The basic building blocks:" { $subsection "threads" } +{ $subsection "alarms" } "High-level abstractions:" { $subsection "concurrency.combinators" } { $subsection "concurrency.promises" } @@ -274,6 +275,7 @@ ARTICLE: "handbook" "Factor documentation" { $heading "Library reference" } { $subsection "numbers" } { $subsection "collections" } +{ $subsection "models" } { $subsection "io" } { $subsection "concurrency" } { $subsection "system" } @@ -288,8 +290,8 @@ ARTICLE: "handbook" "Factor documentation" { $subsection "compiler" } { $subsection "layouts" } { $heading "User interface" } -{ $about "ui" } -{ $about "ui.tools" } +{ $subsection "ui" } +{ $subsection "ui-tools" } { $heading "Index" } { $subsection "primitive-index" } { $subsection "error-index" } diff --git a/extra/io/monitors/monitors-docs.factor b/extra/io/monitors/monitors-docs.factor index b81bd1d303..ce59e23b45 100755 --- a/extra/io/monitors/monitors-docs.factor +++ b/extra/io/monitors/monitors-docs.factor @@ -55,23 +55,31 @@ ARTICLE: "io.monitors.descriptors" "File system change descriptors" { $subsection +rename-file+ } ; ARTICLE: "io.monitors.platforms" "Monitors on different platforms" -"Whether the " { $snippet "path" } " output value of " { $link next-change } " contains an absolute path or a path relative to the path given to " { $link } " is platform-specific. User code should not assume either case." +"Whether the " { $snippet "path" } " output value of " { $link next-change } " contains an absolute path or a path relative to the path given to " { $link } " is unspecified, and may even vary on the same platform. User code should not assume either case." +$nl +"If the immediate path being monitored was changed, then " { $snippet "path" } " will equal " { $snippet "\"\"" } "; however this condition is not reported on all platforms. See below." { $heading "Mac OS X" } "Factor uses " { $snippet "FSEventStream" } "s to implement monitors on Mac OS X. This requires Mac OS X 10.5 or later." $nl { $snippet "FSEventStream" } "s always monitor directory hierarchies recursively, and the " { $snippet "recursive?" } " parameter to " { $link } " has no effect." $nl "The " { $snippet "changed" } " output value of the " { $link next-change } " word always outputs " { $link +modify-file+ } " and the " { $snippet "path" } " output value is always the directory containing the file that changed. Unlike other platforms, fine-grained information is not available." +$nl +"Only directories may be monitored, not individual files. Changes to the directory itself (permissions, modification time, and so on) are not reported; only changes to children are reported." { $heading "Windows" } "Factor uses " { $snippet "ReadDirectoryChanges" } " to implement monitors on Windows." $nl "Both recursive and non-recursive monitors are directly supported by the operating system." +$nl +"Only directories may be monitored, not individual files. Changes to the directory itself (permissions, modification time, and so on) are not reported; only changes to children are reported." { $heading "Linux" } "Factor uses " { $snippet "inotify" } " to implement monitors on Linux. This requires Linux kernel version 2.6.16 or later." $nl "Factor simulates recursive monitors by creating a hierarchy of monitors for every subdirectory, since " { $snippet "inotify" } " can only monitor a single directory. This is transparent to user code." $nl "Inside a single " { $link with-monitors } " scope, only one monitor may be created for any given directory." +$nl +"Both directories and files may be monitored. Unlike Mac OS X and Windows, changes to the immediate directory being monitored (permissions, modification time, and so on) are reported." { $heading "BSD" } "Factor uses " { $snippet "kqueue" } " to implement monitors on BSD." $nl diff --git a/extra/io/monitors/monitors-tests.factor b/extra/io/monitors/monitors-tests.factor index 2b1191d4de..bd33954436 100755 --- a/extra/io/monitors/monitors-tests.factor +++ b/extra/io/monitors/monitors-tests.factor @@ -108,34 +108,4 @@ os { winnt linux macosx } member? [ [ [ t ] [ "m" get next-change 2drop ] [ ] while ] must-fail [ ] [ "m" get dispose ] unit-test ] with-monitors - - ! On Linux, a notification on the directory itself would report an invalid - ! path name - [ - [ ] [ "monitor-test-self" temp-file make-directories ] unit-test - - ! Non-recursive - [ ] [ "monitor-test-self" temp-file f "m" set ] unit-test - - [ ] [ "monitor-test-self" temp-file touch-file ] unit-test - - [ t ] [ - "m" get next-change drop - [ "." = ] [ "monitor-test-self" temp-file = ] bi or - ] unit-test - - [ ] [ "m" get dispose ] unit-test - - ! Recursive - [ ] [ "monitor-test-self" temp-file t "m" set ] unit-test - - [ ] [ "monitor-test-self" temp-file touch-file ] unit-test - - [ t ] [ - "m" get next-change drop - [ "." = ] [ "monitor-test-self" temp-file = ] bi or - ] unit-test - - [ ] [ "m" get dispose ] unit-test - ] with-monitors ] when diff --git a/extra/io/unix/linux/monitors/monitors-tests.factor b/extra/io/unix/linux/monitors/monitors-tests.factor new file mode 100644 index 0000000000..923bfaa890 --- /dev/null +++ b/extra/io/unix/linux/monitors/monitors-tests.factor @@ -0,0 +1,34 @@ +IN: io.unix.linux.monitors.tests +USING: io.monitors tools.test io.files system sequences +continuations namespaces concurrency.count-downs kernel io +threads calendar prettyprint destructors io.timeouts ; + +! On Linux, a notification on the directory itself would report an invalid +! path name +[ + [ ] [ "monitor-test-self" temp-file make-directories ] unit-test + + ! Non-recursive + [ ] [ "monitor-test-self" temp-file f "m" set ] unit-test + + [ ] [ "monitor-test-self" temp-file touch-file ] unit-test + + [ t ] [ + "m" get next-change drop + [ "." = ] [ "monitor-test-self" temp-file = ] bi or + ] unit-test + + [ ] [ "m" get dispose ] unit-test + + ! Recursive + [ ] [ "monitor-test-self" temp-file t "m" set ] unit-test + + [ ] [ "monitor-test-self" temp-file touch-file ] unit-test + + [ t ] [ + "m" get next-change drop + [ "" = ] [ "monitor-test-self" temp-file = ] bi or + ] unit-test + + [ ] [ "m" get dispose ] unit-test +] with-monitors diff --git a/extra/io/unix/linux/monitors/monitors.factor b/extra/io/unix/linux/monitors/monitors.factor index ba9eab1e9e..2ecf53ce1e 100644 --- a/extra/io/unix/linux/monitors/monitors.factor +++ b/extra/io/unix/linux/monitors/monitors.factor @@ -85,7 +85,7 @@ M: linux-monitor dispose* ( monitor -- ) : parse-event-name ( event -- name ) dup inotify-event-len zero? - [ drop "." ] [ inotify-event-name utf8 alien>string ] if ; + [ drop "" ] [ inotify-event-name utf8 alien>string ] if ; : parse-file-notify ( buffer -- path changed ) dup inotify-event-mask ignore-flags? [ diff --git a/extra/models/models-docs.factor b/extra/models/models-docs.factor index 8cccb1c634..da275e934a 100755 --- a/extra/models/models-docs.factor +++ b/extra/models/models-docs.factor @@ -232,8 +232,10 @@ HELP: move-by-page { $side-effects "range" } ; ARTICLE: "models" "Models" -"The Factor UI provides basic support for dataflow programming via " { $emphasis "models" } " and " { $emphasis "controls" } ". A model is an observable value. Changing a model's value notifies other objects which depend on the model automatically, and models may depend on each other's values." +"The " { $vocab-link "models" } " vocabulary provides basic support for dataflow programming. A model is an observable value. Changing a model's value notifies other objects which depend on the model automatically, and models may depend on each other's values." $nl +"The class of models:" +{ $subsection model } "Creating models:" { $subsection } "Adding and removing connections:" diff --git a/extra/ui/ui-docs.factor b/extra/ui/ui-docs.factor index 1b1e9d99f3..61036f1004 100755 --- a/extra/ui/ui-docs.factor +++ b/extra/ui/ui-docs.factor @@ -89,8 +89,8 @@ ARTICLE: "building-ui" "Building user interfaces" { $subsection "ui-geometry" } { $subsection "ui-layouts" } { $subsection "gadgets" } -{ $subsection "models" } -{ $subsection "ui-windows" } ; +{ $subsection "ui-windows" } +{ $see-also "models" } ; ARTICLE: "gadgets" "Pre-made UI gadgets" { $subsection "ui.gadgets.labels" }