%%
%% This is file `chessboard-keys-pgf.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% chessboard.dtx  (with options: `chessboard-keys-pgf')
%% 
%% chessboard: a package to print chessboards
%% Copyright 2006-2019 Ulrike Fischer (chess@nililand.de)
%% -------------------------------------------
%% 
%% This file can be redistributed and/or modified under the terms of
%% the LaTeX Project Public License distributed from CTAN archives in
%% the directory macros/latex/base/lppl.txt; either version 1 of the
%% License, or (at your option) any later version.
%% 
%% For error reports see documentation.
\ProvidesFile{chessboard-keys-pgf.sty}[2019/06/23 version v1.8 key definitions for chessboard.sty]
%%$Date: 2011/03/17 13:42:38 $$Version: e7ec1b100ede $

%% new 1.5.: style keys for curvemove
\define@key[UFCB]{bez}{x1}{\def\board@val@bezxi{#1}}
\define@key[UFCB]{bez}{x2}{\def\board@val@bezxii{#1}}
\define@key[UFCB]{bez}{y1}{\def\board@val@bezyi{#1}}
\define@key[UFCB]{bez}{y2}{\def\board@val@bezyii{#1}}
\define@key[UFCB]{bez}{linewidth}{\def\board@pgf@linewidth{#1}}
\define@key[UFCB]{bez}{pgflinewidth}{\def\board@pgf@linewidth{#1}}
\define@key[UFCB]{bez}{pgfshortenstart}{\def\board@pgf@shortenstart{#1}}
\define@key[UFCB]{bez}{shortenstart}{\def\board@pgf@shortenstart{#1}}
\define@key[UFCB]{bez}{pgfshortenend}{\def\board@pgf@shortenend{#1}}
\define@key[UFCB]{bez}{shortenend}{\def\board@pgf@shortenend{#1}}
\define@key[UFCB]{bez}{pgfarrow}{\def\board@pgf@arrow{#1}}
\define@key[UFCB]{bez}{arrow}{\def\board@pgf@arrow{#1}}

\define@boolkey[UFCB]{bez}{clockwise}[true]{%
  \ifUFCB@bez@clockwise
   \def\board@val@pgfsign{1}
  \else
   \def\board@val@pgfsign{-1}%
  \fi}%
\define@key[UFCB]{bez}{style}{%
 \ifcsname board@pgf@curvemovestyle@#1\endcsname
  \csname board@pgf@curvemovestyle@#1\endcsname
 \else\PackageError{chessboard}{Style #1 not defined for curvemove}{}%
 \fi}

%% disable pgf-picture completely

\define@boolkey[UFCB]{locset}{pgf}[true]{}% D

\define@boolkey[UFCB]{gloset}{pgf}[true]{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,pgf=#1}{}}%

%% clears the user "extra" pictures

\define@key[UFCB]{locfill}{clearbackpgf}[true]{%
  \let\board@pgf@extrabackground\@empty
  }%

\define@key[UFCB]{glofill}{clearbackpgf}[true]{%
  \board@do@l@addto@macro\board@val@savedkeylist{,clearbackpgf=#1}}%

\define@key[UFCB]{locfill}{clearmarkpgf}[true]{%
 \let\board@pgf@extramarkground\@empty
  }%

\define@key[UFCB]{glofill}{clearmarkpgf}[true]{%
  \board@do@l@addto@macro\board@val@savedkeylist{,clearmarkpgf=#1}}%

\define@choicekey[UFCB]{locfill}{clearpgf}[\@tempval\@tempnr]{back,mark,all,both,none}[all]{% D
 \ifcase\@tempnr\relax
  \board@do@setsinglekeys*[UFCB]{locfill}{clearbackpgf}%
 \or
  \board@do@setsinglekeys*[UFCB]{locfill}{clearmarkpgf}%
 \or
  \board@do@setsinglekeys*[UFCB]{locfill}{clearbackpgf,clearmarkpgf}%
 \or
  \board@do@setsinglekeys*[UFCB]{locfill}{clearbackpgf,clearmarkpgf}%
 \or
  \board@do@setsinglekeys*[UFCB]{locfill}{}%
 \fi}

\define@key[UFCB]{glofill}{clearpgf}[all]{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,clearpgf=#1}}%

%% obsolete

\define@key[UFCB]{locfill}{clearbackgroundpgf}[true]{%
  \let\board@pgf@extrabackground\@empty}%

\define@key[UFCB]{glofill}{clearbackgroundpgf}[true]{%
  \board@do@l@addto@macro\board@val@savedkeylist{,clearbackgroundpgf=#1}}%

\define@key[UFCB]{locfill}{clearforegroundpgf}[true]{%
  \let\board@pgf@extramarkground\@empty}%

\define@key[UFCB]{glofill}{clearforegroundpgf}[true]{%
  \board@do@l@addto@macro\board@val@savedkeylist{,clearforegroundpgf=#1}}%

%% to chose the affected picture

\define@boolkey[UFCB]{locfill}{usemarkpgf}[true]{}

\define@boolkey[UFCB]{glofill}{usemarkpgf}[true]{%
  \board@do@l@addto@macro\board@val@savedkeylist{,usemarkpgf=#1}}%

\define@boolkey[UFCB]{locfill}{usebackpgf}[true]{}%

\define@boolkey[UFCB]{glofill}{usebackpgf}[true]{%
  \board@do@l@addto@macro\board@val@savedkeylist{,usebackpgf=#1}}%

\define@choicekey[UFCB]{locfill}{usepgf}[\@tempval\@tempnr]{back,mark,all,both,none}{%
 \def\board@pgf@curusepgf{#1}%
 \ifcase\@tempnr\relax
  \board@do@setsinglekeys*[UFCB]{locfill}{usebackpgf=true,usemarkpgf=false}%
 \or
  \board@do@setsinglekeys*[UFCB]{locfill}{usemarkpgf=true,usebackpgf=false}%
 \or
  \board@do@setsinglekeys*[UFCB]{locfill}{usebackpgf=true,usemarkpgf=true}%
 \or
  \board@do@setsinglekeys*[UFCB]{locfill}{usebackpgf=true,usemarkpgf=true}%
 \or
  \board@do@setsinglekeys*[UFCB]{locfill}{usebackpgf=false,usemarkpgf=false}%
 \fi}%

\define@key[UFCB]{glofill}{usepgf}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,usepgf=#1}}%

\define@boolkey[UFCB]{locfill}{useonblack}[true]{%
 \ifUFCB@locfill@useonblack
   \board@pgf@addmarkground{\UFCB@locfill@useonblacktrue}%
  \else
   \board@pgf@addmarkground{\UFCB@locfill@useonblackfalse}%
  \fi
 \ifUFCB@locfill@useonblack
   \board@pgf@addbackground{\UFCB@locfill@useonblacktrue}%
  \else
   \board@pgf@addbackground{\UFCB@locfill@useonblackfalse}%
  \fi}%

\define@boolkey[UFCB]{glofill}{useonblack}[true]{%
  \board@do@l@addto@macro\board@val@savedkeylist{,useonblack=#1}}%

\define@boolkey[UFCB]{locfill}{useonwhite}[true]{%
  \ifUFCB@locfill@useonwhite
   \board@pgf@addmarkground{\UFCB@locfill@useonwhitetrue}%
  \else
   \board@pgf@addmarkground{\UFCB@locfill@useonwhitefalse}%
  \fi
  \ifUFCB@locfill@useonwhite
   \board@pgf@addbackground{\UFCB@locfill@useonwhitetrue}%
  \else
   \board@pgf@addbackground{\UFCB@locfill@useonwhitefalse}%
  \fi}%

\define@boolkey[UFCB]{glofill}{useonwhite}[true]{%
  \board@do@l@addto@macro\board@val@savedkeylist{,useonwhite=#1}}%

\define@choicekey[UFCB]{locfill}{trimtocolor}[\@tempval\@tempnr]{white,black,false}{% D
 \def\board@pgf@curtrimtocolor{#1}%
 \ifcase\@tempnr\relax
  \board@do@setsinglekeys*[UFCB]{locfill}{useonwhite=true,useonblack=false}%
 \or
  \board@do@setsinglekeys*[UFCB]{locfill}{useonwhite=false,useonblack=true}%
 \or
  \board@do@setsinglekeys*[UFCB]{locfill}{useonwhite=true,useonblack=true}%
 \fi}%

\define@key[UFCB]{glofill}{trimtocolor}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,trimtocolor=#1}}%

\define@key[UFCB]{locfill}{trimtowhite}[true]{%
  \board@do@setsinglekeys*[UFCB]{locfill}{useonwhite=true,useonblack=false}}%

\define@key[UFCB]{glofill}{trimtowhite}[true]{%
  \board@do@l@addto@macro\board@val@savedkeylist{,trimtowhite=#1}}%

\define@key[UFCB]{locfill}{trimtoblack}[true]{%
  \board@do@setsinglekeys*[UFCB]{locfill}{useonwhite=false,useonblack=true}}%

\define@key[UFCB]{glofill}{trimtoblack}[true]{%
  \board@do@l@addto@macro\board@val@savedkeylist{,trimtoblack=#1}}%

\define@key[UFCB]{locfill}{starttrim}{%
  \expandafter\board@split@field #1ARGEND%
  \let\board@val@starttrimfilechar\board@temp@curfilechar
  \let\board@val@starttrimfilenum\board@temp@curfilenum
  \let\board@val@starttrimranknum\board@temp@curranknum}%

\define@key[UFCB]{glofill}{starttrim}{%
  \board@do@l@addto@macro\board@val@savedkeylist{,starttrim=#1}}%

\define@key[UFCB]{locfill}{stoptrim}{%
  \expandafter\board@split@field#1ARGEND%
  \let\board@val@stoptrimfilechar\board@temp@curfilechar
  \let\board@val@stoptrimfilenum\board@temp@curfilenum
  \let\board@val@stoptrimranknum\board@temp@curranknum}%}%

\define@key[UFCB]{glofill}{stoptrim}{%
  \board@do@l@addto@macro\board@val@savedkeylist{,starttrim=#1}}%

\define@key[UFCB]{locfill}{trimarea}[\printarea]{% a7-f1 %
 \ifthenelse{\equal{#1}{empty}}%
  {\def\board@val@starttrimfilenum{-1}%
   \def\board@val@starttrimranknum{-1}%
   \def\board@val@stoptrimfilenum{-1}%
   \def\board@val@stoptrimrankenum{-1}}%
  {\expandafter\board@split@areasort#1ARGEND%
   \let\board@val@starttrimfilechar\board@temp@curstartfilechar
   \let\board@val@starttrimfilenum\board@temp@curstartfilenum
   \let\board@val@starttrimranknum\board@temp@curstartranknum
   \let\board@val@stoptrimfilechar\board@temp@curstopfilechar
   \let\board@val@stoptrimfilenum\board@temp@curstopfilenum
   \let\board@val@stoptrimranknum\board@temp@curstopranknum}%
  \ifUFCB@locfill@captrimtoprint
   \ifnum\board@val@starttrimfilenum<\board@val@startprintfilenum
    \let\board@val@starttrimfilenum\board@val@startprintfilenum
   \fi
   \ifnum\board@val@stoptrimfilenum>\board@val@stopprintfilenum
    \let\board@val@stoptrimfilenum\board@val@stopprintfilenum
   \fi
   \ifnum\board@val@starttrimranknum>\board@val@startprintranknum
    \let\board@val@starttrimranknum\board@val@startprintranknum
   \fi
   \ifnum\board@val@stoptrimranknum<\board@val@stopprintranknum
    \let\board@val@stoptrimranknum\board@val@stopprintranknum
   \fi
   \ifthenelse
    {\(\board@val@starttrimfilenum>\board@val@stoptrimfilenum\)
     \OR
     \(\board@val@starttrimranknum<\board@val@stoptrimranknum\)}%
    {\def\board@val@starttrimfilenum{-1}%
     \def\board@val@starttrimranknum{-1}%
     \def\board@val@stoptrimfilenum{-1}%
     \def\board@val@stoptrimrankenum{-1}}%
    {}%
  \fi}%

\define@key[UFCB]{glofill}{trimarea}{%
    \board@do@l@addto@macro\board@val@savedkeylist{,trimarea=#1}}%

\define@boolkey[UFCB]{locfill}{captrimtoprint}[true]{}%

\define@boolkey[UFCB]{glofill}{captrimtoprint}[true]{%
    \board@do@l@addto@macro\board@val@savedkeylist{,captrimtoprint=#1}}%

\define@boolkey[UFCB]{locfill}{trim}[true]{%
 \ifUFCB@locfill@trim
  \board@do@setsinglekeys*[UFCB]{locfill}{trimarea=\printarea}%
 \else
  \board@do@setsinglekeys*[UFCB]{locfill}{trimarea=\board}%
  \fi}%

\define@key[UFCB]{glofill}{trim}[true]{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,trim=#1}}%

%% clipping

%% clipping the pictures along a path
\define@key[UFCB]{locset}{clip}[true]{% D
 \board@do@setsinglekeys*[UFCB]{intclip}{true,#1}}%

\define@key[UFCB]{gloset}{clip}[true]{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,clip={#1}}{}}%

\define@key[UFCB]{locset}{pgfclip}[true]{% D
 \board@do@setsinglekeys*[UFCB]{intclip}{true,#1}}%

\define@key[UFCB]{gloset}{pgfclip}[true]{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,pgfclip={#1}}{}}%

\define@key[UFCB]{locset}{markclip}[true]{% D
 \board@do@setsinglekeys*[UFCB]{intmarkclip}{true,#1}}%

\define@key[UFCB]{gloset}{markclip}[true]{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,markclip={#1}}{}}%

\define@key[UFCB]{locset}{backclip}[true]{% D
 \board@do@setsinglekeys*[UFCB]{intbackclip}{true,#1}}%

\define@key[UFCB]{gloset}{backclip}[true]{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,backclip={#1}}{}}%

\define@key[UFCB]{intclip}{true}[true]{%
 \def\board@pgf@usemarkclippath{clip}%
 \def\board@pgf@usebackclippath{clip}}

\define@key[UFCB]{intclip}{false}[true]{%
 \def\board@pgf@usemarkclippath{discard}%
 \def\board@pgf@usebackclippath{discard}}

\define@key[UFCB]{intmarkclip}{true}[true]{%
 \def\board@pgf@usemarkclippath{clip}}

\define@key[UFCB]{intmarkclip}{false}[true]{%
 \def\board@pgf@usemarkclippath{discard}}

\define@key[UFCB]{intbackclip}{true}[true]{%
 \def\board@pgf@usebackclippath{clip}}

\define@key[UFCB]{intbackclip}{false}[true]{%
 \def\board@pgf@usebackclippath{discard}}

\define@key[UFCB]{intclip}{left}[0pt]{%
 \def\board@pgf@markclipleftpadding{#1}%
 \def\board@pgf@backclipleftpadding{#1}}

\define@key[UFCB]{intclip}{top}[0pt]{%
 \def\board@pgf@markcliptoppadding{#1}%
 \def\board@pgf@backcliptoppadding{#1}}

\define@key[UFCB]{intclip}{right}[0pt]{%
 \def\board@pgf@markcliprightpadding{#1}%
 \def\board@pgf@backcliprightpadding{#1}}

\define@key[UFCB]{intclip}{bottom}[0pt]{%
 \def\board@pgf@markclipbottompadding{#1}%
 \def\board@pgf@backclipbottompadding{#1}}

\define@key[UFCB]{intmarkclip}{left}[0pt]{%
 \def\board@pgf@markclipleftpadding{#1}}

\define@key[UFCB]{intmarkclip}{top}[0pt]{%
 \def\board@pgf@markcliptoppadding{#1}}

\define@key[UFCB]{intmarkclip}{right}[0pt]{%
 \def\board@pgf@markcliprightpadding{#1}}

\define@key[UFCB]{intmarkclip}{bottom}[0pt]{%
 \def\board@pgf@markclipbottompadding{#1}}

\define@key[UFCB]{intbackclip}{left}[0pt]{%
 \def\board@pgf@backclipleftpadding{#1}}

\define@key[UFCB]{intbackclip}{top}[0pt]{%
 \def\board@pgf@backcliptoppadding{#1}}

\define@key[UFCB]{intbackclip}{right}[0pt]{%
 \def\board@pgf@backcliprightpadding{#1}}

\define@key[UFCB]{intbackclip}{bottom}[0pt]{%
 \def\board@pgf@backclipbottompadding{#1}}

%% pgf properties

\define@key[UFCB]{locfill}{color}{% D
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground{\color{#1}}%
 \fi
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground{\color{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{color}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,color=#1}}%

\define@key[UFCB]{locfill}{pgfcolor}{% D
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground{\color{#1}}%
 \fi
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground{\color{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{pgfcolor}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,pgfcolor=#1}}%

%% padding for colorfields and other means
\define@key[UFCB]{locfill}{padding}{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground{\def\board@pgf@padding{#1}}%
 \fi
 \ifUFCB@locfill@usebackpgf %
  \board@pgf@addbackground{\def\board@pgf@padding{#1}}%
  \board@pgf@addbackground{\def\board@pgf@colorbackpadding{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{padding}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,padding=#1}}%

\define@key[UFCB]{locfill}{pgfpadding}{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground{\def\board@pgf@padding{#1}}%
 \fi
 \ifUFCB@locfill@usebackpgf %
  \board@pgf@addbackground{\def\board@pgf@padding{#1}}%
  \board@pgf@addbackground{\def\board@pgf@colorbackpadding{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{pgfpadding}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,pgfpadding=#1}}%

\define@key[UFCB]{locfill}{opacity}{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground%
    {\pgfsetfillopacity{#1}%
     \pgfsetstrokeopacity{#1}}%%
 \fi
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground%
    {\pgfsetfillopacity{#1}%
     \pgfsetstrokeopacity{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{opacity}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,opacity=#1}}%

\define@key[UFCB]{locfill}{pgfopacity}{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground%
    {\pgfsetfillopacity{#1}%
     \pgfsetstrokeopacity{#1}}%%
 \fi
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground%
    {\pgfsetfillopacity{#1}%
     \pgfsetstrokeopacity{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{pgfopacity}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,pgfopacity=#1}}%

\define@key[UFCB]{locfill}{fillopacity}{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground%
    {\pgfsetfillopacity{#1}}%%
 \fi
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground%
    {\pgfsetfillopacity{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{fillopacity}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,opacity=#1}}%

\define@key[UFCB]{locfill}{pgffillopacity}{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground%
    {\pgfsetfillopacity{#1}}%%
 \fi
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground%
    {\pgfsetfillopacity{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{pgffillopacity}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,pgffillopacity=#1}}%

\define@key[UFCB]{locfill}{strokeopacity}{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground%
    {\pgfsetstrokeopacity{#1}}%
 \fi%%
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground%
    {\pgfsetstrokeopacity{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{strokeopacity}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,opacity=#1}}%

\define@key[UFCB]{locfill}{pgfstrokeopacity}{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground%
    {\pgfsetstrokeopacity{#1}}%%
 \fi
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground%
    {\pgfsetstrokeopacity{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{pgfstrokeopacity}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,pgfstrokeopacity=#1}}%

\define@key[UFCB]{locfill}{linewidth}{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground{\def\board@pgf@linewidth{#1}}%
 \fi
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground{\def\board@pgf@linewidth{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{linewidth}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,linewidth=#1}}%

\define@key[UFCB]{locfill}{pgflinewidth}{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground{\def\board@pgf@linewidth{#1}}%
 \fi
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground{\def\board@pgf@linewidth{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{pgflinewidth}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,pgflinewidth=#1}}%

\define@key[UFCB]{locfill}{backlinewidth}{% D
  \board@pgf@addbackground{\def\board@pgf@linewidth{#1}}}%

\define@key[UFCB]{glofill}{backlinewidth}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,linewidth=#1}}%

\define@key[UFCB]{locfill}{marklinewidth}{% D
  \board@pgf@addmarkground{\def\board@pgf@linewidth{#1}}}%

\define@key[UFCB]{glofill}{marklinewidth}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,linewidth=#1}}%

\define@key[UFCB]{locfill}{backcornerarc}{% D
  \board@pgf@addbackground{\def\board@pgf@corner{#1}}}%

\define@key[UFCB]{glofill}{backcornerarc}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,backcornerarc=#1}}%

\define@key[UFCB]{locfill}{cornerarc}{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground{\def\board@pgf@corner{#1}}%
 \fi
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground{\def\board@pgf@corner{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{cornerarc}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,cornerarc=#1}}%

\define@key[UFCB]{locfill}{pgfcornerarc}{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground{\def\board@pgf@corner{#1}}%
 \fi
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground{\def\board@pgf@corner{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{pgfcornerarc}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,pgfcornerarc=#1}}%

\define@key[UFCB]{locfill}{arrow}{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground{\def\board@pgf@arrow{#1}}%
 \fi
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground{\def\board@pgf@arrow{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{arrow}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,arrow=#1}}%

\define@key[UFCB]{locfill}{pgfarrow}{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground{\def\board@pgf@arrow{#1}}%
 \fi
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground{\def\board@pgf@arrow{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{pgfarrow}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,pgfarrow=#1}}%

\define@key[UFCB]{locfill}{shortenstart}{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground{\def\board@pgf@shortenstart{#1}}%
 \fi
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground{\def\board@pgf@shortenstart{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{shortenstart}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,shortenstart=#1}}%

\define@key[UFCB]{locfill}{pgfshortenstart}{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground{\def\board@pgf@shortenstart{#1}}%
 \fi
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground{\def\board@pgf@shortenstart{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{pgfshortenstart}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,pgfshortenstart=#1}}%

\define@key[UFCB]{locfill}{shortenend}{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground{\def\board@pgf@shortenend{#1}}%
 \fi
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground{\def\board@pgf@shortenend{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{shortenend}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,shortenend=#1}}%

\define@key[UFCB]{locfill}{pgfshortenend}{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground{\def\board@pgf@shortenend{#1}}%
 \fi
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground{\def\board@pgf@shortenend{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{pgfshortenend}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,pgfshortenend=#1}}%

\define@key[UFCB]{locfill}{shorten}{% D
 \board@do@setsinglekeys*[UFCB]{locfill}{shortenend=#1,shortenstart=#1}}%

\define@key[UFCB]{glofill}{shorten}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,shorten=#1}}%

\define@key[UFCB]{locfill}{pgfshorten}{% D
 \board@do@setsinglekeys*[UFCB]{locfill}{pgfshortenend=#1,pgfshortenstart=#1}}%

\define@key[UFCB]{glofill}{pgfshorten}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,pgfshorten=#1}}%

\define@key[UFCB]{locfill}{text}{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground{\def\board@pgf@curtext{#1}}%
 \fi
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground{\def\board@pgf@curtext{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{text}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,text={#1}}}%

\define@key[UFCB]{locfill}{pgftext}{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground{\def\board@pgf@curtext{#1}}%
 \fi
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground{\def\board@pgf@curtext{#1}}%
 \fi}%

\define@key[UFCB]{glofill}{pgftext}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,pgftext={#1}}}%

\define@key[UFCB]{locfill}{addpgf}[\end{pgfscope}\begin{pgfscope}]{% D
 \ifUFCB@locfill@usemarkpgf
  \board@pgf@addmarkground{#1}%
 \fi
 \ifUFCB@locfill@usebackpgf
  \board@pgf@addbackground{#1}%
 \fi}%

\define@key[UFCB]{glofill}{addpgf}[\end{pgfscope}\begin{pgfscope}]{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,addpgf={#1}}}%

\define@key[UFCB]{locfill}{markstyle}{% D
  \board@do@savemarkstyle#1ARGEND}%

\define@key[UFCB]{glofill}{markstyle}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,markstyle=#1}}%

\define@key[UFCB]{locfill}{backstyle}{% D
  \board@do@savebackstyle#1ARGEND}%

\define@key[UFCB]{glofill}{backstyle}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,backstyle=#1}}%

\define@key[UFCB]{locfill}{pgfstyle}{% D
  \expandafter\board@do@savemarkstyle#1ARGEND% change 15.08.2007
  \expandafter\board@do@savebackstyle#1ARGEND}% changed 15.08.2007

\define@key[UFCB]{glofill}{pgfstyle}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,pgfstyle=#1}}%

%%% fields marks

\define@key[UFCB]{locfill}{markarea}{% D
  \edef\board@temp@list{#1}%
   \@for\board@temp@curarea:=\board@temp@list\do
  {\board@pgf@add@fieldmarkstyletoarea{\board@temp@curarea}}}%

\define@key[UFCB]{glofill}{markarea}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,markarea=#1}}%

\define@key[UFCB]{locfill}{backarea}{% D
 \edef\board@temp@list{#1}%
 \@for\board@temp@curarea:=\board@temp@list\do
  {\board@pgf@add@fieldbackstyletoarea{\board@temp@curarea}}}%

\define@key[UFCB]{glofill}{backarea}{%
  \board@do@l@addto@macro\board@val@savedkeylist{,backarea={#1}}}%

\define@key[UFCB]{locfill}{markareas}{% D
 \edef\board@temp@list{#1}%
 \@for\board@temp@curarea:=\board@temp@list\do
  {\board@pgf@add@fieldmarkstyletoarea{\board@temp@curarea}}}%

\define@key[UFCB]{glofill}{markareas}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,markareas={#1}}}%

\define@key[UFCB]{locfill}{backareas}{% D
 \edef\board@temp@list{#1}%
 \@for\board@temp@curarea:=\board@temp@list\do
  {\board@pgf@add@fieldbackstyletoarea{\board@temp@curarea}}}%

\define@key[UFCB]{glofill}{backareas}{%
  \board@do@l@addto@macro\board@val@savedkeylist{,backareas={#1}}}%

\define@key[UFCB]{locfill}{markfield}{% #1=list of fields D
  \edef\board@temp@list{#1}%
  \@for\board@temp@curfield:=\board@temp@list\do
    {\board@do@setsinglekeys*[UFCB]{locfill}{markarea=\board@temp@curfield-\board@temp@curfield}}}%

\define@key[UFCB]{glofill}{markfield}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,markfield={#1}}}%

\define@key[UFCB]{locfill}{backfield}{% #1=list of fields D
  \edef\board@temp@list{#1}%
  \@for\board@temp@curfield:=\board@temp@list\do
    {\board@do@setsinglekeys*[UFCB]{locfill}{backarea=\board@temp@curfield-\board@temp@curfield}}}%

\define@key[UFCB]{glofill}{backfield}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,backfield={#1}}}%

\define@key[UFCB]{locfill}{markfields}{% #1=list of fields D
  \edef\board@temp@list{#1}%
  \@for\board@temp@curfield:=\board@temp@list\do
    {\board@do@setsinglekeys*[UFCB]{locfill}{markarea=\board@temp@curfield-\board@temp@curfield}}}%

\define@key[UFCB]{glofill}{markfields}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,markfields={#1}}}%

\define@key[UFCB]{locfill}{backfields}{% #1=list of fields D
  \edef\board@temp@list{#1}%
  \@for\board@temp@curfield:=\board@temp@list\do
    {\board@do@setsinglekeys*[UFCB]{locfill}{backarea=\board@temp@curfield-\board@temp@curfield}}}%

\define@key[UFCB]{glofill}{backfields}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,backfields={#1}}}%

\define@key[UFCB]{locfill}{markboard}[true]{% D
  \edef\board@temp@curstartfield{\board@val@minfilechar\board@val@maxranknum}%
  \edef\board@temp@curstopfield{\board@val@maxfilechar\board@val@minranknum}%
  \board@do@setsinglekeys*[UFCB]{locfill}{markarea=\board@temp@curstartfield-\board@temp@curstopfield}}%

\define@key[UFCB]{glofill}{markboard}[true]{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,markboard=#1}}%

\define@key[UFCB]{locfill}{backboard}[true]{% D
  \edef\board@temp@curstartfield{\board@val@minfilechar\board@val@maxranknum}%
  \edef\board@temp@curstopfield{\board@val@maxfilechar\board@val@minranknum}%
  \board@do@setsinglekeys*[UFCB]{locfill}{backarea=\board@temp@curstartfield-\board@temp@curstopfield}}%

\define@key[UFCB]{glofill}{backboard}[true]{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,backboard=#1}}%

\define@key[UFCB]{locfill}{markrank}{% D
  \edef\board@temp@list{#1}%
  \@for\board@temp@currank:=\board@temp@list\do
   {\edef\board@temp@curstartfield{\board@val@minfilechar\board@temp@currank}%
    \edef\board@temp@curstopfield{\board@val@maxfilechar\board@temp@currank}%
    \board@do@setsinglekeys*[UFCB]{locfill}{%
     markarea=\board@temp@curstartfield-\board@temp@curstopfield}}}%

\define@key[UFCB]{glofill}{markrank}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,markrank={#1}}}%

\define@key[UFCB]{locfill}{backrank}{% D
  \edef\board@temp@list{#1}%
  \@for\board@temp@currank:=\board@temp@list\do
   {\edef\board@temp@curstartfield{\board@val@minfilechar\board@temp@currank}%
    \edef\board@temp@curstopfield{\board@val@maxfilechar\board@temp@currank}%
    \board@do@setsinglekeys*[UFCB]{locfill}{%
     backarea=\board@temp@curstartfield-\board@temp@curstopfield}}}%

\define@key[UFCB]{glofill}{backrank}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,backrank={#1}}}%

\define@key[UFCB]{locfill}{markranks}{% D
  \edef\board@temp@list{#1}%
  \@for\board@temp@currank:=\board@temp@list\do
   {\edef\board@temp@curstartfield{\board@val@minfilechar\board@temp@currank}%
    \edef\board@temp@curstopfield{\board@val@maxfilechar\board@temp@currank}%
    \board@do@setsinglekeys*[UFCB]{locfill}{%
     markarea=\board@temp@curstartfield-\board@temp@curstopfield}}}%

\define@key[UFCB]{glofill}{markranks}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,markranks={#1}}}%

\define@key[UFCB]{locfill}{backranks}{% D
  \edef\board@temp@list{#1}%
  \@for\board@temp@currank:=\board@temp@list\do
   {\edef\board@temp@curstartfield{\board@val@minfilechar\board@temp@currank}%
    \edef\board@temp@curstopfield{\board@val@maxfilechar\board@temp@currank}%
    \board@do@setsinglekeys*[UFCB]{locfill}{%
     backarea=\board@temp@curstartfield-\board@temp@curstopfield}}}%

\define@key[UFCB]{glofill}{backranks}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,backranks={#1}}}%

\define@key[UFCB]{locfill}{markfile}{% D
  \edef\board@temp@list{#1}%
  \@for\board@temp@curfile:=\board@temp@list\do
   {\edef\board@temp@curstartfield{\board@temp@curfile\board@val@maxranknum}%
    \edef\board@temp@curstopfield{\board@temp@curfile\board@val@minranknum}%
    \board@do@setsinglekeys*[UFCB]{locfill}{%
     markarea=\board@temp@curstartfield-\board@temp@curstopfield}}}%

\define@key[UFCB]{glofill}{markfile}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,markfile={#1}}}%

\define@key[UFCB]{locfill}{backfile}{% D
  \edef\board@temp@list{#1}%
  \@for\board@temp@curfile:=\board@temp@list\do
   {\edef\board@temp@curstartfield{\board@temp@curfile\board@val@maxranknum}%
    \edef\board@temp@curstopfield{\board@temp@curfile\board@val@minranknum}%
    \board@do@setsinglekeys*[UFCB]{locfill}{%
     backarea=\board@temp@curstartfield-\board@temp@curstopfield}}}%

\define@key[UFCB]{glofill}{backfile}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,backfile={#1}}}%

\define@key[UFCB]{locfill}{markfiles}{% D
  \edef\board@temp@list{#1}%
  \@for\board@temp@curfile:=\board@temp@list\do
   {\edef\board@temp@curstartfield{\board@temp@curfile\board@val@maxranknum}%
    \edef\board@temp@curstopfield{\board@temp@curfile\board@val@minranknum}%
    \board@do@setsinglekeys*[UFCB]{locfill}{%
     markarea=\board@temp@curstartfield-\board@temp@curstopfield}}}%

\define@key[UFCB]{glofill}{markfiles}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,markfiles={#1}}}%

\define@key[UFCB]{locfill}{backfiles}{% D
  \edef\board@temp@list{#1}%
  \@for\board@temp@curfile:=\board@temp@list\do
   {\edef\board@temp@curstartfield{\board@temp@curfile\board@val@maxranknum}%
    \edef\board@temp@curstopfield{\board@temp@curfile\board@val@minranknum}%
    \board@do@setsinglekeys*[UFCB]{locfill}{%
     backarea=\board@temp@curstartfield-\board@temp@curstopfield}}}%

\define@key[UFCB]{glofill}{backfiles}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,backfiles={#1}}}%

%%% region marks

\define@key[UFCB]{locfill}{markregion}{% D
  \edef\board@temp@list{#1}%
  \@for\board@temp@curarea:=\board@temp@list\do
    {\expandafter\board@split@areasort\board@temp@curarea ARGEND%
     \edef\board@temp{{\board@temp@curstartfield}{\board@temp@curstopfield}}%
     \expandafter\board@pgf@add@regionmarkstyle\board@temp%{a}{b}%
     }}%

\define@key[UFCB]{glofill}{markregion}{% D
    \board@do@l@addto@macro\board@val@savedkeylist{,markregion={#1}}}%

\define@key[UFCB]{locfill}{backregion}{% D
  \edef\board@temp@list{#1}%
  \@for\board@temp@curarea:=\board@temp@list\do
    {\expandafter\board@split@areasort\board@temp@curarea ARGEND%
     \edef\board@temp{{\board@temp@curstartfield}{\board@temp@curstopfield}}%
     \expandafter\board@pgf@add@regionbackstyle\board@temp%{a}{b}%
     }}%

\define@key[UFCB]{glofill}{backregion}{% D
    \board@do@l@addto@macro\board@val@savedkeylist{,backregion={#1}}}%

\define@key[UFCB]{locfill}{markregions}{% D
   \edef\board@temp@list{#1}%
  \@for\board@temp@curarea:=\board@temp@list\do
    {\expandafter\board@split@areasort\board@temp@curarea ARGEND%
     \edef\board@temp{{\board@temp@curstartfield}{\board@temp@curstopfield}}%
     \expandafter\board@pgf@add@regionmarkstyle\board@temp%{a}{b}%
     }}%

\define@key[UFCB]{glofill}{markregions}{% D
    \board@do@l@addto@macro\board@val@savedkeylist{,markregions={#1}}}%

\define@key[UFCB]{locfill}{backregions}{% D
    \edef\board@temp@list{#1}%
  \@for\board@temp@curarea:=\board@temp@list\do
    {\expandafter\board@split@areasort\board@temp@curarea ARGEND%
     \edef\board@temp{{\board@temp@curstartfield}{\board@temp@curstopfield}}%
     \expandafter\board@pgf@add@regionbackstyle\board@temp%{a}{b}%
     }}%

\define@key[UFCB]{glofill}{backregions}{% D
    \board@do@l@addto@macro\board@val@savedkeylist{,backregions={#1}}}%

%%% move marks

\define@key[UFCB]{locfill}{markmove}{% D
    \edef\board@temp@list{#1}%
  \@for\board@temp@curarea:=\board@temp@list\do
    {\expandafter\board@split@area\board@temp@curarea ARGEND%
     \edef\board@temp{{\board@temp@curstartfield}{\board@temp@curstopfield}}%
     \expandafter\board@pgf@add@movemarkstyle\board@temp}}%

\define@key[UFCB]{glofill}{markmove}{% D
    \board@do@l@addto@macro\board@val@savedkeylist{,markmove={#1}}}%

\define@key[UFCB]{locfill}{backmove}{% D
   \edef\board@temp@list{#1}%
  \@for\board@temp@curarea:=\board@temp@list\do
    {\expandafter\board@split@area\board@temp@curarea ARGEND%
     \edef\board@temp{{\board@temp@curstartfield}{\board@temp@curstopfield}}%
     \expandafter\board@pgf@add@movebackstyle\board@temp}}%

\define@key[UFCB]{glofill}{backmove}{% D
    \board@do@l@addto@macro\board@val@savedkeylist{,backmove={#1}}}%

\define@key[UFCB]{locfill}{markmoves}{% D
    \edef\board@temp@list{#1}%
  \@for\board@temp@curarea:=\board@temp@list\do
    {\expandafter\board@split@area\board@temp@curarea ARGEND%
     \edef\board@temp{{\board@temp@curstartfield}{\board@temp@curstopfield}}%
     \expandafter\board@pgf@add@movemarkstyle\board@temp}}%

\define@key[UFCB]{glofill}{markmoves}{% D
    \board@do@l@addto@macro\board@val@savedkeylist{,markmoves={#1}}}%

\define@key[UFCB]{locfill}{backmoves}{% D
  \edef\board@temp@list{#1}%
  \@for\board@temp@curarea:=\board@temp@list\do
    {\expandafter\board@split@area\board@temp@curarea ARGEND%
     \edef\board@temp{{\board@temp@curstartfield}{\board@temp@curstopfield}}%
     \expandafter\board@pgf@add@movebackstyle\board@temp}}%

\define@key[UFCB]{glofill}{backmoves}{% D
    \board@do@l@addto@macro\board@val@savedkeylist{,backmoves={#1}}}%

%% obsolete keys, shortcuts

%% obsolete key,
\define@choicekey[UFCB]{locfill}{applycolor}[\@tempval\@tempnr]{all,none,white,black}{% D
 \ifcase\@tempnr\relax
  \board@do@setsinglekeys*[UFCB]{locfill}{trimtocolor=false}%
 \or
  \board@do@setsinglekeys*[UFCB]{locfill}{useonwhite=false,useonblack=false}%
 \or
  \board@do@setsinglekeys*[UFCB]{locfill}{trimtocolor=white}%
 \or
  \board@do@setsinglekeys*[UFCB]{locfill}{trimtocolor=black}%
 \fi}%

\define@key[UFCB]{glofill}{applycolor}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,applycolor=#1}}%

\define@key[UFCB]{locfill}{colorbackarea}{% D
  \board@do@setsinglekeys*[UFCB]{locfill}{colorbackareas=#1}}%

\define@key[UFCB]{glofill}{colorbackarea}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,colorbackarea=#1}}%

\define@key[UFCB]{locfill}{colorbackareas}{% D
 \let\board@pgf@savebackstyle\board@pgf@curbackstyle
 \board@do@setsinglekeys*[UFCB]{locfill}{backstyle=color,backareas=#1,backstyle=\board@pgf@savebackstyle}}%

\define@key[UFCB]{glofill}{colorbackareas}{% D
  \board@do@l@addto@macro\board@val@savedkeylist{,colorbackareas={#1}}}%

\define@key[UFCB]{locfill}{colorbackboard}[true]{%D
   \edef\board@temp@curstartfield{\board@val@minfilechar\board@val@maxranknum}%
   \edef\board@temp@curstopfield{\board@val@maxfilechar\board@val@minranknum}%
   \board@do@setsinglekeys*[UFCB]{locfill}{colorbackareas=\board@temp@curstartfield-\board@temp@curstopfield}}%

\define@key[UFCB]{glofill}{colorbackboard}[true]{%D
   \board@do@l@addto@macro\board@val@savedkeylist{,colorbackboard=#1}}%

\define@key[UFCB]{locfill}{colorboard}[true]{%D
   \edef\board@temp@curstartfield{\board@val@startprintfilechar\board@val@startprintranknum}%
   \edef\board@temp@curstopfield{\board@val@stopprintfilechar\board@val@stopprintranknum}%
   \board@do@setsinglekeys*[UFCB]{locfill}{colorbackarea=\board@temp@curstartfield-\board@temp@curstopfield}}%

\define@key[UFCB]{glofill}{colorboard}[true]{%D
   \board@do@l@addto@macro\board@val@savedkeylist{,colorboard=#1}}%

\define@key[UFCB]{locfill}{colorbackranks}{%D
  \edef\board@temp@list{#1}%
  \@for\board@temp@currank:=\board@temp@list\do
   {\edef\board@temp@curstartfield{\board@val@minfilechar\board@temp@currank}%
    \edef\board@temp@curstopfield{\board@val@maxfilechar\board@temp@currank}%
    \board@do@setsinglekeys*[UFCB]{locfill}{%
      colorbackareas=\board@temp@curstartfield-\board@temp@curstopfield}}}%

\define@key[UFCB]{glofill}{colorbackranks}{%D
  \board@do@l@addto@macro\board@val@savedkeylist{,colorbackranks={#1}}}%

\define@key[UFCB]{locfill}{colorbackrank}{% D
    \board@do@setsinglekeys*[UFCB]{locfill}{%
      colorbackranks=#1}}%

\define@key[UFCB]{glofill}{colorbackrank}{%D
  \board@do@l@addto@macro\board@val@savedkeylist{,colorbackrank={#1}}}%

\define@key[UFCB]{locfill}{colorbackfiles}{%D
  \edef\board@temp@list{#1}%
  \@for\board@temp@curfile:=\board@temp@list\do
   {\edef\board@temp@curstartfield{\board@temp@curfile\board@val@maxranknum}%
    \edef\board@temp@curstopfield{\board@temp@curfile\board@val@minranknum}%
    \board@do@setsinglekeys*[UFCB]{locfill}{%
      colorbackareas=\board@temp@curstartfield-\board@temp@curstopfield}}}%

\define@key[UFCB]{glofill}{colorbackfiles}{%D
  \board@do@l@addto@macro\board@val@savedkeylist{,colorbackfiles={#1}}}%

\define@key[UFCB]{locfill}{colorbackfile}{% D
    \board@do@setsinglekeys*[UFCB]{locfill}{%
      colorbackfiles=#1}}%

\define@key[UFCB]{glofill}{colorbackfile}{%D
  \board@do@l@addto@macro\board@val@savedkeylist{,colorbackfile={#1}}}%

\define@key[UFCB]{locfill}{colorbackfields}{% #1=list of fields %D
  \edef\board@temp@list{#1}%
  \@for\board@temp@curfield:=\board@temp@list\do
    {\board@do@setsinglekeys*[UFCB]{locfill}{colorbackareas=\board@temp@curfield-\board@temp@curfield}}}%

\define@key[UFCB]{glofill}{colorbackfields}{% %D
  \board@do@l@addto@macro\board@val@savedkeylist{,colorbackfields={#1}}}%

\define@key[UFCB]{locfill}{colorbackfield}{% %D
  \board@do@setsinglekeys*[UFCB]{locfill}{colorbackareas=#1-#1}}%

\define@key[UFCB]{glofill}{colorbackfield}{% %D
  \board@do@l@addto@macro\board@val@savedkeylist{,colorbackfield=#1}}%

\define@key[UFCB]{locfill}{colorwhitebackfields}[true]{%
 \let\board@pgf@savetrimtocolor\board@pgf@curtrimtocolor%
 \board@do@setsinglekeys*[UFCB]{locfill}{trimtocolor=white, colorbackboard}%
 \expandafter\board@do@setsavedkey\expandafter{\board@pgf@savetrimtocolor}{trimtocolor}}%

\define@key[UFCB]{glofill}{colorwhitebackfields}[true]{% %D
    \board@do@l@addto@macro\board@val@savedkeylist{,colorwhitefields=#1}}%

\define@key[UFCB]{locfill}{colorblackbackfields}[true]{%
  \let\board@pgf@savetrimtocolor\board@pgf@curtrimtocolor%
  \board@do@setsinglekeys*[UFCB]{locfill}{trimtocolor=black, colorbackboard}%
  \expandafter\board@do@setsavedkey\expandafter{\board@pgf@savetrimtocolor}{trimtocolor}}%

\define@key[UFCB]{glofill}{colorblackbackfields}[true]{% %D
    \board@do@l@addto@macro\board@val@savedkeylist{,colorblackfields=#1}}%

%%obsolete
\define@key[UFCB]{locfill}{colorblackfields}[true]{%
  \let\board@pgf@savetrimtocolor\board@pgf@curtrimtocolor%
  \board@do@setsinglekeys*[UFCB]{locfill}{trimtocolor=black, colorbackboard}%
  \expandafter\board@do@setsavedkey\expandafter{\board@pgf@savetrimtocolor}{trimtocolor}}%

\define@key[UFCB]{glofill}{colorblackfields}[true]{% %D
    \board@do@l@addto@macro\board@val@savedkeylist{,colorblackfields=#1}}%

%% obsolete
\define@key[UFCB]{locfill}{colorwhitefields}[true]{%
 \let\board@pgf@savetrimtocolor\board@pgf@curtrimtocolor%
 \board@do@setsinglekeys*[UFCB]{locfill}{trimtocolor=white, colorbackboard}%
 \expandafter\board@do@setsavedkey\expandafter{\board@pgf@savetrimtocolor}{trimtocolor}}%

\define@key[UFCB]{glofill}{colorwhitefields}[true]{% %D
    \board@do@l@addto@macro\board@val@savedkeylist{,colorwhitefields=#1}}%

%% to add background border

\define@key[UFCB]{locfill}{pgfborder}[\printarea]{%
 \edef\board@pgf@savebackstyle{\board@pgf@curbackstyle}%
 \board@do@setsinglekeys*[UFCB]{locfill}{%
   backstyle=border,backregions=#1}%
  \expandafter\board@do@setsavedkey\expandafter{\board@pgf@savebackstyle}{backstyle}}%

\define@key[UFCB]{glofill}{pgfborder}[\printarea]{% %D
    \board@do@l@addto@macro\board@val@savedkeylist{,pgfborder=#1}}%

\endinput
%%
%% End of file `chessboard-keys-pgf.sty'.
