1 ! Copyright (C) 2006, 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: continuations definitions generic help.topics threads
4 stack-checker summary io.pathnames io.styles kernel namespaces
5 parser prettyprint quotations tools.crossref tools.annotations
6 editors tools.profiler tools.test tools.time tools.walker vocabs
7 vocabs.loader words sequences tools.vocabs classes
8 compiler.units accessors vocabs.parser macros.expander ui
9 ui.tools.browser ui.tools.listener ui.tools.listener.completion
10 ui.tools.profiler ui.tools.inspector ui.tools.traceback
11 ui.commands ui.gadgets.editors ui.gestures ui.operations
12 ui.tools.deploy models help.tips ;
13 IN: ui.tools.operations
16 [ drop t ] \ inspector H{
20 : com-prettyprint ( obj -- ) . ;
22 [ drop t ] \ com-prettyprint H{
26 : com-push ( obj -- obj ) ;
28 [ drop t ] \ com-push H{
32 : com-unparse ( obj -- ) unparse listener-input ;
34 [ drop t ] \ com-unparse H{ } define-operation
37 [ model? ] \ inspect-model H{
42 : com-input ( obj -- ) string>> listener-input ;
44 [ input? ] \ com-input H{
50 [ restart? ] \ restart H{
57 [ continuation? ] \ traceback-window H{
63 : com-thread-traceback-window ( thread -- )
64 continuation>> dup occupied>>
65 [ value>> traceback-window ]
69 [ thread? ] \ com-thread-traceback-window H{
75 : edit-file ( pathname -- ) edit ;
77 [ pathname? ] \ edit-file H{
78 { +keyboard+ T{ key-down f { C+ } "e" } }
84 UNION: definition word method-spec link vocab vocab-link ;
86 [ definition? ] \ edit H{
87 { +keyboard+ T{ key-down f { C+ } "e" } }
91 : com-forget ( defspec -- )
92 [ forget ] with-compilation-unit ;
94 [ definition? ] \ com-forget H{ } define-operation
96 [ topic? ] \ com-browse H{
97 { +keyboard+ T{ key-down f { C+ } "h" } }
101 [ word? ] \ usage. H{
102 { +keyboard+ T{ key-down f { C+ } "u" } }
107 { +keyboard+ T{ key-down f { C+ } "f" } }
111 [ word? ] \ watch H{ } define-operation
113 [ word? ] \ breakpoint H{ } define-operation
115 GENERIC: com-stack-effect ( obj -- )
117 M: quotation com-stack-effect infer. ;
119 M: word com-stack-effect 1quotation com-stack-effect ;
121 : com-enter-in ( vocab -- ) vocab-name set-in ;
123 [ vocab? ] \ com-enter-in H{
127 : com-use-vocab ( vocab -- ) vocab-name use+ ;
129 [ vocab-spec? ] \ com-use-vocab H{
134 [ vocab-spec? ] \ run H{
142 [ vocab-spec? ] \ deploy-tool H{ } define-operation
145 [ quotation? ] \ com-stack-effect H{
146 { +keyboard+ T{ key-down f { C+ } "i" } }
150 [ quotation? ] \ walk H{
151 { +keyboard+ T{ key-down f { C+ } "w" } }
155 [ quotation? ] \ time H{
156 { +keyboard+ T{ key-down f { C+ } "t" } }
160 [ quotation? ] \ com-profile H{
161 { +keyboard+ T{ key-down f { C+ } "o" } }
165 : com-expand-macros ( quot -- ) expand-macros . ;
167 [ quotation? ] \ com-expand-macros H{
168 { +keyboard+ T{ key-down f { C+ } "m" } }
172 ! Operations -> commands
175 "These commands operate on the entire contents of the input area."