diff --git a/aclpc/acl-port-vars.lisp b/aclpc/acl-port-vars.lisp new file mode 100644 index 00000000..3deaacf0 --- /dev/null +++ b/aclpc/acl-port-vars.lisp @@ -0,0 +1,126 @@ +;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Package: ACL-CLIM; Base: 10; Lowercase: Yes -*- +;; See the file LICENSE for the full license governing this code. +;; + +#|**************************************************************************** +* * +* * +* This file implements the CLIM Port protocol. Also handles processing * +* events, and text and keyboard support. * +* * +* * +****************************************************************************|# + +(in-package :acl-clim) + +(defparameter *keysym-alist* + `((#\Return . :return) + (#\Newline . :newline) + (#\Tab . :tab) + (#\Rubout . :rubout) + (#\Backspace . :backspace) + (#\Page . :page) + (#\Linefeed . :linefeed) + (#\Escape . :escape))) + + +;;; MSWindows Virtual-Key Codes Win32 PR, V2p872 +(defparameter *vk->keysym* + `( + ;; The semi-standard characters + (#x0d #\newline :enter :newline #\return :return) + (#x20 #\space :space) + (#x09 #\tab :tab) + (#x2e :delete) + (#x08 #\backspace :backspace :rubout) + ;;(???? :page) + ;;(???? :linefeed) + (#x1b #\escape :escape :abort) + ;; The shifts + (#x10 :left-shift) + (#x11 :left-control) + (#x14 :caps-lock) + (#x12 :left-meta) + (#x90 :num-lock) + ;; Non-standard keys + (#x03 :cancel) + (#x0c :clear :clear-input) + (#x13 :pause) + (#x21 :page-up :scroll-up) + (#x22 :page-down :scroll) + (#x23 :end) + (#x24 :home) + (#x25 :left-arrow) + (#x26 :up-arrow) + (#x27 :right-arrow) + (#x28 :down-arrow) + (#x29 :select) + (#x2b :execute) + (#x2c :print-screen) + (#x2d :insert) + (#x2f :help) + (#x60 :keypad-0) + (#x61 :keypad-1) + (#x62 :keypad-2) + (#x63 :keypad-3) + (#x64 :keypad-4) + (#x65 :keypad-5) + (#x66 :keypad-6) + (#x67 :keypad-7) + (#x68 :keypad-8) + (#x69 :keypad-9) + (#x6a :keypad-multiply) + (#x6b :keypad-add) + (#x6c :keypad-separator) + (#x6d :keypad-subtract) + (#x6e :keypad-decimal) + (#x6f :keypad-divide) + (#x70 :f1) + (#x71 :f2) + (#x72 :f3) + (#x73 :f4) + (#x74 :f5) + (#x75 :f6) + (#x76 :f7) + (#x77 :f8) + (#x78 :f9) + (#x79 :f10) + (#x7a :f11) + (#x7b :f12) + (#x7c :f13) + (#x7d :f14) + (#x7e :f15) + (#x7f :f16) + (#x80 :f17) + (#x81 :f18) + (#x82 :f19) + (#x83 :f20) + (#x84 :f21) + (#x85 :f22) + (#x86 :f23) + (#x87 :f24) + (#x91 :scroll-lock) + ;;(???? :complete) + ;;(???? :refresh) + )) + +(defparameter *char->keysym* + (let ((array (make-array 256 :initial-element nil))) + (flet ((cstring (x) + (ecase excl:*current-case-mode* + ((:case-insensitive-upper) + (string-upcase (string x))) + ((:case-sensitive-lower) + (string x)) + ((:case-insensitive-lower) + (string-downcase (string x)))))) + (dolist (char '(#\newline #\escape #\backspace #\tab #\space #\return)) + (setf (svref array (char-code char)) + (intern (cstring (char-name char)) + (find-package :keyword)))) + (loop for code from (char-code #\!) to (char-code #\~) + do (setf (svref array code) + (intern (cstring (code-char code)) + (find-package :keyword)))) + array))) + diff --git a/aclpc/acl-port.lisp b/aclpc/acl-port.lisp index dbe0a019..9b61865a 100644 --- a/aclpc/acl-port.lisp +++ b/aclpc/acl-port.lisp @@ -14,116 +14,6 @@ (in-package :acl-clim) -;;; MSWindows Virtual-Key Codes Win32 PR, V2p872 -(defparameter *vk->keysym* - `( - ;; The semi-standard characters - (#x0d #\newline :enter :newline #\return :return) - (#x20 #\space :space) - (#x09 #\tab :tab) - (#x2e :delete) - (#x08 #\backspace :backspace :rubout) - ;;(???? :page) - ;;(???? :linefeed) - (#x1b #\escape :escape :abort) - ;; The shifts - (#x10 :left-shift) - (#x11 :left-control) - (#x14 :caps-lock) - (#x12 :left-meta) - (#x90 :num-lock) - ;; Non-standard keys - (#x03 :cancel) - (#x0c :clear :clear-input) - (#x13 :pause) - (#x21 :page-up :scroll-up) - (#x22 :page-down :scroll) - (#x23 :end) - (#x24 :home) - (#x25 :left-arrow) - (#x26 :up-arrow) - (#x27 :right-arrow) - (#x28 :down-arrow) - (#x29 :select) - (#x2b :execute) - (#x2c :print-screen) - (#x2d :insert) - (#x2f :help) - (#x60 :keypad-0) - (#x61 :keypad-1) - (#x62 :keypad-2) - (#x63 :keypad-3) - (#x64 :keypad-4) - (#x65 :keypad-5) - (#x66 :keypad-6) - (#x67 :keypad-7) - (#x68 :keypad-8) - (#x69 :keypad-9) - (#x6a :keypad-multiply) - (#x6b :keypad-add) - (#x6c :keypad-separator) - (#x6d :keypad-subtract) - (#x6e :keypad-decimal) - (#x6f :keypad-divide) - (#x70 :f1) - (#x71 :f2) - (#x72 :f3) - (#x73 :f4) - (#x74 :f5) - (#x75 :f6) - (#x76 :f7) - (#x77 :f8) - (#x78 :f9) - (#x79 :f10) - (#x7a :f11) - (#x7b :f12) - (#x7c :f13) - (#x7d :f14) - (#x7e :f15) - (#x7f :f16) - (#x80 :f17) - (#x81 :f18) - (#x82 :f19) - (#x83 :f20) - (#x84 :f21) - (#x85 :f22) - (#x86 :f23) - (#x87 :f24) - (#x91 :scroll-lock) - ;;(???? :complete) - ;;(???? :refresh) - )) - -(defparameter *char->keysym* - (let ((array (make-array 256 :initial-element nil))) - (flet ((cstring (x) - (ecase excl:*current-case-mode* - ((:case-insensitive-upper) - (string-upcase (string x))) - ((:case-sensitive-lower) - (string x)) - ((:case-insensitive-lower) - (string-downcase (string x)))))) - (dolist (char '(#\newline #\escape #\backspace #\tab #\space #\return)) - (setf (svref array (char-code char)) - (intern (cstring (char-name char)) - (find-package :keyword)))) - (loop for code from (char-code #\!) to (char-code #\~) - do (setf (svref array code) - (intern (cstring (code-char code)) - (find-package :keyword)))) - array))) - -(defparameter *keysym-alist* - `((#\Return . :return) - (#\Newline . :newline) - (#\Tab . :tab) - (#\Rubout . :rubout) - (#\Backspace . :backspace) - (#\Page . :page) - (#\Linefeed . :linefeed) - (#\Escape . :escape))) - (defclass acl-event-queue (queue) ()) @@ -1236,3 +1126,4 @@ or (:style . (family face size))") (setf (car tl) (apply #'make-rgb-color (car tl))))) (make-pattern pattern-data rgb-list)))) + diff --git a/aclpc/sysdcl.lisp b/aclpc/sysdcl.lisp index 0619ec87..19acef7e 100644 --- a/aclpc/sysdcl.lisp +++ b/aclpc/sysdcl.lisp @@ -10,6 +10,8 @@ clim-main clim-standalone "pkgdcl" + "acl-port-vars" + "winwidgh-vars" "winwidgh" "climpat" "acl-prel" diff --git a/aclpc/winwidgh-vars.lisp b/aclpc/winwidgh-vars.lisp new file mode 100644 index 00000000..76a71bdb --- /dev/null +++ b/aclpc/winwidgh-vars.lisp @@ -0,0 +1,21 @@ +;;; -*- Package: acl-clim; mode: Common-Lisp -*- +;; See the file LICENSE for the full license governing this code. +;; + +(in-package :acl-clim) + +;; These seem to be missing from winapi-dev +(defconstant LBS_DISABLENOSCROLL #x1000) +(defconstant CB_SETTOPINDEX #x015c) +(defconstant TTN_FIRST -520) +(defconstant TTN_NEEDTEXTA TTN_FIRST) ; ascii +(defconstant TTN_NEEDTEXTW (- TTN_FIRST 10)); unicode +(defconstant TTN_NEEDTEXT TTN_NEEDTEXTA) + +(defconstant EM_SETMARGINS #xD3) +(defconstant EC_LEFTMARGIN 1) +(defconstant EC_RIGHTMARGIN 2) +(defconstant EC_USEFONTINFO #xffff) + +(defvar SRCOR #xee0086) + diff --git a/aclpc/winwidgh.lisp b/aclpc/winwidgh.lisp index 2ab5a569..82c86f52 100644 --- a/aclpc/winwidgh.lisp +++ b/aclpc/winwidgh.lisp @@ -5,21 +5,6 @@ (in-package :acl-clim) -;; These seem to be missing from winapi-dev -(defconstant LBS_DISABLENOSCROLL #x1000) -(defconstant CB_SETTOPINDEX #x015c) -(defconstant TTN_FIRST -520) -(defconstant TTN_NEEDTEXTA TTN_FIRST) ; ascii -(defconstant TTN_NEEDTEXTW (- TTN_FIRST 10)); unicode -(defconstant TTN_NEEDTEXT TTN_NEEDTEXTA) - -(defconstant EM_SETMARGINS #xD3) -(defconstant EC_LEFTMARGIN 1) -(defconstant EC_RIGHTMARGIN 2) -(defconstant EC_USEFONTINFO #xffff) - -(defvar SRCOR #xee0086) - (deftype signed-nat () `(signed-byte #-64bit 32 #+64bit 64)) diff --git a/misc/compile-1.lisp b/misc/compile-1.lisp index efeec3c9..7d8a890b 100644 --- a/misc/compile-1.lisp +++ b/misc/compile-1.lisp @@ -167,6 +167,8 @@ (:serial main-pkg "pkgdcl" + "acl-port-vars" + "winwidgh-vars" "winwidgh" "climpat" "acl-prel"