Unix socket fix, minor UI fixes
parent
87236e842b
commit
a4579c38b5
|
|
@ -3,7 +3,6 @@
|
||||||
- faster layout
|
- faster layout
|
||||||
- faster repaint
|
- faster repaint
|
||||||
- forgotten words not removed from cross-reference
|
- forgotten words not removed from cross-reference
|
||||||
- freebsd 4 -pthread errno
|
|
||||||
- implement fcopy
|
- implement fcopy
|
||||||
- win32 updates
|
- win32 updates
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,6 @@ lists namespaces parser sequences stdio unparser words ;
|
||||||
|
|
||||||
"Bootstrap stage 3..." print
|
"Bootstrap stage 3..." print
|
||||||
|
|
||||||
os "freebsd" = [
|
|
||||||
"libc" "libc.so" "cdecl" add-library
|
|
||||||
] when
|
|
||||||
|
|
||||||
unix? [
|
unix? [
|
||||||
"sdl" "libSDL.so" "cdecl" add-library
|
"sdl" "libSDL.so" "cdecl" add-library
|
||||||
"sdl-gfx" "libSDL_gfx.so" "cdecl" add-library
|
"sdl-gfx" "libSDL_gfx.so" "cdecl" add-library
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,10 @@ USING: errors generic hashtables kernel kernel-internals lists
|
||||||
math namespaces prettyprint sequences stdio unparser vectors
|
math namespaces prettyprint sequences stdio unparser vectors
|
||||||
words ;
|
words ;
|
||||||
|
|
||||||
|
: save
|
||||||
|
#! Save the current image.
|
||||||
|
"image" get save-image ;
|
||||||
|
|
||||||
! Printing an overview of heap usage.
|
! Printing an overview of heap usage.
|
||||||
|
|
||||||
: kb. 1024 /i unparse write " KB" write ;
|
: kb. 1024 /i unparse write " KB" write ;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ USING: alien generic kernel lists math namespaces sdl sequences ;
|
||||||
|
|
||||||
GENERIC: handle-event ( event -- )
|
GENERIC: handle-event ( event -- )
|
||||||
|
|
||||||
M: alien handle-event ( event -- )
|
M: object handle-event ( event -- )
|
||||||
drop ;
|
drop ;
|
||||||
|
|
||||||
M: quit-event handle-event ( event -- )
|
M: quit-event handle-event ( event -- )
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,12 @@ C: gadget ( shape -- gadget )
|
||||||
: redraw ( gadget -- )
|
: redraw ( gadget -- )
|
||||||
#! Redraw a gadget before the next iteration of the event
|
#! Redraw a gadget before the next iteration of the event
|
||||||
#! loop.
|
#! 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 ( gadget -- )
|
||||||
#! Relayout a gadget before the next iteration of the event
|
#! Relayout a gadget before the next iteration of the event
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@ SYMBOL: clip
|
||||||
#! All drawing done inside draw-shape is done with the
|
#! All drawing done inside draw-shape is done with the
|
||||||
#! gadget's paint. If the gadget does not have any custom
|
#! gadget's paint. If the gadget does not have any custom
|
||||||
#! paint, just call the quotation.
|
#! paint, just call the quotation.
|
||||||
|
f over set-gadget-redraw?
|
||||||
dup gadget-paint [
|
dup gadget-paint [
|
||||||
dup [
|
dup [
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ SYMBOL: root-menu
|
||||||
[
|
[
|
||||||
[[ "Listener" [ <console> "Listener" <tile> world get add-gadget ] ]]
|
[[ "Listener" [ <console> "Listener" <tile> world get add-gadget ] ]]
|
||||||
[[ "Globals" [ global inspect ] ]]
|
[[ "Globals" [ global inspect ] ]]
|
||||||
[[ "Save image" [ "image" get save-image ] ]]
|
[[ "Save image" [ save ] ]]
|
||||||
[[ "Exit" [ f world get set-world-running? ] ]]
|
[[ "Exit" [ f world get set-world-running? ] ]]
|
||||||
] root-menu set
|
] root-menu set
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,11 +24,7 @@ M: world inside? ( point world -- ? ) 2drop t ;
|
||||||
|
|
||||||
: draw-world ( world -- )
|
: draw-world ( world -- )
|
||||||
dup gadget-redraw? [
|
dup gadget-redraw? [
|
||||||
[
|
[ dup draw-gadget ] with-surface
|
||||||
f over set-gadget-redraw?
|
|
||||||
dup draw-gadget
|
|
||||||
dup gadget-paint [ world-hand draw-gadget ] bind
|
|
||||||
] with-surface
|
|
||||||
] [
|
] [
|
||||||
drop
|
drop
|
||||||
] ifte ;
|
] ifte ;
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ C: client-stream ( fd host port -- stream )
|
||||||
|
|
||||||
: <client> ( host port -- stream )
|
: <client> ( host port -- stream )
|
||||||
#! Connect to a port number on a TCP/IP host.
|
#! Connect to a port number on a TCP/IP host.
|
||||||
2dup client-socket dup <client-stream> ;
|
[ client-socket ] 2keep <client-stream> ;
|
||||||
|
|
||||||
: <server> ( port -- server )
|
: <server> ( port -- server )
|
||||||
#! Starts listening for TCP connections on localhost:port.
|
#! Starts listening for TCP connections on localhost:port.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue