Raymond Toy pushed to branch rtoy-update-clx-with-cmucl-fixes at cmucl / cmucl
Commits:
-
6ea45079
by Raymond Toy at 2018-01-27T09:06:25-08:00
-
e6f4c980
by Raymond Toy at 2018-01-27T09:08:11-08:00
-
286801fd
by Raymond Toy at 2018-01-27T09:09:49-08:00
-
560af621
by Raymond Toy at 2018-01-27T09:19:42-08:00
11 changed files:
- src/clx/big-requests.lisp → src/clx/extensions/big-requests.lisp
- src/clx/dpms.lisp → src/clx/extensions/dpms.lisp
- src/clx/gl.lisp → src/clx/extensions/gl.lisp
- src/clx/glx.lisp → src/clx/extensions/glx.lisp
- src/clx/screensaver.lisp → src/clx/extensions/screensaver.lisp
- src/clx/shape.lisp → src/clx/extensions/shape.lisp
- src/clx/xinerama.lisp → src/clx/extensions/xinerama.lisp
- src/clx/xrender.lisp → src/clx/extensions/xrender.lisp
- src/clx/xtest.lisp → src/clx/extensions/xtest.lisp
- src/clx/xvidmode.lisp → src/clx/extensions/xvidmode.lisp
- src/tools/clxcom.lisp
Changes:
... | ... | @@ -12,9 +12,6 @@ |
12 | 12 |
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 | 13 |
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
14 | 14 |
|
15 |
-#+cmu
|
|
16 |
-(ext:file-comment "$Id: big-requests.lisp,v 1.2 2009/06/17 18:22:45 rtoy Rel $")
|
|
17 |
- |
|
18 | 15 |
(in-package "XLIB")
|
19 | 16 |
|
20 | 17 |
;;; No new events or errors are defined by this extension. (Big
|
... | ... | @@ -13,10 +13,7 @@ |
13 | 13 |
;;;; any purpose of the information in this document. This documentation is
|
14 | 14 |
;;;; provided ``as is'' without express or implied warranty.
|
15 | 15 |
|
16 |
-#+cmu
|
|
17 |
-(ext:file-comment "$Id: dpms.lisp,v 1.3 2009/06/17 18:22:46 rtoy Rel $")
|
|
18 |
- |
|
19 |
-(defpackage :dpms
|
|
16 |
+(defpackage #:xlib/dpms
|
|
20 | 17 |
(:use :common-lisp)
|
21 | 18 |
(:import-from :xlib
|
22 | 19 |
"DEFINE-EXTENSION"
|
... | ... | @@ -39,7 +36,7 @@ |
39 | 36 |
"DPMS-FORCE-LEVEL"
|
40 | 37 |
"DPMS-INFO"))
|
41 | 38 |
|
42 |
-(in-package :dpms)
|
|
39 |
+(in-package #:xlib/dpms)
|
|
43 | 40 |
|
44 | 41 |
(define-extension "DPMS")
|
45 | 42 |
|
1 |
-#+cmu
|
|
2 |
-(ext:file-comment "$Id: gl.lisp,v 1.2 2009/06/17 18:22:46 rtoy Rel $")
|
|
3 |
- |
|
4 |
-(defpackage :gl
|
|
1 |
+(defpackage #:xlib/gl
|
|
5 | 2 |
(:use :common-lisp :xlib)
|
6 |
- (:import-from :glx
|
|
3 |
+ (:import-from :xlib/glx
|
|
7 | 4 |
"*CURRENT-CONTEXT*"
|
8 | 5 |
"CONTEXT"
|
9 | 6 |
"CONTEXT-P"
|
... | ... | @@ -1156,7 +1153,7 @@ |
1156 | 1153 |
))
|
1157 | 1154 |
|
1158 | 1155 |
|
1159 |
-(in-package :gl)
|
|
1156 |
+(in-package #:xlib/gl)
|
|
1160 | 1157 |
|
1161 | 1158 |
|
1162 | 1159 |
|
... | ... | @@ -2138,6 +2135,27 @@ |
2138 | 2135 |
value)
|
2139 | 2136 |
|
2140 | 2137 |
|
2138 |
+#+lispworks
|
|
2139 |
+(progn
|
|
2140 |
+ (defun %single-float-bits (x)
|
|
2141 |
+ (declare (type single-float x))
|
|
2142 |
+ (fli:with-dynamic-foreign-objects ((bits :int32))
|
|
2143 |
+ (fli:with-coerced-pointer (pointer :type :lisp-single-float) bits
|
|
2144 |
+ (setf (fli:dereference pointer) x))
|
|
2145 |
+ (fli:dereference bits)))
|
|
2146 |
+ |
|
2147 |
+ (declaim (notinline aset-float32))
|
|
2148 |
+ (defun aset-float32 (value array index)
|
|
2149 |
+ (declare (type (or short-float single-float) value)
|
|
2150 |
+ (type buffer-bytes array)
|
|
2151 |
+ (type array-index index))
|
|
2152 |
+ #.(declare-buffun)
|
|
2153 |
+ (let ((bits (%single-float-bits (coerce value 'single-float))))
|
|
2154 |
+ (declare (type (unsigned-byte 32) bits))
|
|
2155 |
+ (aset-card32 bits array index))
|
|
2156 |
+ value))
|
|
2157 |
+ |
|
2158 |
+ |
|
2141 | 2159 |
#+sbcl
|
2142 | 2160 |
(defun aset-float64 (value array index)
|
2143 | 2161 |
(declare (type double-float value)
|
... | ... | @@ -2180,6 +2198,36 @@ |
2180 | 2198 |
value)
|
2181 | 2199 |
|
2182 | 2200 |
|
2201 |
+#+lispworks
|
|
2202 |
+(progn
|
|
2203 |
+ (fli:define-c-struct %uint64
|
|
2204 |
+ (high :uint32)
|
|
2205 |
+ (low :uint32))
|
|
2206 |
+ |
|
2207 |
+ (defun %double-float-bits (x)
|
|
2208 |
+ (declare (type double-float x))
|
|
2209 |
+ (fli:with-dynamic-foreign-objects ((bits %uint64))
|
|
2210 |
+ (fli:with-coerced-pointer (pointer :type :lisp-double-float) bits
|
|
2211 |
+ (setf (fli:dereference pointer) x))
|
|
2212 |
+ |
|
2213 |
+ (values (fli:foreign-slot-value bits 'low :type :uint32 :object-type '%uint64)
|
|
2214 |
+ (fli:foreign-slot-value bits 'high :type :uint32 :object-type '%uint64))))
|
|
2215 |
+ |
|
2216 |
+ (declaim (notinline aset-float64))
|
|
2217 |
+ (defun aset-float64 (value array index)
|
|
2218 |
+ (declare (type double-float value)
|
|
2219 |
+ (type buffer-bytes array)
|
|
2220 |
+ (type array-index index))
|
|
2221 |
+ #.(declare-buffun)
|
|
2222 |
+ (multiple-value-bind (low high)
|
|
2223 |
+ (%double-float-bits value)
|
|
2224 |
+ (declare (type (unsigned-byte 32) low high))
|
|
2225 |
+ |
|
2226 |
+ (aset-card32 low array index)
|
|
2227 |
+ (aset-card32 high array (the array-index (+ index 4))))
|
|
2228 |
+ value))
|
|
2229 |
+ |
|
2230 |
+ |
|
2183 | 2231 |
(eval-when (:compile-toplevel :load-toplevel :execute)
|
2184 | 2232 |
(defun byte-width (type)
|
2185 | 2233 |
(ecase type
|
... | ... | @@ -2593,7 +2641,7 @@ |
2593 | 2641 |
#.+convolution-width+
|
2594 | 2642 |
#.+convolution-height+
|
2595 | 2643 |
#.+max-convolution-width+
|
2596 |
- #.+max-convolution-width+)
|
|
2644 |
+ #.+max-convolution-height+)
|
|
2597 | 2645 |
1)
|
2598 | 2646 |
((#.+convolution-filter-scale+
|
2599 | 2647 |
#.+convolution-filter-bias+)
|
... | ... | @@ -2619,7 +2667,7 @@ |
2619 | 2667 |
#.+convolution-width+
|
2620 | 2668 |
#.+convolution-height+
|
2621 | 2669 |
#.+max-convolution-width+
|
2622 |
- #.+max-convolution-width+)
|
|
2670 |
+ #.+max-convolution-height+)
|
|
2623 | 2671 |
1)
|
2624 | 2672 |
((#.+convolution-filter-scale+
|
2625 | 2673 |
#.+convolution-filter-bias+)
|
1 |
-#+cmu
|
|
2 |
-(ext:file-comment "$Id: glx.lisp,v 1.2 2009/06/17 18:22:46 rtoy Rel $")
|
|
3 |
- |
|
4 |
-(defpackage :glx
|
|
1 |
+(defpackage #:xlib/glx
|
|
5 | 2 |
(:use :common-lisp :xlib)
|
6 | 3 |
(:import-from :xlib
|
7 | 4 |
"DEFINE-ACCESSOR"
|
... | ... | @@ -72,11 +69,11 @@ |
72 | 69 |
))
|
73 | 70 |
|
74 | 71 |
|
75 |
-(in-package :glx)
|
|
76 |
- |
|
77 |
- |
|
78 |
-(declaim (optimize (debug 3) (safety 3)))
|
|
72 |
+(in-package #:xlib/glx)
|
|
79 | 73 |
|
74 |
+;;; Generally don't want this declamation to have load-time effects
|
|
75 |
+(eval-when (:compile-toplevel)
|
|
76 |
+ (declaim (optimize (debug 3) (safety 3))))
|
|
80 | 77 |
|
81 | 78 |
(define-extension "GLX"
|
82 | 79 |
:events (:glx-pbuffer-clobber)
|
... | ... | @@ -599,7 +596,7 @@ Example: '(:glx-rgba (:glx-alpha-size 4) :glx-double-buffer (:glx-class 4 =)." |
599 | 596 |
(let* ((ctx *current-context*)
|
600 | 597 |
(display (context-display ctx)))
|
601 | 598 |
;; Make sure all rendering commands are sent away.
|
602 |
- (glx:render)
|
|
599 |
+ (render)
|
|
603 | 600 |
(with-buffer-request (display (extension-opcode display "GLX"))
|
604 | 601 |
(data +swap-buffers+)
|
605 | 602 |
;; *** GLX_CONTEXT_TAG
|
... | ... | @@ -20,9 +20,6 @@ |
20 | 20 |
;;; Use xc/doc/hardcopy/Xext/shape.PS.gz obtainable from e.g.
|
21 | 21 |
;; ftp://ftp.xfree86.org/pub/XFree86/current/untarred/xc/hardcopy/Xext/shape.PS.gz
|
22 | 22 |
|
23 |
-#+cmu
|
|
24 |
-(ext:file-comment "$Id: shape.lisp,v 1.3 2009/06/17 18:22:46 rtoy Rel $")
|
|
25 |
- |
|
26 | 23 |
(in-package :xlib)
|
27 | 24 |
|
28 | 25 |
(export '(shape-query-version
|
... | ... | @@ -12,7 +12,7 @@ |
12 | 12 |
;;; This is an implementation of the XINERAMA extension. It does not
|
13 | 13 |
;;; include the obsolete PanoramiX calls.
|
14 | 14 |
|
15 |
-(defpackage "XLIB.XINERAMA"
|
|
15 |
+(defpackage #:xlib/xinerama
|
|
16 | 16 |
(:use "COMMON-LISP" "XLIB")
|
17 | 17 |
(:nicknames "XINERAMA")
|
18 | 18 |
(:import-from "XLIB"
|
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 |
"XINERAMA-QUERY-VERSION"
|
34 | 34 |
"XINERAMA-IS-ACTIVE"
|
35 | 35 |
"XINERAMA-QUERY-SCREENS"))
|
36 |
-(in-package "XINERAMA")
|
|
36 |
+(in-package #:xlib/xinerama)
|
|
37 | 37 |
|
38 | 38 |
(define-extension "XINERAMA")
|
39 | 39 |
|
... | ... | @@ -3,8 +3,7 @@ |
3 | 3 |
;;; Title: The X Render Extension
|
4 | 4 |
;;; Created: 2002-08-03
|
5 | 5 |
;;; Author: Gilbert Baumann <unk6@rz.uni-karlsruhe.de>
|
6 |
-#+cmu
|
|
7 |
-(ext:file-comment "$Id: xrender.lisp,v 1.2 2009/06/17 18:22:46 rtoy Rel $")
|
|
6 |
+;;; $Id: xrender.lisp,v 1.5 2004/12/06 11:48:57 csr21 Exp $
|
|
8 | 7 |
;;; ---------------------------------------------------------------------------
|
9 | 8 |
;;;
|
10 | 9 |
;;; (c) copyright 2002, 2003 by Gilbert Baumann
|
... | ... | @@ -128,6 +127,8 @@ |
128 | 127 |
render-query-version
|
129 | 128 |
;; render-query-picture-formats
|
130 | 129 |
render-fill-rectangle
|
130 |
+ render-triangles
|
|
131 |
+ render-trapezoids
|
|
131 | 132 |
render-composite
|
132 | 133 |
render-create-glyph-set
|
133 | 134 |
render-reference-glyph-set
|
... | ... | @@ -196,6 +197,24 @@ |
196 | 197 |
;; We do away with the distinction between pict-format and
|
197 | 198 |
;; picture-format-info. That is we cache picture-format-infos.
|
198 | 199 |
|
200 |
+(defstruct picture-format
|
|
201 |
+ display
|
|
202 |
+ (id 0 :type (unsigned-byte 29))
|
|
203 |
+ type
|
|
204 |
+ depth
|
|
205 |
+ red-byte
|
|
206 |
+ green-byte
|
|
207 |
+ blue-byte
|
|
208 |
+ alpha-byte
|
|
209 |
+ colormap)
|
|
210 |
+ |
|
211 |
+(def-clx-class (glyph-set (:copier nil)
|
|
212 |
+ )
|
|
213 |
+ (id 0 :type resource-id)
|
|
214 |
+ (display nil :type (or null display))
|
|
215 |
+ (plist nil :type list) ; Extension hook
|
|
216 |
+ (format))
|
|
217 |
+ |
|
199 | 218 |
(defstruct render-info
|
200 | 219 |
major-version
|
201 | 220 |
minor-version
|
... | ... | @@ -298,17 +317,6 @@ by every function, which attempts to generate RENDER requests." |
298 | 317 |
|
299 | 318 |
;;; picture format
|
300 | 319 |
|
301 |
-(defstruct picture-format
|
|
302 |
- display
|
|
303 |
- (id 0 :type (unsigned-byte 29))
|
|
304 |
- type
|
|
305 |
- depth
|
|
306 |
- red-byte
|
|
307 |
- green-byte
|
|
308 |
- blue-byte
|
|
309 |
- alpha-byte
|
|
310 |
- colormap)
|
|
311 |
- |
|
312 | 320 |
(defmethod print-object ((object picture-format) stream)
|
313 | 321 |
(let ((abbrev
|
314 | 322 |
(with-output-to-string (bag)
|
... | ... | @@ -517,13 +525,15 @@ by every function, which attempts to generate RENDER requests." |
517 | 525 |
(let ((display (picture-display picture)))
|
518 | 526 |
(with-buffer-request (display (extension-opcode display "RENDER"))
|
519 | 527 |
(data +X-RenderFreePicture+)
|
520 |
- (picture picture))))
|
|
528 |
+ (picture picture))
|
|
529 |
+ (deallocate-resource-id display (picture-id picture) 'picture)))
|
|
521 | 530 |
|
522 | 531 |
(defun render-free-glyph-set (glyph-set)
|
523 | 532 |
(let ((display (glyph-set-display glyph-set)))
|
524 | 533 |
(with-buffer-request (display (extension-opcode display "RENDER"))
|
525 | 534 |
(data +X-RenderFreeGlyphSet+)
|
526 |
- (glyph-set glyph-set))))
|
|
535 |
+ (glyph-set glyph-set))
|
|
536 |
+ (deallocate-resource-id display (glyph-set-id glyph-set) 'glyph-set)))
|
|
527 | 537 |
|
528 | 538 |
(defun render-query-version (display)
|
529 | 539 |
(with-buffer-request-and-reply (display (extension-opcode display "RENDER") nil)
|
... | ... | @@ -570,16 +580,16 @@ by every function, which attempts to generate RENDER requests." |
570 | 580 |
(synchronise-picture-state picture)
|
571 | 581 |
(with-buffer-request (display (extension-opcode display "RENDER"))
|
572 | 582 |
(data +X-RenderFillRectangles+)
|
573 |
- (render-op op) ;op
|
|
574 |
- (card8 0) ;pad
|
|
575 |
- (card16 0) ;pad
|
|
583 |
+ (render-op op)
|
|
584 |
+ (pad8 0)
|
|
585 |
+ (pad16 0)
|
|
576 | 586 |
(resource-id (picture-id picture))
|
577 | 587 |
(card16 (elt color 0)) (card16 (elt color 1)) (card16 (elt color 2)) (card16 (elt color 3))
|
578 | 588 |
(int16 x1) (int16 y1) (card16 w) (card16 h))))
|
579 | 589 |
|
580 | 590 |
;; fill rectangles, colors.
|
581 | 591 |
|
582 |
-(defun render-triangles-1 (picture op source src-x src-y format coord-sequence)
|
|
592 |
+(defun render-triangles (picture op source src-x src-y format coord-sequence)
|
|
583 | 593 |
;; For performance reasons we do a special typecase on (simple-array
|
584 | 594 |
;; (unsigned-byte 32) (*)), so that it'll be possible to have high
|
585 | 595 |
;; performance rasters.
|
... | ... | @@ -587,17 +597,18 @@ by every function, which attempts to generate RENDER requests." |
587 | 597 |
'(let ((display (picture-display picture)))
|
588 | 598 |
(synchronise-picture-state picture)
|
589 | 599 |
(synchronise-picture-state source)
|
590 |
- (with-buffer-request (display (extension-opcode display "RENDER"))
|
|
591 |
- (data +X-RenderTriangles+)
|
|
592 |
- (render-op op) ;op
|
|
593 |
- (card8 0) ;pad
|
|
594 |
- (card16 0) ;pad
|
|
595 |
- (resource-id (picture-id source))
|
|
596 |
- (resource-id (picture-id picture))
|
|
597 |
- (picture-format format)
|
|
598 |
- (int16 src-x)
|
|
599 |
- (int16 src-y)
|
|
600 |
- ((sequence :format int32) coord-sequence) ))))
|
|
600 |
+ (labels ((funk (x) (ash x 16)))
|
|
601 |
+ (with-buffer-request (display (extension-opcode display "RENDER"))
|
|
602 |
+ (data +X-RenderTriangles+)
|
|
603 |
+ (render-op op)
|
|
604 |
+ (pad8 0)
|
|
605 |
+ (pad16 0)
|
|
606 |
+ (resource-id (picture-id source))
|
|
607 |
+ (resource-id (picture-id picture))
|
|
608 |
+ (picture-format format)
|
|
609 |
+ (int16 src-x)
|
|
610 |
+ (int16 src-y)
|
|
611 |
+ ((sequence :format int32 :transform #'funk) coord-sequence))))))
|
|
601 | 612 |
(typecase coord-sequence
|
602 | 613 |
((simple-array (unsigned-byte 32) (*))
|
603 | 614 |
(locally
|
... | ... | @@ -694,7 +705,7 @@ by every function, which attempts to generate RENDER requests." |
694 | 705 |
(data +X-RenderSetPictureFilter+)
|
695 | 706 |
(resource-id (picture-id picture))
|
696 | 707 |
(card16 (length filter))
|
697 |
- (card16 0) ;pad
|
|
708 |
+ (pad16 0)
|
|
698 | 709 |
((sequence :format card8) (map 'vector #'char-code filter)))))
|
699 | 710 |
|
700 | 711 |
|
... | ... | @@ -705,25 +716,26 @@ by every function, which attempts to generate RENDER requests." |
705 | 716 |
)
|
706 | 717 |
||#
|
707 | 718 |
|
708 |
-(defun render-trapezoids-1 (picture op source src-x src-y mask-format coord-sequence)
|
|
719 |
+(defun render-trapezoids (picture op source src-x src-y mask-format coord-sequence)
|
|
709 | 720 |
;; coord-sequence is top bottom
|
710 |
- ;; line-1-x1 line-1-y1 line-1-x2 line-1-y2
|
|
711 |
- ;; line-2-x1 line-2-y1 line-2-x2 line-2-y2 ...
|
|
721 |
+ ;; left-x1 left-y1 left-x2 left-y2
|
|
722 |
+ ;; right-x1 right-y1 right-x2 right-y2 ...
|
|
712 | 723 |
;;
|
713 | 724 |
(let ((display (picture-display picture)))
|
714 | 725 |
(synchronise-picture-state picture)
|
715 | 726 |
(synchronise-picture-state source)
|
716 |
- (with-buffer-request (display (extension-opcode display "RENDER"))
|
|
717 |
- (data +X-RenderTrapezoids+)
|
|
718 |
- (render-op op) ;op
|
|
719 |
- (card8 0) ;pad
|
|
720 |
- (card16 0) ;pad
|
|
721 |
- (resource-id (picture-id source))
|
|
722 |
- (resource-id (picture-id picture))
|
|
723 |
- ((or (member :none) picture-format) mask-format)
|
|
724 |
- (int16 src-x)
|
|
725 |
- (int16 src-y)
|
|
726 |
- ((sequence :format int32) coord-sequence) )))
|
|
727 |
+ (labels ((funk (x) (ash x 16)))
|
|
728 |
+ (with-buffer-request (display (extension-opcode display "RENDER"))
|
|
729 |
+ (data +X-RenderTrapezoids+)
|
|
730 |
+ (render-op op)
|
|
731 |
+ (pad8 0)
|
|
732 |
+ (pad16 0)
|
|
733 |
+ (resource-id (picture-id source))
|
|
734 |
+ (resource-id (picture-id picture))
|
|
735 |
+ ((or (member :none) picture-format) mask-format)
|
|
736 |
+ (int16 src-x)
|
|
737 |
+ (int16 src-y)
|
|
738 |
+ ((sequence :format int32 :transform #'funk) coord-sequence)))))
|
|
727 | 739 |
|
728 | 740 |
(defun render-composite (op
|
729 | 741 |
source mask dest
|
... | ... | @@ -735,9 +747,9 @@ by every function, which attempts to generate RENDER requests." |
735 | 747 |
(synchronise-picture-state dest)
|
736 | 748 |
(with-buffer-request (display (extension-opcode display "RENDER"))
|
737 | 749 |
(data +X-RenderComposite+)
|
738 |
- (render-op op) ;op
|
|
739 |
- (card8 0) ;pad
|
|
740 |
- (card16 0) ;pad
|
|
750 |
+ (render-op op)
|
|
751 |
+ (pad8 0)
|
|
752 |
+ (pad16 0)
|
|
741 | 753 |
(resource-id (picture-id source))
|
742 | 754 |
(resource-id (if mask (picture-id mask) 0))
|
743 | 755 |
(resource-id (picture-id dest))
|
... | ... | @@ -750,13 +762,6 @@ by every function, which attempts to generate RENDER requests." |
750 | 762 |
(card16 width)
|
751 | 763 |
(card16 height))))
|
752 | 764 |
|
753 |
-(def-clx-class (glyph-set (:copier nil)
|
|
754 |
- )
|
|
755 |
- (id 0 :type resource-id)
|
|
756 |
- (display nil :type (or null display))
|
|
757 |
- (plist nil :type list) ; Extension hook
|
|
758 |
- (format))
|
|
759 |
- |
|
760 | 765 |
(defun render-create-glyph-set (format &key glyph-set)
|
761 | 766 |
(let ((display (picture-format-display format)))
|
762 | 767 |
(let* ((glyph-set (or glyph-set (make-glyph-set :display display)))
|
... | ... | @@ -803,14 +808,16 @@ by every function, which attempts to generate RENDER requests." |
803 | 808 |
(with-buffer-request (display (extension-opcode display "RENDER"))
|
804 | 809 |
(data +X-RenderCompositeGlyphs8+)
|
805 | 810 |
(render-op alu)
|
806 |
- (card8 0) (card16 0) ;padding
|
|
811 |
+ (pad8 0)
|
|
812 |
+ (pad16 0)
|
|
807 | 813 |
(picture source)
|
808 | 814 |
(picture dest)
|
809 | 815 |
((or (member :none) picture-format) mask-format)
|
810 | 816 |
(glyph-set glyph-set)
|
811 | 817 |
(int16 src-x) (int16 src-y)
|
812 | 818 |
(card8 (- end start)) ;length of glyph elt
|
813 |
- (card8 0) (card16 0) ;padding
|
|
819 |
+ (pad8 0)
|
|
820 |
+ (pad16 0)
|
|
814 | 821 |
(int16 dest-x) (int16 dest-y) ;dx, dy
|
815 | 822 |
((sequence :format card8) sequence))))
|
816 | 823 |
|
... | ... | @@ -832,7 +839,8 @@ by every function, which attempts to generate RENDER requests." |
832 | 839 |
(data ,opcode)
|
833 | 840 |
(length request-length)
|
834 | 841 |
(render-op ,alu)
|
835 |
- (card8 0) (card16 0) ;padding
|
|
842 |
+ (pad8 0)
|
|
843 |
+ (pad16 0)
|
|
836 | 844 |
(picture ,source)
|
837 | 845 |
(picture ,dest)
|
838 | 846 |
((or (member :none) picture-format) ,mask-format)
|
... | ... | @@ -931,17 +939,27 @@ by every function, which attempts to generate RENDER requests." |
931 | 939 |
(unit (bitmap-format-unit bitmap-format))
|
932 | 940 |
(byte-lsb-first-p (display-image-lsb-first-p display))
|
933 | 941 |
(bit-lsb-first-p (bitmap-format-lsb-first-p bitmap-format)))
|
934 |
- (let* ((byte-per-line (* 4 (ceiling
|
|
935 |
- (* w (picture-format-depth (glyph-set-format glyph-set)))
|
|
936 |
- 32)))
|
|
937 |
- (request-length (+ 28
|
|
938 |
- (* h byte-per-line))))
|
|
942 |
+ (let* ((padded-bytes-per-line
|
|
943 |
+ (index* (index-ceiling
|
|
944 |
+ (index* w (picture-format-depth
|
|
945 |
+ (glyph-set-format glyph-set)))
|
|
946 |
+ 32)
|
|
947 |
+ 4))
|
|
948 |
+ (request-bytes
|
|
949 |
+ (index+ 28 (index* h padded-bytes-per-line)))
|
|
950 |
+ (max-bytes-per-request
|
|
951 |
+ (index* (index- (display-max-request-length display) 6) 4)))
|
|
952 |
+ ;; INV: we can do better – if at least one scanline of the
|
|
953 |
+ ;; image fits in the request, we may render glyph in a loop
|
|
954 |
+ ;; like it's done in a function `put-image' in `image.lisp'.
|
|
955 |
+ (when (> request-bytes max-bytes-per-request)
|
|
956 |
+ (error "Glyph won't fit in a single request"))
|
|
939 | 957 |
(with-buffer-request (display (extension-opcode display "RENDER"))
|
940 | 958 |
(data +X-RenderAddGlyphs+)
|
941 |
- (length (ceiling request-length 4))
|
|
959 |
+ (length (ceiling request-bytes 4))
|
|
942 | 960 |
(glyph-set glyph-set)
|
943 |
- (card32 1) ;number glyphs
|
|
944 |
- (card32 id) ;id
|
|
961 |
+ (card32 1) ;number glyphs
|
|
962 |
+ (card32 id) ;id
|
|
945 | 963 |
(card16 w)
|
946 | 964 |
(card16 h)
|
947 | 965 |
(int16 x-origin)
|
... | ... | @@ -952,7 +970,7 @@ by every function, which attempts to generate RENDER requests." |
952 | 970 |
(setf (buffer-boffset display) (advance-buffer-offset 28))
|
953 | 971 |
(let ((im (create-image :width w :height h :depth 8 :data data)))
|
954 | 972 |
(write-image-z display im 0 0 w h
|
955 |
- byte-per-line ;padded bytes per line
|
|
973 |
+ padded-bytes-per-line
|
|
956 | 974 |
unit byte-lsb-first-p bit-lsb-first-p)) ))) )))
|
957 | 975 |
|
958 | 976 |
(defun render-add-glyph-from-picture (glyph-set picture
|
... | ... | @@ -1153,3 +1171,21 @@ by every function, which attempts to generate RENDER requests." |
1153 | 1171 |
(card16 x)
|
1154 | 1172 |
(card16 y))
|
1155 | 1173 |
cursor)))
|
1174 |
+ |
|
1175 |
+(defun render-create-anim-cursor (cursors delays)
|
|
1176 |
+ "Create animated cursor. cursors length must be the same as delays length."
|
|
1177 |
+ (let ((display (cursor-display (first cursors))))
|
|
1178 |
+ (ensure-render-initialized display)
|
|
1179 |
+ (let* ((cursor (make-cursor :display display))
|
|
1180 |
+ (cid (allocate-resource-id display cursor 'cursor))
|
|
1181 |
+ (cursors-length (length cursors))
|
|
1182 |
+ (cursors-delays (make-list (* 2 (length cursors)))))
|
|
1183 |
+ (setf (xlib:cursor-id cursor) cid)
|
|
1184 |
+ (dotimes (i cursors-length)
|
|
1185 |
+ (setf (elt cursors-delays (* 2 i)) (cursor-id (elt cursors i))
|
|
1186 |
+ (elt cursors-delays (1+ (* 2 i))) (elt delays i)))
|
|
1187 |
+ (xlib::with-buffer-request (display (extension-opcode display "RENDER"))
|
|
1188 |
+ (data +X-RenderCreateAnimCursor+)
|
|
1189 |
+ (resource-id cid)
|
|
1190 |
+ ((sequence :format card32) cursors-delays))
|
|
1191 |
+ cursor)))
|
... | ... | @@ -10,7 +10,7 @@ |
10 | 10 |
;;; * Implement XTestSetVisualIDOfVisual and XTestDiscard
|
11 | 11 |
;;; * Add the missing (declare (type ...
|
12 | 12 |
|
13 |
-(defpackage :xtest
|
|
13 |
+(defpackage #:xlib/xtest
|
|
14 | 14 |
(:use :common-lisp :xlib)
|
15 | 15 |
(:import-from :xlib
|
16 | 16 |
#:data
|
... | ... | @@ -44,7 +44,7 @@ |
44 | 44 |
#:fake-key-event
|
45 | 45 |
#:grab-control))
|
46 | 46 |
|
47 |
-(in-package :xtest)
|
|
47 |
+(in-package #:xlib/xtest)
|
|
48 | 48 |
|
49 | 49 |
(define-extension "XTEST")
|
50 | 50 |
|
... | ... | @@ -35,9 +35,6 @@ |
35 | 35 |
;;; constructed as well as to indentify any obsolete/wrong
|
36 | 36 |
;;; functions I made.
|
37 | 37 |
|
38 |
-#+cmu
|
|
39 |
-(ext:file-comment "$Id: xvidmode.lisp,v 1.2 2009/06/17 18:22:46 rtoy Rel $")
|
|
40 |
- |
|
41 | 38 |
(in-package :xlib)
|
42 | 39 |
|
43 | 40 |
(export '(mode-info
|
... | ... | @@ -176,6 +173,14 @@ |
176 | 173 |
(error "screen ~A not found in display ~A" screen display)
|
177 | 174 |
position)))
|
178 | 175 |
|
176 |
+(declaim (inline __card32->card16__))
|
|
177 |
+(defun __card32->card16__ (i)
|
|
178 |
+ (declare (type card32 i))
|
|
179 |
+ #+clx-little-endian
|
|
180 |
+ (progn (values (ldb (byte 16 0) i) (ldb (byte 32 16) i)))
|
|
181 |
+ #-clx-little-endian
|
|
182 |
+ (progn (values (ldb (byte 32 16) i) (ldb (byte 16 0) i))))
|
|
183 |
+ |
|
179 | 184 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
180 | 185 |
;;;; ;;;;
|
181 | 186 |
;;;; public XFree86-VidMode Extension routines ;;;;
|
... | ... | @@ -723,11 +728,3 @@ x and y keyword parameters value (zero will be theire default value)." |
723 | 728 |
(setf (svref v (incf index)) w1
|
724 | 729 |
(svref v (incf index)) w2))))
|
725 | 730 |
v)))
|
726 |
- |
|
727 |
-(declaim (inline __card32->card16__))
|
|
728 |
-(defun __card32->card16__ (i)
|
|
729 |
- (declare (type card32 i))
|
|
730 |
- #+clx-little-endian
|
|
731 |
- (progn (values (ldb (byte 16 0) i) (ldb (byte 32 16) i)))
|
|
732 |
- #-clx-little-endian
|
|
733 |
- (progn (values (ldb (byte 32 16) i) (ldb (byte 16 0) i))))
|
... | ... | @@ -68,16 +68,16 @@ |
68 | 68 |
(comf "target:clx/manager" :load t)
|
69 | 69 |
(comf "target:clx/image" :load t)
|
70 | 70 |
(comf "target:clx/resource" :load t)
|
71 |
- (comf "target:clx/shape" :load t)
|
|
72 |
- (comf "target:clx/big-requests" :load t)
|
|
73 |
- (comf "target:clx/xvidmode" :load t)
|
|
74 |
- (comf "target:clx/xrender" :load t)
|
|
75 |
- (comf "target:clx/glx" :load t)
|
|
76 |
- (comf "target:clx/gl" :load t)
|
|
77 |
- (comf "target:clx/dpms" :load t)
|
|
78 |
- (comf "target:clx/screensaver" :load t)
|
|
79 |
- (comf "target:clx/xinerama" :load t)
|
|
80 |
- (comf "target:clx/xtest" :load t))
|
|
71 |
+ (comf "target:clx/extensions/shape" :load t)
|
|
72 |
+ (comf "target:clx/extensions/big-requests" :load t)
|
|
73 |
+ (comf "target:clx/extensions/xvidmode" :load t)
|
|
74 |
+ (comf "target:clx/extensions/xrender" :load t)
|
|
75 |
+ (comf "target:clx/extensions/glx" :load t)
|
|
76 |
+ (comf "target:clx/extensions/gl" :load t)
|
|
77 |
+ (comf "target:clx/extensions/dpms" :load t)
|
|
78 |
+ (comf "target:clx/extensions/screensaver" :load t)
|
|
79 |
+ (comf "target:clx/extensions/xinerama" :load t)
|
|
80 |
+ (comf "target:clx/extensions/xtest" :load t))
|
|
81 | 81 |
(comf "target:code/clx-ext")
|
82 | 82 |
(comf "target:hemlock/charmacs" :load t)
|
83 | 83 |
(comf "target:hemlock/key-event" :load t)
|
... | ... | @@ -109,16 +109,16 @@ |
109 | 109 |
"target:clx/manager"
|
110 | 110 |
"target:clx/image"
|
111 | 111 |
"target:clx/resource"
|
112 |
- "target:clx/shape"
|
|
113 |
- "target:clx/big-requests"
|
|
114 |
- "target:clx/xvidmode"
|
|
115 |
- "target:clx/xrender"
|
|
116 |
- "target:clx/glx"
|
|
117 |
- "target:clx/gl"
|
|
118 |
- "target:clx/dpms"
|
|
119 |
- "target:clx/screensaver"
|
|
120 |
- "target:clx/xinerama"
|
|
121 |
- "target:clx/xtest"
|
|
112 |
+ "target:clx/extensions/shape"
|
|
113 |
+ "target:clx/extensions/big-requests"
|
|
114 |
+ "target:clx/extensions/xvidmode"
|
|
115 |
+ "target:clx/extensions/xrender"
|
|
116 |
+ "target:clx/extensions/glx"
|
|
117 |
+ "target:clx/extensions/gl"
|
|
118 |
+ "target:clx/extensions/dpms"
|
|
119 |
+ "target:clx/extensions/screensaver"
|
|
120 |
+ "target:clx/extensions/xinerama"
|
|
121 |
+ "target:clx/extensions/xtest"
|
|
122 | 122 |
"target:code/clx-ext"
|
123 | 123 |
"target:hemlock/charmacs"
|
124 | 124 |
"target:hemlock/key-event"
|