diff --git a/ueforth/Makefile b/ueforth/Makefile index a7dbe65..d83201e 100644 --- a/ueforth/Makefile +++ b/ueforth/Makefile @@ -186,12 +186,12 @@ $(GEN): COMMON_PHASE1 = common/boot.fs common/conditionals.fs common/vocabulary.fs \ common/floats.fs common/structures.fs -COMMON_DESKTOP = common/ansi.fs common/desktop.fs - COMMON_PHASE2 = common/tasks.fs common/utils.fs common/locals.fs \ common/filetools.fs common/including.fs \ common/streams.fs common/blocks.fs +COMMON_DESKTOP = common/ansi.fs common/desktop.fs common/grf.fs + POSIX_BOOT = $(COMMON_PHASE1) \ posix/posix.fs posix/allocation.fs posix/termios.fs \ $(COMMON_PHASE2) $(COMMON_DESKTOP) \ @@ -210,6 +210,7 @@ WINDOWS_BOOT = $(COMMON_PHASE1) \ windows/windows_messages.fs \ windows/allocation.fs \ $(COMMON_PHASE2) $(COMMON_DESKTOP) \ + windows/grf.fs \ posix/autoboot.fs \ common/fini.fs $(GEN)/windows_boot.h: common/source_to_string.js $(WINDOWS_BOOT) | $(GEN) diff --git a/ueforth/common/forth_namespace_tests.fs b/ueforth/common/forth_namespace_tests.fs index 14af07f..6b76f5b 100644 --- a/ueforth/common/forth_namespace_tests.fs +++ b/ueforth/common/forth_namespace_tests.fs @@ -438,6 +438,7 @@ e: check-opcodes ;e e: check-desktop + out: grf check-args check-ansi ;e @@ -457,6 +458,8 @@ DEFINED? windows [IF] e: test-windows-forth-namespace internals voclist + out: internals + out: grf out: ansi out: editor out: streams @@ -494,6 +497,8 @@ e: test-windows-forth-namespace e: test-posix-forth-namespace internals voclist out: sockets + out: internals + out: grf out: ansi out: editor out: streams diff --git a/ueforth/common/grf.fs b/ueforth/common/grf.fs new file mode 100644 index 0000000..73da49a --- /dev/null +++ b/ueforth/common/grf.fs @@ -0,0 +1,51 @@ +( ------------------------------------------------------------ ) +\ 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. + +( Generic Graphics Interface ) +\ Startup: +\ window ( w h -- ) +\ Drawing region: +\ pixel ( x y -- a ) (format [b g r x]) +\ width ( -- n ) +\ height ( -- n ) +\ flip ( -- ) +\ Getting events: +\ wait ( -- ) +\ poll ( -- ) +\ Event info: +\ mouse-x ( -- n ) +\ mouse-y ( -- n ) +\ last-key ( -- n ) +\ last-keysym ( -- n ) +\ last-keycode ( -- n ) +\ event ( -- n ) +\ Event constants: +\ UNKNOWN TIMEOUT RESIZE EXPOSE +\ MOTION PRESS RELEASE + +vocabulary grf grf definitions +vocabulary internals + +0 constant UNKNOWN +1 constant TIMEOUT +2 constant RESIZE +3 constant EXPOSE +4 constant MOTION +5 constant PRESS +6 constant RELEASE + +( Rest of definitions per platform. ) + +forth definitions diff --git a/ueforth/windows/grf.fs b/ueforth/windows/grf.fs new file mode 100644 index 0000000..7c0c2e5 --- /dev/null +++ b/ueforth/windows/grf.fs @@ -0,0 +1,20 @@ +( ------------------------------------------------------------ ) +\ 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. + +( Expand Graphics for Windows ) + +grf internals definitions + +forth definitions