Unix socket fix, minor UI fixes

cvs
Slava Pestov 2005-04-30 18:27:40 +00:00
parent 87236e842b
commit a4579c38b5
9 changed files with 15 additions and 14 deletions

View File

@ -3,7 +3,6 @@
- faster layout
- faster repaint
- forgotten words not removed from cross-reference
- freebsd 4 -pthread errno
- implement fcopy
- win32 updates

View File

@ -5,10 +5,6 @@ lists namespaces parser sequences stdio unparser words ;
"Bootstrap stage 3..." print
os "freebsd" = [
"libc" "libc.so" "cdecl" add-library
] when
unix? [
"sdl" "libSDL.so" "cdecl" add-library
"sdl-gfx" "libSDL_gfx.so" "cdecl" add-library

View File

@ -5,6 +5,10 @@ USING: errors generic hashtables kernel kernel-internals lists
math namespaces prettyprint sequences stdio unparser vectors
words ;
: save
#! Save the current image.
"image" get save-image ;
! Printing an overview of heap usage.
: kb. 1024 /i unparse write " KB" write ;

View File

@ -5,7 +5,7 @@ USING: alien generic kernel lists math namespaces sdl sequences ;
GENERIC: handle-event ( event -- )
M: alien handle-event ( event -- )
M: object handle-event ( event -- )
drop ;
M: quit-event handle-event ( event -- )

View File

@ -20,7 +20,12 @@ C: gadget ( shape -- gadget )
: redraw ( gadget -- )
#! Redraw a gadget before the next iteration of the event
#! loop.
t over set-gadget-redraw? gadget-parent [ redraw ] when* ;
dup gadget-redraw? [
t over set-gadget-redraw?
gadget-parent [ redraw ] when*
] [
drop
] ifte ;
: relayout ( gadget -- )
#! Relayout a gadget before the next iteration of the event

View File

@ -63,6 +63,7 @@ SYMBOL: clip
#! All drawing done inside draw-shape is done with the
#! gadget's paint. If the gadget does not have any custom
#! paint, just call the quotation.
f over set-gadget-redraw?
dup gadget-paint [
dup [
[

View File

@ -14,7 +14,7 @@ SYMBOL: root-menu
[
[[ "Listener" [ <console> "Listener" <tile> world get add-gadget ] ]]
[[ "Globals" [ global inspect ] ]]
[[ "Save image" [ "image" get save-image ] ]]
[[ "Save image" [ save ] ]]
[[ "Exit" [ f world get set-world-running? ] ]]
] root-menu set

View File

@ -24,11 +24,7 @@ M: world inside? ( point world -- ? ) 2drop t ;
: draw-world ( world -- )
dup gadget-redraw? [
[
f over set-gadget-redraw?
dup draw-gadget
dup gadget-paint [ world-hand draw-gadget ] bind
] with-surface
[ dup draw-gadget ] with-surface
] [
drop
] ifte ;

View File

@ -85,7 +85,7 @@ C: client-stream ( fd host port -- stream )
: <client> ( host port -- stream )
#! Connect to a port number on a TCP/IP host.
2dup client-socket dup <client-stream> ;
[ client-socket ] 2keep <client-stream> ;
: <server> ( port -- server )
#! Starts listening for TCP connections on localhost:port.