Skip to content

Commit

Permalink
The great renaming, part I:
Browse files Browse the repository at this point in the history
The great renaming, part I:
For constants named by *FOO*, change the source to use +FOO+.  This
commit was brought to you by the function dired-do-query-replace-regexp,
the letter y, and the regular expression

\*\(clx-cached-types\|replysize\|buffer-text16-size\|... \)\*

darcs-hash:20030403112715-ed5a3-5cb0e20a94dd81b4d3f19db3eaab72980ba80915.gz
  • Loading branch information
csr21 committed Apr 3, 2003
1 parent ca5c8c2 commit 93d567e
Show file tree
Hide file tree
Showing 17 changed files with 506 additions and 506 deletions.
32 changes: 16 additions & 16 deletions attributes.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
(in-package :xlib)

(eval-when (compile load eval) ;needed by Franz Lisp
(defconstant *attribute-size* 44)
(defconstant *geometry-size* 24)
(defconstant *context-size* (max *attribute-size* *geometry-size* (* 16 4))))
(defconstant +attribute-size+ 44)
(defconstant +geometry-size+ 24)
(defconstant +context-size+ (max +attribute-size+ +geometry-size+ (* 16 4))))

(defvar *window-attributes* nil) ;; Bound to an alist of (drawable . state) within WITH-STATE

Expand All @@ -54,7 +54,7 @@

(defun allocate-context ()
(or (threaded-atomic-pop *context-free-list* reply-next reply-buffer)
(make-reply-buffer *context-size*)))
(make-reply-buffer +context-size+)))

