Merge branch 'master' of git://factorcode.org/git/factor
commit
4a118829c8
39
README.txt
39
README.txt
|
@ -24,7 +24,7 @@ The Factor runtime is written in GNU C99, and is built with GNU make and
|
||||||
gcc.
|
gcc.
|
||||||
|
|
||||||
Factor supports various platforms. For an up-to-date list, see
|
Factor supports various platforms. For an up-to-date list, see
|
||||||
<http://factorcode.org/getfactor.fhtml>.
|
<http://factorcode.org>.
|
||||||
|
|
||||||
Factor requires gcc 3.4 or later.
|
Factor requires gcc 3.4 or later.
|
||||||
|
|
||||||
|
@ -36,17 +36,6 @@ arguments for make.
|
||||||
|
|
||||||
Run 'make' ('gmake' on *BSD) with no parameters to build the Factor VM.
|
Run 'make' ('gmake' on *BSD) with no parameters to build the Factor VM.
|
||||||
|
|
||||||
Compilation will yield an executable named 'factor' on Unix,
|
|
||||||
'factor.exe' on Windows XP/Vista, and 'factor-ce.exe' on Windows CE.
|
|
||||||
|
|
||||||
* Libraries needed for compilation
|
|
||||||
|
|
||||||
For X11 support, you need recent development libraries for libc,
|
|
||||||
Freetype, X11, OpenGL and GLUT. On a Debian-derived Linux distribution
|
|
||||||
(like Ubuntu), you can use the following line to grab everything:
|
|
||||||
|
|
||||||
sudo apt-get install libc6-dev libfreetype6-dev libx11-dev glutg3-dev
|
|
||||||
|
|
||||||
* Bootstrapping the Factor image
|
* Bootstrapping the Factor image
|
||||||
|
|
||||||
Once you have compiled the Factor runtime, you must bootstrap the Factor
|
Once you have compiled the Factor runtime, you must bootstrap the Factor
|
||||||
|
@ -69,6 +58,12 @@ machines.
|
||||||
On Unix, Factor can either run a graphical user interface using X11, or
|
On Unix, Factor can either run a graphical user interface using X11, or
|
||||||
a terminal listener.
|
a terminal listener.
|
||||||
|
|
||||||
|
For X11 support, you need recent development libraries for libc,
|
||||||
|
Pango, X11, OpenGL and GLUT. On a Debian-derived Linux distribution
|
||||||
|
(like Ubuntu), you can use the following line to grab everything:
|
||||||
|
|
||||||
|
sudo apt-get install libc6-dev libpango-1.0-dev libx11-dev glutg3-dev
|
||||||
|
|
||||||
If your DISPLAY environment variable is set, the UI will start
|
If your DISPLAY environment variable is set, the UI will start
|
||||||
automatically:
|
automatically:
|
||||||
|
|
||||||
|
@ -78,14 +73,6 @@ To run an interactive terminal listener:
|
||||||
|
|
||||||
./factor -run=listener
|
./factor -run=listener
|
||||||
|
|
||||||
If you're inside a terminal session, you can start the UI with one of
|
|
||||||
the following two commands:
|
|
||||||
|
|
||||||
ui
|
|
||||||
[ ui ] in-thread
|
|
||||||
|
|
||||||
The latter keeps the terminal listener running.
|
|
||||||
|
|
||||||
* Running Factor on Mac OS X - Cocoa UI
|
* Running Factor on Mac OS X - Cocoa UI
|
||||||
|
|
||||||
On Mac OS X, a Cocoa UI is available in addition to the terminal
|
On Mac OS X, a Cocoa UI is available in addition to the terminal
|
||||||
|
@ -110,7 +97,7 @@ When compiling Factor, pass the X11=1 parameter:
|
||||||
|
|
||||||
Then bootstrap with the following switches:
|
Then bootstrap with the following switches:
|
||||||
|
|
||||||
./factor -i=boot.<cpu>.image -ui-backend=x11
|
./factor -i=boot.<cpu>.image -ui-backend=x11 -ui-text-backend=pango
|
||||||
|
|
||||||
Now if $DISPLAY is set, running ./factor will start the UI.
|
Now if $DISPLAY is set, running ./factor will start the UI.
|
||||||
|
|
||||||
|
@ -126,6 +113,12 @@ the command prompt using the console application:
|
||||||
|
|
||||||
factor.com -i=boot.<cpu>.image
|
factor.com -i=boot.<cpu>.image
|
||||||
|
|
||||||
|
Before bootstrapping, you will need to download the DLLs for the Pango
|
||||||
|
text rendering library. The required DLLs are listed in
|
||||||
|
build-support/dlls.txt and are available from the following location:
|
||||||
|
|
||||||
|
<http://factorcode.org/dlls>
|
||||||
|
|
||||||
Once bootstrapped, double-clicking factor.exe or factor.com starts
|
Once bootstrapped, double-clicking factor.exe or factor.com starts
|
||||||
the Factor UI.
|
the Factor UI.
|
||||||
|
|
||||||
|
@ -135,7 +128,9 @@ To run the listener in the command prompt:
|
||||||
|
|
||||||
* The Factor FAQ
|
* The Factor FAQ
|
||||||
|
|
||||||
The Factor FAQ is available at <http://factorcode.org/faq.fhtml>.
|
The Factor FAQ is available at the following location:
|
||||||
|
|
||||||
|
<http://concatenative.org/wiki/view/Factor/FAQ>
|
||||||
|
|
||||||
* Command line usage
|
* Command line usage
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ IN: colors.constants
|
||||||
USING: help.markup help.syntax strings colors ;
|
USING: help.markup help.syntax strings colors ;
|
||||||
|
|
||||||
HELP: named-color
|
HELP: named-color
|
||||||
{ $values { "string" string } { "color" color } }
|
{ $values { "name" string } { "color" color } }
|
||||||
{ $description "Outputs a named color from the " { $snippet "rgb.txt" } " database." }
|
{ $description "Outputs a named color from the " { $snippet "rgb.txt" } " database." }
|
||||||
{ $notes "In most cases, " { $link POSTPONE: COLOR: } " should be used instead." }
|
{ $notes "In most cases, " { $link POSTPONE: COLOR: } " should be used instead." }
|
||||||
{ $errors "Throws an error if the color is not listed in " { $snippet "rgb.txt" } "." } ;
|
{ $errors "Throws an error if the color is not listed in " { $snippet "rgb.txt" } "." } ;
|
||||||
|
|
|
@ -27,7 +27,7 @@ PRIVATE>
|
||||||
|
|
||||||
ERROR: no-such-color name ;
|
ERROR: no-such-color name ;
|
||||||
|
|
||||||
: named-color ( name -- rgb )
|
: named-color ( name -- color )
|
||||||
dup rgb.txt at [ ] [ no-such-color ] ?if ;
|
dup rgb.txt at [ ] [ no-such-color ] ?if ;
|
||||||
|
|
||||||
: COLOR: scan named-color parsed ; parsing
|
: COLOR: scan named-color parsed ; parsing
|
|
@ -0,0 +1,2 @@
|
||||||
|
unportable
|
||||||
|
bindings
|
|
@ -13,8 +13,8 @@ HELP: PROTOCOL:
|
||||||
{ define-protocol POSTPONE: PROTOCOL: } related-words
|
{ define-protocol POSTPONE: PROTOCOL: } related-words
|
||||||
|
|
||||||
HELP: define-consult
|
HELP: define-consult
|
||||||
{ $values { "class" "a class" } { "group" "a protocol, generic word or tuple class" } { "quot" "a quotation" } }
|
{ $values { "consultation" consultation } }
|
||||||
{ $description "Defines a class to consult, using the given quotation, on the generic words contained in the group." }
|
{ $description "Defines a class to consult, using the quotation, on the generic words contained in the group." }
|
||||||
{ $notes "Usually, " { $link POSTPONE: CONSULT: } " should be used instead. This is only for runtime use." } ;
|
{ $notes "Usually, " { $link POSTPONE: CONSULT: } " should be used instead. This is only for runtime use." } ;
|
||||||
|
|
||||||
HELP: CONSULT:
|
HELP: CONSULT:
|
||||||
|
|
|
@ -99,6 +99,7 @@ link-no-follow? off
|
||||||
[ "<p><img src=\"lol.jpg\" alt=\"teh lol\"/></p>" ] [ "[[image:lol.jpg|teh lol]]" convert-farkup ] unit-test
|
[ "<p><img src=\"lol.jpg\" alt=\"teh lol\"/></p>" ] [ "[[image:lol.jpg|teh lol]]" convert-farkup ] unit-test
|
||||||
[ "<p><a href=\"http://lol.com\">http://lol.com</a></p>" ] [ "[[http://lol.com]]" convert-farkup ] unit-test
|
[ "<p><a href=\"http://lol.com\">http://lol.com</a></p>" ] [ "[[http://lol.com]]" convert-farkup ] unit-test
|
||||||
[ "<p><a href=\"http://lol.com\">haha</a></p>" ] [ "[[http://lol.com|haha]]" convert-farkup ] unit-test
|
[ "<p><a href=\"http://lol.com\">haha</a></p>" ] [ "[[http://lol.com|haha]]" convert-farkup ] unit-test
|
||||||
|
[ "<p><a href=\"http://lol.com/search?q=sex\">haha</a></p>" ] [ "[[http://lol.com/search?q=sex|haha]]" convert-farkup ] unit-test
|
||||||
[ "<p><a href=\"Foo/Bar\">Bar</a></p>" ] [ "[[Foo/Bar]]" convert-farkup ] unit-test
|
[ "<p><a href=\"Foo/Bar\">Bar</a></p>" ] [ "[[Foo/Bar]]" convert-farkup ] unit-test
|
||||||
|
|
||||||
"/wiki/view/" relative-link-prefix [
|
"/wiki/view/" relative-link-prefix [
|
||||||
|
|
|
@ -165,12 +165,12 @@ CONSTANT: invalid-url "javascript:alert('Invalid URL in farkup');"
|
||||||
{ [ dup [ 127 > ] any? ] [ drop invalid-url ] }
|
{ [ dup [ 127 > ] any? ] [ drop invalid-url ] }
|
||||||
{ [ dup first "/\\" member? ] [ drop invalid-url ] }
|
{ [ dup first "/\\" member? ] [ drop invalid-url ] }
|
||||||
{ [ CHAR: : over member? ] [ dup absolute-url? [ drop invalid-url ] unless ] }
|
{ [ CHAR: : over member? ] [ dup absolute-url? [ drop invalid-url ] unless ] }
|
||||||
[ relative-link-prefix get prepend "" like ]
|
[ relative-link-prefix get prepend "" like url-encode ]
|
||||||
} cond url-encode ;
|
} cond ;
|
||||||
|
|
||||||
: write-link ( href text -- xml )
|
: write-link ( href text -- xml )
|
||||||
[ check-url link-no-follow? get "true" and ] dip
|
[ check-url link-no-follow? get "nofollow" and ] dip
|
||||||
[XML <a href=<-> nofollow=<->><-></a> XML] ;
|
[XML <a href=<-> rel=<->><-></a> XML] ;
|
||||||
|
|
||||||
: write-image-link ( href text -- xml )
|
: write-image-link ( href text -- xml )
|
||||||
disable-images? get [
|
disable-images? get [
|
||||||
|
|
|
@ -9,14 +9,10 @@ IN: http.tests
|
||||||
|
|
||||||
[ "text/html" utf8 ] [ "text/html; charset=UTF-8" parse-content-type ] unit-test
|
[ "text/html" utf8 ] [ "text/html; charset=UTF-8" parse-content-type ] unit-test
|
||||||
|
|
||||||
|
[ "text/html" utf8 ] [ "text/html; charset=\"utf-8\"" parse-content-type ] unit-test
|
||||||
|
|
||||||
[ "application/octet-stream" binary ] [ "application/octet-stream" parse-content-type ] unit-test
|
[ "application/octet-stream" binary ] [ "application/octet-stream" parse-content-type ] unit-test
|
||||||
|
|
||||||
[ { } ] [ "" parse-cookie ] unit-test
|
|
||||||
[ { } ] [ "" parse-set-cookie ] unit-test
|
|
||||||
|
|
||||||
! Make sure that totally invalid cookies don't confuse us
|
|
||||||
[ { } ] [ "hello world; how are you" parse-cookie ] unit-test
|
|
||||||
|
|
||||||
: lf>crlf "\n" split "\r\n" join ;
|
: lf>crlf "\n" split "\r\n" join ;
|
||||||
|
|
||||||
STRING: read-request-test-1
|
STRING: read-request-test-1
|
||||||
|
|
|
@ -34,7 +34,7 @@ IN: http
|
||||||
|
|
||||||
: check-header-string ( str -- str )
|
: check-header-string ( str -- str )
|
||||||
#! http://en.wikipedia.org/wiki/HTTP_Header_Injection
|
#! http://en.wikipedia.org/wiki/HTTP_Header_Injection
|
||||||
dup "\r\n\"" intersects?
|
dup "\r\n" intersects?
|
||||||
[ "Header injection attack" throw ] when ;
|
[ "Header injection attack" throw ] when ;
|
||||||
|
|
||||||
: write-header ( assoc -- )
|
: write-header ( assoc -- )
|
||||||
|
@ -213,7 +213,10 @@ TUPLE: post-data data params content-type content-encoding ;
|
||||||
swap >>content-type ;
|
swap >>content-type ;
|
||||||
|
|
||||||
: parse-content-type-attributes ( string -- attributes )
|
: parse-content-type-attributes ( string -- attributes )
|
||||||
" " split harvest [ "=" split1 [ >lower ] dip ] { } map>assoc ;
|
" " split harvest [
|
||||||
|
"=" split1
|
||||||
|
[ >lower ] [ "\"" ?head drop "\"" ?tail drop ] bi*
|
||||||
|
] { } map>assoc ;
|
||||||
|
|
||||||
: parse-content-type ( content-type -- type encoding )
|
: parse-content-type ( content-type -- type encoding )
|
||||||
";" split1
|
";" split1
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
IN: http.parsers.tests
|
||||||
|
USING: http http.parsers tools.test ;
|
||||||
|
|
||||||
|
[ { } ] [ "" parse-cookie ] unit-test
|
||||||
|
[ { } ] [ "" parse-set-cookie ] unit-test
|
||||||
|
|
||||||
|
! Make sure that totally invalid cookies don't confuse us
|
||||||
|
[ { } ] [ "hello world; how are you" parse-cookie ] unit-test
|
||||||
|
|
||||||
|
[ { T{ cookie { name "__s" } { value "12345567" } } } ]
|
||||||
|
[ "__s=12345567" parse-cookie ]
|
||||||
|
unit-test
|
||||||
|
|
||||||
|
[ { T{ cookie { name "__s" } { value "12345567" } } } ]
|
||||||
|
[ "__s=12345567;" parse-cookie ]
|
||||||
|
unit-test
|
|
@ -162,7 +162,7 @@ PEG: (parse-set-cookie) ( string -- alist )
|
||||||
'value' ,
|
'value' ,
|
||||||
'space' ,
|
'space' ,
|
||||||
] seq*
|
] seq*
|
||||||
[ ";,=" member? not ] satisfy repeat1 [ drop f ] action
|
[ ";,=" member? not ] satisfy repeat0 [ drop f ] action
|
||||||
2choice ;
|
2choice ;
|
||||||
|
|
||||||
PEG: (parse-cookie) ( string -- alist )
|
PEG: (parse-cookie) ( string -- alist )
|
||||||
|
|
|
@ -53,9 +53,9 @@ IN: http.server.cgi
|
||||||
"CGI output follows" >>message
|
"CGI output follows" >>message
|
||||||
swap '[
|
swap '[
|
||||||
binary encode-output
|
binary encode-output
|
||||||
_ output-stream get swap <cgi-process> binary <process-stream> [
|
output-stream get _ <cgi-process> binary <process-stream> [
|
||||||
post-request? [ request get post-data>> data>> write flush ] when
|
post-request? [ request get post-data>> data>> write flush ] when
|
||||||
'[ _ write ] each-block
|
'[ _ stream-write ] each-block
|
||||||
] with-stream
|
] with-stream
|
||||||
] >>body ;
|
] >>body ;
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,11 @@
|
||||||
USING: help.syntax help.markup ;
|
USING: help.syntax help.markup ;
|
||||||
IN: io.encodings.euc-kr
|
IN: io.encodings.euc-kr
|
||||||
|
|
||||||
ABOUT: euc-kr
|
|
||||||
|
|
||||||
HELP: euc-kr
|
HELP: euc-kr
|
||||||
{ $class-description "This encoding class implements Microsoft's code page #949 encoding, also called Unified Hangul Code or ks_c_5601-1987, UHC. CP949 is extended version of EUC-KR and downward-compatibility to EUC-KR, in practice." }
|
{ $class-description "This encoding class implements Microsoft's CP949 encoding, also called Unified Hangul Code or ks_c_5601-1987, UHC. CP949 is extended version of EUC-KR and downward-compatible with EUC-KR in practice." }
|
||||||
{ $see-also "encodings-introduction" } ;
|
{ $see-also "encodings-introduction" } ;
|
||||||
|
|
||||||
|
ARTICLE: "io.encodings.euc-kr" "EUC-KR encoding"
|
||||||
|
{ $subsection euc-kr } ;
|
||||||
|
|
||||||
|
ABOUT: "io.encodings.euc-kr"
|
|
@ -3,7 +3,10 @@
|
||||||
USING: help.syntax help.markup ;
|
USING: help.syntax help.markup ;
|
||||||
IN: io.encodings.johab
|
IN: io.encodings.johab
|
||||||
|
|
||||||
ABOUT: johab
|
|
||||||
|
|
||||||
HELP: johab
|
HELP: johab
|
||||||
{ $class-description "Korean Johab encoding (KSC5601-1992). This encoding is not commonly used anymore." } ;
|
{ $class-description "Korean Johab encoding (KSC5601-1992). This encoding is not commonly used anymore." } ;
|
||||||
|
|
||||||
|
ARTICLE: "io.encodings.johab" "Korean Johab encoding"
|
||||||
|
{ $subsection johab } ;
|
||||||
|
|
||||||
|
ABOUT: "io.encodings.johab"
|
|
@ -137,7 +137,7 @@ $nl
|
||||||
{ $subsection "models-delay" } ;
|
{ $subsection "models-delay" } ;
|
||||||
|
|
||||||
ARTICLE: "models-impl" "Implementing models"
|
ARTICLE: "models-impl" "Implementing models"
|
||||||
"New types of models can be defined, for example see " { $vocab-link "models.filter" } "."
|
"New types of models can be defined, for example see " { $vocab-link "models.arrow" } "."
|
||||||
$nl
|
$nl
|
||||||
"Models can execute hooks when activated:"
|
"Models can execute hooks when activated:"
|
||||||
{ $subsection model-activated }
|
{ $subsection model-activated }
|
||||||
|
|
|
@ -7,10 +7,13 @@ IN: simple-flat-file
|
||||||
[ "#" split1 drop ] map harvest ;
|
[ "#" split1 drop ] map harvest ;
|
||||||
|
|
||||||
: split-column ( line -- columns )
|
: split-column ( line -- columns )
|
||||||
" \t" split harvest 2 head ;
|
" \t" split harvest 2 short head 2 f pad-tail ;
|
||||||
|
|
||||||
: parse-hex ( s -- n )
|
: parse-hex ( s -- n )
|
||||||
2 short tail hex> ;
|
dup [
|
||||||
|
"0x" ?head [ "U+" ?head [ "Missing 0x or U+" throw ] unless ] unless
|
||||||
|
hex>
|
||||||
|
] when ;
|
||||||
|
|
||||||
: parse-line ( line -- code-unicode )
|
: parse-line ( line -- code-unicode )
|
||||||
split-column [ parse-hex ] map ;
|
split-column [ parse-hex ] map ;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
! Copyright (C) 2007, 2008 Slava Pestov.
|
! Copyright (C) 2007, 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: namespaces make continuations.private kernel.private init
|
USING: namespaces make continuations.private kernel.private init
|
||||||
assocs kernel vocabs words sequences memory io system arrays
|
assocs kernel vocabs words sequences memory io system arrays
|
||||||
|
@ -14,9 +14,14 @@ IN: tools.deploy.backend
|
||||||
: copy-vm ( executable bundle-name -- vm )
|
: copy-vm ( executable bundle-name -- vm )
|
||||||
prepend-path vm over copy-file ;
|
prepend-path vm over copy-file ;
|
||||||
|
|
||||||
: copy-fonts ( name dir -- )
|
CONSTANT: theme-path "basis/ui/gadgets/theme/"
|
||||||
|
|
||||||
|
: copy-theme ( name dir -- )
|
||||||
deploy-ui? get [
|
deploy-ui? get [
|
||||||
append-path "resource:fonts/" swap copy-tree-into
|
append-path
|
||||||
|
theme-path append-path
|
||||||
|
[ make-directories ]
|
||||||
|
[ theme-path "resource:" prepend swap copy-tree ] bi
|
||||||
] [ 2drop ] if ;
|
] [ 2drop ] if ;
|
||||||
|
|
||||||
: image-name ( vocab bundle-name -- str )
|
: image-name ( vocab bundle-name -- str )
|
||||||
|
|
|
@ -7,7 +7,7 @@ tools.deploy.config.editor assocs hashtables prettyprint ;
|
||||||
IN: tools.deploy.unix
|
IN: tools.deploy.unix
|
||||||
|
|
||||||
: create-app-dir ( vocab bundle-name -- vm )
|
: create-app-dir ( vocab bundle-name -- vm )
|
||||||
dup "" copy-fonts
|
dup "" copy-theme
|
||||||
copy-vm
|
copy-vm
|
||||||
dup OCT: 755 set-file-permissions ;
|
dup OCT: 755 set-file-permissions ;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
! Copyright (C) 2007, 2009 Slava Pestov.
|
! Copyright (C) 2007, 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: io io.files io.pathnames io.directories kernel namespaces
|
USING: io io.files io.pathnames io.directories io.encodings.ascii kernel namespaces
|
||||||
sequences locals system splitting tools.deploy.backend
|
sequences locals system splitting tools.deploy.backend
|
||||||
tools.deploy.config tools.deploy.config.editor assocs hashtables
|
tools.deploy.config tools.deploy.config.editor assocs hashtables
|
||||||
prettyprint combinators windows.shell32 windows.user32 ;
|
prettyprint combinators windows.shell32 windows.user32 ;
|
||||||
|
@ -9,11 +9,10 @@ IN: tools.deploy.windows
|
||||||
: copy-dll ( bundle-name -- )
|
: copy-dll ( bundle-name -- )
|
||||||
"resource:factor.dll" swap copy-file-into ;
|
"resource:factor.dll" swap copy-file-into ;
|
||||||
|
|
||||||
: copy-freetype ( bundle-name -- )
|
: copy-pango ( bundle-name -- )
|
||||||
{
|
"resource:build-support/dlls.txt" ascii file-lines
|
||||||
"resource:freetype6.dll"
|
[ "resource:" prepend-path ] map
|
||||||
"resource:zlib1.dll"
|
swap copy-files-into ;
|
||||||
} swap copy-files-into ;
|
|
||||||
|
|
||||||
:: copy-vm ( executable bundle-name extension -- vm )
|
:: copy-vm ( executable bundle-name extension -- vm )
|
||||||
vm "." split1-last drop extension append
|
vm "." split1-last drop extension append
|
||||||
|
@ -23,8 +22,8 @@ IN: tools.deploy.windows
|
||||||
: create-exe-dir ( vocab bundle-name -- vm )
|
: create-exe-dir ( vocab bundle-name -- vm )
|
||||||
dup copy-dll
|
dup copy-dll
|
||||||
deploy-ui? get [
|
deploy-ui? get [
|
||||||
[ copy-freetype ]
|
[ copy-pango ]
|
||||||
[ "" copy-fonts ]
|
[ "" copy-theme ]
|
||||||
[ ".exe" copy-vm ] tri
|
[ ".exe" copy-vm ] tri
|
||||||
] [ ".com" copy-vm ] if ;
|
] [ ".com" copy-vm ] if ;
|
||||||
|
|
||||||
|
|
|
@ -29,11 +29,14 @@ selection-color caret mark selecting? ;
|
||||||
: init-current ( pane -- pane )
|
: init-current ( pane -- pane )
|
||||||
dup prototype>> clone >>current ; inline
|
dup prototype>> clone >>current ; inline
|
||||||
|
|
||||||
|
: focus-input ( pane -- )
|
||||||
|
input>> [ request-focus ] when* ;
|
||||||
|
|
||||||
: next-line ( pane -- )
|
: next-line ( pane -- )
|
||||||
clear-selection
|
clear-selection
|
||||||
[ input>> unparent ]
|
[ input>> unparent ]
|
||||||
[ init-current prepare-last-line ]
|
[ init-current prepare-last-line ]
|
||||||
[ input>> [ request-focus ] when* ] tri ;
|
[ focus-input ] tri ;
|
||||||
|
|
||||||
: pane-caret&mark ( pane -- caret mark )
|
: pane-caret&mark ( pane -- caret mark )
|
||||||
[ caret>> ] [ mark>> ] bi ; inline
|
[ caret>> ] [ mark>> ] bi ; inline
|
||||||
|
@ -364,9 +367,8 @@ M: paragraph stream-format
|
||||||
interleave
|
interleave
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
: caret>mark ( pane -- pane )
|
: caret>mark ( pane -- )
|
||||||
dup caret>> >>mark
|
dup caret>> >>mark relayout-1 ;
|
||||||
dup relayout-1 ;
|
|
||||||
|
|
||||||
GENERIC: sloppy-pick-up* ( loc gadget -- n )
|
GENERIC: sloppy-pick-up* ( loc gadget -- n )
|
||||||
|
|
||||||
|
@ -388,45 +390,46 @@ M: f sloppy-pick-up*
|
||||||
[ 3drop { } ]
|
[ 3drop { } ]
|
||||||
if ;
|
if ;
|
||||||
|
|
||||||
: move-caret ( pane loc -- pane )
|
: move-caret ( pane loc -- )
|
||||||
over screen-loc v- over sloppy-pick-up >>caret
|
over screen-loc v- over sloppy-pick-up >>caret
|
||||||
dup relayout-1 ;
|
relayout-1 ;
|
||||||
|
|
||||||
: begin-selection ( pane -- )
|
: begin-selection ( pane -- )
|
||||||
f >>selecting?
|
f >>selecting?
|
||||||
hand-loc get move-caret
|
dup hand-loc get move-caret
|
||||||
f >>mark
|
f >>mark
|
||||||
drop ;
|
drop ;
|
||||||
|
|
||||||
: extend-selection ( pane -- )
|
: extend-selection ( pane -- )
|
||||||
hand-moved? [
|
hand-moved? [
|
||||||
|
[
|
||||||
dup selecting?>> [
|
dup selecting?>> [
|
||||||
hand-loc get move-caret
|
hand-loc get move-caret
|
||||||
] [
|
] [
|
||||||
dup hand-clicked get child? [
|
dup hand-clicked get child? [
|
||||||
t >>selecting?
|
t >>selecting?
|
||||||
dup hand-clicked set-global
|
[ hand-clicked set-global ]
|
||||||
hand-click-loc get move-caret
|
[ hand-click-loc get move-caret ]
|
||||||
caret>mark
|
[ caret>mark ]
|
||||||
] when
|
tri
|
||||||
|
] [ drop ] if
|
||||||
] if
|
] if
|
||||||
dup dup caret>> gadget-at-path scroll>gadget
|
] [ dup caret>> gadget-at-path scroll>gadget ] bi
|
||||||
] when drop ;
|
] [ drop ] if ;
|
||||||
|
|
||||||
: end-selection ( pane -- )
|
: end-selection ( pane -- )
|
||||||
f >>selecting?
|
f >>selecting?
|
||||||
hand-moved? [
|
hand-moved?
|
||||||
[ com-copy-selection ] [ request-focus ] bi
|
[ [ com-copy-selection ] [ request-focus ] bi ]
|
||||||
] [
|
[ [ relayout-1 ] [ focus-input ] bi ]
|
||||||
relayout-1
|
if ;
|
||||||
] if ;
|
|
||||||
|
|
||||||
: select-to-caret ( pane -- )
|
: select-to-caret ( pane -- )
|
||||||
t >>selecting?
|
t >>selecting?
|
||||||
dup mark>> [ caret>mark ] unless
|
[ dup mark>> [ dup caret>mark ] unless hand-loc get move-caret ]
|
||||||
hand-loc get move-caret
|
[ com-copy-selection ]
|
||||||
dup request-focus
|
[ request-focus ]
|
||||||
com-copy-selection ;
|
tri ;
|
||||||
|
|
||||||
: pane-menu ( pane -- ) { com-copy } show-commands-menu ;
|
: pane-menu ( pane -- ) { com-copy } show-commands-menu ;
|
||||||
|
|
||||||
|
|
|
@ -306,12 +306,18 @@ M: macosx modifiers>string
|
||||||
M: object modifiers>string
|
M: object modifiers>string
|
||||||
[ name>> ] map "" join ;
|
[ name>> ] map "" join ;
|
||||||
|
|
||||||
|
HOOK: keysym>string os ( keysym -- string )
|
||||||
|
|
||||||
|
M: macosx keysym>string >upper ;
|
||||||
|
|
||||||
|
M: object keysym>string ;
|
||||||
|
|
||||||
M: key-down gesture>string
|
M: key-down gesture>string
|
||||||
[ mods>> ] [ sym>> ] bi
|
[ mods>> ] [ sym>> ] bi
|
||||||
{
|
{
|
||||||
{ [ dup { [ length 1 = ] [ first LETTER? ] } 1&& ] [ [ S+ prefix ] dip ] }
|
{ [ dup { [ length 1 = ] [ first LETTER? ] } 1&& ] [ [ S+ prefix ] dip ] }
|
||||||
{ [ dup " " = ] [ drop "SPACE" ] }
|
{ [ dup " " = ] [ drop "SPACE" ] }
|
||||||
[ >upper ]
|
[ keysym>string ]
|
||||||
} cond
|
} cond
|
||||||
[ modifiers>string ] dip append ;
|
[ modifiers>string ] dip append ;
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,9 @@ M: browser-gadget focusable-child* search-field>> ;
|
||||||
[ [ raise-window ] [ gadget-child show-help ] bi ]
|
[ [ raise-window ] [ gadget-child show-help ] bi ]
|
||||||
[ (browser-window) ] if* ;
|
[ (browser-window) ] if* ;
|
||||||
|
|
||||||
: show-browser ( -- ) "handbook" com-browse ;
|
: show-browser ( -- )
|
||||||
|
[ browser-gadget? ] find-window
|
||||||
|
[ raise-window ] [ browser-window ] if* ;
|
||||||
|
|
||||||
\ show-browser H{ { +nullary+ t } } define-command
|
\ show-browser H{ { +nullary+ t } } define-command
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
USING: alien.syntax ;
|
USING: alien.syntax ;
|
||||||
IN: unix
|
IN: unix
|
||||||
|
|
||||||
: FD_SETSIZE 1024 ;
|
CONSTANT: FD_SETSIZE 1024
|
||||||
|
|
||||||
C-STRUCT: addrinfo
|
C-STRUCT: addrinfo
|
||||||
{ "int" "flags" }
|
{ "int" "flags" }
|
||||||
|
|
|
@ -15,11 +15,11 @@ HELP: com-release
|
||||||
{ $description "A small wrapper around " { $link IUnknown::Release } ". Decrements the reference count on " { $snippet "interface" } ", releasing the underlying object if the reference count has reached zero." } ;
|
{ $description "A small wrapper around " { $link IUnknown::Release } ". Decrements the reference count on " { $snippet "interface" } ", releasing the underlying object if the reference count has reached zero." } ;
|
||||||
|
|
||||||
HELP: &com-release
|
HELP: &com-release
|
||||||
{ $values { "interface" "Pointer to a COM interface implementing " { $snippet "IUnknown" } } }
|
{ $values { "alien" "pointer to a COM interface implementing " { $snippet "IUnknown" } } }
|
||||||
{ $description "Marks the given COM interface for unconditional release via " { $link com-release } " at the end of the enclosing " { $link with-destructors } " scope." } ;
|
{ $description "Marks the given COM interface for unconditional release via " { $link com-release } " at the end of the enclosing " { $link with-destructors } " scope." } ;
|
||||||
|
|
||||||
HELP: |com-release
|
HELP: |com-release
|
||||||
{ $values { "interface" "Pointer to a COM interface implementing " { $snippet "IUnknown" } } }
|
{ $values { "alien" "pointer to a COM interface implementing " { $snippet "IUnknown" } } }
|
||||||
{ $description "Marks the given COM interface for release via " { $link com-release } " in the event of an error at the end of the enclosing " { $link with-destructors } " scope." } ;
|
{ $description "Marks the given COM interface for release via " { $link com-release } " in the event of an error at the end of the enclosing " { $link with-destructors } " scope." } ;
|
||||||
|
|
||||||
{ com-release &com-release |com-release } related-words
|
{ com-release &com-release |com-release } related-words
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
libcairo-2.dll
|
||||||
|
libgio-2.0-0.dll
|
||||||
|
libglib-2.0-0.dll
|
||||||
|
libgmodule-2.0-0.dll
|
||||||
|
libgobject-2.0-0.dll
|
||||||
|
libgthread-2.0-0.dll
|
||||||
|
libpango-1.0-0.dll
|
||||||
|
libpangocairo-1.0-0.dll
|
||||||
|
libpangowin32-1.0-0.dll
|
||||||
|
libpng12-0.dll
|
||||||
|
libtiff3.dll
|
||||||
|
zlib1.dll
|
|
@ -447,31 +447,11 @@ get_url() {
|
||||||
|
|
||||||
maybe_download_dlls() {
|
maybe_download_dlls() {
|
||||||
if [[ $OS == winnt ]] ; then
|
if [[ $OS == winnt ]] ; then
|
||||||
get_url http://factorcode.org/dlls/freetype6.dll
|
for file in `cat build-support/dlls.txt`; do
|
||||||
get_url http://factorcode.org/dlls/zlib1.dll
|
get_url http://factorcode.org/dlls/$file
|
||||||
get_url http://factorcode.org/dlls/OpenAL32.dll
|
|
||||||
get_url http://factorcode.org/dlls/alut.dll
|
|
||||||
get_url http://factorcode.org/dlls/comerr32.dll
|
|
||||||
get_url http://factorcode.org/dlls/gssapi32.dll
|
|
||||||
get_url http://factorcode.org/dlls/iconv.dll
|
|
||||||
get_url http://factorcode.org/dlls/k5sprt32.dll
|
|
||||||
get_url http://factorcode.org/dlls/krb5_32.dll
|
|
||||||
get_url http://factorcode.org/dlls/libcairo-2.dll
|
|
||||||
get_url http://factorcode.org/dlls/libeay32.dll
|
|
||||||
get_url http://factorcode.org/dlls/libiconv2.dll
|
|
||||||
get_url http://factorcode.org/dlls/libintl3.dll
|
|
||||||
get_url http://factorcode.org/dlls/libpq.dll
|
|
||||||
get_url http://factorcode.org/dlls/libxml2.dll
|
|
||||||
get_url http://factorcode.org/dlls/libxslt.dll
|
|
||||||
get_url http://factorcode.org/dlls/msvcr71.dll
|
|
||||||
get_url http://factorcode.org/dlls/ogg.dll
|
|
||||||
get_url http://factorcode.org/dlls/pgaevent.dll
|
|
||||||
get_url http://factorcode.org/dlls/sqlite3.dll
|
|
||||||
get_url http://factorcode.org/dlls/ssleay32.dll
|
|
||||||
get_url http://factorcode.org/dlls/theora.dll
|
|
||||||
get_url http://factorcode.org/dlls/vorbis.dll
|
|
||||||
chmod 777 *.dll
|
chmod 777 *.dll
|
||||||
check_ret chmod
|
check_ret chmod
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -522,7 +502,7 @@ make_boot_image() {
|
||||||
}
|
}
|
||||||
|
|
||||||
install_build_system_apt() {
|
install_build_system_apt() {
|
||||||
sudo apt-get --yes install libc6-dev libfreetype6-dev libx11-dev xorg-dev glutg3-dev wget git-core git-doc rlwrap gcc make
|
sudo apt-get --yes install libc6-dev libpango-1.0-dev libx11-dev xorg-dev glutg3-dev wget git-core git-doc rlwrap gcc make
|
||||||
check_ret sudo
|
check_ret sudo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,21 +1,22 @@
|
||||||
! Copyright (C) 2008 Eduardo Cavazos, Slava Pestov.
|
! Copyright (C) 2008, 2009 Eduardo Cavazos, Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors arrays calendar combinators.short-circuit
|
USING: accessors arrays calendar combinators.short-circuit
|
||||||
continuations debugger http.client io.directories io.files
|
continuations debugger http.client io.directories io.files io.launcher
|
||||||
io.launcher io.pathnames kernel make mason.common mason.config
|
io.pathnames io.encodings.ascii kernel make mason.common mason.config
|
||||||
mason.platform mason.report mason.email namespaces sequences ;
|
mason.platform mason.report mason.email namespaces sequences ;
|
||||||
IN: mason.child
|
IN: mason.child
|
||||||
|
|
||||||
: make-cmd ( -- args )
|
: make-cmd ( -- args )
|
||||||
gnu-make platform 2array ;
|
gnu-make platform 2array ;
|
||||||
|
|
||||||
|
: dll-url ( -- url )
|
||||||
|
"http://factorcode.org/dlls/"
|
||||||
|
target-cpu get "x86.64" = [ "64/" append ] when ;
|
||||||
|
|
||||||
: download-dlls ( -- )
|
: download-dlls ( -- )
|
||||||
target-os get "winnt" = [
|
target-os get "winnt" = [
|
||||||
"http://factorcode.org/dlls/"
|
dll-url "build-support/dlls.txt" ascii file-lines
|
||||||
target-cpu get "x86.64" = [ "64/" append ] when
|
[ append download ] with each
|
||||||
[ "freetype6.dll" append ]
|
|
||||||
[ "zlib1.dll" append ] bi
|
|
||||||
[ download ] bi@
|
|
||||||
] when ;
|
] when ;
|
||||||
|
|
||||||
: make-vm ( -- )
|
: make-vm ( -- )
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
<t:chloe xmlns:t="http://factorcode.org/chloe/1.0">
|
||||||
|
|
||||||
|
<t:atom t:href="$planet/feed.xml">[ planet-factor ]</t:atom>
|
||||||
|
|
||||||
<t:title>[ planet-factor ]</t:title>
|
<t:title>[ planet-factor ]</t:title>
|
||||||
|
|
||||||
<table width="100%" cellpadding="10">
|
<table width="100%" cellpadding="10">
|
||||||
|
|
Loading…
Reference in New Issue