%%
%% This is file `tikz-timing-clockarrows.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% tikz-timing.dtx  (with options: `tikz-timing-clockarrows.sty')
%% 
%% IMPORTANT NOTICE:
%% 
%% For the copyright see the source file.
%% 
%% Any modified versions of this file must be renamed
%% with new filenames distinct from tikz-timing-clockarrows.sty.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file tikz-timing.dtx.
%% 
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%% Copyright (C) 2009-2012 by Martin Scharrer <martin@scharrer-online.de>
%% ----------------------------------------------------------------------
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Martin Scharrer.
%%
%% This work consists of the files tikz-timing.dtx and tikz-timing.ins
%% and the derived filebase tikz-timing*.sty.
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{tikz-timing-clockarrows}[%
    2017/12/20
    v0.7f
    tikz-timing library for timing clock arrows]
\tikztiming@iftrans{CC}%
  {\let\tikztiming@trans@C@normal@C\tikztiming@trans@CC}%
  {\PackageError{\@currname}{No 'CC' transition defined by the main tikz-timing
  package.}{}}%
\tikztiming@iftrans{HC}%
  {\let\tikztiming@trans@H@normal@C\tikztiming@trans@HC}%
  {\PackageError{\@currname}{No 'HC' transition defined by the main tikz-timing
  package.}{}}%
\tikztiming@iftrans{LC}%
  {\let\tikztiming@trans@L@normal@C\tikztiming@trans@LC}%
  {\PackageError{\@currname}{No 'LC' transition defined by the main tikz-timing
  package.}{}}%

\tikztimingdef{CC}{%
  \code{\setcounter{tikztimingtrans}{-\value{tikztimingtrans}}}
  [timing/c/save]
  \newdraw [\style,timing/c/restore,>=\noexpand\tikztiming@c@arrow@tip,timing/c/arrow@style]
  -- ++(\slope*\noexpand\tikztiming@c@arrow@pos,\value{tikztimingtrans}*\height*\noexpand\tikztiming@c@arrow@pos)
  ; \draw [timing/restore,timing/c/restore] (timing@save) ++(0,0) [\style]
  -- ++(\slope,\value{tikztimingtrans}*\height)
  -- ++($ (#1,0) - (\slope,0) $)
}
\let\tikztiming@trans@C@arrow@C\tikztiming@trans@CC

\tikztimingdef{HC}{%
  \code{\setcounter{tikztimingtrans}{-1}}
  [timing/c/save]
  \newdraw [\style,timing/c/restore,>=\noexpand\tikztiming@c@arrow@tip,timing/c/arrow@style]
  -- ++(\slope*\noexpand\tikztiming@c@arrow@pos,\value{tikztimingtrans}*\height*\noexpand\tikztiming@c@arrow@pos)
  ; \draw [timing/restore,timing/c/restore] (timing@save) ++(0,0) [\style]
  -- ++(\slope,\value{tikztimingtrans}*\height)
  -- ++($ (#1,0) - (\slope,0) $)
}
\let\tikztiming@trans@H@arrow@C\tikztiming@trans@HC

\tikztimingdef{LC}{%
  \code{\setcounter{tikztimingtrans}{+1}}
  [timing/c/save]
  \newdraw [\style,timing/c/restore,>=\noexpand\tikztiming@c@arrow@tip,timing/c/arrow@style]
  -- ++(\slope*\noexpand\tikztiming@c@arrow@pos,\value{tikztimingtrans}*\height*\noexpand\tikztiming@c@arrow@pos)
  ; \draw [timing/restore,timing/c/restore] (timing@save) ++(0,0) [\style]
  -- ++(\slope,\value{tikztimingtrans}*\height)
  -- ++($ (#1,0) - (\slope,0) $)
}
\let\tikztiming@trans@L@arrow@C\tikztiming@trans@LC

\tikzset{timing/c/.cd,
  rising arrows/.code={%
    \let\tikztiming@trans@CC\tikztiming@trans@C@arrow@C%
    \let\tikztiming@trans@LC\tikztiming@trans@L@arrow@C%
    \let\tikztiming@trans@HC\tikztiming@trans@H@arrow@C%
    \def\tikztiming@clockarrow@style{\ifnum1=\c@tikztimingtrans\tikzset{->,timing/c/arrow}\fi}%
  },%
  falling arrows/.code={%
    \let\tikztiming@trans@CC\tikztiming@trans@C@arrow@C%
    \let\tikztiming@trans@LC\tikztiming@trans@L@arrow@C%
    \let\tikztiming@trans@HC\tikztiming@trans@H@arrow@C%
    \def\tikztiming@clockarrow@style{\ifnum-1=\c@tikztimingtrans\tikzset{->,timing/c/arrow}\fi}%
  },%
  dual arrows/.code={%
    \let\tikztiming@trans@CC\tikztiming@trans@C@arrow@C%
    \let\tikztiming@trans@LC\tikztiming@trans@L@arrow@C%
    \let\tikztiming@trans@HC\tikztiming@trans@H@arrow@C%
    \def\tikztiming@clockarrow@style{\tikzset{->,timing/c/arrow}}%
  },%
  no arrows/.code={%
    \let\tikztiming@trans@CC\tikztiming@trans@C@normal@C%
    \let\tikztiming@trans@LC\tikztiming@trans@L@normal@C%
    \let\tikztiming@trans@HC\tikztiming@trans@H@normal@C%
    \def\tikztiming@clockarrow@style{}%
  },%
  arrow@style/.code={\tikztiming@clockarrow@style},%
  arrow/.style={},%
  arrow pos/.store in=\tikztiming@c@arrow@pos,
  arrow tip/.store in=\tikztiming@c@arrow@tip,
  save/.code={%
    \global\let\tikztiming@clockarrow@savedstyle\tikztiming@clockarrow@style
    \global\let\tikztiming@trans@saved@CC\tikztiming@trans@CC
    \global\let\tikztiming@c@arrow@savedpos\tikztiming@c@arrow@pos
    \global\let\tikztiming@c@arrow@savedtip\tikztiming@c@arrow@tip
  },
  restore/.code={%
    \let\tikztiming@clockarrow@style\tikztiming@clockarrow@savedstyle
    \let\tikztiming@trans@CC\tikztiming@trans@saved@CC
    \let\tikztiming@c@arrow@pos\tikztiming@c@arrow@savedpos
    \let\tikztiming@c@arrow@tip\tikztiming@c@arrow@savedtip
  },
}
\tikzset{timing/c/.cd,
  no arrows,
  arrow pos=0.95,
  arrow tip=to,
}

\RequirePackage{pgfopts}
\ProcessPgfOptions{/tikz/timing/c}
\endinput
%%
%% End of file `tikz-timing-clockarrows.sty'.
