;ELC ;;; Compiled ;;; in Emacs version 26.3 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\210\300\303!\207" [require xpm xpm-m2z cl-lib] 2) #@492 Alist of styles suitable for `gnugo-imgen-create-xpms'. The key is a symbol naming the style. The value is a plist. Here is a list of recognized keywords and their meanings: :background -- string that names a color in XPM format, such as :grid-lines "#000000000000" or "black"; the special string :circ-edges "None" makes that component transparent :white-fill :black-fill All keywords are required and color values cannot be nil. This restriction may be lifted in the future. (defvar gnugo-imgen-styles '((d-bump :background "#FFFFC7C75252" :grid-lines "#000000000000" :circ-edges "#C6C6C3C3C6C6" :white-fill "#FFFFFFFFFFFF" :black-fill "#000000000000") (ttn :background "#000000000000" :grid-lines "#AAAA88885555" :circ-edges "#888888888888" :white-fill "#CCCCCCCCCCCC" :black-fill "#444444444444")) (#$ . 494)) #@106 Which style in `gnugo-imgen-styles' to use. If nil, `gnugo-imgen-create-xpms' defaults to the first one. (defvar gnugo-imgen-style nil (#$ . 1329)) #@254 Function to compute XPM image size from board size. This is called with one arg, integer BOARD-SIZE, and should return a number (float or integer), the number of pixels for the side of a square position on the board. A value less than 8 is taken as 8. (defvar gnugo-imgen-sizing-function 'gnugo-imgen-fit-window-height (#$ . 1484)) (defvar gnugo-imgen-cache (make-hash-table :test 'equal)) #@18 Clear the cache. (defalias 'gnugo-imgen-clear-cache #[0 "\301!\207" [gnugo-imgen-cache clrhash] 2 (#$ . 1881) nil]) #@38 (fn BOARD-SIZE IGNORED-GRID-LINES) (defalias 'gnugo-imgen--fit #[514 "\300 \211G\301U\203\211A\262\242\202\302\303\304GD\"\211A\262\242\211A\262\242@\305\306\307 \n_#!\245\207" [window-inside-absolute-pixel-edges 4 signal wrong-number-of-arguments nil float - frame-char-height] 13 (#$ . 2004)]) #@246 Return the dimension (in pixels) of a square for BOARD-SIZE. This uses the TOP and BOTTOM components as returned by `window-inside-absolute-pixel-edges' and subtracts twice the `frame-char-height' (to leave space for the grid). (fn BOARD-SIZE) (defalias 'gnugo-imgen-fit-window-height #[257 "\300\301\"\207" [gnugo-imgen--fit 2] 4 (#$ . 2326)]) #@249 Return the dimension (in pixels) of a square for BOARD-SIZE. This uses the TOP and BOTTOM components as returned by `window-inside-absolute-pixel-edges' and subtracts the `frame-char-height' (to leave top-line space for the grid). (fn BOARD-SIZE) (defalias 'gnugo-imgen-fit-window-height/no-grid-bottom #[257 "\300\301\"\207" [gnugo-imgen--fit 1] 4 (#$ . 2680)]) (defconst gnugo-imgen-palette '((32 . :background) (46 . :grid-lines) (88 . :circ-edges) (45 . :black-fill) (43 . :white-fill))) #@21 (fn SQUARE STYLE) (defalias 'gnugo-imgen-create-xpms-1 #[514 "\301\302\"\301\303\"\301\304\"\305\305\211:\2037@\262:\2037@\262\306\307\"BB\262A\262A\262\202\211\237\266\205\310!\305\305\211:\203k@\262:\203k@\262\311\"BB\262A\262A\262\202C\211\237\266\206S\211\312\245\313\314Z!\313\315\\!\316\317\305\"\316\320\305\"\305C\321\322\323\324\325\326\327\330\331\332%%\332%\n%$\262\262\262\262\305\333X\203:\203@\262 r#q\210\211\203\376\211@\334\"\210A\266\202\202\353\210p)I\210T\262A\262\202\314\266\335\211 \313 !\"\f\333\245\"\332C\211\242\320W\203n \242r \242#q\210\336\337\242!\203M\211\340\341$\210\202_  \242SH!\210\211\341\340$\210p\262)I\210\211\242T\240\210\202#\266\342r\343#q\210\343H!\210\344\345\f\211\320\346$\334\347#\210\211 \343\350\351%\210)\325\n\nB\332DD\332DD$\262\305C\333X\203$:\203$\211@\240\210r\nHq\210\n\352\351%\210)\353\332\354\305\320W\203:\203@\262r Hq\210 \334#\210 \355%\210 \356#\210)T\262A\262\202\331\266T\262A\262\202\263\266\357\360\"\210\242\237\262\266\204\207" [gnugo-imgen-palette mapcar cdr symbol-name car nil format "s %s" copy-sequence plist-get 2.0 truncate 0.5 0.5 make-vector 10 4 #[771 "\300\301\302#\211\303%\207" [xpm-generate-buffer format "%d_%d" 1] 9 "\n\n(fn SQUARE PALETTE N)"] #[257 "\300 \210\301!\210\302\303!\207" [erase-buffer insert-buffer-substring xpm-grok t] 3 "\n\n(fn BUFFER)"] #[1028 "DEDEFE  D\n\n\nE \nD\257 \207" #1=[] 14 "\n\n(fn N E W S)"] #[514 "\211\211\205\211@\300\301#\210A\266\202\202\207" [apply xpm-put-points] 8 "\n\n(fn PX LS)"] 1 #[771 "BDC\207" #1# 6 "\n\n(fn X Y1 Y2)"] #[1285 "\300##\"\207" [append] 11 "\n\n(fn HALF-M1 HALF-P1 --CL-VLINE-- Y1 Y2)"] #[771 "BDC\207" #1# 5 "\n\n(fn Y X1 X2)"] #[1285 "\300##\"\207" [append] 11 "\n\n(fn HALF-M1 HALF-P1 --CL-HLINE-- X1 X2)"] 0 9 46 #[514 "\300\211#\207" [xpm-m2z-circle] 6 "\n\n(fn HALF RADIUS)"] #[1028 "\300\301\302\242V\203\202#\207" [xpm-raster 88 2] 9 "\n\n(fn N FORM B W)"] cl-evenp 45 43 #[1285 "\300b\210\301\302\303w[!\210\301\304!\210\305\306#c\210B\307\310\311\n$B\242B\240\207" [25 delete-char "^1-9" nil 1 format "%s%d" :ascent center :color-symbols] 12 "\n\n(fn RESOLVED RV PLACE TYPE FINISH)"] 5 xpm-raster xpm-m2z-ellipse 4.5 t hoshi xpm-finish empty #[771 "\242\"\207" #1# 6 "\n\n(fn --CL-MPUT-POINTS-- DECOR PX)"] (bmoku bpmoku wmoku wpmoku) xpm-as-xpm 32 mapc kill-buffer] 32 (#$ . 3180)]) #@309 Return a list of XPM images suitable for BOARD-SIZE. The size and style of the images are determined by `gnugo-imgen-sizing-function' (rounded down to an even number) and `gnugo-imgen-style', respectively. See `gnugo-xpms'. The returned list is cached; see also `gnugo-imgen-clear-cache'. (fn BOARD-SIZE) (defalias 'gnugo-imgen-create-xpms #[257 "!\211\247\204 \304\305\"\210\306\307\310!\311\"]\262 \204!\n@A\206+ \n\236A\206+\304\312!B\313 \"\206=\314\315\" #\207" [gnugo-imgen-sizing-function gnugo-imgen-style gnugo-imgen-styles gnugo-imgen-cache error "Invalid BOARD-SIZE: %s" 8 logand truncate -2 "No style selected" gethash puthash gnugo-imgen-create-xpms-1] 9 (#$ . 5859)]) (provide 'gnugo-imgen)