%%
%% This is file `l3dvips.def',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% l3drivers.dtx  (with options: `package,dvips')
%% 
%% Copyright (C) 1990-2018 The LaTeX3 Project
%% 
%% It may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License (LPPL), either version 1.3c of
%% this license or (at your option) any later version.  The latest
%% version of this license is in the file:
%% 
%%    https://www.latex-project.org/lppl.txt
%% 
%% This file is part of the "l3kernel bundle" (The Work in LPPL)
%% and all files in that bundle must be distributed together.
%% 
%% File: l3drivers.dtx Copyright(C) 2011-2018 The LaTeX3 Project
\ProvidesExplFile
  {l3dvips.def}{2018-06-14}{}
  {L3 Experimental driver: dvips}
\cs_new_eq:NN \__driver_literal_x:n \tex_special:D
\cs_new_protected:Npn \__driver_literal:n #1
  { \__driver_literal_x:n { \exp_not:n {#1} } }
\cs_generate_variant:Nn \__driver_literal:n { x }
\cs_new_protected:Npn \driver_color_pickup:N #1 { }
\AtBeginDocument
  {
    \@ifpackageloaded { color }
      {
        \cs_set_protected:Npn \driver_color_pickup:N #1
          {
            \exp_args:NV \tl_if_head_is_space:nTF \current@color
              {
                \tl_set:Nx #1
                   {
                     spot ~
                     \exp_after:wN \use:n \current@color \c_space_tl 1
                   }
              }
              {
                \exp_after:wN \__driver_color_pickup:w
                  \current@color \q_stop #1
              }
          }
        \cs_new_protected:Npn \__driver_color_pickup:w #1 ~ #2 \q_stop #3
          { \tl_set:Nn #3 { #1 ~ #2 } }
      }
      { }
  }
\cs_new_protected:Npn \driver_color_cmyk:nnnn #1#2#3#4
  {
    \__driver_color_select:x
      {
        cmyk~
        \fp_eval:n {#1} ~ \fp_eval:n {#2} ~
        \fp_eval:n {#3} ~ \fp_eval:n {#4}
      }
  }
\cs_new_protected:Npn \driver_color_gray:n #1
  { \__driver_color_select:x { gray~ \fp_eval:n {#1} } }
\cs_new_protected:Npn \driver_color_rgb:nnn #1#2#3
  {
    \__driver_color_select:x
      { rgb~ \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ \fp_eval:n {#3} }
  }
\cs_new_protected:Npn \driver_color_spot:nn #1#2
  { \__driver_color_select:n { \c_space_tl #1 } }
\cs_new_protected:Npn \__driver_color_select:n #1
  {
    \__driver_literal:n { color~push~ #1 }
    \__driver_literal_postscript:n { /l3fc~{ }~def }
    \group_insert_after:N \__driver_color_reset:
  }
\cs_generate_variant:Nn \__driver_color_select:n { x }
\cs_new_protected:Npn \__driver_color_reset:
  { \__driver_literal:n { color~pop } }
\cs_new_protected:Npn \__driver_literal_postscript:n #1
  { \__driver_literal:n { ps:: #1 } }
\cs_generate_variant:Nn \__driver_literal_postscript:n { x }
\cs_new_protected:Npn \__driver_align_currentpoint_begin:
  {
    \__driver_literal:n { ps::[begin] }
    \__driver_literal_postscript:n { currentpoint }
    \__driver_literal_postscript:n { currentpoint~translate }
  }
\cs_new_protected:Npn \__driver_align_currentpoint_end:
  {
    \__driver_literal_postscript:n { neg~exch~neg~exch~translate }
    \__driver_literal:n { ps::[end] }
  }
\cs_new_protected:Npn \__driver_scope_begin:
  { \__driver_literal:n { ps:gsave } }
\cs_new_protected:Npn \__driver_scope_end:
  { \__driver_literal:n { ps:grestore } }
\cs_new_protected:Npn \driver_box_use_clip:N #1
  {
    \__driver_scope_begin:
    \__driver_align_currentpoint_begin:
    \__driver_literal_postscript:n { matrix~currentmatrix }
    \__driver_literal_postscript:n
      { Resolution~72~div~VResolution~72~div~scale }
    \__driver_literal_postscript:n { DVImag~dup~scale }
    \__driver_literal_postscript:x
      {
        0 ~
        \dim_to_decimal_in_bp:n { \box_dp:N #1 } ~
        \dim_to_decimal_in_bp:n { \box_wd:N #1 } ~
        \dim_to_decimal_in_bp:n { -\box_ht:N #1 - \box_dp:N #1 } ~
        rectclip
      }
    \__driver_literal_postscript:n { setmatrix }
    \__driver_align_currentpoint_end:
    \hbox_overlap_right:n { \box_use:N #1 }
    \__driver_scope_end:
    \skip_horizontal:n { \box_wd:N #1 }
  }
\cs_new_protected:Npn \driver_box_use_rotate:Nn #1#2
  { \exp_args:NNf \__driver_box_use_rotate:Nn #1 { \fp_eval:n {#2} } }
\cs_new_protected:Npn \__driver_box_use_rotate:Nn #1#2
  {
    \__driver_scope_begin:
    \__driver_align_currentpoint_begin:
    \__driver_literal_postscript:x
      {
        \fp_compare:nNnTF {#2} = \c_zero_fp
          { 0 }
          { \fp_eval:n { round ( -(#2) , 5 ) } } ~
        rotate
      }
   \__driver_align_currentpoint_end:
   \box_use:N #1
   \__driver_scope_end:
  }
\cs_new_protected:Npn \driver_box_use_scale:Nnn #1#2#3
  {
    \__driver_scope_begin:
    \__driver_align_currentpoint_begin:
    \__driver_literal_postscript:x
      {
        \fp_eval:n { round ( #2 , 5 ) } ~
        \fp_eval:n { round ( #3 , 5 ) } ~
        scale
      }
    \__driver_align_currentpoint_end:
    \hbox_overlap_right:n { \box_use:N #1 }
    \__driver_scope_end:
  }
\cs_new_eq:NN \__driver_image_getbb_eps:n \image_read_bb:n
\cs_new_protected:Npn \__driver_image_include_eps:n #1
  { \__driver_literal:n { PSfile = #1 } }
\cs_new_eq:NN \__driver_draw_literal:n \__driver_literal_postscript:n
\cs_generate_variant:Nn \__driver_draw_literal:n { x }
\cs_new_protected:Npn \driver_draw_begin:
  {
    \__driver_literal:n { ps::[begin] }
    \__driver_draw_literal:n { @beginspecial }
    \__driver_draw_literal:n { /l3fc~{ }~def }
  }
\cs_new_protected:Npn \driver_draw_end:
  {
    \__driver_draw_literal:n { @endspecial }
    \__driver_literal:n { ps::[end] }
  }
\cs_new_protected:Npn \driver_draw_scope_begin:
  { \__driver_draw_literal:n { save } }
\cs_new_protected:Npn \driver_draw_scope_end:
  { \__driver_draw_literal:n { restore } }
\cs_new_protected:Npn \driver_draw_moveto:nn #1#2
  {
    \__driver_draw_literal:x
      {
        \dim_to_decimal_in_bp:n {#1} ~
        \dim_to_decimal_in_bp:n {#2} ~ moveto
      }
  }
\cs_new_protected:Npn \driver_draw_lineto:nn #1#2
  {
    \__driver_draw_literal:x
      {
        \dim_to_decimal_in_bp:n {#1} ~
        \dim_to_decimal_in_bp:n {#2} ~ lineto
      }
  }
\cs_new_protected:Npn \driver_draw_rectangle:nnnn #1#2#3#4
  {
     \__driver_draw_literal:x
       {
         \dim_to_decimal_in_bp:n {#4} ~ \dim_to_decimal_in_bp:n {#3} ~
         \dim_to_decimal_in_bp:n {#1} ~ \dim_to_decimal_in_bp:n {#2} ~
         moveto~dup~0~rlineto~exch~0~exch~rlineto~neg~0~rlineto~closepath
      }
  }
\cs_new_protected:Npn \driver_draw_curveto:nnnnnn #1#2#3#4#5#6
  {
    \__driver_draw_literal:x
      {
        \dim_to_decimal_in_bp:n {#1} ~ \dim_to_decimal_in_bp:n {#2} ~
        \dim_to_decimal_in_bp:n {#3} ~ \dim_to_decimal_in_bp:n {#4} ~
        \dim_to_decimal_in_bp:n {#5} ~ \dim_to_decimal_in_bp:n {#6} ~
        curveto
      }
 }
\cs_new_protected:Npn \driver_draw_evenodd_rule:
  { \bool_gset_true:N \g__driver_draw_eor_bool }
\cs_new_protected:Npn \driver_draw_nonzero_rule:
  { \bool_gset_false:N \g__driver_draw_eor_bool }
\bool_new:N \g__driver_draw_eor_bool
\cs_new_protected:Npn \driver_draw_closepath:
  { \__driver_draw_literal:n { closepath } }
\cs_new_protected:Npn \driver_draw_stroke:
  {
    \__driver_draw_literal:n { stroke }
    \bool_if:NT \g__driver_draw_clip_bool
      {
        \__driver_draw_literal:x
          {
            \bool_if:NT \g__driver_draw_eor_bool { eo }
            clip
          }
      }
    \__driver_draw_literal:n { newpath }
    \bool_gset_false:N \g__driver_draw_clip_bool
  }
\cs_new_protected:Npn \driver_draw_closestroke:
  {
    \driver_draw_closepath:
    \driver_draw_stroke:
  }
\cs_new_protected:Npn \driver_draw_fill:
  {
    \__driver_draw_literal:n { gsave }
    \__driver_draw_literal:n { l3fc }
    \__driver_draw_literal:x
      {
        \bool_if:NT \g__driver_draw_eor_bool { eo }
        fill
      }
    \__driver_draw_literal:n { grestore }
    \bool_if:NT \g__driver_draw_clip_bool
      {
        \__driver_draw_literal:x
          {
            \bool_if:NT \g__driver_draw_eor_bool { eo }
            clip
          }
      }
    \__driver_draw_literal:n { newpath }
    \bool_gset_false:N \g__driver_draw_clip_bool
  }
\cs_new_protected:Npn \driver_draw_fillstroke:
  {
    \__driver_draw_literal:n { gsave }
    \__driver_draw_literal:n { l3fc }
    \__driver_draw_literal:x
      {
        \bool_if:NT \g__driver_draw_eor_bool { eo }
        fill
      }
    \__driver_draw_literal:n { grestore }
    \__driver_draw_literal:n { stroke }
    \bool_if:NT \g__driver_draw_clip_bool
      {
        \__driver_draw_literal:x
          {
            \bool_if:NT \g__driver_draw_eor_bool { eo }
            clip
          }
      }
    \__driver_draw_literal:n { newpath }
    \bool_gset_false:N \g__driver_draw_clip_bool
  }
\cs_new_protected:Npn \driver_draw_clip:
  { \bool_gset_true:N \g__driver_draw_clip_bool }
\bool_new:N \g__driver_draw_clip_bool
\cs_new_protected:Npn \driver_draw_discardpath:
  {
    \bool_if:NT \g__driver_draw_clip_bool
      {
        \__driver_draw_literal:x
          {
            \bool_if:NT \g__driver_draw_eor_bool { eo }
            clip
          }
      }
    \__driver_draw_literal:n { newpath }
    \bool_gset_false:N \g__driver_draw_clip_bool
  }
\cs_new_protected:Npn \driver_draw_dash_pattern:nn #1#2
  {
    \__driver_draw_literal:x
      {
        [
          \exp_args:Nf \use:n
            { \clist_map_function:nN {#1} \__driver_draw_dash:n }
        ] ~
        \dim_to_decimal_in_bp:n {#2} ~ setdash
      }
  }
\cs_new:Npn \__driver_draw_dash:n #1
  { ~ \dim_to_decimal_in_bp:n {#1} }
\cs_new_protected:Npn \driver_draw_linewidth:n #1
  {
    \__driver_draw_literal:x
      { \dim_to_decimal_in_bp:n {#1} ~ setlinewidth }
  }
\cs_new_protected:Npn \driver_draw_miterlimit:n #1
  { \__driver_draw_literal:x { \fp_eval:n {#1} ~ setmiterlimit } }
\cs_new_protected:Npn \driver_draw_cap_butt:
  { \__driver_draw_literal:n { 0 ~ setlinecap } }
\cs_new_protected:Npn \driver_draw_cap_round:
  { \__driver_draw_literal:n { 1 ~ setlinecap } }
\cs_new_protected:Npn \driver_draw_cap_rectangle:
  { \__driver_draw_literal:n { 2 ~ setlinecap } }
\cs_new_protected:Npn \driver_draw_join_miter:
  { \__driver_draw_literal:n { 0 ~ setlinejoin } }
\cs_new_protected:Npn \driver_draw_join_round:
  { \__driver_draw_literal:n { 1 ~ setlinejoin } }
\cs_new_protected:Npn \driver_draw_join_bevel:
  { \__driver_draw_literal:n { 2 ~ setlinejoin } }
\cs_new_protected:Npn \driver_draw_color_fill_cmyk:nnnn #1#2#3#4
  {
    \__driver_draw_color_fill:x
      {
        \fp_eval:n {#1} ~ \fp_eval:n {#2} ~
        \fp_eval:n {#3} ~ \fp_eval:n {#4} ~
        setcmykcolor
      }
  }
\cs_new_protected:Npn \driver_draw_color_stroke_cmyk:nnnn #1#2#3#4
  {
    \__driver_draw_color_stroke:x
      {
        cmyk ~
        \fp_eval:n {#1} ~ \fp_eval:n {#2} ~
        \fp_eval:n {#3} ~ \fp_eval:n {#4}
      }
  }
\cs_new_protected:Npn \driver_draw_color_fill_gray:n #1
  { \__driver_draw_color_fill:x { \fp_eval:n {#1} ~ setgray } }
\cs_new_protected:Npn \driver_draw_color_stroke_gray:n #1
  { \__driver_draw_color_stroke:x { gray ~ \fp_eval:n {#1} } }
\cs_new_protected:Npn \driver_draw_color_fill_rgb:nnn #1#2#3
  {
    \__driver_draw_color_fill:x
      { \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ \fp_eval:n {#3} ~ setrgbcolor }
  }
\cs_new_protected:Npn \driver_draw_color_stroke_rgb:nnn #1#2#3
  {
    \__driver_draw_color_stroke:x
      { rgb ~ \fp_eval:n {#1} ~ \fp_eval:n {#2} ~ \fp_eval:n {#3} }
  }
\cs_new_protected:Npn \__driver_draw_color_fill:n #1
  { \__driver_draw_literal:n { /l3fc ~ { #1 } ~ def } }
\cs_generate_variant:Nn \__driver_draw_color_fill:n { x }
\cs_new_protected:Npn \__driver_draw_color_stroke:n #1
  {
    \__driver_literal:n { color~push~#1 }
    \group_insert_after:N \__driver_color_reset:
  }
\cs_generate_variant:Nn \__driver_draw_color_stroke:n { x }
\cs_new_protected:Npn \driver_draw_cm:nnnn #1#2#3#4
  {
    \__driver_draw_literal:n
      {
        [
          \fp_eval:n {#1} ~ \fp_eval:n {#2} ~
          \fp_eval:n {#3} ~ \fp_eval:n {#4} ~
          0 ~ 0
        ] ~
        concat
      }
  }
\cs_new_protected:Npn \driver_draw_box_use:Nnnnn #1#2#3#4#5
  {
    \__driver_draw_literal:n { @endspecial }
    \__driver_draw_literal:n { [end] }
    \__driver_draw_literal:n { [begin] }
    \__driver_draw_literal:n { save }
    \__driver_draw_literal:n { currentpoint }
    \__driver_draw_literal:n { currentpoint~translate }
    \driver_draw_cm:nnnn { 1 } { 0 } { 0 } { -1 }
    \driver_draw_cm:nnnn {#2} {#3} {#4} {#5}
    \driver_draw_cm:nnnn { 1 } { 0 } { 0 } { -1 }
    \__driver_draw_literal:n { neg~exch~neg~exch~translate }
    \__driver_draw_literal:n { [end] }
    \hbox_overlap_right:n { \box_use:N #1 }
    \__driver_draw_literal:n { [begin] }
    \__driver_draw_literal:n { restore }
    \__driver_draw_literal:n { [end] }
    \__driver_draw_literal:n { [begin] }
    \__driver_draw_literal:n { @beginspecial }
  }
%% 
%%
%% End of file `l3dvips.def'.
