% Copyright 2011 by Till Tantau
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.

\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/frontendlayer/tikz/libraries/tikzlibraryquotes.code.tex,v 1.3 2013/08/28 15:24:27 tantau Exp $

\def\tikz@quote@parser#1{\tikz@quote@@parser#1\pgf@stop}
\def\tikz@quote@@parser"#1"{%
  \pgfutil@ifnextchar\bgroup{%
    \tikz@quote@@parser@group{#1}}{%
    \pgfutil@ifnextchar'{%
      \tikz@quote@@parser@apo{#1}}{%
      \tikz@quote@@parser@normal{#1}}}}
\def\tikz@quote@@parser@apo#1'{%
  \pgfutil@ifnextchar\bgroup{\tikz@quote@@parser@apo@group{#1}}{\tikz@quote@@parser@apo@normal{#1}}}
\def\tikz@quote@@parser@group#1#2#3\pgf@stop{%
  \expandafter\def\expandafter\tikz@temp\expandafter{\tikz@quotes@as{#1}{#2}}%
  \expandafter\pgfkeysalso\expandafter{\tikz@temp}%
}
\def\tikz@quote@@parser@normal#1#2\pgf@stop{%
  \expandafter\def\expandafter\tikz@temp\expandafter{\tikz@quotes@as{#1}{#2}}%
  \expandafter\pgfkeysalso\expandafter{\tikz@temp}%
}
\def\tikz@quote@@parser@apo@group#1#2#3\pgf@stop{%
  \expandafter\def\expandafter\tikz@temp\expandafter{\tikz@quotes@as{#1}{',#2}}%
  \expandafter\pgfkeysalso\expandafter{\tikz@temp}%
}
\def\tikz@quote@@parser@apo@normal#1#2\pgf@stop{%
  \expandafter\def\expandafter\tikz@temp\expandafter{\tikz@quotes@as{#1}{',#2}}%
  \expandafter\pgfkeysalso\expandafter{\tikz@temp}%
}

\pgfkeys{/handlers/first char syntax=true}

\def\tikz@enable@node@quotes{%
  \pgfkeyssetvalue{/handlers/first char syntax/the character "}{\tikz@quote@parser}%
  \let\tikz@quotes@as\tikz@node@quotes@as%
}
\def\tikz@enable@edge@quotes{%
  \pgfkeyssetvalue{/handlers/first char syntax/the character "}{\tikz@quote@parser}%
  \let\tikz@quotes@as\tikz@edge@quotes@as%
}
\def\tikz@enable@pic@quotes{%
  \pgfkeyssetvalue{/handlers/first char syntax/the character "}{\tikz@quote@parser}%
  \let\tikz@quotes@as\tikz@pic@quotes@as%
}

\tikzset{
  node quotes mean/.code={\def\tikz@node@quotes@as##1##2{#1}},
  edge quotes mean/.code={\def\tikz@edge@quotes@as##1##2{#1}},
  pic quotes mean/.code={\def\tikz@pic@quotes@as##1##2{#1}},
  quotes mean pin/.style={node quotes mean={
      pin={[direction shorthands,every pin quotes/.try,##2]##1}}},
  quotes mean label/.style={node quotes mean={
      label={[direction shorthands,every label quotes/.try,##2]##1}}},
  quotes mean label,
  edge quotes mean={edge node={node [every edge quotes,#2]{#1}}},
  pic quotes mean={pic text={#1},pic text options={every pic quotes/.try,#2}},
  every edge quotes/.style={auto},
  direction shorthands/.code={%
    \pgfkeyslet{/tikz/above/.@cmd}\tikz@label@@above
    \pgfkeyslet{/tikz/below/.@cmd}\tikz@label@@below
    \pgfkeyslet{/tikz/left/.@cmd}\tikz@label@@left
    \pgfkeyslet{/tikz/right/.@cmd}\tikz@label@@right
    \pgfkeyslet{/tikz/above left/.@cmd}\tikz@label@@above@left
    \pgfkeyslet{/tikz/above right/.@cmd}\tikz@label@@above@right
    \pgfkeyslet{/tikz/below left/.@cmd}\tikz@label@@below@left
    \pgfkeyslet{/tikz/below right/.@cmd}\tikz@label@@below@right
  }
}

\def\tikz@label@@above#1\pgfeov{\pgfkeysalso{label position=90,pin position=90}}
\def\tikz@label@@below#1\pgfeov{\pgfkeysalso{label position=-90,pin position=-90}}
\def\tikz@label@@left#1\pgfeov{\pgfkeysalso{label position=180,pin position=180}}
\def\tikz@label@@right#1\pgfeov{\pgfkeysalso{label position=0,pin position=0}}
\def\tikz@label@@above@left#1\pgfeov{\pgfkeysalso{label position=135,pin position=135}}
\def\tikz@label@@below@left#1\pgfeov{\pgfkeysalso{label position=-135,pin position=-135}}
\def\tikz@label@@above@right#1\pgfeov{\pgfkeysalso{label position=45,pin position=45}}
\def\tikz@label@@below@right#1\pgfeov{\pgfkeysalso{label position=-45,pin position=-45}}



\endinput
