From 53592d0f3cc4d63469028bed9dc2be633327fe44 Mon Sep 17 00:00:00 2001 From: erg Date: Sun, 27 Aug 2006 23:30:07 +0000 Subject: [PATCH] fix bootstrap issues, alt+key handling, function keys for win32 --- library/bootstrap/boot-stage2.factor | 4 ++++ library/ui/windows/ui.factor | 21 +++++++++++++++++---- library/windows/dlls.factor | 12 ++++++++++++ library/windows/load.factor | 9 --------- 4 files changed, 33 insertions(+), 13 deletions(-) create mode 100644 library/windows/dlls.factor diff --git a/library/bootstrap/boot-stage2.factor b/library/bootstrap/boot-stage2.factor index 16f823309f..4de3471b5b 100644 --- a/library/bootstrap/boot-stage2.factor +++ b/library/bootstrap/boot-stage2.factor @@ -20,6 +20,10 @@ optimizer parser sequences sequences-internals words ; ] when "compile" get [ + windows? [ + "/library/windows/dlls.factor" run-resource + ] when + \ number= compile \ + compile \ nth compile diff --git a/library/ui/windows/ui.factor b/library/ui/windows/ui.factor index 16d1f0da60..2951a508b8 100644 --- a/library/ui/windows/ui.factor +++ b/library/ui/windows/ui.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2005, 2006 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: alien arrays errors freetype gadgets - gadgets-listener hashtables io kernel math namespaces prettyprint +USING: alien arrays errors freetype gadgets gadgets-listener + gadgets-workspace hashtables io kernel math namespaces prettyprint sequences strings vectors words win32-api win32-api-messages ; USING: inspector threads memory ; IN: win32 @@ -58,6 +58,18 @@ SYMBOL: class-name { 40 "DOWN" } { 45 "INSERT" } { 46 "DELETE" } + { 112 "F1" } + { 113 "F2" } + { 114 "F3" } + { 115 "F4" } + { 116 "F5" } + { 117 "F6" } + { 118 "F7" } + { 119 "F8" } + { 120 "F9" } + { 121 "F10" } + { 122 "F11" } + { 123 "F12" } } ; : key-state-down? @@ -122,7 +134,7 @@ SYMBOL: hWnd : handle-wm-char ( hWnd uMsg wParam lParam -- ) lParam set wParam set uMsg set hWnd set - wParam get exclude-key-wm-char? ctrl? or [ + wParam get exclude-key-wm-char? ctrl? or alt? or [ wParam get ch>string hWnd get window-focus user-input ] unless ; @@ -336,5 +348,6 @@ IN: shells ] [ cleanup-win32-ui ] cleanup ; IN: io-internals -! Temporary, until native io returns +! Allows use of the ui without native i/o. +! Overwritten when native i/o is loaded. : io-multiplex ( ms -- ) 0 SleepEx drop ; diff --git a/library/windows/dlls.factor b/library/windows/dlls.factor new file mode 100644 index 0000000000..cbe5dc296e --- /dev/null +++ b/library/windows/dlls.factor @@ -0,0 +1,12 @@ +IN: scratchpad +USING: alien sequences ; +{ + { "gdi32" "gdi32.dll" "stdcall" } + { "user32" "user32.dll" "stdcall" } + { "kernel32" "kernel32.dll" "stdcall" } + { "winsock" "ws2_32.dll" "stdcall" } + { "mswsock" "mswsock.dll" "stdcall" } + { "libc" "msvcrt.dll" "cdecl" } + { "libm" "msvcrt.dll" "cdecl" } +} [ first3 add-library ] each + diff --git a/library/windows/load.factor b/library/windows/load.factor index 806318dd38..817c37de9f 100644 --- a/library/windows/load.factor +++ b/library/windows/load.factor @@ -1,15 +1,6 @@ IN: scratchpad USING: alien compiler kernel namespaces parser sequences words ; -{ - { "gdi32" "gdi32.dll" "stdcall" } - { "user32" "user32.dll" "stdcall" } - { "kernel32" "kernel32.dll" "stdcall" } - { "winsock" "ws2_32.dll" "stdcall" } - { "mswsock" "mswsock.dll" "stdcall" } - { "libc" "msvcrt.dll" "cdecl" } -} [ first3 add-library ] each - { "windows-messages" "types"