;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\302\303\304\305\306\301\307\310&\210\311\312\313\314\315DD\316\317\320%\210\311\321\313\314\322DD\323\317\324%\210\311\325\313\314\326DD\327\317\324%\210\311\330\313\314\331DD\332\317\333%\210\311\334\313\314\335DD\336\317\337%\210\311\340\313\314\341DD\342\317\343%\210\344\345\346\347#\210\344\350\351\352#\210\344\353\354\355#\210\311\356\313\314\357DD\360\317\314%\210\311\361\313\314\362DD\363\317\364%\207" [require chess-display custom-declare-group chess-plain nil "A minimal, customizable ASCII display." :group :link (custom-manual "(chess)Plain ASCII diagram displays") custom-declare-variable chess-plain-border-style funcall function #[0 "\300\207" [[43 45 43 124 124 43 45 43]] 1] "If non-nil, a vector describing the border characters." :type (choice (const :tag "No border" nil) (vector :tag "Plain ASCII" (const :value 43 :tag "Upper left corner: +") (const :value 45 :tag "Upper border: -") (const :value 43 :tag "Upper right corner: +") (const :value 124 :tag "Left border: |") (const :value 124 :tag "Right border: |") (const :value 43 :tag "Lower left corrner: +") (const :value 45 :tag "Lower border: -") (const :value 43 :tag "Lower right corner: +")) (vector :tag "Unicode box drawing characters" (const :value 9484 :tag "Upper left corner: ┌") (const :value 9590 :tag "Upper border: ╶") (const :value 9488 :tag "Upper right corner: ┐") (const :value 9591 :tag "Left border: ╷") (const :value 9591 :tag "Right border: ╷") (const :value 9492 :tag "Lower left corrner: └") (const :value 9590 :tag "Lower border: ╶") (const :value 9496 :tag "Lower right corner: ┘")) (vector :tag "Custom" (character :tag "Upper left corner") (character :tag "Upper border") (character :tag "Upper right corner") (character :tag "Left border") (character :tag "Right border") (character :tag "Lower left corner") (character :tag "Lower border") (character :tag "Lower right corner"))) chess-plain-black-square-char #[0 "\300\207" [46] 1] "Character used to indicate empty black squares." character chess-plain-white-square-char #[0 "\300\207" [46] 1] "Character used to indicate empty white squares." chess-plain-piece-chars #[0 "\300\207" [((75 . 75) (81 . 81) (82 . 82) (66 . 66) (78 . 78) (80 . 80) (107 . 107) (113 . 113) (114 . 114) (98 . 98) (110 . 110) (112 . 112))] 1] "Alist of pieces and their corresponding characters.\nCharacters defined here should make sense in respect to the current setting\nof `chess-plain-upcase-indicates'." (choice (list :tag "White has uppercase english letters and black has lowercase english letters" (const :tag "White King: K" (75 . 75)) (const :tag "White Queen: Q" (81 . 81)) (const :tag "White Rook: R" (82 . 82)) (const :tag "White Bishop: B" (66 . 66)) (const :tag "White Knight: N" (78 . 78)) (const :tag "White Pawn: P" (80 . 80)) (const :tag "Black King: k" (107 . 107)) (const :tag "Black Queen: q" (113 . 113)) (const :tag "Black Rook: r" (114 . 114)) (const :tag "Black Bishop: b" (98 . 98)) (const :tag "Black Knight: n" (110 . 110)) (const :tag "Black Pawn: p" (112 . 112))) (list :tag "White has uppercase german letters and black has lowercase german letters" (const :tag "White King: K" (75 . 75)) (const :tag "White Queen: D" (81 . 68)) (const :tag "White Rook: T" (82 . 84)) (const :tag "White Bishop: L" (66 . 76)) (const :tag "White Knight: S" (78 . 83)) (const :tag "White Pawn: B" (80 . 66)) (const :tag "Black King: k" (107 . 107)) (const :tag "Black Queen: d" (113 . 100)) (const :tag "Black Rook: t" (114 . 116)) (const :tag "Black Bishop: l" (98 . 108)) (const :tag "Black Knight: s" (110 . 115)) (const :tag "Black Pawn: b" (112 . 98))) (list :tag "White has english letters and black has german letters" (const :tag "White King: K" (75 . 75)) (const :tag "White Queen: Q" (81 . 81)) (const :tag "White Rook: R" (82 . 82)) (const :tag "White Bishop: B" (66 . 66)) (const :tag "White Knight: N" (78 . 78)) (const :tag "White Pawn: P" (80 . 80)) (const :tag "Black King: J" (107 . 74)) (const :tag "Black Queen: D" (113 . 68)) (const :tag "Black Rook: T" (114 . 84)) (const :tag "Black Bishop: L" (98 . 76)) (const :tag "Black Knight: S" (110 . 83)) (const :tag "Black Pawn: X" (112 . 88))) (list :tag "White has german letters and black has english letters" (const :tag "White King: J" (75 . 74)) (const :tag "White Queen: D" (81 . 68)) (const :tag "White Rook: T" (82 . 84)) (const :tag "White Bishop: L" (66 . 76)) (const :tag "White Knight: S" (78 . 83)) (const :tag "White Pawn: X" (80 . 88)) (const :tag "Black King: K" (107 . 75)) (const :tag "Black Queen: Q" (113 . 81)) (const :tag "Black Rook: R" (114 . 82)) (const :tag "Black Bishop: B" (98 . 66)) (const :tag "Black Knight: N" (110 . 78)) (const :tag "Black Pawn: P" (112 . 80))) (list :tag "Unicode figure pieces" (const :tag "White King: ♔" (75 . 9812)) (const :tag "White Queen: ♕" (81 . 9813)) (const :tag "White Rook: ♖" (82 . 9814)) (const :tag "White Bishop: ♗" (66 . 9815)) (const :tag "White Knight: ♘" (78 . 9816)) (const :tag "White Pawn: ♙" (80 . 9817)) (const :tag "Black King: ♚" (107 . 9818)) (const :tag "Black Queen: ♛" (113 . 9819)) (const :tag "Black Rook: ♜" (114 . 9820)) (const :tag "Black Bishop: ♝" (98 . 9821)) (const :tag "Black Knight: ♞" (110 . 9822)) (const :tag "Black Pawn: ♟" (112 . 9823))) (list :tag "User defined" (cons :format "%v" (const :format #1="" 75) (character :tag "White King")) (cons :format "%v" (const :format #1# 81) (character :tag "White Queen")) (cons :format "%v" (const :format #1# 82) (character :tag "White Rook")) (cons :format "%v" (const :format #1# 66) (character :tag "White Bishop")) (cons :format "%v" (const :format #1# 78) (character :tag "White Knight")) (cons :format "%v" (const :format #1# 80) (character :tag "White Pawn")) (cons :format "%v" (const :format #1# 107) (character :tag "Black King")) (cons :format "%v" (const :format #1# 113) (character :tag "Black Queen")) (cons :format "%v" (const :format #1# 114) (character :tag "Black Rook")) (cons :format "%v" (const :format #1# 98) (character :tag "Black Bishop")) (cons :format "%v" (const :format #1# 110) (character :tag "Black Knight")) (cons :format "%v" (const :format #1# 112) (character :tag "Black Pawn"))) (function :tag "Function")) chess-plain-upcase-indicates #[0 "\300\207" [color] 1] "Defines what a upcase char should indicate.\nThe default is 'color, meaning a upcase char is a white piece, a\nlowercase char a black piece. Possible values: 'color (default),\n'square-color. If set to 'square-color, a uppercase character\nindicates a piece on a black square. (Note that you also need to\nmodify `chess-plain-piece-chars' to avoid real confusion.)" (choice (const :tag "Upcase indicates white piece" color) (const :tag "Upcase indicates black square" square-color)) chess-plain-spacing #[0 "\300\207" [1] 1] "Number of spaces between files." integer custom-declare-face chess-plain-black-face ((((class color) (background light)) (:foreground "Black")) (((class color) (background dark)) (:foreground "Green")) (t (:bold t))) "The face used for black pieces on the ASCII display." chess-plain-white-face ((((class color) (background light)) (:foreground "Blue")) (((class color) (background dark)) (:foreground "Yellow")) (t (:bold t))) "The face used for white pieces on the ASCII display." chess-plain-highlight-face ((((class color) (background light)) (:background "#add8e6")) (((class color) (background dark)) (:background "#add8e6"))) "Face to use for highlighting pieces that have been selected." chess-plain-popup-function #[0 "\300\207" [chess-plain-popup] 1] "The function used to popup a chess-plain display." chess-plain-separate-frame #[0 "\300\207" [nil] 1] "If non-nil, display the chessboard in its own frame." boolean] 8) #@64 Show possible customisations for the plain chessboard display. (defalias 'chess-plain-customize #[0 "\300\301!\207" [customize-group chess-plain] 2 (#$ . 7874) nil]) #@25 (fn EVENT &rest ARGS) (defalias 'chess-plain-handler #[385 "\301\267\202 \302\207 \207\303\304\305!P!\211\205\306\"\207" [chess-plain-popup-function #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (initialize 6 popup 8)) t intern-soft "chess-plain-" symbol-name apply] 6 (#$ . 8046)]) (defalias 'chess-plain-popup #[0 "\203\302\303 T\304_\305\211\306%\207\307 \207" [chess-plain-separate-frame chess-plain-spacing chess-display-popup-in-frame 9 8 nil t chess-display-popup-in-window] 6]) #@24 (fn PIECE RANK FILE) (defalias 'chess-plain-piece-text #[771 "\211\\\304\246\305U\306U\203\211\203\207 \207\n\236A\307 \310=\203.\203)\227\202/\226\202/!\311\305\312\313 \314V\203?\315\202@\316D$\210\207" [chess-plain-white-square-char chess-plain-black-square-char chess-plain-piece-chars chess-plain-upcase-indicates 2 0 32 char-to-string square-color add-text-properties 1 face 97 chess-plain-black-face chess-plain-white-face] 12 (#$ . 8590)]) #@72 Draw a piece at POS on an already drawn display. (fn POS PIECE INDEX) (defalias 'chess-plain-draw-square #[771 "\212b\210\300\301!\210\302\211\250\203\211\303Y\203\211\304X\204$\305\306\307\310E\"\210\211\311\245\262\211\250\203;\211\303Y\203;\211\304X\204C\305\306\312\310E\"\210\313\311\"\262#c\210\314`\315D#)\207" [delete-char 1 chess-plain-piece-text 0 63 signal wrong-type-argument (integer 0 63) index 8 (integer 0 63) mod add-text-properties chess-coord] 12 (#$ . 9066)]) #@131 Draw the given POSITION from PERSPECTIVE's point of view. PERSPECTIVE is t for white or nil for black. (fn POSITION PERSPECTIVE) (defalias 'chess-plain-draw #[514 "\303`\304 \210?\211\203\305\202\306\203\305\202\306 \2034\307 \306H\310\311\305\n_\\ \312H\" \313H\314\261\210\203>\306Y\202A\311W\203q \203S\315\311Z! \316H\261\210\203]\211\306Y\202`\211\311W\203J\250\203x\306Y\203x\305X\204\200\317\320\321\322E\"\210\211\250\203\221\211\306Y\203\221\211\305X\204\231\317\320\323\324E\"\210\311_\\\266\202\325!\205\253\211G\326U\262\204\270\317\320\327\330E\"\210\211\250\203\311\211\306Y\203\311\211\331X\204\321\317\320\332\333E\"\210H\266\202`\334#c\210\335`\336\250\203\367\306Y\203\367\305X\204\377\317\320\321\322E\"\210\211\250\203\211\306Y\203\211\305X\204\317\320\323\324E\"\210\311_\\\266\202D#\210\203,\312Y\202/\305W\2038\310\n\307\"c\210\266\203C\211S\202E\211T\262\202S \203S \337Hc\210\314c\210\203^\305\202_\306\262\203jS\202lT\262\2024 \203\246\307 \340H\310\311\305\n_\\ \341H\" \305H\314\307\211 \204\222\342\202\223\343\344\345\346\347\"\262\310\n\307\"#\262\261\210\350\347!\210b\266\203)\207" [inhibit-redisplay chess-plain-border-style chess-plain-spacing t erase-buffer 7 0 32 make-string 8 1 2 10 number-to-string 3 signal wrong-type-argument (integer 0 7) rank (integer 0 7) file vectorp 75 chess-pos position 63 (integer 0 63) index chess-plain-piece-text add-text-properties chess-coord 4 5 6 "abcdefgh" "hgfedcba" mapconcat string append nil set-buffer-modified-p] 21 (#$ . 9573)]) #@29 (fn INDEX &optional MODE) (defalias 'chess-plain-highlight #[513 "\300\301\"\302\211T\303\304=\203\305\202\306!$\207" [chess-display-index-pos nil put-text-property face :selected chess-plain-highlight-face chess-display-get-face] 9 (#$ . 11205)]) (provide 'chess-plain)