diff --git a/ueforth/Makefile b/ueforth/Makefile index 80e08db..cad5659 100644 --- a/ueforth/Makefile +++ b/ueforth/Makefile @@ -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 diff --git a/ueforth/common/forth_namespace_tests.fs b/ueforth/common/forth_namespace_tests.fs index 64eeffd..9b78934 100644 --- a/ueforth/common/forth_namespace_tests.fs +++ b/ueforth/common/forth_namespace_tests.fs @@ -529,6 +529,7 @@ e: test-posix-forth-namespace out: httpd out: telnetd out: sockets + out: x11 check-desktop check-phase2 out: form diff --git a/ueforth/common/testing.fs b/ueforth/common/testing.fs index d15abfd..7d2d294 100644 --- a/ueforth/common/testing.fs +++ b/ueforth/common/testing.fs @@ -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 -- ) diff --git a/ueforth/posix/grf.fs b/ueforth/posix/grf.fs new file mode 100644 index 0000000..75ed8be --- /dev/null +++ b/ueforth/posix/grf.fs @@ -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 diff --git a/ueforth/posix/xlib.fs b/ueforth/posix/x11.fs similarity index 97% rename from ueforth/posix/xlib.fs rename to ueforth/posix/x11.fs index 5d53b1c..eb90ed5 100644 --- a/ueforth/posix/xlib.fs +++ b/ueforth/posix/x11.fs @@ -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 ; diff --git a/ueforth/posix/xlib_test.fs b/ueforth/posix/xlib_test.fs index 961857e..caec620 100644 --- a/ueforth/posix/xlib_test.fs +++ b/ueforth/posix/xlib_test.fs @@ -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