Added interface for grf.
This commit is contained in:
@ -186,12 +186,12 @@ $(GEN):
|
|||||||
COMMON_PHASE1 = common/boot.fs common/conditionals.fs common/vocabulary.fs \
|
COMMON_PHASE1 = common/boot.fs common/conditionals.fs common/vocabulary.fs \
|
||||||
common/floats.fs common/structures.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_PHASE2 = common/tasks.fs common/utils.fs common/locals.fs \
|
||||||
common/filetools.fs common/including.fs \
|
common/filetools.fs common/including.fs \
|
||||||
common/streams.fs common/blocks.fs
|
common/streams.fs common/blocks.fs
|
||||||
|
|
||||||
|
COMMON_DESKTOP = common/ansi.fs common/desktop.fs common/grf.fs
|
||||||
|
|
||||||
POSIX_BOOT = $(COMMON_PHASE1) \
|
POSIX_BOOT = $(COMMON_PHASE1) \
|
||||||
posix/posix.fs posix/allocation.fs posix/termios.fs \
|
posix/posix.fs posix/allocation.fs posix/termios.fs \
|
||||||
$(COMMON_PHASE2) $(COMMON_DESKTOP) \
|
$(COMMON_PHASE2) $(COMMON_DESKTOP) \
|
||||||
@ -210,6 +210,7 @@ WINDOWS_BOOT = $(COMMON_PHASE1) \
|
|||||||
windows/windows_messages.fs \
|
windows/windows_messages.fs \
|
||||||
windows/allocation.fs \
|
windows/allocation.fs \
|
||||||
$(COMMON_PHASE2) $(COMMON_DESKTOP) \
|
$(COMMON_PHASE2) $(COMMON_DESKTOP) \
|
||||||
|
windows/grf.fs \
|
||||||
posix/autoboot.fs \
|
posix/autoboot.fs \
|
||||||
common/fini.fs
|
common/fini.fs
|
||||||
$(GEN)/windows_boot.h: common/source_to_string.js $(WINDOWS_BOOT) | $(GEN)
|
$(GEN)/windows_boot.h: common/source_to_string.js $(WINDOWS_BOOT) | $(GEN)
|
||||||
|
|||||||
@ -438,6 +438,7 @@ e: check-opcodes
|
|||||||
;e
|
;e
|
||||||
|
|
||||||
e: check-desktop
|
e: check-desktop
|
||||||
|
out: grf
|
||||||
check-args
|
check-args
|
||||||
check-ansi
|
check-ansi
|
||||||
;e
|
;e
|
||||||
@ -457,6 +458,8 @@ DEFINED? windows [IF]
|
|||||||
|
|
||||||
e: test-windows-forth-namespace
|
e: test-windows-forth-namespace
|
||||||
internals voclist
|
internals voclist
|
||||||
|
out: internals
|
||||||
|
out: grf
|
||||||
out: ansi
|
out: ansi
|
||||||
out: editor
|
out: editor
|
||||||
out: streams
|
out: streams
|
||||||
@ -494,6 +497,8 @@ e: test-windows-forth-namespace
|
|||||||
e: test-posix-forth-namespace
|
e: test-posix-forth-namespace
|
||||||
internals voclist
|
internals voclist
|
||||||
out: sockets
|
out: sockets
|
||||||
|
out: internals
|
||||||
|
out: grf
|
||||||
out: ansi
|
out: ansi
|
||||||
out: editor
|
out: editor
|
||||||
out: streams
|
out: streams
|
||||||
|
|||||||
51
ueforth/common/grf.fs
Normal file
51
ueforth/common/grf.fs
Normal file
@ -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
|
||||||
20
ueforth/windows/grf.fs
Normal file
20
ueforth/windows/grf.fs
Normal file
@ -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
|
||||||
Reference in New Issue
Block a user