Incorporate x11, lazy-loaded.

This commit is contained in:
Brad Nelson
2022-02-21 14:37:14 -08:00
parent 93a59422b9
commit 499450b5d8
6 changed files with 44 additions and 6 deletions

View File

@ -196,6 +196,8 @@ COMMON_DESKTOP = common/ansi.fs common/desktop.fs \
POSIX_BOOT = $(COMMON_PHASE1) \
posix/posix.fs posix/allocation.fs posix/termios.fs \
$(COMMON_PHASE2) $(COMMON_DESKTOP) \
posix/x11.fs \
posix/grf.fs \
posix/sockets.fs posix/telnetd.fs posix/httpd.fs posix/web_interface.fs \
posix/autoboot.fs \
common/fini.fs

View File

@ -529,6 +529,7 @@ e: test-posix-forth-namespace
out: httpd
out: telnetd
out: sockets
out: x11
check-desktop
check-phase2
out: form

View File

@ -60,9 +60,10 @@ variable confirm-old-type
>r >r >r 1+ r> 1- r> 1+ r> 1-
again
;
: stars ( n -- ) 1- for 42 emit next ;
: expect-finish expected resulted str= if exit then }confirm
cr ." Expected:" cr expected resulted diverged type cr
." Resulted:" cr resulted expected diverged type cr 1 throw ;
cr ." Expected:" cr expected resulted diverged type 30 stars cr
." Resulted:" cr resulted expected diverged type 30 stars cr 1 throw ;
( Better error asserts )
: =assert ( actual expected -- )

31
ueforth/posix/grf.fs Normal file
View File

@ -0,0 +1,31 @@
\ Copyright 2022 Bradley D. Nelson
\
\ Licensed under the Apache License, Version 2.0 (the "License");
\ you may not use this file except in compliance with the License.
\ You may obtain a copy of the License at
\
\ http://www.apache.org/licenses/LICENSE-2.0
\
\ Unless required by applicable law or agreed to in writing, software
\ distributed under the License is distributed on an "AS IS" BASIS,
\ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\ See the License for the specific language governing permissions and
\ limitations under the License.
( Lazy load expand Graphics for Xlib )
grf definitions
: window r|
forth grf internals definitions also x11
grf definitions also internals also x11
only forth definitions
window
| evaluate ;
forth definitions

View File

@ -12,8 +12,11 @@
\ See the License for the specific language governing permissions and
\ limitations under the License.
( Bindings for Xlib )
also posix
( Lazy load bindings for Xlib )
: x11 r|
forth also posix
vocabulary x11 also x11 definitions
z" libX11.so" shared-library xlib
@ -114,3 +117,5 @@ xevent GenericEvent
drop
only forth definitions
x11
| evaluate ;

View File

@ -13,8 +13,6 @@
\ See the License for the specific language governing permissions and
\ limitations under the License.
include posix/xlib.fs
also x11
0 XOpenDisplay constant display