From 7660f5ada949d42d8e263a0817cd59d88c308dc6 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Sun, 26 Dec 2004 23:57:57 +0000 Subject: [PATCH] graphical console; start factor with -graphical switch --- library/bootstrap/boot-stage2.factor | 1 + library/bootstrap/init-stage2.factor | 16 +++++++++++----- {examples => library/sdl}/console.factor | 5 ++--- 3 files changed, 14 insertions(+), 8 deletions(-) rename {examples => library/sdl}/console.factor (99%) diff --git a/library/bootstrap/boot-stage2.factor b/library/bootstrap/boot-stage2.factor index c8c77cd940..039633bafc 100644 --- a/library/bootstrap/boot-stage2.factor +++ b/library/bootstrap/boot-stage2.factor @@ -136,6 +136,7 @@ USE: namespaces "/library/sdl/sdl-keyboard.factor" "/library/sdl/sdl-utils.factor" "/library/sdl/hsv.factor" + "/library/sdl/console.factor" "/library/bootstrap/image.factor" diff --git a/library/bootstrap/init-stage2.factor b/library/bootstrap/init-stage2.factor index 3bb64a86e6..ee8ff08ef7 100644 --- a/library/bootstrap/init-stage2.factor +++ b/library/bootstrap/init-stage2.factor @@ -43,6 +43,7 @@ USE: presentation USE: words USE: unparser USE: kernel-internals +USE: console : init-smart-terminal "smart-terminal" get [ @@ -56,15 +57,20 @@ USE: kernel-internals init-error-handler init-random default-cli-args - parse-command-line - init-smart-terminal - run-user-init ; + parse-command-line ; -: auto-inline-count 3 ; [ warm-boot garbage-collection - "interactive" get [ print-banner listener ] when + init-smart-terminal + run-user-init + "graphical" get [ + start-console + ] [ + "interactive" get [ + print-banner listener + ] when + ] ifte 0 exit* ] set-boot diff --git a/examples/console.factor b/library/sdl/console.factor similarity index 99% rename from examples/console.factor rename to library/sdl/console.factor index 3c158c8a40..ad9d569925 100644 --- a/examples/console.factor +++ b/library/sdl/console.factor @@ -11,7 +11,8 @@ ! Then, start Factor as usual (./f factor.image) and enter this ! at the listener: ! -! "examples/console.factor" run-file +! USE: console +! start-console IN: console USE: generic @@ -267,5 +268,3 @@ M: alien handle-event ( event -- ? ) console-quit ] bind ] callcc0 ; - -start-console