(defun deallocate-context (context)
(declare (type reply-buffer context))
Expand All @@ -66,12 +66,12 @@
(defmacro state-geometry-changes (state) `(fifth ,state))

(defmacro drawable-equal-function ()
(if (member 'drawable *clx-cached-types*)
(if (member 'drawable +clx-cached-types+)
''eq ;; Allows the compiler to use the microcoded ASSQ primitive on LISPM's
''drawable-equal))

(defmacro window-equal-function ()
(if (member 'window *clx-cached-types*)
(if (member 'window +clx-cached-types+)
''eq
''drawable-equal))

Expand Down Expand Up @@ -155,7 +155,7 @@
(setf (aref changes 0) (logior (aref changes 0) (ash 1 number))) ;; set mask bit
(setf (aref changes (1+ number)) value)) ;; save value
; Send change to the server
(with-buffer-request ((window-display window) *x-changewindowattributes*)
(with-buffer-request ((window-display window) +x-changewindowattributes+)
(window window)
(card32 (ash 1 number) value)))))
;;
Expand All @@ -182,7 +182,7 @@
(setf (aref changes 0) (logior (aref changes 0) (ash 1 number))) ;; set mask bit
(setf (aref changes (1+ number)) value)) ;; save value
; Send change to the server
(with-buffer-request ((drawable-display drawable) *x-configurewindow*)
(with-buffer-request ((drawable-display drawable) +x-configurewindow+)
(drawable drawable)
(card16 (ash 1 number))
(card29 value)))))
Expand All @@ -204,7 +204,7 @@
(deallocate-gcontext-state (state-attribute-changes state-entry))
(setf (state-attribute-changes state-entry) nil))
;; Get window attributes
(with-buffer-request-and-reply (display *x-getwindowattributes* size :sizes (8))
(with-buffer-request-and-reply (display +x-getwindowattributes+ size :sizes (8))
((window window))
(let ((repbuf (or (state-attributes state-entry) (allocate-context))))
(declare (type reply-buffer repbuf))
Expand Down Expand Up @@ -234,7 +234,7 @@
(deallocate-gcontext-state (state-geometry-changes state-entry))
(setf (state-geometry-changes state-entry) nil))
;; Get drawable attributes
(with-buffer-request-and-reply (display *x-getgeometry* size :sizes (8))
(with-buffer-request-and-reply (display +x-getgeometry+ size :sizes (8))
((drawable drawable))
(let ((repbuf (or (state-geometry state-entry) (allocate-context))))
(declare (type reply-buffer repbuf))
Expand All @@ -252,7 +252,7 @@
(mask (aref changes 0)))
(declare (type display display)
(type mask32 mask))
(with-buffer-request (display *x-changewindowattributes*)
(with-buffer-request (display +x-changewindowattributes+)
(window window)
(card32 mask)
(progn ;; Insert a word in the request for each one bit in the mask
Expand All @@ -279,7 +279,7 @@
(mask (aref changes 0)))
(declare (type display display)
(type mask16 mask))
(with-buffer-request (display *x-configurewindow*)
(with-buffer-request (display +x-configurewindow+)
(window window)
(card16 mask)
(progn ;; Insert a word in the request for each one bit in the mask
Expand Down Expand Up @@ -373,11 +373,11 @@
(declare (type window window))
(declare (clx-values bit-gravity))
(with-attributes (window :sizes 8)
(member8-vector-get 14 *bit-gravity-vector*)))
(member8-vector-get 14 +bit-gravity-vector+)))

(defun set-window-bit-gravity (window gravity)
(change-window-attribute
window 4 (encode-type (member-vector *bit-gravity-vector*) gravity))
window 4 (encode-type (member-vector +bit-gravity-vector+) gravity))
gravity)

(defsetf window-bit-gravity set-window-bit-gravity)
Expand All @@ -387,11 +387,11 @@
(declare (type window window))
(declare (clx-values win-gravity))
(with-attributes (window :sizes 8)
(member8-vector-get 15 *win-gravity-vector*)))
(member8-vector-get 15 +win-gravity-vector+)))

(defun set-window-gravity (window gravity)
(change-window-attribute
window 5 (encode-type (member-vector *win-gravity-vector*) gravity))
window 5 (encode-type (member-vector +win-gravity-vector+) gravity))
gravity)

(defsetf window-gravity set-window-gravity)
Expand Down
2 changes: 1 addition & 1 deletion buffer.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

(in-package :xlib)

(defconstant *requestsize* 160) ;; Max request size (excluding variable length requests)
(defconstant +requestsize+ 160) ;; Max request size (excluding variable length requests)

;;; This is here instead of in bufmac so that with-display can be
;;; compiled without macros and bufmac being loaded.
Expand Down
38 changes: 19 additions & 19 deletions clx.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@

(#-sbcl defconstant
#+sbcl sb-int:defconstant-eqx
*predefined-atoms*
+predefined-atoms+
'#(nil :PRIMARY :SECONDARY :ARC :ATOM :BITMAP
:CARDINAL :COLORMAP :CURSOR
:CUT_BUFFER0 :CUT_BUFFER1 :CUT_BUFFER2 :CUT_BUFFER3
Expand Down Expand Up @@ -486,7 +486,7 @@

(#-sbcl defconstant
#+sbcl sb-int:defconstant-eqx
*bit-gravity-vector*
+bit-gravity-vector+
'#(:forget :north-west :north :north-east :west
:center :east :south-west :south
:south-east :static)
Expand All @@ -498,7 +498,7 @@

(#-sbcl defconstant
#+sbcl sb-int:defconstant-eqx
*win-gravity-vector*
+win-gravity-vector+
'#(:unmap :north-west :north :north-east :west
:center :east :south-west :south :south-east
:static)
Expand Down Expand Up @@ -571,7 +571,7 @@

(#-sbcl defconstant
#+sbcl sb-int:defconstant-eqx
*event-mask-vector*
+event-mask-vector+
'#(:key-press :key-release :button-press :button-release
:enter-window :leave-window :pointer-motion :pointer-motion-hint
:button-1-motion :button-2-motion :button-3-motion :button-4-motion
Expand All @@ -593,7 +593,7 @@

(#-sbcl defconstant
#+sbcl sb-int:defconstant-eqx
*pointer-event-mask-vector*
+pointer-event-mask-vector+
'#(%error %error :button-press :button-release
:enter-window :leave-window :pointer-motion :pointer-motion-hint
:button-1-motion :button-2-motion :button-3-motion :button-4-motion
Expand All @@ -611,7 +611,7 @@

(#-sbcl defconstant
#+sbcl sb-int:defconstant-eqx
*device-event-mask-vector*
+device-event-mask-vector+
'#(:key-press :key-release :button-press :button-release :pointer-motion
:button-1-motion :button-2-motion :button-3-motion :button-4-motion
:button-5-motion :button-motion)
Expand All @@ -627,7 +627,7 @@

(#-sbcl defconstant
#+sbcl sb-int:defconstant-eqx
*state-mask-vector*
+state-mask-vector+
'#(:shift :lock :control :mod-1 :mod-2 :mod-3 :mod-4 :mod-5
:button-1 :button-2 :button-3 :button-4 :button-5)
#+sbcl #'equalp)
Expand All @@ -643,7 +643,7 @@

(#-sbcl defconstant
#+sbcl sb-int:defconstant-eqx
*gcontext-components*
+gcontext-components+
'(:function :plane-mask :foreground :background
:line-width :line-style :cap-style :join-style :fill-style
:fill-rule :tile :stipple :ts-x :ts-y :font :subwindow-mode
Expand Down Expand Up @@ -678,7 +678,7 @@

(#-sbcl defconstant
#+sbcl sb-int:defconstant-eqx
*boole-vector*
+boole-vector+
'#(#.boole-clr #.boole-and #.boole-andc2 #.boole-1
#.boole-andc1 #.boole-2 #.boole-xor #.boole-ior
#.boole-nor #.boole-eqv #.boole-c2 #.boole-orc2
Expand Down Expand Up @@ -852,7 +852,7 @@
(let ((predicate (xintern type '-equal))
(id (xintern type '-id))
(dpy (xintern type '-display)))
(if (member type *clx-cached-types*)
(if (member type +clx-cached-types+)
`(within-definition (,type make-mumble-equal)
(declaim (inline ,predicate))
(defun ,predicate (a b) (eq a b)))
Expand Down Expand Up @@ -908,56 +908,56 @@
(defun encode-event-mask (event-mask)
(declare (type event-mask event-mask))
(declare (clx-values mask32))
(or (encode-mask *event-mask-vector* event-mask 'event-mask-class)
(or (encode-mask +event-mask-vector+ event-mask 'event-mask-class)
(x-type-error event-mask 'event-mask)))

(defun make-event-mask (&rest keys)
;; This is only defined for core events.
;; Useful for constructing event-mask, pointer-event-mask, device-event-mask.
(declare (type (clx-list event-mask-class) keys))
(declare (clx-values mask32))
(encode-mask *event-mask-vector* keys 'event-mask-class))
(encode-mask +event-mask-vector+ keys 'event-mask-class))

(defun make-event-keys (event-mask)
;; This is only defined for core events.
(declare (type mask32 event-mask))
(declare (clx-values (clx-list event-mask-class)))
(decode-mask *event-mask-vector* event-mask))
(decode-mask +event-mask-vector+ event-mask))

(defun encode-device-event-mask (device-event-mask)
(declare (type device-event-mask device-event-mask))
(declare (clx-values mask32))
(or (encode-mask *device-event-mask-vector* device-event-mask
(or (encode-mask +device-event-mask-vector+ device-event-mask
'device-event-mask-class)
(x-type-error device-event-mask 'device-event-mask)))

(defun encode-modifier-mask (modifier-mask)
(declare (type modifier-mask modifier-mask))
(declare (clx-values mask16))
(or (and (eq modifier-mask :any) #x8000)
(encode-mask *state-mask-vector* modifier-mask 'modifier-key)
(encode-mask +state-mask-vector+ modifier-mask 'modifier-key)
(x-type-error modifier-mask 'modifier-mask)))

(defun encode-state-mask (state-mask)
(declare (type (or mask16 (clx-list state-mask-key)) state-mask))
(declare (clx-values mask16))
(or (encode-mask *state-mask-vector* state-mask 'state-mask-key)
(or (encode-mask +state-mask-vector+ state-mask 'state-mask-key)
(x-type-error state-mask '(or mask16 (clx-list state-mask-key)))))

(defun make-state-mask (&rest keys)
;; Useful for constructing modifier-mask, state-mask.
(declare (type (clx-list state-mask-key) keys))
(declare (clx-values mask16))
(encode-mask *state-mask-vector* keys 'state-mask-key))
(encode-mask +state-mask-vector+ keys 'state-mask-key))

(defun make-state-keys (state-mask)
(declare (type mask16 state-mask))
(declare (clx-values (clx-list state-mask-key)))
(decode-mask *state-mask-vector* state-mask))
(decode-mask +state-mask-vector+ state-mask))

(defun encode-pointer-event-mask (pointer-event-mask)
(declare (type pointer-event-mask pointer-event-mask))
(declare (clx-values mask32))
(or (encode-mask *pointer-event-mask-vector* pointer-event-mask
(or (encode-mask +pointer-event-mask-vector+ pointer-event-mask
'pointer-event-mask-class)
(x-type-error pointer-event-mask 'pointer-event-mask)))
18 changes: 9 additions & 9 deletions depdefs.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
;;;--------------------------------------------------------------------------
(#-sbcl defconstant
#+sbcl sb-int:defconstant-eqx
*clx-cached-types*
+clx-cached-types+
'(drawable
window
pixmap
Expand Down Expand Up @@ -341,7 +341,7 @@

;;;; Stuff for BUFFER definition

(defconstant *replysize* 32.)
(defconstant +replysize+ 32.)

;; used in defstruct initializations to avoid compiler warnings
(defvar *empty-bytes* (make-sequence 'buffer-bytes 0))
Expand Down Expand Up @@ -372,8 +372,8 @@
(data-size 0 :type array-index)
)

(defconstant *buffer-text16-size* 256)
(deftype buffer-text16 () `(simple-array (unsigned-byte 16) (,*buffer-text16-size*)))
(defconstant +buffer-text16-size+ 256)
(deftype buffer-text16 () `(simple-array (unsigned-byte 16) (,+buffer-text16-size+)))

;; These are here because.

Expand Down Expand Up @@ -554,7 +554,7 @@
#+clx-overlapping-arrays
(obuf32 *empty-longs* :type buffer-longs)
;; Holding buffer for 16-bit text
(tbuf16 (make-sequence 'buffer-text16 *buffer-text16-size* :initial-element 0))
(tbuf16 (make-sequence 'buffer-text16 +buffer-text16-size+ :initial-element 0))
;; Probably EQ to Output-Stream
#-excl (input-stream nil :type (or null stream))
#+excl (input-stream -1 :type fixnum)
Expand Down Expand Up @@ -623,17 +623,17 @@
;; Image stuff
;;-----------------------------------------------------------------------------

(defconstant *image-bit-lsb-first-p*
(defconstant +image-bit-lsb-first-p+
#+clx-little-endian t
#-clx-little-endian nil)

(defconstant *image-byte-lsb-first-p*
(defconstant +image-byte-lsb-first-p+
#+clx-little-endian t
#-clx-little-endian nil)

(defconstant *image-unit* 32)
(defconstant +image-unit+ 32)

(defconstant *image-pad* 32)
(defconstant +image-pad+ 32)


;;-----------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 93d567e

Please sign in to comment.