diff --git a/extra/easy-help/easy-help.factor b/extra/easy-help/easy-help.factor new file mode 100644 index 0000000000..692a029b97 --- /dev/null +++ b/extra/easy-help/easy-help.factor @@ -0,0 +1,48 @@ + +USING: kernel multiline parser sequences splitting help.markup ; + +IN: easy-help + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: Description: + + ".." parse-multiline-string + string-lines + 1 tail + [ dup " " head? [ 4 tail ] [ ] if ] map + [ dup "" = [ drop { $nl } ] [ ] if ] map + \ $description prefix + parsed + + ; parsing + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: Example: + + { $heading "Example" } parsed + + ".." parse-multiline-string + string-lines + [ dup " " head? [ 4 tail ] [ ] if ] map + [ "" = not ] filter + ! \ $example prefix + \ $code prefix + parsed + + ; parsing + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +: Summary: + + ".." parse-multiline-string + string-lines + 1 tail + [ dup " " head? [ 4 tail ] [ ] if ] map + [ dup "" = [ drop { $nl } ] [ ] if ] map + { $heading "Summary" } prefix + parsed + + ; parsing diff --git a/unmaintained/nehe/2/2.factor b/extra/nehe/2/2.factor similarity index 100% rename from unmaintained/nehe/2/2.factor rename to extra/nehe/2/2.factor diff --git a/unmaintained/nehe/2/authors.txt b/extra/nehe/2/authors.txt similarity index 100% rename from unmaintained/nehe/2/authors.txt rename to extra/nehe/2/authors.txt diff --git a/unmaintained/nehe/3/3.factor b/extra/nehe/3/3.factor similarity index 100% rename from unmaintained/nehe/3/3.factor rename to extra/nehe/3/3.factor diff --git a/unmaintained/nehe/3/authors.txt b/extra/nehe/3/authors.txt similarity index 100% rename from unmaintained/nehe/3/authors.txt rename to extra/nehe/3/authors.txt diff --git a/unmaintained/nehe/4/4.factor b/extra/nehe/4/4.factor similarity index 100% rename from unmaintained/nehe/4/4.factor rename to extra/nehe/4/4.factor diff --git a/unmaintained/nehe/4/authors.txt b/extra/nehe/4/authors.txt similarity index 100% rename from unmaintained/nehe/4/authors.txt rename to extra/nehe/4/authors.txt diff --git a/unmaintained/nehe/5/5.factor b/extra/nehe/5/5.factor similarity index 100% rename from unmaintained/nehe/5/5.factor rename to extra/nehe/5/5.factor diff --git a/unmaintained/nehe/5/authors.txt b/extra/nehe/5/authors.txt similarity index 100% rename from unmaintained/nehe/5/authors.txt rename to extra/nehe/5/authors.txt diff --git a/unmaintained/nehe/authors.txt b/extra/nehe/authors.txt similarity index 100% rename from unmaintained/nehe/authors.txt rename to extra/nehe/authors.txt diff --git a/unmaintained/nehe/deploy.factor b/extra/nehe/deploy.factor similarity index 100% rename from unmaintained/nehe/deploy.factor rename to extra/nehe/deploy.factor diff --git a/unmaintained/nehe/nehe.factor b/extra/nehe/nehe.factor similarity index 100% rename from unmaintained/nehe/nehe.factor rename to extra/nehe/nehe.factor diff --git a/unmaintained/nehe/summary.txt b/extra/nehe/summary.txt similarity index 100% rename from unmaintained/nehe/summary.txt rename to extra/nehe/summary.txt diff --git a/unmaintained/nehe/tags.txt b/extra/nehe/tags.txt similarity index 100% rename from unmaintained/nehe/tags.txt rename to extra/nehe/tags.txt diff --git a/extra/size-of/size-of.factor b/extra/size-of/size-of.factor index d40ea6f8ba..06a7067636 100644 --- a/extra/size-of/size-of.factor +++ b/extra/size-of/size-of.factor @@ -1,19 +1,39 @@ USING: io io.encodings.ascii io.files io.files.temp io.launcher - locals math.parser sequences sequences.deep ; + locals math.parser sequences sequences.deep + help.syntax + easy-help ; IN: size-of -! Use 'size-of' to find out the size in bytes of a C type. -! -! The 'headers' argument is a list of header files to use. You may -! pass 'f' to only use 'stdio.h'. -! -! Examples: -! -! f "int" size-of . -! -! { "X11/Xlib.h" } "XAnyEvent" size-of . +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +DEFER: size-of + +HELP: size-of + +Description: + + Use 'size-of' to find out the size in bytes of a C type. + + The 'headers' argument is a list of header files to use. You may + pass 'f' to only use 'stdio.h'. .. + +Example: + + ! Find the size of 'int' + + f "int" size-of . .. + +Example: + + ! Find the size of the 'XAnyEvent' struct from Xlib.h + + { "X11/Xlib.h" } "XAnyEvent" size-of . .. + +; + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :: size-of ( HEADERS TYPE -- n ) diff --git a/extra/ui/gadgets/plot/plot.factor b/extra/ui/gadgets/plot/plot.factor index 6fee7dc454..f502b7eb38 100644 --- a/extra/ui/gadgets/plot/plot.factor +++ b/extra/ui/gadgets/plot/plot.factor @@ -1,25 +1,38 @@ USING: kernel quotations arrays sequences math math.ranges fry opengl opengl.gl ui.render ui.gadgets.cartesian processing.shapes - accessors ; + accessors + help.syntax + easy-help ; IN: ui.gadgets.plot ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -! Examples: -! -! [ sin ] add-function gadget. -! -! -! [ sin ] red function boa add-function -! [ cos ] blue function boa add-function -! gadget. -! -! -! Use the arrow keys to move around. -! -! Use 'a' and 'z' keys to zoom in and out. +ARTICLE: "ui.gadgets.plot" "Plot Gadget" + +Summary: + + A simple gadget for ploting two dimentional functions. + + Use the arrow keys to move around. + + Use 'a' and 'z' keys to zoom in and out. .. + +Example: + + [ sin ] add-function gadget. .. + +Example: + + + [ sin ] red function boa add-function + [ cos ] blue function boa add-function + gadget. .. + +; + +ABOUT: "ui.gadgets.plot" ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/extra/ui/gadgets/slate/slate.factor b/extra/ui/gadgets/slate/slate.factor index 0505586b53..af2dfcccc2 100644 --- a/extra/ui/gadgets/slate/slate.factor +++ b/extra/ui/gadgets/slate/slate.factor @@ -1,8 +1,35 @@ -USING: kernel namespaces opengl ui.render ui.gadgets accessors ; +USING: kernel namespaces opengl ui.render ui.gadgets accessors + help.syntax + easy-help ; IN: ui.gadgets.slate +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +ARTICLE: "slate" "Slate Gadget" + +Summary: + + A gadget with an 'action' slot which should be set to a callable. .. + +Example: + + ! Load the right vocabs for the examples + + USING: processing.shapes ui.gadgets.slate ; .. + +Example: + + [ { { 10 10 } { 50 30 } { 10 50 } } polygon fill-mode ] + gadget. .. + +; + +ABOUT: "slate" + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + TUPLE: slate < gadget action pdim graft ungraft ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/unmaintained/tiling/tiling.factor b/extra/ui/gadgets/tiling/tiling.factor similarity index 82% rename from unmaintained/tiling/tiling.factor rename to extra/ui/gadgets/tiling/tiling.factor index cf6ea7f48e..8a3c878161 100644 --- a/unmaintained/tiling/tiling.factor +++ b/extra/ui/gadgets/tiling/tiling.factor @@ -1,10 +1,42 @@ USING: kernel sequences math math.order - ui.gadgets ui.gadgets.tracks ui.gestures - bake.fry accessors ; + ui.gadgets ui.gadgets.tracks ui.gestures accessors fry + help.syntax + easy-help ; IN: ui.gadgets.tiling +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +ARTICLE: "ui.gadgets.tiling" "Tiling Layout Gadgets" + +Summary: + + A gadget which tiles it's children. + + A tiling gadget may contain any number of children, but only a + fixed number is displayed at one time. How many are displayed can + be controlled via Control-[ and Control-]. + + The focus may be switched with Alt-Left and Alt-Right. + + The focused child may be moved via Shift-Alt-Left and + Shift-Alt-Right. .. + +Example: + + + "resource:" directory-files + [ [ drop ] tiling-add ] + each + "Files" open-window .. + +; + +ABOUT: "ui.gadgets.tiling" + +! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + TUPLE: tiling < track gadgets tiles first focused ; ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!