diff options
| author | Richard M. Stallman | 1994-10-17 07:31:52 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-10-17 07:31:52 +0000 |
| commit | 72418504bfb7b41973c4fac83daf2edbccf5793d (patch) | |
| tree | 738bc9e1376244705ad35857c9b351b1ab8ab328 | |
| parent | 0c6b475508ec247169c3b3f5c7ef9dc34df41e9e (diff) | |
| download | emacs-72418504bfb7b41973c4fac83daf2edbccf5793d.tar.gz emacs-72418504bfb7b41973c4fac83daf2edbccf5793d.zip | |
(set-face-stipple): New function.
(set-face-background-pixmap): An alias for that.
(face-stipple): New function.
(face-background-pixmap): An alias for that.
(copy-face, face-equal, face-differs-from-default-p)
(make-face-x-resource-internal): Handle stipple bitmaps.
| -rw-r--r-- | lisp/faces.el | 71 |
1 files changed, 39 insertions, 32 deletions
diff --git a/lisp/faces.el b/lisp/faces.el index 0f38cb7a956..335e583f13a 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -28,7 +28,7 @@ | |||
| 28 | ;;;; Functions for manipulating face vectors. | 28 | ;;;; Functions for manipulating face vectors. |
| 29 | 29 | ||
| 30 | ;;; A face vector is a vector of the form: | 30 | ;;; A face vector is a vector of the form: |
| 31 | ;;; [face NAME ID FONT FOREGROUND BACKGROUND BACKGROUND-PIXMAP UNDERLINE] | 31 | ;;; [face NAME ID FONT FOREGROUND BACKGROUND STIPPLE UNDERLINE] |
| 32 | 32 | ||
| 33 | ;;; Type checkers. | 33 | ;;; Type checkers. |
| 34 | (defsubst internal-facep (x) | 34 | (defsubst internal-facep (x) |
| @@ -70,11 +70,14 @@ If FRAME is t, report on the defaults for face FACE (for new frames). | |||
| 70 | If FRAME is omitted or nil, use the selected frame." | 70 | If FRAME is omitted or nil, use the selected frame." |
| 71 | (aref (internal-get-face face frame) 5)) | 71 | (aref (internal-get-face face frame) 5)) |
| 72 | 72 | ||
| 73 | ;;(defsubst face-background-pixmap (face &optional frame) | 73 | (defsubst face-stipple (face &optional frame) |
| 74 | ;; "Return the background pixmap name of face FACE, or nil if unspecified. | 74 | "Return the stipple pixmap name of face FACE, or nil if unspecified. |
| 75 | ;;If the optional argument FRAME is given, report on face FACE in that frame. | 75 | If the optional argument FRAME is given, report on face FACE in that frame. |
| 76 | ;;Otherwise report on the defaults for face FACE (for new frames)." | 76 | If FRAME is t, report on the defaults for face FACE (for new frames). |
| 77 | ;; (aref (internal-get-face face frame) 6)) | 77 | If FRAME is omitted or nil, use the selected frame." |
| 78 | (aref (internal-get-face face frame) 6)) | ||
| 79 | |||
| 80 | (defalias 'face-background-pixmap 'face-stipple) | ||
| 78 | 81 | ||
| 79 | (defsubst face-underline-p (face &optional frame) | 82 | (defsubst face-underline-p (face &optional frame) |
| 80 | "Return t if face FACE is underlined. | 83 | "Return t if face FACE is underlined. |
| @@ -108,19 +111,21 @@ in that frame; otherwise change each frame." | |||
| 108 | (interactive (internal-face-interactive "background")) | 111 | (interactive (internal-face-interactive "background")) |
| 109 | (internal-set-face-1 face 'background color 5 frame)) | 112 | (internal-set-face-1 face 'background color 5 frame)) |
| 110 | 113 | ||
| 111 | ;;(defsubst set-face-background-pixmap (face name &optional frame) | 114 | (defsubst set-face-stipple (face name &optional frame) |
| 112 | ;; "Change the background pixmap of face FACE to PIXMAP. | 115 | "Change the stipple pixmap of face FACE to PIXMAP. |
| 113 | ;;PIXMAP should be a string, the name of a file of pixmap data. | 116 | PIXMAP should be a string, the name of a file of pixmap data. |
| 114 | ;;The directories listed in the `x-bitmap-file-path' variable are searched. | 117 | The directories listed in the `x-bitmap-file-path' variable are searched. |
| 115 | 118 | ||
| 116 | ;;Alternatively, PIXMAP may be a list of the form (WIDTH HEIGHT DATA) | 119 | Alternatively, PIXMAP may be a list of the form (WIDTH HEIGHT DATA) |
| 117 | ;;where WIDTH and HEIGHT are the size in pixels, | 120 | where WIDTH and HEIGHT are the size in pixels, |
| 118 | ;;and DATA is a string, containing the raw bits of the bitmap. | 121 | and DATA is a string, containing the raw bits of the bitmap. |
| 119 | 122 | ||
| 120 | ;;If the optional FRAME argument is provided, change only | 123 | If the optional FRAME argument is provided, change only |
| 121 | ;;in that frame; otherwise change each frame." | 124 | in that frame; otherwise change each frame." |
| 122 | ;; (interactive (internal-face-interactive "background-pixmap")) | 125 | (interactive (internal-face-interactive "stipple")) |
| 123 | ;; (internal-set-face-1 face 'background-pixmap name 6 frame)) | 126 | (internal-set-face-1 face 'background-pixmap name 6 frame)) |
| 127 | |||
| 128 | (defalias 'set-face-background-pixmap 'set-face-stipple) | ||
| 124 | 129 | ||
| 125 | (defsubst set-face-underline-p (face underline-p &optional frame) | 130 | (defsubst set-face-underline-p (face underline-p &optional frame) |
| 126 | "Specify whether face FACE is underlined. (Yes if UNDERLINE-P is non-nil.) | 131 | "Specify whether face FACE is underlined. (Yes if UNDERLINE-P is non-nil.) |
| @@ -305,9 +310,11 @@ If the face already exists, it is unmodified." | |||
| 305 | (bg (or (x-get-resource (concat name ".attributeBackground") | 310 | (bg (or (x-get-resource (concat name ".attributeBackground") |
| 306 | "Face.AttributeBackground") | 311 | "Face.AttributeBackground") |
| 307 | (and set-anyway (face-background face)))) | 312 | (and set-anyway (face-background face)))) |
| 308 | ;; (bgp (or (x-get-resource (concat name ".attributeBackgroundPixmap") | 313 | (bgp (or (x-get-resource (concat name ".attributeStipple") |
| 309 | ;; "Face.AttributeBackgroundPixmap") | 314 | "Face.AttributeStipple") |
| 310 | ;; (and set-anyway (face-background-pixmap face)))) | 315 | (x-get-resource (concat name ".attributeBackgroundPixmap") |
| 316 | "Face.AttributeBackgroundPixmap") | ||
| 317 | (and set-anyway (face-stipple face)))) | ||
| 311 | (ulp (let ((resource (x-get-resource | 318 | (ulp (let ((resource (x-get-resource |
| 312 | (concat name ".attributeUnderline") | 319 | (concat name ".attributeUnderline") |
| 313 | "Face.AttributeUnderline"))) | 320 | "Face.AttributeUnderline"))) |
| @@ -327,10 +334,10 @@ If the face already exists, it is unmodified." | |||
| 327 | (condition-case () | 334 | (condition-case () |
| 328 | (set-face-background face bg frame) | 335 | (set-face-background face bg frame) |
| 329 | (error (message "color `%s' not allocated for face `%s'" bg name)))) | 336 | (error (message "color `%s' not allocated for face `%s'" bg name)))) |
| 330 | ;; (if bgp | 337 | (if bgp |
| 331 | ;; (condition-case () | 338 | (condition-case () |
| 332 | ;; (set-face-background-pixmap face bgp frame) | 339 | (set-face-stipple face bgp frame) |
| 333 | ;; (error (message "pixmap `%s' not found for face `%s'" bgp name)))) | 340 | (error (message "pixmap `%s' not found for face `%s'" bgp name)))) |
| 334 | (if (or ulp set-anyway) | 341 | (if (or ulp set-anyway) |
| 335 | (set-face-underline-p face ulp frame)) | 342 | (set-face-underline-p face ulp frame)) |
| 336 | ))) | 343 | ))) |
| @@ -370,8 +377,9 @@ to NEW-FACE on frame NEW-FRAME." | |||
| 370 | (set-face-font new-face nil new-frame))) | 377 | (set-face-font new-face nil new-frame))) |
| 371 | (set-face-foreground new-face (face-foreground old-face frame) new-frame) | 378 | (set-face-foreground new-face (face-foreground old-face frame) new-frame) |
| 372 | (set-face-background new-face (face-background old-face frame) new-frame) | 379 | (set-face-background new-face (face-background old-face frame) new-frame) |
| 373 | ;;; (set-face-background-pixmap | 380 | (set-face-stipple new-face |
| 374 | ;;; new-face (face-background-pixmap old-face frame) new-frame) | 381 | (face-stipple old-face frame) |
| 382 | new-frame) | ||
| 375 | (set-face-underline-p new-face (face-underline-p old-face frame) | 383 | (set-face-underline-p new-face (face-underline-p old-face frame) |
| 376 | new-frame)) | 384 | new-frame)) |
| 377 | new-face)) | 385 | new-face)) |
| @@ -384,9 +392,8 @@ to NEW-FACE on frame NEW-FRAME." | |||
| 384 | (equal (face-background face1 frame) (face-background face2 frame)) | 392 | (equal (face-background face1 frame) (face-background face2 frame)) |
| 385 | (equal (face-font face1 frame) (face-font face2 frame)) | 393 | (equal (face-font face1 frame) (face-font face2 frame)) |
| 386 | (eq (face-underline-p face1 frame) (face-underline-p face2 frame)) | 394 | (eq (face-underline-p face1 frame) (face-underline-p face2 frame)) |
| 387 | ;; (equal (face-background-pixmap face1 frame) | 395 | (equal (face-stipple face1 frame) |
| 388 | ;; (face-background-pixmap face2 frame)) | 396 | (face-stipple face2 frame)))) |
| 389 | )) | ||
| 390 | 397 | ||
| 391 | (defun face-differs-from-default-p (face &optional frame) | 398 | (defun face-differs-from-default-p (face &optional frame) |
| 392 | "True if face FACE displays differently from the default face, on FRAME. | 399 | "True if face FACE displays differently from the default face, on FRAME. |
| @@ -404,9 +411,9 @@ is displayed on top of." | |||
| 404 | (null (face-background face frame))) | 411 | (null (face-background face frame))) |
| 405 | (or (equal (face-font default frame) (face-font face frame)) | 412 | (or (equal (face-font default frame) (face-font face frame)) |
| 406 | (null (face-font face frame))) | 413 | (null (face-font face frame))) |
| 407 | ;;; (or (equal (face-background-pixmap default frame) | 414 | (or (equal (face-stipple default frame) |
| 408 | ;;; (face-background-pixmap face frame)) | 415 | (face-stipple face frame)) |
| 409 | ;;; (null (face-background-pixmap face frame))) | 416 | (null (face-stipple face frame))) |
| 410 | (equal (face-underline-p default frame) | 417 | (equal (face-underline-p default frame) |
| 411 | (face-underline-p face frame)) | 418 | (face-underline-p face frame)) |
| 412 | )))) | 419 | )))) |