Merge branch 'master' of git://factorcode.org/git/factor

db4
Doug Coleman 2009-03-27 17:50:54 -05:00
commit b06d31d3dc
114 changed files with 698 additions and 341 deletions

View File

@ -4,12 +4,14 @@ LD = ld
EXECUTABLE = factor EXECUTABLE = factor
CONSOLE_EXECUTABLE = factor-console CONSOLE_EXECUTABLE = factor-console
TEST_LIBRARY = factor-ffi-test
VERSION = 0.92 VERSION = 0.92
IMAGE = factor.image IMAGE = factor.image
BUNDLE = Factor.app BUNDLE = Factor.app
LIBPATH = -L/usr/X11R6/lib LIBPATH = -L/usr/X11R6/lib
CFLAGS = -Wall CFLAGS = -Wall
FFI_TEST_CFLAGS = -fPIC
ifdef DEBUG ifdef DEBUG
CFLAGS += -g CFLAGS += -g
@ -35,7 +37,6 @@ DLL_OBJS = $(PLAF_DLL_OBJS) \
vm/debug.o \ vm/debug.o \
vm/errors.o \ vm/errors.o \
vm/factor.o \ vm/factor.o \
vm/ffi_test.o \
vm/image.o \ vm/image.o \
vm/io.o \ vm/io.o \
vm/math.o \ vm/math.o \
@ -48,6 +49,8 @@ DLL_OBJS = $(PLAF_DLL_OBJS) \
EXE_OBJS = $(PLAF_EXE_OBJS) EXE_OBJS = $(PLAF_EXE_OBJS)
TEST_OBJS = vm/ffi_test.o
default: default:
$(MAKE) `./build-support/factor.sh make-target` $(MAKE) `./build-support/factor.sh make-target`
@ -81,64 +84,60 @@ help:
@echo "X11=1 force link with X11 libraries instead of Cocoa (only on Mac OS X)" @echo "X11=1 force link with X11 libraries instead of Cocoa (only on Mac OS X)"
openbsd-x86-32: openbsd-x86-32:
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.openbsd.x86.32 $(MAKE) $(EXECUTABLE) $(TEST_LIBRARY) CONFIG=vm/Config.openbsd.x86.32
openbsd-x86-64: openbsd-x86-64:
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.openbsd.x86.64 $(MAKE) $(EXECUTABLE) $(TEST_LIBRARY) CONFIG=vm/Config.openbsd.x86.64
freebsd-x86-32: freebsd-x86-32:
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.freebsd.x86.32 $(MAKE) $(EXECUTABLE) $(TEST_LIBRARY) CONFIG=vm/Config.freebsd.x86.32
freebsd-x86-64: freebsd-x86-64:
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.freebsd.x86.64 $(MAKE) $(EXECUTABLE) $(TEST_LIBRARY) CONFIG=vm/Config.freebsd.x86.64
netbsd-x86-32: netbsd-x86-32:
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.netbsd.x86.32 $(MAKE) $(EXECUTABLE) $(TEST_LIBRARY) CONFIG=vm/Config.netbsd.x86.32
netbsd-x86-64: netbsd-x86-64:
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.netbsd.x86.64 $(MAKE) $(EXECUTABLE) $(TEST_LIBRARY) CONFIG=vm/Config.netbsd.x86.64
macosx-freetype: macosx-ppc:
ln -sf libfreetype.6.dylib \ $(MAKE) $(EXECUTABLE) $(TEST_LIBRARY) macosx.app CONFIG=vm/Config.macosx.ppc
Factor.app/Contents/Frameworks/libfreetype.dylib
macosx-ppc: macosx-freetype macosx-x86-32:
$(MAKE) $(EXECUTABLE) macosx.app CONFIG=vm/Config.macosx.ppc $(MAKE) $(EXECUTABLE) $(TEST_LIBRARY) macosx.app CONFIG=vm/Config.macosx.x86.32
macosx-x86-32: macosx-freetype macosx-x86-64:
$(MAKE) $(EXECUTABLE) macosx.app CONFIG=vm/Config.macosx.x86.32 $(MAKE) $(EXECUTABLE) $(TEST_LIBRARY) macosx.app CONFIG=vm/Config.macosx.x86.64
macosx-x86-64: macosx-freetype
$(MAKE) $(EXECUTABLE) macosx.app CONFIG=vm/Config.macosx.x86.64
linux-x86-32: linux-x86-32:
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.linux.x86.32 $(MAKE) $(EXECUTABLE) $(TEST_LIBRARY) CONFIG=vm/Config.linux.x86.32
linux-x86-64: linux-x86-64:
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.linux.x86.64 $(MAKE) $(EXECUTABLE) $(TEST_LIBRARY) CONFIG=vm/Config.linux.x86.64
linux-ppc: linux-ppc:
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.linux.ppc $(MAKE) $(EXECUTABLE) $(TEST_LIBRARY) CONFIG=vm/Config.linux.ppc
linux-arm: linux-arm:
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.linux.arm $(MAKE) $(EXECUTABLE) $(TEST_LIBRARY) CONFIG=vm/Config.linux.arm
solaris-x86-32: solaris-x86-32:
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.solaris.x86.32 $(MAKE) $(EXECUTABLE) $(TEST_LIBRARY) CONFIG=vm/Config.solaris.x86.32
solaris-x86-64: solaris-x86-64:
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.solaris.x86.64 $(MAKE) $(EXECUTABLE) $(TEST_LIBRARY) CONFIG=vm/Config.solaris.x86.64
winnt-x86-32: winnt-x86-32:
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.windows.nt.x86.32 $(MAKE) $(EXECUTABLE) $(TEST_LIBRARY) CONFIG=vm/Config.windows.nt.x86.32
$(MAKE) $(CONSOLE_EXECUTABLE) CONFIG=vm/Config.windows.nt.x86.32 $(MAKE) $(CONSOLE_EXECUTABLE) CONFIG=vm/Config.windows.nt.x86.32
winnt-x86-64: winnt-x86-64:
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.windows.nt.x86.64 $(MAKE) $(EXECUTABLE) $(TEST_LIBRARY) CONFIG=vm/Config.windows.nt.x86.64
$(MAKE) $(CONSOLE_EXECUTABLE) CONFIG=vm/Config.windows.nt.x86.64 $(MAKE) $(CONSOLE_EXECUTABLE) CONFIG=vm/Config.windows.nt.x86.64
wince-arm: wince-arm:
$(MAKE) $(EXECUTABLE) CONFIG=vm/Config.windows.ce.arm $(MAKE) $(EXECUTABLE) $(TEST_LIBRARY) CONFIG=vm/Config.windows.ce.arm
macosx.app: factor macosx.app: factor
mkdir -p $(BUNDLE)/Contents/MacOS mkdir -p $(BUNDLE)/Contents/MacOS
@ -161,6 +160,9 @@ factor-console: $(DLL_OBJS) $(EXE_OBJS)
$(CC) $(LIBS) $(LIBPATH) -L. $(LINK_WITH_ENGINE) \ $(CC) $(LIBS) $(LIBPATH) -L. $(LINK_WITH_ENGINE) \
$(CFLAGS) $(CFLAGS_CONSOLE) -o factor$(EXE_SUFFIX)$(CONSOLE_EXTENSION) $(EXE_OBJS) $(CFLAGS) $(CFLAGS_CONSOLE) -o factor$(EXE_SUFFIX)$(CONSOLE_EXTENSION) $(EXE_OBJS)
factor-ffi-test: vm/ffi_test.o
$(CC) $(LIBPATH) $(CFLAGS) $(FFI_TEST_CFLAGS) $(SHARED_FLAG) -o libfactor-ffi-test$(DLL_EXTENSION) $(TEST_OBJS)
clean: clean:
rm -f vm/*.o rm -f vm/*.o
rm -f factor*.dll libfactor.{a,so,dylib} rm -f factor*.dll libfactor.{a,so,dylib}
@ -168,6 +170,9 @@ clean:
vm/resources.o: vm/resources.o:
$(WINDRES) vm/factor.rs vm/resources.o $(WINDRES) vm/factor.rs vm/resources.o
vm/ffi_test.o: vm/ffi_test.c
$(CC) -c $(CFLAGS) $(FFI_TEST_CFLAGS) -o $@ $<
.c.o: .c.o:
$(CC) -c $(CFLAGS) -o $@ $< $(CC) -c $(CFLAGS) -o $@ $<

View File

@ -5,7 +5,7 @@ byte-arrays combinators combinators.short-circuit fry generalizations
kernel lexer macros math math.parser namespaces parser sequences kernel lexer macros math math.parser namespaces parser sequences
splitting stack-checker vectors vocabs.parser words locals splitting stack-checker vectors vocabs.parser words locals
io.encodings.ascii io.encodings.string shuffle effects math.ranges io.encodings.ascii io.encodings.string shuffle effects math.ranges
math.order sorting strings system ; math.order sorting strings system alien.libraries ;
IN: alien.fortran IN: alien.fortran
SINGLETONS: f2c-abi gfortran-abi intel-unix-abi intel-windows-abi ; SINGLETONS: f2c-abi gfortran-abi intel-unix-abi intel-windows-abi ;

View File

View File

@ -0,0 +1,60 @@
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien alien.syntax assocs help.markup
help.syntax io.backend kernel namespaces ;
IN: alien.libraries
HELP: <library>
{ $values
{ "path" "a pathname string" } { "abi" "the ABI used by the library, either " { $snippet "cdecl" } " or " { $snippet "stdcall" } }
{ "library" library } }
{ $description "Opens a C library using the path and ABI parameters and outputs a library tuple." }
{ $notes "User code should use " { $link add-library } " so that the opened library is added to a global hashtable, " { $link libraries } "." } ;
HELP: libraries
{ $description "A global hashtable that keeps a list of open libraries. Use the " { $link add-library } " word to construct a library and add it with a single call." } ;
HELP: library
{ $values { "name" "a string" } { "library" "a hashtable" } }
{ $description "Looks up a library by its logical name. The library object is a hashtable with the following keys:"
{ $list
{ { $snippet "name" } " - the full path of the C library binary" }
{ { $snippet "abi" } " - the ABI used by the library, either " { $snippet "cdecl" } " or " { $snippet "stdcall" } }
{ { $snippet "dll" } " - an instance of the " { $link dll } " class; only set if the library is loaded" }
}
} ;
HELP: dlopen ( path -- dll )
{ $values { "path" "a pathname string" } { "dll" "a DLL handle" } }
{ $description "Opens a native library and outputs a handle which may be passed to " { $link dlsym } " or " { $link dlclose } "." }
{ $errors "Throws an error if the library could not be found, or if loading fails for some other reason." }
{ $notes "This is the low-level facility used to implement " { $link load-library } ". Use the latter instead." } ;
HELP: dlsym ( name dll -- alien )
{ $values { "name" "a C symbol name" } { "dll" "a DLL handle" } { "alien" "an alien pointer" } }
{ $description "Looks up a symbol in a native library. If " { $snippet "dll" } " is " { $link f } " looks for the symbol in the runtime executable." }
{ $errors "Throws an error if the symbol could not be found." } ;
HELP: dlclose ( dll -- )
{ $values { "dll" "a DLL handle" } }
{ $description "Closes a DLL handle created by " { $link dlopen } ". This word might not be implemented on all platforms." } ;
HELP: load-library
{ $values { "name" "a string" } { "dll" "a DLL handle" } }
{ $description "Loads a library by logical name and outputs a handle which may be passed to " { $link dlsym } " or " { $link dlclose } ". If the library is already loaded, returns the existing handle." } ;
HELP: add-library
{ $values { "name" "a string" } { "path" "a string" } { "abi" "one of " { $snippet "\"cdecl\"" } " or " { $snippet "\"stdcall\"" } } }
{ $description "Defines a new logical library named " { $snippet "name" } " located in the file system at " { $snippet "path" } "and the specified ABI." }
{ $notes "Because the entire source file is parsed before top-level forms are executed, " { $link add-library } " cannot be used in the same file as " { $link POSTPONE: FUNCTION: } " definitions from that library. The " { $link add-library } " call will happen too late, after compilation, and the alien calls will not work."
$nl
"Instead, " { $link add-library } " calls must either be placed in different source files from those that use that library, or alternatively, " { $link "syntax-immediate" } " can be used to load the library before compilation." }
{ $examples "Here is a typical usage of " { $link add-library } ":"
{ $code
"<< \"freetype\" {"
" { [ os macosx? ] [ \"libfreetype.6.dylib\" \"cdecl\" add-library ] }"
" { [ os windows? ] [ \"freetype6.dll\" \"cdecl\" add-library ] }"
" [ drop ]"
"} cond >>"
}
"Note the parse time evaluation with " { $link POSTPONE: << } "." } ;

View File

@ -0,0 +1,21 @@
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien assocs io.backend kernel namespaces ;
IN: alien.libraries
SYMBOL: libraries
libraries [ H{ } clone ] initialize
TUPLE: library path abi dll ;
: library ( name -- library ) libraries get at ;
: <library> ( path abi -- library )
over dup [ dlopen ] when \ library boa ;
: load-library ( name -- dll )
library dup [ dll>> ] when ;
: add-library ( name path abi -- )
<library> swap libraries get set-at ;

View File

@ -4,7 +4,7 @@ USING: accessors arrays alien alien.c-types alien.structs
alien.arrays alien.strings kernel math namespaces parser alien.arrays alien.strings kernel math namespaces parser
sequences words quotations math.parser splitting grouping sequences words quotations math.parser splitting grouping
effects assocs combinators lexer strings.parser alien.parser effects assocs combinators lexer strings.parser alien.parser
fry vocabs.parser words.constant ; fry vocabs.parser words.constant alien.libraries ;
IN: alien.syntax IN: alien.syntax
SYNTAX: DLL" lexer get skip-blank parse-string dlopen parsed ; SYNTAX: DLL" lexer get skip-blank parse-string dlopen parsed ;

View File

@ -5,7 +5,7 @@ IN: bootstrap.help
: load-help ( -- ) : load-help ( -- )
"help.lint" require "help.lint" require
"tools.vocabs.browser" require "help.vocabs" require
"alien.syntax" require "alien.syntax" require
"compiler" require "compiler" require

View File

@ -14,7 +14,6 @@ IN: bootstrap.tools
"tools.time" "tools.time"
"tools.threads" "tools.threads"
"tools.vocabs" "tools.vocabs"
"tools.vocabs.browser"
"tools.vocabs.monitor" "tools.vocabs.monitor"
"editors" "editors"
} [ require ] each } [ require ] each

View File

@ -5,7 +5,8 @@
! License: http://factorcode.org/license.txt ! License: http://factorcode.org/license.txt
USING: system combinators alien alien.syntax alien.c-types USING: system combinators alien alien.syntax alien.c-types
alien.destructors kernel accessors sequences arrays ui.gadgets ; alien.destructors kernel accessors sequences arrays ui.gadgets
alien.libraries ;
IN: cairo.ffi IN: cairo.ffi
<< { << {

View File

@ -89,4 +89,4 @@ PRIVATE>
-> locationInWindow f -> convertPoint:fromView: -> locationInWindow f -> convertPoint:fromView:
[ CGPoint-x ] [ CGPoint-y ] bi [ CGPoint-x ] [ CGPoint-y ] bi
] [ drop -> frame CGRect-h ] 2bi ] [ drop -> frame CGRect-h ] 2bi
swap - 2array ; swap - [ >integer ] bi@ 2array ;

View File

@ -3,7 +3,7 @@
USING: namespaces make math math.order math.parser sequences accessors USING: namespaces make math math.order math.parser sequences accessors
kernel kernel.private layouts assocs words summary arrays kernel kernel.private layouts assocs words summary arrays
combinators classes.algebra alien alien.c-types alien.structs combinators classes.algebra alien alien.c-types alien.structs
alien.strings alien.arrays alien.complex sets libc alien.strings alien.arrays alien.complex sets libc alien.libraries
continuations.private fry cpu.architecture continuations.private fry cpu.architecture
compiler.errors compiler.errors
compiler.alien compiler.alien

View File

@ -1,10 +1,25 @@
IN: compiler.tests
USING: alien alien.c-types alien.syntax compiler kernel USING: alien alien.c-types alien.syntax compiler kernel
namespaces namespaces tools.test sequences stack-checker namespaces namespaces tools.test sequences stack-checker
stack-checker.errors words arrays parser quotations stack-checker.errors words arrays parser quotations
continuations effects namespaces.private io io.streams.string continuations effects namespaces.private io io.streams.string
memory system threads tools.test math accessors combinators memory system threads tools.test math accessors combinators
specialized-arrays.float ; specialized-arrays.float alien.libraries io.pathnames
io.backend ;
IN: compiler.tests
<<
: libfactor-ffi-tests-path ( -- string )
"resource:" normalize-path
{
{ [ os winnt? ] [ "libfactor-ffi-test.dll" ] }
{ [ os macosx? ] [ "libfactor-ffi-test.dylib" ] }
{ [ os unix? ] [ "libfactor-ffi-test.a" ] }
} cond append-path ;
"f-cdecl" libfactor-ffi-tests-path "cdecl" add-library
"f-stdcall" libfactor-ffi-tests-path "stdcall" add-library
>>
FUNCTION: void ffi_test_0 ; FUNCTION: void ffi_test_0 ;
[ ] [ ffi_test_0 ] unit-test [ ] [ ffi_test_0 ] unit-test
@ -107,9 +122,7 @@ unit-test
"int" { "int" "int" "int" "int" } "stdcall" alien-indirect "int" { "int" "int" "int" "int" } "stdcall" alien-indirect
gc ; gc ;
<< "f-stdcall" f "stdcall" add-library >> [ f ] [ "f-stdcall" load-library f = ] unit-test
[ f ] [ "f-stdcall" load-library ] unit-test
[ "stdcall" ] [ "f-stdcall" library abi>> ] unit-test [ "stdcall" ] [ "f-stdcall" library abi>> ] unit-test
: ffi_test_18 ( w x y z -- int ) : ffi_test_18 ( w x y z -- int )
@ -149,7 +162,7 @@ FUNCTION: void ffi_test_20 double x1, double x2, double x3,
: ffi_test_31 ( a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a -- result y ) : ffi_test_31 ( a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a -- result y )
"int" "int"
f "ffi_test_31" "f-cdecl" "ffi_test_31"
{ "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" } { "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" "int" }
alien-invoke gc 3 ; alien-invoke gc 3 ;
@ -157,7 +170,7 @@ FUNCTION: void ffi_test_20 double x1, double x2, double x3,
: ffi_test_31_point_5 ( a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a -- result ) : ffi_test_31_point_5 ( a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a -- result )
"float" "float"
f "ffi_test_31_point_5" "cdecl" "ffi_test_31_point_5"
{ "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" } { "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" "float" }
alien-invoke ; alien-invoke ;

View File

@ -1,5 +1,8 @@
IN: compiler.tree.debugger.tests IN: compiler.tree.debugger.tests
USING: compiler.tree.debugger tools.test ; USING: compiler.tree.debugger tools.test sorting sequences io math.order ;
\ optimized. must-infer \ optimized. must-infer
\ optimizer-report. must-infer \ optimizer-report. must-infer
[ [ <=> ] sort ] optimized.
[ <reversed> [ print ] each ] optimizer-report.

View File

@ -160,7 +160,7 @@ SYMBOL: node-count
{ [ dup generic? ] [ generics-called ] } { [ dup generic? ] [ generics-called ] }
{ [ dup method-body? ] [ methods-called ] } { [ dup method-body? ] [ methods-called ] }
[ words-called ] [ words-called ]
} cond inc-at } cond get inc-at
] [ drop ] if ] [ drop ] if
] each-node ] each-node
node-count set node-count set

View File

@ -1,6 +1,6 @@
! Copyright (C) 2009 Doug Coleman. ! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.syntax combinators system ; USING: alien alien.syntax combinators system alien.libraries ;
IN: compression.zlib.ffi IN: compression.zlib.ffi
<< "zlib" { << "zlib" {

View File

@ -1,6 +1,7 @@
! Copyright (C) 2009 Slava Pestov. ! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: words parser alien alien.c-types kernel fry accessors ; USING: words parser alien alien.c-types kernel fry accessors
alien.libraries ;
IN: core-text.utilities IN: core-text.utilities
SYNTAX: C-GLOBAL: SYNTAX: C-GLOBAL:

View File

@ -1,7 +1,7 @@
! Copyright (C) 2007, 2008 Doug Coleman. ! Copyright (C) 2007, 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
! tested on debian linux with postgresql 8.1 ! tested on debian linux with postgresql 8.1
USING: alien alien.syntax combinators system ; USING: alien alien.syntax combinators system alien.libraries ;
IN: db.postgresql.ffi IN: db.postgresql.ffi
<< "postgresql" { << "postgresql" {

View File

@ -3,7 +3,7 @@
! An interface to the sqlite database. Tested against sqlite v3.1.3. ! An interface to the sqlite database. Tested against sqlite v3.1.3.
! Not all functions have been wrapped. ! Not all functions have been wrapped.
USING: alien compiler kernel math namespaces sequences strings alien.syntax USING: alien compiler kernel math namespaces sequences strings alien.syntax
system combinators alien.c-types ; system combinators alien.c-types alien.libraries ;
IN: db.sqlite.ffi IN: db.sqlite.ffi
<< "sqlite" { << "sqlite" {

View File

@ -1,6 +1,7 @@
USING: alien arrays generic generic.math help.markup help.syntax USING: alien arrays generic generic.math help.markup help.syntax
kernel math memory strings sbufs vectors io io.files classes kernel math memory strings sbufs vectors io io.files classes
help generic.standard continuations io.files.private listener ; help generic.standard continuations io.files.private listener
alien.libraries ;
IN: debugger IN: debugger
ARTICLE: "debugger" "The debugger" ARTICLE: "debugger" "The debugger"

View File

@ -0,0 +1,12 @@
IN: definitions.icons
USING: help.markup help.syntax ;
ARTICLE: "definitions.icons" "Definition icons"
"The " { $vocab-link "definitions.icons" } " vocabulary associates common definition types with icons."
{ $definition-icons }
"Looking up the icon associated with a definition:"
{ $subsection definition-icon }
"Defining new icons:"
{ $subsection POSTPONE: ICON: } ;
ABOUT: "definitions.icons"

View File

@ -2,22 +2,29 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: assocs classes.predicate fry generic io.pathnames kernel USING: assocs classes.predicate fry generic io.pathnames kernel
macros sequences vocabs words words.symbol words.constant macros sequences vocabs words words.symbol words.constant
lexer parser help.topics ; lexer parser help.topics help.markup namespaces sorting ;
IN: definitions.icons IN: definitions.icons
GENERIC: definition-icon ( definition -- path ) GENERIC: definition-icon ( definition -- path )
<PRIVATE
: definition-icon-path ( string -- string' ) : definition-icon-path ( string -- string' )
"resource:basis/definitions/icons/" prepend-path ".tiff" append ; "vocab:definitions/icons/" prepend-path ".tiff" append ;
<< <<
SYNTAX: ICON: SYMBOL: icons
scan-word \ definition-icon create-method
scan '[ drop _ definition-icon-path ] icons [ H{ } clone ] initialize
define ;
: define-icon ( class name -- )
[ swap icons get set-at ]
[
[ \ definition-icon create-method ]
[ '[ drop _ definition-icon-path ] ] bi*
define
] 2bi ;
SYNTAX: ICON: scan-word scan define-icon ;
>> >>
@ -29,12 +36,15 @@ ICON: primitive primitive-word
ICON: symbol symbol-word ICON: symbol symbol-word
ICON: constant constant-word ICON: constant constant-word
ICON: word normal-word ICON: word normal-word
ICON: vocab-link unopen-vocab
ICON: word-link word-help-article ICON: word-link word-help-article
ICON: link help-article ICON: link help-article
ICON: runnable-vocab runnable-vocab
ICON: vocab open-vocab
ICON: vocab-link unopen-vocab
PRIVATE> : $definition-icons ( element -- )
drop
M: vocab definition-icon icons get >alist sort-keys
vocab-main "runnable-vocab" "open-vocab" ? definition-icon-path ; [ [ <$link> ] [ definition-icon-path <$image> ] bi* swap ] assoc-map
{ "" "Definition class" } prefix
$table ;

View File

@ -1,7 +1,8 @@
! Copyright (C) 2008 Matthew Willis. ! Copyright (C) 2008 Matthew Willis.
! Copyright (C) 2009 Slava Pestov. ! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license ! See http://factorcode.org/license.txt for BSD license
USING: alien alien.syntax alien.destructors combinators system ; USING: alien alien.syntax alien.destructors combinators system
alien.libraries ;
IN: glib IN: glib
<< <<

View File

@ -1,6 +1,8 @@
IN: tools.apropos IN: help.apropos
USING: help.markup help.syntax strings ; USING: help.markup help.syntax strings help.tips ;
HELP: apropos HELP: apropos
{ $values { "str" string } } { $values { "str" string } }
{ $description "Lists all words, vocabularies and help articles whose name contains a subsequence equal to " { $snippet "str" } ". Results are ranked using a simple distance algorithm." } ; { $description "Lists all words, vocabularies and help articles whose name contains a subsequence equal to " { $snippet "str" } ". Results are ranked using a simple distance algorithm." } ;
TIP: "Use " { $link apropos } " to search for words, vocabularies and help articles." ;

View File

@ -0,0 +1,4 @@
IN: help.apropos.tests
USING: help.apropos tools.test ;
[ ] [ "swp" apropos ] unit-test

View File

@ -2,9 +2,9 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs fry help.markup help.topics io USING: accessors arrays assocs fry help.markup help.topics io
kernel make math math.parser namespaces sequences sorting kernel make math math.parser namespaces sequences sorting
summary tools.completion tools.vocabs tools.vocabs.browser summary tools.completion tools.vocabs help.vocabs
vocabs words unicode.case help ; vocabs words unicode.case help ;
IN: tools.apropos IN: help.apropos
: $completions ( seq -- ) : $completions ( seq -- )
dup [ word? ] all? [ words-table ] [ dup [ word? ] all? [ words-table ] [
@ -67,5 +67,9 @@ M: apropos article-name article-title ;
M: apropos article-content M: apropos article-content
search>> 1array \ $apropos prefix ; search>> 1array \ $apropos prefix ;
M: apropos >link ;
INSTANCE: apropos topic
: apropos ( str -- ) : apropos ( str -- )
<apropos> print-topic ; <apropos> print-topic ;

View File

@ -11,10 +11,7 @@ HELP: article-parent
HELP: help-path HELP: help-path
{ $values { "topic" "an article name or a word" } { "seq" "a new sequence" } } { $values { "topic" "an article name or a word" } { "seq" "a new sequence" } }
{ $description "Outputs a sequence of all help articles which contain " { $snippet "topic" } " as a subsection, traversing all the way up to the root." } { $description "Outputs a sequence of all help articles which contain " { $snippet "topic" } " as a subsection, traversing all the way up to the root." } ;
{ $examples
{ $example "USING: help.crossref prettyprint ;" "\"sequences\" help-path ." "{ \"collections\" \"handbook-language-reference\" \"handbook\" }" }
} ;
HELP: xref-article HELP: xref-article
{ $values { "topic" "an article name or a word" } } { $values { "topic" "an article name or a word" } }

View File

@ -4,7 +4,7 @@ prettyprint.backend prettyprint.custom kernel.private io generic
math system strings sbufs vectors byte-arrays quotations math system strings sbufs vectors byte-arrays quotations
io.streams.byte-array classes.builtin parser lexer io.streams.byte-array classes.builtin parser lexer
classes.predicate classes.union classes.intersection classes.predicate classes.union classes.intersection
classes.singleton classes.tuple tools.vocabs.browser math.parser classes.singleton classes.tuple help.vocabs math.parser
accessors ; accessors ;
IN: help.handbook IN: help.handbook
@ -278,11 +278,7 @@ ARTICLE: "handbook-library-reference" "Library reference"
"This index only includes articles from loaded vocabularies. To explore more vocabularies, see " { $link "vocab-index" } "." "This index only includes articles from loaded vocabularies. To explore more vocabularies, see " { $link "vocab-index" } "."
{ $index [ "handbook" orphan-articles remove ] } ; { $index [ "handbook" orphan-articles remove ] } ;
ARTICLE: "handbook" "Factor documentation" ARTICLE: "handbook" "Factor handbook"
"Welcome to Factor."
$nl
"Explore the code base:"
{ $subsection "vocab-index" }
"Learn the language:" "Learn the language:"
{ $subsection "cookbook" } { $subsection "cookbook" }
{ $subsection "first-program" } { $subsection "first-program" }
@ -290,11 +286,13 @@ $nl
{ $subsection "handbook-environment-reference" } { $subsection "handbook-environment-reference" }
{ $subsection "ui" } { $subsection "ui" }
{ $subsection "handbook-library-reference" } { $subsection "handbook-library-reference" }
"The below indices only include articles from loaded vocabularies. To explore more vocabularies, see " { $link "vocab-index" } "." "Explore loaded libraries:"
{ $subsection "article-index" } { $subsection "article-index" }
{ $subsection "primitive-index" } { $subsection "primitive-index" }
{ $subsection "error-index" } { $subsection "error-index" }
{ $subsection "type-index" } { $subsection "type-index" }
{ $subsection "class-index" } ; { $subsection "class-index" }
"Explore the code base:"
{ $subsection "vocab-index" } ;
ABOUT: "handbook" ABOUT: "handbook"

View File

@ -69,12 +69,6 @@ ARTICLE: "element-types" "Element types"
IN: help.markup IN: help.markup
ABOUT: "element-types" ABOUT: "element-types"
ARTICLE: "browsing-help" "Browsing documentation"
"The easiest way to browse the help is from the help browser tool in the UI, however you can also display help topics in the listener. Help topics are identified by article name strings, or words. You can request a specific help topic:"
{ $subsection help }
"You can also display the main help article for a vocabulary:"
{ $subsection about } ;
ARTICLE: "writing-help" "Writing documentation" ARTICLE: "writing-help" "Writing documentation"
"By convention, documentation is written in files whose names end with " { $snippet "-docs.factor" } ". Vocabulary documentation should be placed in the same directory as the vocabulary source code; see " { $link "vocabs.loader" } "." "By convention, documentation is written in files whose names end with " { $snippet "-docs.factor" } ". Vocabulary documentation should be placed in the same directory as the vocabulary source code; see " { $link "vocabs.loader" } "."
$nl $nl
@ -127,6 +121,7 @@ ARTICLE: "help" "Help system"
{ $subsection "browsing-help" } { $subsection "browsing-help" }
{ $subsection "writing-help" } { $subsection "writing-help" }
{ $subsection "help.lint" } { $subsection "help.lint" }
{ $subsection "tips-of-the-day" }
{ $subsection "help-impl" } ; { $subsection "help-impl" } ;
IN: help IN: help
@ -147,11 +142,6 @@ HELP: help
{ $description { $description
"Displays a help topic." "Displays a help topic."
} ; } ;
HELP: about
{ $values { "vocab" "a vocabulary specifier" } }
{ $description
"Displays the main help article for the vocabulary. The main help article is set with the " { $link POSTPONE: ABOUT: } " parsing word."
} ;
HELP: :help HELP: :help
{ $description "Displays documentation for the most recent error." } ; { $description "Displays documentation for the most recent error." } ;

View File

@ -127,15 +127,6 @@ help-hook [ [ print-topic ] ] initialize
: help ( topic -- ) : help ( topic -- )
help-hook get call( topic -- ) ; help-hook get call( topic -- ) ;
: about ( vocab -- )
dup require
dup vocab [ ] [ no-vocab ] ?if
dup vocab-help [ help ] [
"The " write vocab-name write
" vocabulary does not define a main help article." print
"To define one, refer to \\ ABOUT: help" print
] ?if ;
: ($index) ( articles -- ) : ($index) ( articles -- )
sort-articles [ \ $subsection swap 2array ] map print-element ; sort-articles [ \ $subsection swap 2array ] map print-element ;

View File

@ -0,0 +1 @@
Slava Pestov

View File

@ -0,0 +1,23 @@
IN: help.home
USING: help.markup help.syntax ;
ARTICLE: "help.home" "Factor documentation"
"If this is your first time with Factor, you can start by writing " { $link "first-program" } "."
{ $heading "Reference" }
{ $list
{ $link "handbook" }
{ $link "vocab-index" }
{ $link "ui-tools" }
{ $link "handbook-library-reference" }
}
{ $heading "Recently visited" }
{ $table
{ "Words" "Articles" "Vocabs" }
{ { $recent recent-words } { $recent recent-articles } { $recent recent-vocabs } }
}
"The browser, completion popups and other tools use a common set of " { $link "definitions.icons" } "."
{ $heading "Recent searches" }
{ $recent-searches }
"Use the search field in the top-right of the " { $link "ui-browser" } " window to search for words, vocabularies and help articles." ;
ABOUT: "help.home"

View File

@ -0,0 +1,40 @@
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: arrays compiler.units fry hashtables help.topics io
kernel math namespaces sequences sets help.vocabs
help.apropos vocabs help.markup ;
IN: help.home
SYMBOLS: recent-words recent-articles recent-vocabs recent-searches ;
CONSTANT: recent-count 10
{ recent-words recent-articles recent-vocabs recent-searches }
[ [ V{ } clone ] initialize ] each
GENERIC: add-recent-where ( obj -- obj symbol )
M: link add-recent-where recent-articles ;
M: word-link add-recent-where recent-words ;
M: vocab-spec add-recent-where recent-vocabs ;
M: apropos add-recent-where recent-searches ;
M: object add-recent-where f ;
: $recent ( element -- )
first get [ nl ] [ 1array $pretty-link ] interleave ;
: $recent-searches ( element -- )
drop recent-searches get [ <$link> ] map $list ;
: redisplay-recent-page ( -- )
"help.home" >link dup associate
notify-definition-observers ;
: expire ( seq -- )
[ length recent-count - [ 0 > ] keep ] keep
'[ 0 _ _ delete-slice ] when ;
: add-recent ( obj -- )
add-recent-where dup
[ get [ adjoin ] [ expire ] bi ] [ 2drop ] if
redisplay-recent-page ;

View File

@ -3,7 +3,7 @@
USING: io.encodings.utf8 io.encodings.ascii io.encodings.binary USING: io.encodings.utf8 io.encodings.ascii io.encodings.binary
io.files io.files.temp io.directories html.streams help kernel io.files io.files.temp io.directories html.streams help kernel
assocs sequences make words accessors arrays help.topics vocabs assocs sequences make words accessors arrays help.topics vocabs
tools.vocabs tools.vocabs.browser namespaces prettyprint io tools.vocabs help.vocabs namespaces prettyprint io
vocabs.loader serialize fry memoize unicode.case math.order vocabs.loader serialize fry memoize unicode.case math.order
sorting debugger html xml.syntax xml.writer ; sorting debugger html xml.syntax xml.writer ;
IN: help.html IN: help.html

View File

@ -140,6 +140,9 @@ ALIAS: $slot $snippet
: $image ( element -- ) : $image ( element -- )
[ [ "" ] dip first image associate format ] ($span) ; [ [ "" ] dip first image associate format ] ($span) ;
: <$image> ( path -- element )
1array \ $image prefix ;
! Some links ! Some links
: write-link ( string object -- ) : write-link ( string object -- )
link-style get [ write-object ] with-style ; link-style get [ write-object ] with-style ;

View File

@ -0,0 +1 @@
Slava Pestov

View File

@ -0,0 +1,30 @@
IN: help.tips
USING: help.markup help.syntax debugger prettyprint see help help.vocabs
help.apropos tools.time stack-checker editors ;
TIP: "To look at the most recent error, run " { $link :error } ". To look at the most recent error's callstack, run " { $link :c } "." ;
TIP: "Learn to use " { $link "dataflow-combinators" } "." ;
TIP: "Learn to use " { $link "editor" } " to be able to jump to the source code for word definitions from the listener." ;
TIP: "Check out " { $url "http://concatenative.org/wiki/view/Factor/FAQ" } " to get answers to frequently-asked questions." ;
TIP: "Drop by the " { $snippet "#concatenative" } " IRC channel on " { $snippet "irc.freenode.net" } " some time." ;
TIP: "You can write documentation for your own code using the " { $link "help" } "." ;
TIP: "You can write graphical applications using the " { $link "ui" } "." ;
TIP: "Power tools: " { $links see edit help about apropos time infer. } ;
ARTICLE: "all-tips-of-the-day" "All tips of the day"
{ $tips-of-the-day } ;
ARTICLE: "tips-of-the-day" "Tips of the day"
"The " { $vocab-link "help.tips" } " vocabulary provides a facility for displaying tips of the day in the " { $link "ui-listener" } ". Tips are defined with a parsing word:"
{ $subsection POSTPONE: TIP: }
"All tips defined so far:"
{ $subsection "all-tips-of-the-day" } ;
ABOUT: "tips-of-the-day"

View File

@ -0,0 +1,38 @@
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: parser arrays namespaces sequences random help.markup kernel io
io.styles colors.constants ;
IN: help.tips
SYMBOL: tips
tips [ V{ } clone ] initialize
SYNTAX: TIP: parse-definition >array tips get push ;
: a-tip ( -- tip ) tips get random ;
SYMBOL: tip-of-the-day-style
H{
{ page-color COLOR: lavender }
{ border-width 5 }
{ wrap-margin 500 }
} tip-of-the-day-style set-global
: $tip-of-the-day ( element -- )
drop
[
tip-of-the-day-style get
[
last-element off
"Tip of the day" $heading a-tip print-element nl
"— " print-element "all-tips-of-the-day" ($link)
]
with-nesting
] ($heading) ;
: tip-of-the-day. ( -- ) { $tip-of-the-day } print-content nl ;
: $tips-of-the-day ( element -- )
drop tips get [ nl nl ] [ print-element ] interleave ;

View File

@ -62,7 +62,9 @@ ARTICLE: "first-program-test" "Testing your first program"
"" ""
": palindrome? ( str -- ? ) dup reverse = ;" ": palindrome? ( str -- ? ) dup reverse = ;"
} }
"We will now test our new word in the listener. First, push a string on the stack:" "We will now test our new word in the listener. First we have add the palindrome vocabulary to the listener's vocabulary search path:"
{ $code "USE: palindrome"}
"Next, push a string on the stack:"
{ $code "\"hello\"" } { $code "\"hello\"" }
"Note that the stack display in the listener now shows this string. Having supplied the input, we call our word:" "Note that the stack display in the listener now shows this string. Having supplied the input, we call our word:"
{ $code "palindrome?" } { $code "palindrome?" }
@ -132,6 +134,8 @@ $nl
$nl $nl
"We modify " { $snippet "palindrome?" } " to first apply " { $snippet "normalize" } " to its input:" "We modify " { $snippet "palindrome?" } " to first apply " { $snippet "normalize" } " to its input:"
{ $code ": palindrome? ( str -- ? ) normalize dup reverse = ;" } { $code ": palindrome? ( str -- ? ) normalize dup reverse = ;" }
"Factor compiles the file from the top down. So, be sure to place the definition for " { $snippet "normalize" } " above the definition for " { $snippet "palindrome?" } "."
$nl
"Now if you press " { $command tool "common" refresh-all } ", the source file should reload without any errors. You can run unit tests again, and this time, they will all pass:" "Now if you press " { $command tool "common" refresh-all } ", the source file should reload without any errors. You can run unit tests again, and this time, they will all pass:"
{ $code "\"palindrome\" test" } ; { $code "\"palindrome\" test" } ;

View File

@ -0,0 +1,38 @@
USING: help help.topics help.markup help.syntax io strings ;
IN: help.vocabs
ARTICLE: "vocab-tags" "Vocabulary tags"
{ $all-tags } ;
ARTICLE: "vocab-authors" "Vocabulary authors"
{ $all-authors } ;
ARTICLE: "vocab-index" "Vocabulary index"
{ $subsection "vocab-tags" }
{ $subsection "vocab-authors" }
{ $vocab "" } ;
HELP: words.
{ $values { "vocab" "a vocabulary name" } }
{ $description "Printings a listing of all the words in a vocabulary, categorized by type." } ;
HELP: about
{ $values { "vocab" "a vocabulary specifier" } }
{ $description
"Displays the main help article for the vocabulary. The main help article is set with the " { $link POSTPONE: ABOUT: } " parsing word."
} ;
ARTICLE: "browsing-help" "Browsing documentation"
"Help topics are instances of a mixin:"
{ $subsection topic }
"Most commonly, topics are article name strings, or words. You can display a specific help topic:"
{ $subsection help }
"You can also display the help for a vocabulary:"
{ $subsection about }
"To list a vocabulary's words only:"
{ $subsection words. }
{ $examples
{ $code "\"evaluator\" help" }
{ $code "\\ + help" }
{ $code "\"io.files\" about" }
} ;

View File

@ -0,0 +1,5 @@
IN: help.vocabs.tests
USING: help.vocabs tools.test help.markup help vocabs ;
[ ] [ { $vocab "scratchpad" } print-content ] unit-test
[ ] [ "classes" vocab print-topic ] unit-test

View File

@ -6,17 +6,19 @@ classes.singleton classes.tuple classes.union combinators
definitions effects fry generic help help.markup help.stylesheet definitions effects fry generic help help.markup help.stylesheet
help.topics io io.files io.pathnames io.styles kernel macros help.topics io io.files io.pathnames io.styles kernel macros
make namespaces prettyprint sequences sets sorting summary make namespaces prettyprint sequences sets sorting summary
tools.vocabs vocabs vocabs.loader words words.symbol tools.vocabs vocabs vocabs.loader words words.symbol definitions.icons ;
combinators.smart definitions.icons ; IN: help.vocabs
IN: tools.vocabs.browser
: about ( vocab -- )
[ require ] [ vocab help ] bi ;
: $pretty-link ( element -- )
[ first definition-icon 1array $image " " print-element ]
[ $definition-link ]
bi ;
: <$pretty-link> ( definition -- element ) : <$pretty-link> ( definition -- element )
[ 1array \ $pretty-link prefix ;
[ definition-icon 1array \ $image prefix ]
[ drop " " ]
[ 1array \ $definition-link prefix ]
tri
] output>array ;
: vocab-row ( vocab -- row ) : vocab-row ( vocab -- row )
[ <$pretty-link> ] [ vocab-summary ] bi 2array ; [ <$pretty-link> ] [ vocab-summary ] bi 2array ;

View File

@ -1,4 +1,5 @@
USING: alien alien.fortran kernel system combinators ; USING: alien alien.fortran kernel system combinators
alien.libraries ;
IN: math.blas.ffi IN: math.blas.ffi
<< <<

View File

@ -1,4 +1,4 @@
USING: kernel alien ; USING: kernel alien alien.libraries ;
IN: opengl.gl.macosx IN: opengl.gl.macosx
: gl-function-context ( -- context ) 0 ; inline : gl-function-context ( -- context ) 0 ; inline

View File

@ -5,7 +5,8 @@
! !
! export LD_LIBRARY_PATH=/opt/local/lib ! export LD_LIBRARY_PATH=/opt/local/lib
USING: alien alien.syntax combinators kernel system ; USING: alien alien.syntax combinators kernel system
alien.libraries ;
IN: openssl.libcrypto IN: openssl.libcrypto

View File

@ -2,7 +2,8 @@
! Portions copyright (C) 2008 Slava Pestov ! Portions copyright (C) 2008 Slava Pestov
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.syntax combinators kernel system namespaces USING: alien alien.syntax combinators kernel system namespaces
assocs parser lexer sequences words quotations math.bitwise ; assocs parser lexer sequences words quotations math.bitwise
alien.libraries ;
IN: openssl.libssl IN: openssl.libssl

View File

@ -3,7 +3,8 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
! !
! pangocairo bindings, from pango/pangocairo.h ! pangocairo bindings, from pango/pangocairo.h
USING: alien alien.syntax combinators system cairo.ffi ; USING: alien alien.syntax combinators system cairo.ffi
alien.libraries ;
IN: pango.cairo IN: pango.cairo
<< { << {

View File

@ -2,7 +2,7 @@
! Copyright (C) 2009 Slava Pestov. ! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license ! See http://factorcode.org/license.txt for BSD license
USING: arrays system alien.destructors alien.c-types alien.syntax alien USING: arrays system alien.destructors alien.c-types alien.syntax alien
combinators math.rectangles kernel math ; combinators math.rectangles kernel math alien.libraries ;
IN: pango IN: pango
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

View File

@ -1,7 +1,7 @@
! Copyright (C) 2008 Slava Pestov. ! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: kernel sequences accessors combinators math namespaces USING: kernel sequences accessors combinators math namespaces
init sets words init sets words alien.libraries
alien alien.c-types alien alien.c-types
stack-checker.backend stack-checker.errors stack-checker.visitor ; stack-checker.backend stack-checker.errors stack-checker.visitor ;
IN: stack-checker.alien IN: stack-checker.alien

View File

@ -12,6 +12,7 @@ classes.tuple.private vectors vectors.private words definitions
words.private assocs summary compiler.units system.private words.private assocs summary compiler.units system.private
combinators locals locals.backend locals.types words.private combinators locals locals.backend locals.types words.private
quotations.private combinators.private stack-checker.values quotations.private combinators.private stack-checker.values
alien.libraries
stack-checker.alien stack-checker.alien
stack-checker.state stack-checker.state
stack-checker.errors stack-checker.errors

View File

@ -1,4 +0,0 @@
IN: tools.apropos.tests
USING: tools.apropos tools.test ;
[ ] [ "swp" apropos ] unit-test

View File

@ -204,7 +204,8 @@ IN: tools.deploy.shaker
] when ; ] when ;
: strip-vocab-globals ( except names -- words ) : strip-vocab-globals ( except names -- words )
[ child-vocabs [ words ] map concat ] map concat swap diff ; [ child-vocabs [ words ] map concat ] map concat
swap [ first2 lookup ] map sift diff ;
: stripped-globals ( -- seq ) : stripped-globals ( -- seq )
[ [
@ -245,7 +246,8 @@ IN: tools.deploy.shaker
strip-dictionary? [ strip-dictionary? [
"libraries" "alien" lookup , "libraries" "alien" lookup ,
{ } { "cpu" "compiler" } strip-vocab-globals % { { "yield-hook" "compiler.utilities" } }
{ "cpu" "compiler" } strip-vocab-globals %
{ {
gensym gensym

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: tools.disassembler namespaces combinators USING: tools.disassembler namespaces combinators
alien alien.syntax alien.c-types lexer parser kernel alien alien.syntax alien.c-types lexer parser kernel
sequences layouts math math.order sequences layouts math math.order alien.libraries
math.parser system make fry arrays ; math.parser system make fry arrays ;
IN: tools.disassembler.udis IN: tools.disassembler.udis

View File

@ -1,16 +0,0 @@
USING: dlists ui.gadgets ui.gadgets.private
kernel ui namespaces io.streams.string io ;
IN: tools.test.ui
! We can't print to output-stream here because that might be a pane
! stream, and our graft-queue rebinding here would be captured
! by code adding children to the pane...
: with-grafted-gadget ( gadget quot -- )
[
<dlist> \ graft-queue [
over
graft notify-queued
dip
ungraft notify-queued
] with-variable
] with-string-writer print ;

View File

@ -1,17 +0,0 @@
USING: help.markup help.syntax io strings ;
IN: tools.vocabs.browser
ARTICLE: "vocab-tags" "Vocabulary tags"
{ $all-tags } ;
ARTICLE: "vocab-authors" "Vocabulary authors"
{ $all-authors } ;
ARTICLE: "vocab-index" "Vocabulary index"
{ $subsection "vocab-tags" }
{ $subsection "vocab-authors" }
{ $vocab "" } ;
HELP: words.
{ $values { "vocab" "a vocabulary name" } }
{ $description "Printings a listing of all the words in a vocabulary, categorized by type." } ;

View File

@ -1,5 +0,0 @@
IN: tools.vocabs.browser.tests
USING: tools.vocabs.browser tools.test help.markup help vocabs ;
[ ] [ { $vocab "scratchpad" } print-content ] unit-test
[ ] [ "classes" vocab print-topic ] unit-test

View File

@ -354,7 +354,7 @@ H{ } clone wm-handlers set-global
: add-wm-handler ( quot wm -- ) : add-wm-handler ( quot wm -- )
dup array? dup array?
[ [ execute add-wm-handler ] with each ] [ [ execute( -- wm ) add-wm-handler ] with each ]
[ wm-handlers get-global set-at ] if ; [ wm-handlers get-global set-at ] if ;
[ handle-wm-close 0 ] WM_CLOSE add-wm-handler [ handle-wm-close 0 ] WM_CLOSE add-wm-handler

View File

@ -2,9 +2,23 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays colors.constants combinators kernel USING: accessors arrays colors.constants combinators kernel
opengl sequences ui ui.baseline-alignment ui.gadgets opengl sequences ui ui.baseline-alignment ui.gadgets
ui.gadgets.buttons ui.gadgets.labels ui.pens ui.render ui.text ; ui.gadgets.buttons ui.gadgets.labels ui.pens ui.render ui.text
ui.gadgets.private dlists namespaces io.streams.string io ;
IN: ui.gadgets.debug IN: ui.gadgets.debug
! We can't print to output-stream here because that might be a pane
! stream, and our graft-queue rebinding here would be captured
! by code adding children to the pane...
: with-grafted-gadget ( gadget quot -- )
[
<dlist> \ graft-queue set
<dlist> \ layout-queue set
over
graft notify-queued
dip
ungraft notify-queued
] with-string-writer print ; inline
TUPLE: baseline-gadget < gadget baseline cap-height ; TUPLE: baseline-gadget < gadget baseline cap-height ;
M: baseline-gadget baseline baseline>> ; M: baseline-gadget baseline baseline>> ;

View File

@ -1,6 +1,6 @@
USING: documents help.markup help.syntax ui.gadgets USING: documents help.markup help.syntax ui.gadgets
ui.gadgets.scrollers models strings ui.commands ui.gadgets.scrollers models strings ui.commands
ui.text colors fonts ; ui.text colors fonts help.tips ;
IN: ui.gadgets.editors IN: ui.gadgets.editors
HELP: editor HELP: editor
@ -109,4 +109,8 @@ ARTICLE: "ui.gadgets.editors" "Editor gadgets"
"Editors edit " { $emphasis "documents" } ":" "Editors edit " { $emphasis "documents" } ":"
{ $subsection "documents" } ; { $subsection "documents" } ;
TIP: "Editor gadgets support undo and redo; press " { $command editor "editing" com-undo } " and " { $command editor "editing" com-redo } "." ;
TIP: "Learn the keyboard shortcuts used in " { $link "ui.gadgets.editors" } "." ;
ABOUT: "ui.gadgets.editors" ABOUT: "ui.gadgets.editors"

View File

@ -1,6 +1,6 @@
USING: accessors ui.gadgets.editors tools.test kernel io USING: accessors ui.gadgets.editors tools.test kernel io
io.streams.plain definitions namespaces ui.gadgets io.streams.plain definitions namespaces ui.gadgets
ui.gadgets.grids prettyprint documents ui.gestures tools.test.ui ui.gadgets.grids prettyprint documents ui.gestures ui.gadgets.debug
models documents.elements ui.gadgets.scrollers ui.gadgets.line-support models documents.elements ui.gadgets.scrollers ui.gadgets.line-support
sequences ; sequences ;
IN: ui.gadgets.editors.tests IN: ui.gadgets.editors.tests

View File

@ -214,7 +214,8 @@ M: gadget ungraft* drop ;
<PRIVATE <PRIVATE
: graft-queue ( -- dlist ) \ graft-queue get ; : graft-queue ( -- dlist )
\ graft-queue get [ "UI not running" throw ] unless* ;
: unqueue-graft ( gadget -- ) : unqueue-graft ( gadget -- )
[ graft-node>> graft-queue delete-node ] [ graft-node>> graft-queue delete-node ]

View File

@ -1,7 +1,7 @@
USING: alien ui.gadgets.panes ui.gadgets namespaces USING: alien ui.gadgets.panes ui.gadgets namespaces
kernel sequences io io.styles io.streams.string tools.test kernel sequences io io.styles io.streams.string tools.test
prettyprint definitions help help.syntax help.markup prettyprint definitions help help.syntax help.markup
help.stylesheet splitting tools.test.ui models math summary help.stylesheet splitting ui.gadgets.debug models math summary
inspector accessors help.topics see ; inspector accessors help.topics see ;
IN: ui.gadgets.panes.tests IN: ui.gadgets.panes.tests

View File

@ -1,7 +1,7 @@
USING: ui.gadgets ui.gadgets.scrollers namespaces tools.test USING: ui.gadgets ui.gadgets.scrollers namespaces tools.test
kernel models models.product models.range ui.gadgets.viewports kernel models models.product models.range ui.gadgets.viewports
ui.gadgets.labels ui.gadgets.grids ui.gadgets.sliders math ui.gadgets.labels ui.gadgets.grids ui.gadgets.sliders math
math.vectors arrays sequences tools.test.ui math.rectangles math.vectors arrays sequences ui.gadgets.debug math.rectangles
accessors ui.gadgets.buttons ui.gadgets.packs accessors ui.gadgets.buttons ui.gadgets.packs
ui.gadgets.scrollers.private ; ui.gadgets.scrollers.private ;
IN: ui.gadgets.scrollers.tests IN: ui.gadgets.scrollers.tests

View File

@ -1,5 +1,5 @@
IN: ui.tools.browser.tests IN: ui.tools.browser.tests
USING: tools.test tools.test.ui ui.tools.browser math ; USING: tools.test ui.gadgets.debug ui.tools.browser math ;
\ <browser-gadget> must-infer \ <browser-gadget> must-infer
[ ] [ \ + <browser-gadget> [ ] with-grafted-gadget ] unit-test [ ] [ \ + <browser-gadget> [ ] with-grafted-gadget ] unit-test

View File

@ -1,10 +1,11 @@
! Copyright (C) 2006, 2009 Slava Pestov. ! Copyright (C) 2006, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: debugger help help.topics help.crossref kernel models compiler.units USING: debugger help help.topics help.crossref help.home kernel
assocs words vocabs accessors fry combinators.short-circuit models compiler.units assocs words vocabs accessors fry
sequences models models.history tools.apropos combinators combinators.short-circuit namespaces sequences models
ui.commands ui.gadgets ui.gadgets.panes ui.gadgets.scrollers models.history help.apropos combinators ui.commands ui.gadgets
ui.gadgets.tracks ui.gestures ui.gadgets.buttons ui.gadgets.packs ui.gadgets.panes ui.gadgets.scrollers ui.gadgets.tracks
ui.gestures ui.gadgets.buttons ui.gadgets.packs
ui.gadgets.editors ui.gadgets.labels ui.gadgets.status-bar ui.gadgets.editors ui.gadgets.labels ui.gadgets.status-bar
ui.gadgets.glass ui.gadgets.borders ui.tools.common ui.gadgets.glass ui.gadgets.borders ui.tools.common
ui.tools.browser.popups ui ; ui.tools.browser.popups ui ;
@ -15,8 +16,8 @@ TUPLE: browser-gadget < tool pane scroller search-field popup ;
{ 650 400 } browser-gadget set-tool-dim { 650 400 } browser-gadget set-tool-dim
: show-help ( link browser-gadget -- ) : show-help ( link browser-gadget -- )
model>> dup add-history [ >link ] [ model>> ] bi*
[ >link ] dip set-model ; [ [ add-recent ] [ add-history ] bi* ] [ set-model ] 2bi ;
: <help-pane> ( browser-gadget -- gadget ) : <help-pane> ( browser-gadget -- gadget )
model>> [ '[ _ print-topic ] try ] <pane-control> ; model>> [ '[ _ print-topic ] try ] <pane-control> ;
@ -77,7 +78,7 @@ M: browser-gadget focusable-child* search-field>> ;
<browser-gadget> "Browser" open-status-window ; <browser-gadget> "Browser" open-status-window ;
: browser-window ( -- ) : browser-window ( -- )
"handbook" (browser-window) ; "help.home" (browser-window) ;
\ browser-window H{ { +nullary+ t } } define-command \ browser-window H{ { +nullary+ t } } define-command
@ -88,7 +89,7 @@ M: browser-gadget focusable-child* search-field>> ;
: show-browser ( -- ) : show-browser ( -- )
[ browser-gadget? ] find-window [ browser-gadget? ] find-window
[ raise-window ] [ browser-window ] if* ; [ [ raise-window ] [ request-focus ] bi ] [ browser-window ] if* ;
\ show-browser H{ { +nullary+ t } } define-command \ show-browser H{ { +nullary+ t } } define-command
@ -96,7 +97,7 @@ M: browser-gadget focusable-child* search-field>> ;
: com-forward ( browser -- ) model>> go-forward ; : com-forward ( browser -- ) model>> go-forward ;
: com-documentation ( browser -- ) "handbook" swap show-help ; : com-home ( browser -- ) "help.home" swap show-help ;
: browser-help ( -- ) "ui-browser" com-browse ; : browser-help ( -- ) "ui-browser" com-browse ;
@ -105,7 +106,7 @@ M: browser-gadget focusable-child* search-field>> ;
browser-gadget "toolbar" f { browser-gadget "toolbar" f {
{ T{ key-down f { A+ } "LEFT" } com-back } { T{ key-down f { A+ } "LEFT" } com-back }
{ T{ key-down f { A+ } "RIGHT" } com-forward } { T{ key-down f { A+ } "RIGHT" } com-forward }
{ f com-documentation } { T{ key-down f { A+ } "H" } com-home }
{ T{ key-down f f "F1" } browser-help } { T{ key-down f f "F1" } browser-help }
} define-command-map } define-command-map
@ -113,7 +114,7 @@ browser-gadget "toolbar" f {
over [ show-help ] [ 2drop ] if ; over [ show-help ] [ 2drop ] if ;
: navigate ( browser quot -- ) : navigate ( browser quot -- )
'[ control-value @ ] keep ?show-help ; '[ control-value @ ] keep ?show-help ; inline
: com-up ( browser -- ) [ article-parent ] navigate ; : com-up ( browser -- ) [ article-parent ] navigate ;

View File

@ -1,4 +1,4 @@
USING: help.markup help.syntax ; USING: help.markup help.syntax help.tips ;
IN: ui.tools.deploy IN: ui.tools.deploy
HELP: deploy-tool HELP: deploy-tool
@ -14,4 +14,6 @@ $nl
"Alternatively, right-click on a vocabulary presentation in the UI and choose " { $strong "Deploy tool" } " from the resulting popup menu." "Alternatively, right-click on a vocabulary presentation in the UI and choose " { $strong "Deploy tool" } " from the resulting popup menu."
{ $see-also "tools.deploy" } ; { $see-also "tools.deploy" } ;
TIP: "Generate stand-alone applications from vocabularies with the " { $link "ui.tools.deploy" } "." ;
ABOUT: "ui.tools.deploy" ABOUT: "ui.tools.deploy"

View File

@ -3,7 +3,7 @@
USING: accessors arrays assocs calendar colors colors.constants USING: accessors arrays assocs calendar colors colors.constants
documents documents.elements fry kernel words sets splitting math documents documents.elements fry kernel words sets splitting math
math.vectors models.delay models.arrow combinators.short-circuit math.vectors models.delay models.arrow combinators.short-circuit
parser present sequences tools.completion tools.vocabs.browser generic parser present sequences tools.completion help.vocabs generic
generic.standard.engines.tuple fonts definitions.icons ui.images generic.standard.engines.tuple fonts definitions.icons ui.images
ui.commands ui.operations ui.gadgets ui.gadgets.editors ui.commands ui.operations ui.gadgets ui.gadgets.editors
ui.gadgets.glass ui.gadgets.scrollers ui.gadgets.tables ui.gadgets.glass ui.gadgets.scrollers ui.gadgets.tables

View File

@ -1,5 +1,7 @@
USING: help.markup help.syntax ui.commands ui.operations USING: help.markup help.syntax ui.commands ui.operations
ui.gadgets.editors ui.gadgets.panes listener io words ; ui.gadgets.editors ui.gadgets.panes listener io words
ui.tools.listener.completion ui.tools.common help.tips
tools.vocabs vocabs ;
IN: ui.tools.listener IN: ui.tools.listener
HELP: interactor HELP: interactor
@ -21,11 +23,27 @@ ARTICLE: "ui-listener" "UI listener"
{ $operations \ word } { $operations \ word }
{ $heading "Vocabulary commands" } { $heading "Vocabulary commands" }
"These words operate on the vocabulary at the cursor." "These words operate on the vocabulary at the cursor."
{ $operations \ word } { $operations T{ vocab-link f "kernel" } }
{ $command-map interactor "quotation" } { $command-map interactor "quotation" }
{ $heading "Editing commands" } { $heading "Editing commands" }
"The text editing commands are standard; see " { $link "gadgets-editors-commands" } "." "The text editing commands are standard; see " { $link "gadgets-editors-commands" } "."
{ $heading "Implementation" } { $heading "Implementation" }
"Listeners are instances of " { $link listener-gadget } ". The listener consists of an output area (instance of " { $link pane } ") and an input area (instance of " { $link interactor } "). Clickable presentations can also be printed to the listener; see " { $link "ui-presentations" } "." ; "Listeners are instances of " { $link listener-gadget } ". The listener consists of an output area (instance of " { $link pane } ") and an input area (instance of " { $link interactor } "). Clickable presentations can also be printed to the listener; see " { $link "ui-presentations" } "." ;
TIP: "You can read documentation by pressing F1." ;
TIP: "The listener tool remembers previous lines of input. Press " { $command interactor "completion" recall-previous } " and " { $command interactor "completion" recall-next } " to cycle through them." ;
TIP: "When you mouse over certain objects, a block border will appear. Left-clicking on such an object will perform the default operation. Right-clicking will show a menu with all operations." ;
TIP: "The status bar displays stack effects of recognized words as they are being typed in." ;
TIP: "Press " { $command interactor "completion" code-completion-popup } " to complete word, vocabulary and Unicode character names. The latter two features become available if the cursor is after a " { $link POSTPONE: USE: } ", " { $link POSTPONE: USING: } " or " { $link POSTPONE: CHAR: } "." ;
TIP: "If a word's vocabulary is loaded, but not in the search path, you can use restarts to add the vocabulary to the search path. Auto-use mode (" { $command listener-gadget "toolbar" com-auto-use } ") invokes restarts automatically if there is only one restart." ;
TIP: "Scroll the listener from the keyboard by pressing " { $command listener-gadget "scrolling" com-page-up } " and " { $command listener-gadget "scrolling" com-page-down } "." ;
TIP: "Press " { $command tool "common" refresh-all } " or run " { $link refresh-all } " to reload changed source files from disk. " ;
ABOUT: "ui-listener" ABOUT: "ui-listener"

View File

@ -1,7 +1,7 @@
USING: continuations documents USING: continuations documents
ui.tools.listener hashtables kernel namespaces parser sequences ui.tools.listener hashtables kernel namespaces parser sequences
tools.test ui.commands ui.gadgets ui.gadgets.editors tools.test ui.commands ui.gadgets ui.gadgets.editors
ui.gadgets.panes vocabs words tools.test.ui slots.private ui.gadgets.panes vocabs words ui.gadgets.debug slots.private
threads arrays generic threads accessors listener math threads arrays generic threads accessors listener math
calendar concurrency.promises io ui.tools.common ; calendar concurrency.promises io ui.tools.common ;
IN: ui.tools.listener.tests IN: ui.tools.listener.tests

View File

@ -2,12 +2,13 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs calendar combinators locals USING: accessors arrays assocs calendar combinators locals
colors.constants combinators.short-circuit compiler.units colors.constants combinators.short-circuit compiler.units
concurrency.flags concurrency.mailboxes continuations destructors help.tips concurrency.flags concurrency.mailboxes continuations
documents documents.elements fry hashtables help help.markup io destructors documents documents.elements fry hashtables help
io.styles kernel lexer listener math models models.delay models.arrow help.markup io io.styles kernel lexer listener math models
namespaces parser prettyprint quotations sequences strings threads models.delay models.arrow namespaces parser prettyprint quotations
tools.vocabs vocabs vocabs.loader vocabs.parser words debugger ui ui.commands sequences strings threads tools.vocabs vocabs vocabs.loader
ui.pens.solid ui.gadgets ui.gadgets.glass ui.gadgets.buttons ui.gadgets.editors vocabs.parser words debugger ui ui.commands ui.pens.solid ui.gadgets
ui.gadgets.glass ui.gadgets.buttons ui.gadgets.editors
ui.gadgets.labeled ui.gadgets.panes ui.gadgets.scrollers ui.gadgets.labeled ui.gadgets.panes ui.gadgets.scrollers
ui.gadgets.status-bar ui.gadgets.tracks ui.gadgets.borders ui.gestures ui.gadgets.status-bar ui.gadgets.tracks ui.gadgets.borders ui.gestures
ui.operations ui.tools.browser ui.tools.common ui.tools.debugger ui.operations ui.tools.browser ui.tools.common ui.tools.debugger
@ -354,16 +355,11 @@ interactor "completion" f {
{ T{ key-down f { C+ } "r" } history-completion-popup } { T{ key-down f { C+ } "r" } history-completion-popup }
} define-command-map } define-command-map
: welcome. ( -- )
"If this is your first time with Factor, please read the " print
"handbook" ($link) ". To see a list of keyboard shortcuts," print
"press F1." print nl ;
: listener-thread ( listener -- ) : listener-thread ( listener -- )
dup listener-streams [ dup listener-streams [
[ com-browse ] help-hook set [ com-browse ] help-hook set
'[ [ _ input>> ] 2dip debugger-popup ] error-hook set '[ [ _ input>> ] 2dip debugger-popup ] error-hook set
welcome. tip-of-the-day. nl
listener listener
] with-streams* ; ] with-streams* ;
@ -385,7 +381,7 @@ interactor "completion" f {
[ wait-for-listener ] [ wait-for-listener ]
} cleave ; } cleave ;
: listener-help ( -- ) "ui-listener" com-browse ; : listener-help ( -- ) "help.home" com-browse ;
\ listener-help H{ { +nullary+ t } } define-command \ listener-help H{ { +nullary+ t } } define-command

View File

@ -0,0 +1,8 @@
USING: help.tips help.markup help.syntax ui.operations
tools.walker tools.time tools.profiler ui.tools.operations ;
TIP: "Press " { $operation com-stack-effect } " to print the stack effect of the code in the input field without executing it (" { $link "inference" } ")." ;
TIP: "Press " { $operation walk } " to single-step through the code in the input field (" { $link "ui-walker" } ")." ;
TIP: "Press " { $operation time } " to time execution of the code in the input field (" { $link "timing" } ")." ;

View File

@ -9,7 +9,7 @@ compiler.units accessors vocabs.parser macros.expander ui
ui.tools.browser ui.tools.listener ui.tools.listener.completion ui.tools.browser ui.tools.listener ui.tools.listener.completion
ui.tools.profiler ui.tools.inspector ui.tools.traceback ui.tools.profiler ui.tools.inspector ui.tools.traceback
ui.commands ui.gadgets.editors ui.gestures ui.operations ui.commands ui.gadgets.editors ui.gestures ui.operations
ui.tools.deploy models ; ui.tools.deploy models help.tips ;
IN: ui.tools.operations IN: ui.tools.operations
! Objects ! Objects
@ -157,8 +157,6 @@ M: word com-stack-effect 1quotation com-stack-effect ;
{ +listener+ t } { +listener+ t }
} define-operation } define-operation
: com-profile ( quot -- ) profile profiler-window ;
[ quotation? ] \ com-profile H{ [ quotation? ] \ com-profile H{
{ +keyboard+ T{ key-down f { C+ } "o" } } { +keyboard+ T{ key-down f { C+ } "o" } }
{ +listener+ t } { +listener+ t }

View File

@ -0,0 +1,11 @@
IN: ui.tools.profiler
USING: help.markup help.syntax ui.operations help.tips ;
ARTICLE: "ui.tools.profiler" "UI profiler tool"
"The " { $vocab-link "ui.tools.profiler" } " vocabulary implements a graphical tool for viewing profiling results (see " { $link "profiling" } ")."
$nl
"To use the profiler, enter a piece of code in the listener's input area and press " { $operation com-profile } "." ;
TIP: "Press " { $operation com-profile } " to run the code in the input field with profiling enabled (" { $link "ui.tools.profiler" } ")." ;
ABOUT: "ui.tools.profiler"

View File

@ -208,4 +208,6 @@ profiler-gadget "toolbar" f {
: profiler-window ( -- ) : profiler-window ( -- )
<profiler-gadget> "Profiling results" open-status-window ; <profiler-gadget> "Profiling results" open-status-window ;
: com-profile ( quot -- ) profile profiler-window ;
MAIN: profiler-window MAIN: profiler-window

View File

@ -1,7 +1,8 @@
USING: editors help.markup help.syntax summary inspector io io.styles USING: editors help.markup help.syntax summary inspector io io.styles
listener parser prettyprint tools.profiler tools.walker ui.commands listener parser prettyprint tools.profiler tools.walker ui.commands
ui.gadgets.panes ui.gadgets.presentations ui.operations ui.gadgets.panes ui.gadgets.presentations ui.operations
ui.tools.operations ui.tools.profiler ui.tools.common vocabs see ; ui.tools.operations ui.tools.profiler ui.tools.common vocabs see
help.tips ;
IN: ui.tools IN: ui.tools
ARTICLE: "starting-ui-tools" "Starting the UI tools" ARTICLE: "starting-ui-tools" "Starting the UI tools"
@ -56,8 +57,12 @@ ARTICLE: "ui-tools" "UI developer tools"
"The " { $vocab-link "ui.tools" } " vocabulary hierarchy implements a collection of simple developer tools." "The " { $vocab-link "ui.tools" } " vocabulary hierarchy implements a collection of simple developer tools."
$nl $nl
"To take full advantage of the UI tools, you should be using a supported text editor. See " { $link "editor" } "." "To take full advantage of the UI tools, you should be using a supported text editor. See " { $link "editor" } "."
$nl
"Common functionality:"
{ $subsection "ui-shortcuts" } { $subsection "ui-shortcuts" }
{ $subsection "ui-presentations" } { $subsection "ui-presentations" }
{ $subsection "definitions.icons" }
"Tools:"
{ $subsection "ui-listener" } { $subsection "ui-listener" }
{ $subsection "ui-browser" } { $subsection "ui-browser" }
{ $subsection "ui-inspector" } { $subsection "ui-inspector" }
@ -67,4 +72,6 @@ $nl
"Platform-specific features:" "Platform-specific features:"
{ $subsection "ui-cocoa" } ; { $subsection "ui-cocoa" } ;
TIP: "All UI developer tools support a common set of " { $link "ui-shortcuts" } ". Each individual tool has its own shortcuts as well; the F1 key is context-sensitive." ;
ABOUT: "ui-tools" ABOUT: "ui-tools"

View File

@ -1,4 +1,4 @@
USING: alien sequences ; USING: alien sequences alien.libraries ;
{ {
{ "advapi32" "\\windows\\coredll.dll" "stdcall" } { "advapi32" "\\windows\\coredll.dll" "stdcall" }
{ "gdi32" "\\windows\\coredll.dll" "stdcall" } { "gdi32" "\\windows\\coredll.dll" "stdcall" }
@ -10,6 +10,5 @@ USING: alien sequences ;
{ "libm" "\\windows\\coredll.dll" "stdcall" } { "libm" "\\windows\\coredll.dll" "stdcall" }
! { "gl" "libGLES_CM.dll" "stdcall" } ! { "gl" "libGLES_CM.dll" "stdcall" }
! { "glu" "libGLES_CM.dll" "stdcall" } ! { "glu" "libGLES_CM.dll" "stdcall" }
! { "freetype" "libfreetype-6.dll" "stdcall" }
{ "ole32" "ole32.dll" "stdcall" } { "ole32" "ole32.dll" "stdcall" }
} [ first3 add-library ] each } [ first3 add-library ] each

View File

@ -832,7 +832,7 @@ SYMBOLS:
define-keyboard-format-constant define-keyboard-format-constant
define-hid-keyboard-format-constant ; define-hid-keyboard-format-constant ;
: define-constants : define-constants ( -- )
define-guid-constants define-guid-constants
define-format-constants ; define-format-constants ;

View File

@ -2,12 +2,6 @@ USING: windows.kernel32 windows.ole32 windows.com windows.com.syntax
alien alien.c-types alien.syntax kernel system namespaces math ; alien alien.c-types alien.syntax kernel system namespaces math ;
IN: windows.dinput IN: windows.dinput
<<
os windows?
[ "dinput" "dinput8.dll" "stdcall" add-library ]
when
>>
LIBRARY: dinput LIBRARY: dinput
TYPEDEF: void* LPDIENUMDEVICESCALLBACKW TYPEDEF: void* LPDIENUMDEVICESCALLBACKW
@ -27,15 +21,15 @@ TYPEDEF: void* LPDIENUMEFFECTSCALLBACKW
[ "BOOL" { "LPCDIEFFECTINFOW" "LPVOID" } "stdcall" ] [ "BOOL" { "LPCDIEFFECTINFOW" "LPVOID" } "stdcall" ]
dip alien-callback ; inline dip alien-callback ; inline
TYPEDEF: void* LPDIENUMCREATEDEFFECTOBJECTSCALLBACK TYPEDEF: void* LPDIENUMCREATEDEFFECTOBJECTSCALLBACK
: LPDIENUMCREATEDEFFECTOBJECTSCALLBACK : LPDIENUMCREATEDEFFECTOBJECTSCALLBACK ( quot -- callback )
[ "BOOL" { "LPDIRECTINPUTEFFECT" "LPVOID" } "stdcall" ] [ "BOOL" { "LPDIRECTINPUTEFFECT" "LPVOID" } "stdcall" ]
dip alien-callback ; inline dip alien-callback ; inline
TYPEDEF: void* LPDIENUMEFFECTSINFILECALLBACK TYPEDEF: void* LPDIENUMEFFECTSINFILECALLBACK
: LPDIENUMEFFECTSINFILECALLBACK : LPDIENUMEFFECTSINFILECALLBACK ( quot -- callback )
[ "BOOL" { "LPCDIFILEEFFECT" "LPVOID" } "stdcall" ] [ "BOOL" { "LPCDIFILEEFFECT" "LPVOID" } "stdcall" ]
dip alien-callback ; inline dip alien-callback ; inline
TYPEDEF: void* LPDIENUMDEVICEOBJECTSCALLBACKW TYPEDEF: void* LPDIENUMDEVICEOBJECTSCALLBACKW
: LPDIENUMDEVICEOBJECTSCALLBACKW : LPDIENUMDEVICEOBJECTSCALLBACKW ( quot -- callback )
[ "BOOL" { "LPCDIDEVICEOBJECTINSTANCEW" "LPVOID" } "stdcall" ] [ "BOOL" { "LPCDIDEVICEOBJECTINSTANCEW" "LPVOID" } "stdcall" ]
dip alien-callback ; inline dip alien-callback ; inline

View File

@ -1,6 +1,7 @@
USING: alien sequences ; USING: alien sequences alien.libraries ;
{ {
{ "advapi32" "advapi32.dll" "stdcall" } { "advapi32" "advapi32.dll" "stdcall" }
{ "dinput" "dinput8.dll" "stdcall" }
{ "gdi32" "gdi32.dll" "stdcall" } { "gdi32" "gdi32.dll" "stdcall" }
{ "user32" "user32.dll" "stdcall" } { "user32" "user32.dll" "stdcall" }
{ "kernel32" "kernel32.dll" "stdcall" } { "kernel32" "kernel32.dll" "stdcall" }

View File

@ -1,7 +1,7 @@
USING: byte-arrays arrays help.syntax help.markup USING: byte-arrays arrays help.syntax help.markup
alien.syntax compiler definitions math libc alien.syntax compiler definitions math libc eval
debugger parser io io.backend system debugger parser io io.backend system alien.accessors
alien.accessors eval ; alien.libraries ;
IN: alien IN: alien
HELP: alien HELP: alien
@ -22,16 +22,6 @@ HELP: <bad-alien>
{ $values { "alien" c-ptr } } { $values { "alien" c-ptr } }
{ $description "Constructs an invalid alien pointer that has expired." } ; { $description "Constructs an invalid alien pointer that has expired." } ;
HELP: <library>
{ $values
{ "path" "a pathname string" } { "abi" "the ABI used by the library, either " { $snippet "cdecl" } " or " { $snippet "stdcall" } }
{ "library" library } }
{ $description "Opens a C library using the path and ABI parameters and outputs a library tuple." }
{ $notes "User code should use " { $link add-library } " so that the opened library is added to a global hashtable, " { $link libraries } "." } ;
HELP: libraries
{ $description "A global hashtable that keeps a list of open libraries. Use the " { $link add-library } " word to construct a library and add it with a single call." } ;
HELP: <displaced-alien> ( displacement c-ptr -- alien ) HELP: <displaced-alien> ( displacement c-ptr -- alien )
{ $values { "displacement" "an integer" } { "c-ptr" c-ptr } { "alien" "a new alien" } } { $values { "displacement" "an integer" } { "c-ptr" c-ptr } { "alien" "a new alien" } }
{ $description "Creates a new alien address object, wrapping a raw memory address. The alien points to a location in memory which is offset by " { $snippet "displacement" } " from the address of " { $snippet "c-ptr" } "." } { $description "Creates a new alien address object, wrapping a raw memory address. The alien points to a location in memory which is offset by " { $snippet "displacement" } " from the address of " { $snippet "c-ptr" } "." }
@ -54,61 +44,6 @@ HELP: <alien>
HELP: c-ptr HELP: c-ptr
{ $class-description "Class of objects consisting of aliens, byte arrays and " { $link f } ". These objects can convert to pointer C types, which are all aliases of " { $snippet "void*" } "." } ; { $class-description "Class of objects consisting of aliens, byte arrays and " { $link f } ". These objects can convert to pointer C types, which are all aliases of " { $snippet "void*" } "." } ;
HELP: library
{ $values { "name" "a string" } { "library" "a hashtable" } }
{ $description "Looks up a library by its logical name. The library object is a hashtable with the following keys:"
{ $list
{ { $snippet "name" } " - the full path of the C library binary" }
{ { $snippet "abi" } " - the ABI used by the library, either " { $snippet "cdecl" } " or " { $snippet "stdcall" } }
{ { $snippet "dll" } " - an instance of the " { $link dll } " class; only set if the library is loaded" }
}
} ;
HELP: dlopen ( path -- dll )
{ $values { "path" "a pathname string" } { "dll" "a DLL handle" } }
{ $description "Opens a native library and outputs a handle which may be passed to " { $link dlsym } " or " { $link dlclose } "." }
{ $errors "Throws an error if the library could not be found, or if loading fails for some other reason." }
{ $notes "This is the low-level facility used to implement " { $link load-library } ". Use the latter instead." } ;
HELP: dlsym ( name dll -- alien )
{ $values { "name" "a C symbol name" } { "dll" "a DLL handle" } { "alien" "an alien pointer" } }
{ $description "Looks up a symbol in a native library. If " { $snippet "dll" } " is " { $link f } " looks for the symbol in the runtime executable." }
{ $errors "Throws an error if the symbol could not be found." } ;
HELP: dlclose ( dll -- )
{ $values { "dll" "a DLL handle" } }
{ $description "Closes a DLL handle created by " { $link dlopen } ". This word might not be implemented on all platforms." } ;
HELP: load-library
{ $values { "name" "a string" } { "dll" "a DLL handle" } }
{ $description "Loads a library by logical name and outputs a handle which may be passed to " { $link dlsym } " or " { $link dlclose } ". If the library is already loaded, returns the existing handle." } ;
HELP: add-library
{ $values { "name" "a string" } { "path" "a string" } { "abi" "one of " { $snippet "\"cdecl\"" } " or " { $snippet "\"stdcall\"" } } }
{ $description "Defines a new logical library named " { $snippet "name" } " located in the file system at " { $snippet "path" } "and the specified ABI." }
{ $notes "Because the entire source file is parsed before top-level forms are executed, " { $link add-library } " cannot be used in the same file as " { $link POSTPONE: FUNCTION: } " definitions from that library. The " { $link add-library } " call will happen too late, after compilation, and the alien calls will not work."
$nl
"Instead, " { $link add-library } " calls must either be placed in different source files from those that use that library, or alternatively, " { $link "syntax-immediate" } " can be used to load the library before compilation." }
{ $examples "Here is a typical usage of " { $link add-library } ":"
{ $code
"<< \"freetype\" {"
" { [ os macosx? ] [ \"libfreetype.6.dylib\" \"cdecl\" add-library ] }"
" { [ os windows? ] [ \"freetype6.dll\" \"cdecl\" add-library ] }"
" [ drop ]"
"} cond >>"
}
"Note the parse time evaluation with " { $link POSTPONE: << } "." } ;
HELP: alien-invoke-error
{ $error-description "Thrown if the word calling " { $link alien-invoke } " was not compiled with the optimizing compiler. This may be a result of one of several failure conditions:"
{ $list
{ "This can happen when experimenting with " { $link alien-invoke } " in this listener. To fix the problem, place the " { $link alien-invoke } " call in a word; word definitions are automatically compiled with the optimizing compiler." }
{ "The return type or parameter list references an unknown C type." }
{ "The symbol or library could not be found." }
{ "One of the four inputs to " { $link alien-invoke } " is not a literal value. To call functions which are not known at compile-time, use " { $link alien-indirect } "." }
}
} ;
HELP: alien-invoke HELP: alien-invoke
{ $values { "..." "zero or more objects passed to the C function" } { "return" "a C return type" } { "library" "a logical library name" } { "function" "a C function name" } { "parameters" "a sequence of C parameter types" } } { $values { "..." "zero or more objects passed to the C function" } { "return" "a C return type" } { "library" "a logical library name" } { "function" "a C function name" } { "parameters" "a sequence of C parameter types" } }
{ $description "Calls a C library function with the given name. Input parameters are taken from the data stack, and the return value is pushed on the data stack after the function returns. A return type of " { $snippet "\"void\"" } " indicates that no value is to be expected." } { $description "Calls a C library function with the given name. Input parameters are taken from the data stack, and the return value is pushed on the data stack after the function returns. A return type of " { $snippet "\"void\"" } " indicates that no value is to be expected." }
@ -226,6 +161,16 @@ ARTICLE: "alien-invoke" "Calling C from Factor"
{ $subsection alien-indirect } { $subsection alien-indirect }
"There are some details concerning the conversion of Factor objects to C values, and vice versa. See " { $link "c-data" } "." ; "There are some details concerning the conversion of Factor objects to C values, and vice versa. See " { $link "c-data" } "." ;
HELP: alien-invoke-error
{ $error-description "Thrown if the word calling " { $link alien-invoke } " was not compiled with the optimizing compiler. This may be a result of one of several failure conditions:"
{ $list
{ "This can happen when experimenting with " { $link alien-invoke } " in this listener. To fix the problem, place the " { $link alien-invoke } " call in a word; word definitions are automatically compiled with the optimizing compiler." }
{ "The return type or parameter list references an unknown C type." }
{ "The symbol or library could not be found." }
{ "One of the four inputs to " { $link alien-invoke } " is not a literal value. To call functions which are not known at compile-time, use " { $link alien-indirect } "." }
}
} ;
ARTICLE: "alien-callback-gc" "Callbacks and code GC" ARTICLE: "alien-callback-gc" "Callbacks and code GC"
"A callback consits of two parts; the callback word, which pushes the address of the callback on the stack when executed, and the callback body itself. If the callback word is redefined, removed from the dictionary using " { $link forget } ", or recompiled, the callback body will not be reclaimed by the garbage collector, since potentially C code may be holding a reference to the callback body." "A callback consits of two parts; the callback word, which pushes the address of the callback on the stack when executed, and the callback body itself. If the callback word is redefined, removed from the dictionary using " { $link forget } ", or recompiled, the callback body will not be reclaimed by the garbage collector, since potentially C code may be holding a reference to the callback body."
$nl $nl

View File

@ -1,7 +1,7 @@
IN: alien.tests
USING: accessors alien alien.accessors alien.syntax byte-arrays arrays USING: accessors alien alien.accessors alien.syntax byte-arrays arrays
kernel kernel.private namespaces tools.test sequences libc math kernel kernel.private namespaces tools.test sequences libc math
system prettyprint layouts ; system prettyprint layouts alien.libraries ;
IN: alien.tests
[ t ] [ -1 <alien> alien-address 0 > ] unit-test [ t ] [ -1 <alien> alien-address 0 > ] unit-test

View File

@ -49,23 +49,6 @@ M: alien equal?
2drop f 2drop f
] if ; ] if ;
SYMBOL: libraries
libraries [ H{ } clone ] initialize
TUPLE: library path abi dll ;
: library ( name -- library ) libraries get at ;
: <library> ( path abi -- library )
over dup [ dlopen ] when \ library boa ;
: load-library ( name -- dll )
library dup [ dll>> ] when ;
: add-library ( name path abi -- )
<library> swap libraries get set-at ;
ERROR: alien-callback-error ; ERROR: alien-callback-error ;
: alien-callback ( return parameters abi quot -- alien ) : alien-callback ( return parameters abi quot -- alien )

View File

@ -62,6 +62,7 @@ bootstrapping? on
{ {
"alien" "alien"
"alien.accessors" "alien.accessors"
"alien.libraries"
"arrays" "arrays"
"byte-arrays" "byte-arrays"
"classes.private" "classes.private"
@ -458,9 +459,9 @@ tuple
{ "code-room" "memory" (( -- code-free code-total )) } { "code-room" "memory" (( -- code-free code-total )) }
{ "micros" "system" (( -- us )) } { "micros" "system" (( -- us )) }
{ "modify-code-heap" "compiler.units" (( alist -- )) } { "modify-code-heap" "compiler.units" (( alist -- )) }
{ "dlopen" "alien" (( path -- dll )) } { "dlopen" "alien.libraries" (( path -- dll )) }
{ "dlsym" "alien" (( name dll -- alien )) } { "dlsym" "alien.libraries" (( name dll -- alien )) }
{ "dlclose" "alien" (( dll -- )) } { "dlclose" "alien.libraries" (( dll -- )) }
{ "<byte-array>" "byte-arrays" (( n -- byte-array )) } { "<byte-array>" "byte-arrays" (( n -- byte-array )) }
{ "(byte-array)" "byte-arrays" (( n -- byte-array )) } { "(byte-array)" "byte-arrays" (( n -- byte-array )) }
{ "<displaced-alien>" "alien" (( displacement c-ptr -- alien )) } { "<displaced-alien>" "alien" (( displacement c-ptr -- alien )) }

View File

@ -166,7 +166,9 @@ SYMBOL: interactive-vocabs
"definitions" "definitions"
"editors" "editors"
"help" "help"
"help.apropos"
"help.lint" "help.lint"
"help.vocabs"
"inspector" "inspector"
"io" "io"
"io.files" "io.files"
@ -186,7 +188,6 @@ SYMBOL: interactive-vocabs
"strings" "strings"
"syntax" "syntax"
"tools.annotations" "tools.annotations"
"tools.apropos"
"tools.crossref" "tools.crossref"
"tools.disassembler" "tools.disassembler"
"tools.memory" "tools.memory"

View File

@ -1,6 +1,6 @@
USING: arrays byte-arrays help.markup help.syntax USING: arrays byte-arrays help.markup help.syntax
kernel kernel.private strings.private sequences vectors kernel kernel.private strings.private sequences vectors
sbufs math tools.vocabs.browser ; sbufs math help.vocabs ;
IN: strings IN: strings
ARTICLE: "strings" "Strings" ARTICLE: "strings" "Strings"

View File

@ -56,6 +56,7 @@ $nl
"Application vocabularies can define a main entry point, giving the user a convenient way to run the application:" "Application vocabularies can define a main entry point, giving the user a convenient way to run the application:"
{ $subsection POSTPONE: MAIN: } { $subsection POSTPONE: MAIN: }
{ $subsection run } { $subsection run }
{ $subsection runnable-vocab }
{ $see-also "vocabularies" "parser-files" "source-files" } ; { $see-also "vocabularies" "parser-files" "source-files" } ;
ABOUT: "vocabs.loader" ABOUT: "vocabs.loader"

View File

@ -96,3 +96,6 @@ $nl
HELP: >vocab-link HELP: >vocab-link
{ $values { "name" string } { "vocab" "a vocabulary specifier" } } { $values { "name" string } { "vocab" "a vocabulary specifier" } }
{ $description "If the vocabulary is loaded, outputs the corresponding " { $link vocab } " instance, otherwise creates a new " { $link vocab-link } "." } ; { $description "If the vocabulary is loaded, outputs the corresponding " { $link vocab } " instance, otherwise creates a new " { $link vocab-link } "." } ;
HELP: runnable-vocab
{ $class-description "The class of vocabularies with a " { $slot "main" } " word." } ;

View File

@ -106,3 +106,6 @@ M: vocab-spec forget* forget-vocab ;
SYMBOL: load-vocab-hook ! ( name -- vocab ) SYMBOL: load-vocab-hook ! ( name -- vocab )
: load-vocab ( name -- vocab ) load-vocab-hook get call( name -- vocab ) ; : load-vocab ( name -- vocab ) load-vocab-hook get call( name -- vocab ) ;
PREDICATE: runnable-vocab < vocab
vocab-main >boolean ;

View File

@ -0,0 +1 @@
Slava Pestov

View File

@ -0,0 +1,65 @@
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: slides help.markup ;
IN: chicago-talk
CONSTANT: chicago-slides
{
{ $slide "factor"
{ $url "http://factorcode.org" }
}
{ $slide "goals"
"high level language"
"expressive and extensible"
"reasonable performance"
"interactive development with arbitrary redefinition"
"standalone app deployment (strip out compiler and REPL)"
}
{ $slide "challenges"
"higher-order functions"
"dynamic typing"
"memory allocation"
"float boxing/unboxing"
"integer overflow checks"
"user-defined abstractions"
}
{ $slide "implementation"
"VM: 12 kloc of C, library: >100 kloc of Factor"
"generational copying garbage collection, card marking write barrier"
"full continuations, tail calls"
"simple non-optimizing “bootstrap” compiler"
"optimizing compiler"
}
{ $slide "optimizing compiler"
"about 12,000 lines of Factor code"
"targets x86-32, x86-64, PowerPC"
"factor code ⇒ high-level SSA ⇒ low-level SSA ⇒ machine code"
}
{ $slide "high-level optimizer"
"macro expansion, defunctionalization"
"type and interval inference, sparse conditional constant propagation, method inlining"
"escape analysis and tuple unboxing"
}
{ $slide "low-level optimizer"
"alias analysis, value numbering, write barrier elimination"
"linear scan register allocation"
}
}
: chicago-talk ( -- ) chicago-slides slides-window ;
MAIN: chicago-talk

View File

@ -1,6 +1,7 @@
! Copyright (C) 2008 Doug Coleman. ! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien alien.syntax combinators kernel system ; USING: accessors alien alien.syntax combinators kernel system
alien.libraries ;
IN: curses.ffi IN: curses.ffi
<< "curses" { << "curses" {

View File

@ -1,6 +1,6 @@
USING: kernel fry sequences USING: kernel fry sequences
vocabs.loader tools.vocabs.browser vocabs.loader help.vocabs
ui ui.gadgets ui.gadgets.buttons ui.gadgets.packs ui.gadgets.scrollers ui ui.gadgets ui.gadgets.buttons ui.gadgets.packs ui.gadgets.scrollers
ui.tools.listener ui.tools.listener
accessors ; accessors ;

1
extra/ecdsa/tags.txt Normal file
View File

@ -0,0 +1 @@
unportable

View File

@ -1,6 +1,7 @@
! Copyright (C) 2005, 2007 Slava Pestov. ! Copyright (C) 2005, 2007 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.syntax kernel system combinators ; USING: alien alien.syntax kernel system combinators
alien.libraries ;
IN: freetype IN: freetype
<< "freetype" { << "freetype" {

View File

@ -3,7 +3,7 @@
USING: accessors arrays assocs combinators help help.crossref USING: accessors arrays assocs combinators help help.crossref
help.markup help.topics io io.streams.string kernel make namespaces help.markup help.topics io io.streams.string kernel make namespaces
parser prettyprint sequences summary tools.vocabs tools.vocabs.browser parser prettyprint sequences summary tools.vocabs help.vocabs
vocabs vocabs.loader words see ; vocabs vocabs.loader words see ;
IN: fuel.help IN: fuel.help

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: slides help.markup math arrays hashtables namespaces USING: slides help.markup math arrays hashtables namespaces
sequences kernel sequences parser memoize io.encodings.binary sequences kernel sequences parser memoize io.encodings.binary
locals kernel.private tools.vocabs.browser assocs quotations locals kernel.private help.vocabs assocs quotations
urls peg.ebnf tools.vocabs tools.annotations tools.crossref urls peg.ebnf tools.vocabs tools.annotations tools.crossref
help.topics math.functions compiler.tree.optimizer help.topics math.functions compiler.tree.optimizer
compiler.cfg.optimizer fry ; compiler.cfg.optimizer fry ;

View File

@ -2,10 +2,10 @@ USING: windows.dinput windows.dinput.constants parser
alien.c-types windows.ole32 namespaces assocs kernel arrays alien.c-types windows.ole32 namespaces assocs kernel arrays
vectors windows.kernel32 windows.com windows.dinput shuffle vectors windows.kernel32 windows.com windows.dinput shuffle
windows.user32 windows.messages sequences combinators locals windows.user32 windows.messages sequences combinators locals
math.rectangles ui.windows accessors math windows alien math.rectangles accessors math windows alien
alien.strings io.encodings.utf16 io.encodings.utf16n alien.strings io.encodings.utf16 io.encodings.utf16n
continuations byte-arrays game-input.dinput.keys-array continuations byte-arrays game-input.dinput.keys-array
game-input ; game-input ui.backend.windows ;
IN: game-input.dinput IN: game-input.dinput
SINGLETON: dinput-game-input-backend SINGLETON: dinput-game-input-backend

View File

@ -35,7 +35,7 @@ PRIVATE>
] when ; ] when ;
: with-game-input ( quot -- ) : with-game-input ( quot -- )
open-game-input [ close-game-input ] [ ] cleanup ; open-game-input [ close-game-input ] [ ] cleanup ; inline
TUPLE: controller handle ; TUPLE: controller handle ;
TUPLE: controller-state x y z rx ry rz slider pov buttons ; TUPLE: controller-state x y z rx ry rz slider pov buttons ;

Some files were not shown because too many files have changed in this diff Show More