[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 163/255: sorted out different types of backgrounds
From: |
Eric Schulte |
Subject: |
[elpa] 163/255: sorted out different types of backgrounds |
Date: |
Sun, 16 Mar 2014 01:02:40 +0000 |
eschulte pushed a commit to branch go
in repository elpa.
commit d73669831bf8b43462d6ea00e1e60e52b0a0c934
Author: Eric Schulte <address@hidden>
Date: Tue Jun 5 13:47:57 2012 -0600
sorted out different types of backgrounds
---
go-board.el | 46 +++++++++++++++++++++++++++++++++-------------
1 files changed, 33 insertions(+), 13 deletions(-)
diff --git a/go-board.el b/go-board.el
index 1e72d30..12bf16b 100644
--- a/go-board.el
+++ b/go-board.el
@@ -173,12 +173,23 @@
((equal val :B) black-piece)
((and (stringp val) (= 1 (length val)) val))
(t (if (and (emph (car pos)) (emph (cdr pos))) "+" ".")))))
- (cond
- ((string= str white-piece) (put str :type :white))
- ((string= str black-piece) (put str :type :black))
- ((string= str "+") (put str :type :hoshi))
- ((string= str ".") (put str :type :background-1))
- (t (put str :type :background)))
+ (put str :type
+ (cons (cond ;; foreground
+ ((string= str white-piece) :white)
+ ((string= str black-piece) :black)
+ ((string= str "+") :hoshi)
+ ((string= str ".") :background-1)
+ (t :background))
+ (cond ;; background
+ ((and (= 0 (car pos)) (= 0 (cdr pos))) :bl)
+ ((and (= 0 (car pos)) (= (1- size) (cdr pos))) :br)
+ ((and (= (1- size) (car pos)) (= 0 (cdr pos))) :tl)
+ ((and (= (1- size) (car pos)) (= (1- size) (cdr pos))) :tr)
+ ((= 0 (car pos)) :b)
+ ((= (1- size) (car pos)) :t)
+ ((= 0 (cdr pos)) :l)
+ ((= (1- size) (cdr pos)) :r)
+ (t nil))))
(put str :pos (cons (cdr pos) (car pos)))
str))))
@@ -187,7 +198,7 @@
(label (format "%3d" (1+ row)))
(row-body "")
(filler " "))
- (put-text-property 0 1 :type :background filler)
+ (put-text-property 0 1 :type (cons :background nil) filler)
(dotimes (n size)
(setq row-body
(concat row-body
@@ -224,14 +235,23 @@
(let ((start (or start (point-min)))
(end (or end (point-max))))
(dolist (point (range start end))
- (case (get-text-property point :type)
- (:background (if go-board-use-images
- (hide point)
- (ov point 'background)))
- (:background-1 (ov point 'background))
+ (case (car (get-text-property point :type))
(:hoshi (ov point 'hoshi))
(:white (ov point 'white))
- (:black (ov point 'black)))))))
+ (:black (ov point 'black))
+ (:background (if go-board-use-images
+ (hide point)
+ (ov point 'background)))
+ (:background-1 (ov point (case (cdr (get-text-property point :type))
+ (:tl 'top-left)
+ (:tr 'top-right)
+ (:bl 'bottom-left)
+ (:br 'bottom-right)
+ (:t 'top)
+ (:b 'bottom)
+ (:l 'left)
+ (:r 'right)
+ (t 'background)))))))))
(defun update-display (buffer)
(with-current-buffer buffer
- [elpa] 148/255: improved the setf method for aget, (continued)
- [elpa] 148/255: improved the setf method for aget, Eric Schulte, 2014/03/15
- [elpa] 150/255: more lenient regexp for matching game listing, Eric Schulte, 2014/03/15
- [elpa] 152/255: Revert "improved the setf method for aget", Eric Schulte, 2014/03/15
- [elpa] 154/255: don't quit main back-end when quitting a board, Eric Schulte, 2014/03/15
- [elpa] 158/255: beginning to translate svg images into elisp, Eric Schulte, 2014/03/15
- [elpa] 149/255: push all buffer-local variables into an igs object, Eric Schulte, 2014/03/15
- [elpa] 162/255: painting a nice svg board, but more to do, Eric Schulte, 2014/03/15
- [elpa] 159/255: translated all svg stone images into elisp, Eric Schulte, 2014/03/15
- [elpa] 164/255: prompt before quitting, Eric Schulte, 2014/03/15
- [elpa] 153/255: safety measure when observing igs games, Eric Schulte, 2014/03/15
- [elpa] 163/255: sorted out different types of backgrounds,
Eric Schulte <=
- [elpa] 168/255: adding option to play a sound during moves, Eric Schulte, 2014/03/15
- [elpa] 155/255: less permissive igs move regular expression, Eric Schulte, 2014/03/15
- [elpa] 166/255: board images working with backgrounds, Eric Schulte, 2014/03/15
- [elpa] 173/255: start gnugo process when object is created, Eric Schulte, 2014/03/15
- [elpa] 167/255: cleanup images in board faces, Eric Schulte, 2014/03/15
- [elpa] 170/255: fix spacing of labels when using image for display, Eric Schulte, 2014/03/15
- [elpa] 174/255: quit the main back-end as well, Eric Schulte, 2014/03/15
- [elpa] 160/255: removing stones/ directory, Eric Schulte, 2014/03/15
- [elpa] 175/255: support for playing different types of games, Eric Schulte, 2014/03/15
- [elpa] 157/255: images of stones, Eric Schulte, 2014/03/15