%% This is a part of bclogo.sty v3.0
%% This file is loaded by bclogo when pstrick is used
%% It is a modification of md-frame-3.mdf file, from the mdframed package
%% This file may be distributed under the terms of the LaTeX Project
%% Public License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1.0 or, at your option, any later version.
%
\def\md@putbox@single{%boite qui tient sur la page
   \leftline{\null\hspace*{\mdf@leftmargin@length}%%
        \setlength\bc@mdfboxwidth{\wd\@tempboxa}%
        \setlength\bc@mdfboxheight{\ht\@tempboxa+\dp\@tempboxa}%
        \setlength{\bc@invboxh}{\bc@mdfboxheight}%
        \setlength{\mdfboundingboxheight}{%
                     \bc@mdfboxheight%
                    +\mdf@innertopmargin@length%
                    +\mdf@innerbottommargin@length%
%                    +\mdf@middlelinewidth@length%
%                    +\mdf@middlelinewidth@length%
                  }%
         \ifbool{mdf@topline}{\addtolength{\mdfboundingboxheight}{\mdf@middlelinewidth@length}}{}%
         \ifbool{mdf@bottomline}{\addtolength{\mdfboundingboxheight}{\mdf@middlelinewidth@length}}{}%
         \setlength{\mdfboundingboxwidth}{%
                     \bc@mdfboxwidth%
                    +\mdf@innerleftmargin@length%
                    +\mdf@innerrightmargin@length%
%                    +\mdf@middlelinewidth@length%
%                    +\mdf@middlelinewidth@length%
                  }%
       \ifbool{mdf@leftline}{\addtolength{\mdfboundingboxwidth}{\mdf@middlelinewidth@length}}{}%
       \ifbool{mdf@rightline}{\addtolength{\mdfboundingboxwidth}{\mdf@middlelinewidth@length}}{}%
       \psset{linearc=\mdf@roundcorner@length,cornersize=absolute}%
       \psset{unit=1pt}%
       \begin{pspicture}(0,0)(\dimexpr\mdfboundingboxwidth,\mdfboundingboxheight)%
                \ifKV@bclogo@ombre%cadre ombre
                \ifKV@bclogo@blur%blur
                \psframe[fillstyle=solid, shadow=true, blur=true, shadowsize=\bcval@epOmbre cm,%
                         shadowcolor=\bcval@couleurOmbre, fillcolor=\bcval@couleur,linewidth=\bcval@borderWidth,%
                         linestyle=\ifKV@bclogo@noborder none\else solid\fi,linecolor=\bcval@couleurBord]%
                         (0,0)(\mdfboundingboxwidth,\mdfboundingboxheight)%
                \else%
                \psframe[fillstyle=solid, shadow=true, shadowsize=\bcval@epOmbre cm,%
                         shadowcolor=\bcval@couleurOmbre, fillcolor=\bcval@couleur,linewidth=\bcval@borderWidth,%
                         linestyle=\ifKV@bclogo@noborder none\else solid\fi,linecolor=\bcval@couleurBord]%
                         (0,0)(\mdfboundingboxwidth,\mdfboundingboxheight)%
                \fi%
                \else%
                \psframe[fillstyle=solid, fillcolor=\bcval@couleur,linewidth=\bcval@borderWidth,
                         linestyle=\ifKV@bclogo@noborder none\else solid\fi,linecolor=\bcval@couleurBord]%
                         (0,0)(\mdfboundingboxwidth,\mdfboundingboxheight)%
                \fi%
                \rput[tl](\dimexpr0.5\bcval@framesep+\mdf@middlelinewidth@length,%
                          \dimexpr\mdfboundingboxheight-0.75\bcval@framesep-\mdf@middlelinewidth@length){\box\bc@envbox}%
                \rput[bl](\dimexpr\mdf@middlelinewidth@length+0.5\bcval@framesep,%
                          \dimexpr\mdf@innerbottommargin@length+\mdf@middlelinewidth@length){\bc@barre}%
                \rput[bl](\dimexpr\mdf@innerleftmargin@length+\mdf@middlelinewidth@length,%
                          \dimexpr\mdf@innerbottommargin@length+\mdf@middlelinewidth@length){\box\@tempboxa}%
       \end{pspicture}%
     }%
}%
%
\def\md@putbox@first{%tete d'une boite coupée
   \leftline{\null\hspace*{\mdf@leftmargin@length}%%
        \setlength\bc@mdfboxwidth{\wd\tw@}%
        \setlength\bc@mdfboxheight{\ht\tw@+\dp\tw@}%
        \setlength{\bc@invboxh}{\bc@mdfboxheight}%
        \setlength{\mdfboundingboxheight}{%
                    +\bc@mdfboxheight%
                    +\mdf@innertopmargin@length%
                    +\mdf@splitbottomskip@length%
                  }%
         \ifbool{mdf@topline}{\addtolength{\mdfboundingboxheight}{\mdf@middlelinewidth@length}}{}%
         \setlength{\mdfboundingboxwidth}{%
                    +\mdf@innerleftmargin@length%
                    +\bc@mdfboxwidth
                    +\mdf@innerrightmargin@length%
                  }%
         \ifbool{mdf@leftline}{\addtolength{\mdfboundingboxwidth}{\mdf@middlelinewidth@length}}{}%
         \ifbool{mdf@rightline}{\addtolength{\mdfboundingboxwidth}{\mdf@middlelinewidth@length}}{}%
         \psset{linearc=\mdf@roundcorner@length}%
         \psset{unit=1pt}%
         \ifdimgreater{\mdfboundingboxheight}{\vsize}
                {\begin{pspicture}(0,0)(\mdfboundingboxwidth,\vsize)}
                {\begin{pspicture}(0,0)(\mdfboundingboxwidth,\mdfboundingboxheight)}
                \ifKV@bclogo@noborder\psset{linecolor=\bcval@couleur}\else\psset{linecolor=\bcval@couleurBord}\fi%
                \ifdimequal{\mdf@roundcorner@length}{\z@}%
                {%pas d'arrondi
                \ifKV@bclogo@ombre%cadre ombre
                \ifKV@bclogo@blur%blur
                \psframe[fillstyle=solid, shadow=true, blur=true, shadowsize=\bcval@epOmbre cm,%
                         shadowcolor=\bcval@couleurOmbre, fillcolor=\bcval@couleur,linestyle=none]%
                         (0,0)(\mdfboundingboxwidth,\mdfboundingboxheight)%
                \else%
                \psframe[fillstyle=solid, shadow=true, shadowsize=\bcval@epOmbre cm,%
                         shadowcolor=\bcval@couleurOmbre, fillcolor=\bcval@couleur,linestyle=none]%
                         (0,0)(\mdfboundingboxwidth,\mdfboundingboxheight)%
                \fi%
                \else
                \psframe[fillstyle=solid, fillcolor=\bcval@couleur,linestyle=none]%
                         (0,0)(\mdfboundingboxwidth,\mdfboundingboxheight)%
                \fi%
                \ifKV@bclogo@noborder\else%
                \psline[linestyle=solid,linecolor=\bcval@couleurBord,fillstyle=none,linewidth=\bcval@borderWidth]%
                        (\dimexpr0.5\mdf@middlelinewidth@length,0)%
                        (\dimexpr0.5\mdf@middlelinewidth@length,\dimexpr\mdfboundingboxheight-0.5\mdf@middlelinewidth@length)%
                        (\dimexpr\mdfboundingboxwidth-0.5\mdf@middlelinewidth@length,\dimexpr\mdfboundingboxheight-0.5\mdf@middlelinewidth@length)%
                        (\dimexpr\mdfboundingboxwidth-0.5\mdf@middlelinewidth@length,0)%
                \fi%
                }%
                {%arrondi
                \ifKV@bclogo@ombre%cadre ombre
                \ifKV@bclogo@blur%blur
                \psline[shadow=true,blur=true,shadowsize=\bcval@epOmbre cm,shadowcolor=\bcval@couleurOmbre,fillstyle=solid,%
                        fillcolor=\bcval@couleur,linestyle=solid,linewidth=\bcval@borderWidth]%
                        (\dimexpr0.5\mdf@middlelinewidth@length,0)%
                        (\dimexpr0.5\mdf@middlelinewidth@length,\dimexpr\mdfboundingboxheight-0.5\mdf@middlelinewidth@length)%
                        (\dimexpr\mdfboundingboxwidth-0.5\mdf@middlelinewidth@length,\dimexpr\mdfboundingboxheight-0.5\mdf@middlelinewidth@length)%
                        (\dimexpr\mdfboundingboxwidth-0.5\mdf@middlelinewidth@length,0)%
                \else%no blur
                \psline[shadow=true,shadowsize=\bcval@epOmbre cm,shadowcolor=\bcval@couleurOmbre,fillstyle=solid,%
                        fillcolor=\bcval@couleur,linestyle=solid,linewidth=\bcval@borderWidth]%
                        (\dimexpr0.5\mdf@middlelinewidth@length,0)%
                        (\dimexpr0.5\mdf@middlelinewidth@length,\dimexpr\mdfboundingboxheight-0.5\mdf@middlelinewidth@length)%
                        (\dimexpr\mdfboundingboxwidth-0.5\mdf@middlelinewidth@length,\dimexpr\mdfboundingboxheight-0.5\mdf@middlelinewidth@length)%
                        (\dimexpr\mdfboundingboxwidth-0.5\mdf@middlelinewidth@length,0)%
                \fi%
                \else% no ombre
                \psline[fillstyle=solid,fillcolor=\bcval@couleur,linestyle=solid,linewidth=\bcval@borderWidth]%
                        (\dimexpr0.5\mdf@middlelinewidth@length,0)%
                        (\dimexpr0.5\mdf@middlelinewidth@length,\dimexpr\mdfboundingboxheight-0.5\mdf@middlelinewidth@length)%
                        (\dimexpr\mdfboundingboxwidth-0.5\mdf@middlelinewidth@length,\dimexpr\mdfboundingboxheight-0.5\mdf@middlelinewidth@length)%
                        (\dimexpr\mdfboundingboxwidth-0.5\mdf@middlelinewidth@length,0)%
                \fi%
                }%
                \rput[tl](\dimexpr0.5\bcval@framesep+\mdf@middlelinewidth@length,%
                          \dimexpr\mdfboundingboxheight-0.75\bcval@framesep-\mdf@middlelinewidth@length){\box\bc@envbox}%
                \rput[bl](\dimexpr\mdf@middlelinewidth@length+0.5\bcval@framesep,0){\bc@barre}%
                \rput[bl](\dimexpr\mdf@innerleftmargin@length+\mdf@middlelinewidth@length,0){\box\tw@}%
           \end{pspicture}%
     }%
}%
%
\def\md@putbox@middle{%milieu d'une boite coupée (occupe une page entière)
   \leftline{\null\hspace*{\mdf@leftmargin@length}%%
        \setlength\bc@mdfboxwidth{\wd\tw@}%
        \setlength\bc@mdfboxheight{\ht\tw@+\dp\tw@}%
        \setlength{\bc@invboxh}{\bc@mdfboxheight}%
        \setlength{\mdfboundingboxheight}{%
                    +\bc@mdfboxheight%
                    +\mdf@splitbottomskip@length%
                  }%
         \setlength{\mdfboundingboxwidth}{%
                    +\mdf@innerleftmargin@length%
                    +\bc@mdfboxwidth%
                    +\mdf@innerrightmargin@length%
                  }%
         \ifbool{mdf@leftline}{\addtolength{\mdfboundingboxwidth}{\mdf@middlelinewidth@length}}{}%
         \ifbool{mdf@rightline}{\addtolength{\mdfboundingboxwidth}{\mdf@middlelinewidth@length}}{}%
         \psset{linearc=\mdf@roundcorner@length}%
         \psset{unit=1pt}%
         \ifdimgreater{\mdfboundingboxheight}{\vsize}
                {\begin{pspicture}(0,0)(\mdfboundingboxwidth,\vsize)}
                {\begin{pspicture}(0,0)(\mdfboundingboxwidth,\mdfboundingboxheight)}
                \ifKV@bclogo@ombre%cadre ombre
                \ifKV@bclogo@blur%blur
                \psframe[fillstyle=solid, shadow=true, blur=true, shadowsize=\bcval@epOmbre cm,%
                         shadowcolor=\bcval@couleurOmbre, fillcolor=\bcval@couleur,linestyle=none]%
                         (0,0)(\mdfboundingboxwidth,\mdfboundingboxheight)%
                \else%
                \psframe[fillstyle=solid, shadow=true, shadowsize=\bcval@epOmbre cm,%
                         shadowcolor=\bcval@couleurOmbre, fillcolor=\bcval@couleur,linestyle=none]%
                         (0,0)(\mdfboundingboxwidth,\mdfboundingboxheight)%
                \fi%
                \else%
                \psframe[fillstyle=solid, fillcolor=\bcval@couleur,linestyle=none]%
                         (0,0)(\mdfboundingboxwidth,\mdfboundingboxheight)%
                \fi%
                \ifKV@bclogo@noborder\else%
                \psline[linestyle=solid,linecolor=\bcval@couleurBord,fillstyle=none,linewidth=\bcval@borderWidth]%
                        (\dimexpr0.5\mdf@middlelinewidth@length,0)(\dimexpr0.5\mdf@middlelinewidth@length,\mdfboundingboxheight)
                \psline[linestyle=solid,linecolor=\bcval@couleurBord,fillstyle=none,linewidth=\bcval@borderWidth]%
                        (\dimexpr\mdfboundingboxwidth-0.5\mdf@middlelinewidth@length,\mdfboundingboxheight)%
                        (\dimexpr\mdfboundingboxwidth-0.5\mdf@middlelinewidth@length,0)%
                \fi%
                \rput[bl](\dimexpr\mdf@middlelinewidth@length+0.5\bcval@framesep,0){\bc@barre}%
                \rput[bl](\dimexpr\mdf@innerleftmargin@length+\mdf@middlelinewidth@length,0){\box\tw@}%
       \end{pspicture}%
     }%
}%
%
\def\md@putbox@second{%pied d'une boite coupée
   \leftline{\null\hspace*{\mdf@leftmargin@length}%%
        \setlength\bc@mdfboxwidth{\wd\@tempboxa}%
        \setlength\bc@mdfboxheight{\ht\@tempboxa+\dp\@tempboxa}%
        \setlength{\bc@invboxh}{\bc@mdfboxheight}%
        \setlength{\mdfboundingboxheight}{%
                    +\bc@mdfboxheight%
                    +\mdf@innerbottommargin@length%
                  }%
         \ifbool{mdf@bottomline}{\addtolength{\mdfboundingboxheight}{\mdf@middlelinewidth@length}}{}%
         \setlength{\mdfboundingboxwidth}{%
                    +\mdf@innerleftmargin@length%
                    +\bc@mdfboxwidth
                    +\mdf@innerrightmargin@length%
                  }%
         \ifbool{mdf@leftline}{\addtolength{\mdfboundingboxwidth}{\mdf@middlelinewidth@length}}{}%
         \ifbool{mdf@rightline}{\addtolength{\mdfboundingboxwidth}{\mdf@middlelinewidth@length}}{}%
         \psset{linearc=\mdf@roundcorner@length}%
         \psset{unit=1pt}%
         \begin{pspicture}(0,0)(\mdfboundingboxwidth,\mdfboundingboxheight)%
                \ifKV@bclogo@noborder\psset{linecolor=\bcval@couleur}\else\psset{linecolor=\bcval@couleurBord}\fi%
                \ifdimequal{\mdf@roundcorner@length}{\z@}%
                {%pas d'arrondi
                    \ifKV@bclogo@ombre%cadre ombre
                      \ifKV@bclogo@blur%blur
                        \psframe[shadow=true,blur=true,shadowsize=\bcval@epOmbre cm,shadowcolor=\bcval@couleurOmbre,fillstyle=solid,%
                                fillcolor=\bcval@couleur,linestyle=none](0,0)(\mdfboundingboxwidth,\mdfboundingboxheight)%
                      \else%no blur
                        \psframe[shadow=true,shadowsize=\bcval@epOmbre cm,shadowcolor=\bcval@couleurOmbre,fillstyle=solid,%
                                fillcolor=\bcval@couleur,linestyle=none](0,0)(\mdfboundingboxwidth,\mdfboundingboxheight)%
                      \fi%
                   \else% no ombre
                        \psframe[fillstyle=solid,fillcolor=\bcval@couleur,linestyle=none](0,0)(\mdfboundingboxwidth,\mdfboundingboxheight)%
                   \fi%
                   \ifKV@bclogo@noborder\else
                        \psline[fillstyle=solid,fillcolor=\bcval@couleur,linestyle=solid,linewidth=\bcval@borderWidth]%
                                (\dimexpr0.5\mdf@middlelinewidth@length,\mdfboundingboxheight)%
                                (\dimexpr0.5\mdf@middlelinewidth@length,\dimexpr0.5\mdf@middlelinewidth@length)%
                                (\dimexpr\mdfboundingboxwidth-0.5\mdf@middlelinewidth@length,\dimexpr0.5\mdf@middlelinewidth@length)%
                                (\dimexpr\mdfboundingboxwidth-0.5\mdf@middlelinewidth@length,\mdfboundingboxheight)%
                   \fi%
                }%
                {%sinon arrondi
                \ifKV@bclogo@ombre%cadre ombre
                \ifKV@bclogo@blur%blur
                \psline[shadow=true,blur=true,shadowsize=\bcval@epOmbre cm,shadowcolor=\bcval@couleurOmbre,fillstyle=solid,%
                        fillcolor=\bcval@couleur,linestyle=solid,linewidth=\bcval@borderWidth]%
                        (\dimexpr0.5\mdf@middlelinewidth@length,\mdfboundingboxheight)%
                        (\dimexpr0.5\mdf@middlelinewidth@length,\dimexpr0.5\mdf@middlelinewidth@length)%
                        (\dimexpr\mdfboundingboxwidth-0.5\mdf@middlelinewidth@length,\dimexpr0.5\mdf@middlelinewidth@length)%
                        (\dimexpr\mdfboundingboxwidth-0.5\mdf@middlelinewidth@length,\mdfboundingboxheight)%
                \else%no blur
                \psline[shadow=true,shadowsize=\bcval@epOmbre cm,shadowcolor=\bcval@couleurOmbre,fillstyle=solid,%
                        fillcolor=\bcval@couleur,linestyle=solid,linewidth=\bcval@borderWidth]%
                        (\dimexpr0.5\mdf@middlelinewidth@length,\mdfboundingboxheight)%
                        (\dimexpr0.5\mdf@middlelinewidth@length,\dimexpr0.5\mdf@middlelinewidth@length)%
                        (\dimexpr\mdfboundingboxwidth-0.5\mdf@middlelinewidth@length,\dimexpr0.5\mdf@middlelinewidth@length)%
                        (\dimexpr\mdfboundingboxwidth-0.5\mdf@middlelinewidth@length,\mdfboundingboxheight)%
                \fi%
                \else% no ombre
                \psline[fillstyle=solid,fillcolor=\bcval@couleur,linestyle=solid,linewidth=\bcval@borderWidth]%
                        (\dimexpr0.5\mdf@middlelinewidth@length,\mdfboundingboxheight)%
                        (\dimexpr0.5\mdf@middlelinewidth@length,\dimexpr0.5\mdf@middlelinewidth@length)%
                        (\dimexpr\mdfboundingboxwidth-0.5\mdf@middlelinewidth@length,\dimexpr0.5\mdf@middlelinewidth@length)%
                        (\dimexpr\mdfboundingboxwidth-0.5\mdf@middlelinewidth@length,\mdfboundingboxheight)%
                \fi%
                }%
                \rput[bl](\dimexpr\mdf@middlelinewidth@length+0.5\bcval@framesep,%
                          \dimexpr\mdf@innerbottommargin@length+\mdf@middlelinewidth@length){\bc@barre}%
                \rput[bl](\dimexpr\mdf@innerleftmargin@length+\mdf@middlelinewidth@length,%
                          \dimexpr\mdf@innerbottommargin@length+\mdf@middlelinewidth@length){\box\@tempboxa}%
       \end{pspicture}%
     }%
}%
