-! Copyright (C) 2006, 2007 Slava Pestov.
+! Copyright (C) 2006, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
-USING: continuations definitions ui.tools.browser
-ui.tools.interactor ui.tools.listener ui.tools.profiler
-ui.tools.search ui.tools.traceback ui.tools.workspace generic
-help.topics stack-checker summary inspector io.pathnames
-io.styles kernel namespaces parser prettyprint quotations
-tools.annotations editors tools.profiler tools.test tools.time
-tools.walker ui.commands ui.gadgets.editors ui.gestures
-ui.operations ui.tools.deploy vocabs vocabs.loader words
-sequences tools.vocabs classes compiler.units accessors
-vocabs.parser ;
+USING: continuations definitions generic help.topics threads
+stack-checker summary io.pathnames io.styles kernel namespaces
+parser prettyprint quotations tools.crossref tools.annotations
+editors tools.profiler tools.test tools.time tools.walker vocabs
+vocabs.loader words sequences tools.vocabs classes
+compiler.units accessors vocabs.parser macros.expander ui
+ui.tools.browser ui.tools.listener ui.tools.listener.completion
+ui.tools.profiler ui.tools.inspector ui.tools.traceback
+ui.commands ui.gadgets.editors ui.gestures ui.operations
+ui.tools.deploy models ;
IN: ui.tools.operations
! Objects
-[ drop t ] \ inspect H{
+[ drop t ] \ inspector H{
{ +primary+ t }
- { +listener+ t }
} define-operation
: com-prettyprint ( obj -- ) . ;
[ drop t ] \ com-unparse H{ } define-operation
-! Input
+! Models
+[ model? ] \ inspect-model H{
+ { +primary+ t }
+} define-operation
+! Input
: com-input ( obj -- ) string>> listener-input ;
[ input? ] \ com-input H{
{ +secondary+ t }
} define-operation
+! Thread
+: com-thread-traceback-window ( thread -- )
+ continuation>> dup occupied>>
+ [ value>> traceback-window ]
+ [ drop beep ]
+ if ;
+
+[ thread? ] \ com-thread-traceback-window H{
+ { +primary+ t }
+ { +secondary+ t }
+} define-operation
+
! Pathnames
: edit-file ( pathname -- ) edit ;
[ pathname? ] \ edit-file H{
- { +keyboard+ T{ key-down f { C+ } "E" } }
+ { +keyboard+ T{ key-down f { C+ } "e" } }
{ +primary+ t }
{ +secondary+ t }
{ +listener+ t }
UNION: definition word method-spec link vocab vocab-link ;
[ definition? ] \ edit H{
- { +keyboard+ T{ key-down f { C+ } "E" } }
+ { +keyboard+ T{ key-down f { C+ } "e" } }
{ +listener+ t }
} define-operation
[ definition? ] \ com-forget H{ } define-operation
-! Words
-[ word? ] \ insert-word H{
- { +secondary+ t }
-} define-operation
-
[ topic? ] \ com-follow H{
- { +keyboard+ T{ key-down f { C+ } "H" } }
+ { +keyboard+ T{ key-down f { C+ } "h" } }
{ +primary+ t }
} define-operation
-: com-usage ( word -- )
- get-workspace swap show-word-usage ;
-
-[ word? ] \ com-usage H{
- { +keyboard+ T{ key-down f { C+ } "U" } }
+[ word? ] \ usage. H{
+ { +keyboard+ T{ key-down f { C+ } "u" } }
+ { +listener+ t }
} define-operation
[ word? ] \ fix H{
- { +keyboard+ T{ key-down f { C+ } "F" } }
+ { +keyboard+ T{ key-down f { C+ } "f" } }
{ +listener+ t }
} define-operation
M: quotation com-stack-effect infer. ;
-M: word com-stack-effect def>> com-stack-effect ;
-
-[ word? ] \ com-stack-effect H{
- { +listener+ t }
-} define-operation
-
-! Vocabularies
-: com-vocab-words ( vocab -- )
- get-workspace swap show-vocab-words ;
-
-[ vocab? ] \ com-vocab-words H{
- { +secondary+ t }
- { +keyboard+ T{ key-down f { C+ } "B" } }
-} define-operation
+M: word com-stack-effect 1quotation com-stack-effect ;
: com-enter-in ( vocab -- ) vocab-name set-in ;
[ vocab? ] \ com-enter-in H{
- { +keyboard+ T{ key-down f { C+ } "I" } }
{ +listener+ t }
} define-operation
} define-operation
[ vocab-spec? ] \ run H{
- { +keyboard+ T{ key-down f { C+ } "R" } }
{ +listener+ t }
} define-operation
[ vocab? ] \ test H{
- { +keyboard+ T{ key-down f { C+ } "T" } }
{ +listener+ t }
} define-operation
{ +listener+ t }
} define-operation
-: com-show-profile ( workspace -- )
- profiler-gadget call-tool ;
-
-: com-profile ( quot -- ) profile f com-show-profile ;
+: com-profile ( quot -- ) profile profiler-window ;
[ quotation? ] \ com-profile H{
- { +keyboard+ T{ key-down f { C+ } "r" } }
+ { +keyboard+ T{ key-down f { C+ } "o" } }
{ +listener+ t }
} define-operation
-! Profiler presentations
-[ dup usage-profile? swap vocab-profile? or ]
-\ com-show-profile H{ { +primary+ t } } define-operation
+: com-expand-macros ( quot -- ) expand-macros . ;
-! Operations -> commands
-source-editor
-"word"
-"These commands operate on the Factor word named by the token at the caret position."
-\ selected-word
-[ selected-word ]
-[ dup search [ ] [ no-word ] ?if ]
-define-operation-map
+[ quotation? ] \ com-expand-macros H{
+ { +keyboard+ T{ key-down f { C+ } "m" } }
+ { +listener+ t }
+} define-operation
+! Operations -> commands
interactor
"quotation"
"These commands operate on the entire contents of the input area."
[ ]
[ quot-action ]
-[ [ parse-lines ] with-compilation-unit ]
define-operation-map