%%
%% This is file `beamerouterthemesidebar-xetex-bidi.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% bidi.dtx  (with options: `table,beamerouterthemesidebar-xetex-bidi.def')
%% 
%%   __________________________________________________
%%   Vafa Khalighi
%% 
%%   Copyright (c) 2007--2026  Vafa Khalighi
%%   Copyright (c) 2018--2020 bidi-tex GitHub Organization
%% 
%%   It may be distributed and/or modified under the LaTeX Project Public License,
%%   version 1.3c or higher (your choice). The latest version of
%%   this license is at: http://www.latex-project.org/lppl.txt
%% 
%%   This work is “author-maintained” (as per LPPL maintenance status)
%%   by Vafa Khalighi.
%% 
%% 

%% \CheckSum{54366}
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%%
\ProvidesFile{beamerouterthemesidebar-xetex-bidi.def}[2022/06/07 v0.2 bidi adaptations for beamerouterthemesidebar package for XeTeX engine]
\bidi@csundef{beamer@@tmpop@frametitle@sidebar theme}

\bidi@csundef{beamer@@tmpop@headline@sidebar theme}

\bidi@csundef{beamer@@tmpop@sidebar left@sidebar theme}

\bidi@csundef{beamer@@tmpop@sidebar right@sidebar theme}

\ifdim\beamer@headheight>0pt

  \defbeamertemplate*{frametitle}{sidebar theme}
  {%
    \nointerlineskip%
    \ifbeamer@plainframe%
      \hbox{\usebeamercolor[bg]{frametitle}%
        \@tempdima\paperwidth\advance\@tempdima-\beamer@sidebarwidth
        \hskip-\beamer@leftmargin\vrule height\beamer@headheight width\@tempdima\hskip-\beamer@rightmargin}%
      \nointerlineskip%
    \fi%
    \vskip-\beamer@headheight%
    \vbox to \beamer@headheight{%
      \vfil
      \bidi@beamer@leftskip=-\beamer@leftmargin%
      \advance\bidi@beamer@leftskip by0.3cm%
      \bidi@beamer@rightskip=-\beamer@rightmargin%
      \advance\bidi@beamer@rightskip by0.3cm plus1fil%
      {\usebeamercolor[fg]{frametitle}\usebeamerfont{frametitle}\strut\insertframetitle\par}%
      \ifx\insertframesubtitle\@empty\else%
        {\usebeamercolor[fg]{framesubtitle}\usebeamerfont{framesubtitle}\strut\insertframesubtitle\par}%
      \fi%
      \vbox{}%
      \vskip-1em%
      \vfil
    }%
  }

\AtBeginDocument{%
  \setbeamertemplate{frametitle}[sidebar theme]%
}

  \defbeamertemplate*{headline}{sidebar theme}
  {%
    \begin{beamercolorbox}[wd=\paperwidth]{frametitle}
      \ifx\beamer@sidebarside\beamer@lefttext%
      \else%
        \hfill%
      \fi%
      \ifdim\beamer@sidebarwidth>0pt%
        \bgroup
        \usebeamercolor[bg]{logo}%
        \if@RTLmain
        \else
          \vrule width\beamer@sidebarwidth height \beamer@headheight%
          \hskip-\beamer@sidebarwidth%
        \fi
        \hbox to \beamer@sidebarwidth{\hss\vbox to
          \beamer@headheight{\vss\hbox{{\color{fg}\insertlogo}}\vss}\hss}%
          \if@RTLmain
            \hskip-\beamer@sidebarwidth%
            \vrule width\beamer@sidebarwidth height \beamer@headheight%
          \fi
          \egroup
      \else%
        \vrule width0pt height \beamer@headheight%
      \fi%
    \end{beamercolorbox}
  }
\fi

\def\beamer@sidebarformat#1#2#3{%
\if@RTL
  \begin{beamercolorbox}[wd=\beamer@sidebarwidth,rightskip=#1,leftskip=1ex plus1fil,vmode]{#2}
\else
  \begin{beamercolorbox}[wd=\beamer@sidebarwidth,leftskip=#1,rightskip=1ex plus1fil,vmode]{#2}
 \fi
    \vbox{}%
    #3\par%
    \vbox{}%
    \vskip-1.5ex%
  \end{beamercolorbox}
}

\ifdim\beamer@sidebarwidth>0pt

\AtBeginDocument{%
  \setbeamersize{sidebar width \beamer@sidebarside=\beamer@sidebarwidth}%
}

  \defbeamertemplate*{sidebar \beamer@sidebarside}{sidebar theme}
  {
    \beamer@tempdim=\beamer@sidebarwidth%
    \advance\beamer@tempdim by -6pt%
    {\usebeamerfont{title in sidebar}%
      \vskip1.5em%
      \hskip3pt%
      \bgroup
      \usebeamercolor[fg]{title in sidebar}%
      \insertshorttitle[width=\beamer@tempdim,center,respectlinebreaks]\egroup\par%
      \vskip1.25em%
    }%
    {%
      \hskip3pt%
      \bgroup
      \usebeamercolor[fg]{author in sidebar}%
      \usebeamerfont{author in sidebar}%
      \insertshortauthor[width=\beamer@tempdim,center,respectlinebreaks]\egroup\par%
      \vskip1.25em%
    }%
    \insertverticalnavigation{\beamer@sidebarwidth}%
    \vfill
    \ifx\beamer@sidebarside\beamer@lefttext%
    \else%
      \usebeamercolor{normal text}%
      \llap{\usebeamertemplate***{navigation symbols}\hskip0.1cm}%
      \vskip2pt%
    \fi%
  }%
\fi

\endinput
%%
%% End of file `beamerouterthemesidebar-xetex-bidi.def'.
