%%
%% This is file `xcoffins.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% xcoffins.dtx  (with options: `package')
%% 
%% EXPERIMENTAL CODE
%% 
%% Do not distribute this file without also distributing the
%% source files specified above.
%% 
%% Do not distribute a modified version of this file.
%% 
%% File: xcoffins.dtx Copyright(C) 2010,2011 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
%%
%%    http://www.latex-project.org/lppl.txt
%%
%% This file is part of the "l3experimental bundle" (The Work in LPPL)
%% and all files in that bundle must be distributed together.
%%
%% The released version of this bundle is available from CTAN.
%%
%% -----------------------------------------------------------------------
%%
%% The development version of the bundle can be found at
%%
%%    http://www.latex-project.org/svnroot/experimental/trunk/
%%
%% for those people who are interested.
%%
%%%%%%%%%%%
%% NOTE: %%
%%%%%%%%%%%
%%
%%   Snapshots taken from the repository represent work in progress and may
%%   not work or may contain conflicting material!  We therefore ask
%%   people _not_ to put them into distributions, archives, etc. without
%%   prior consultation with the LaTeX Project Team.
%%
%% -----------------------------------------------------------------------
%%
\RequirePackage{xparse}
\GetIdInfo$Id: xcoffins.dtx 2963 2011-11-15 22:06:41Z joseph $
  {L3 Experimental design-level coffins}
\ProvidesExplPackage
  {\ExplFileName}{\ExplFileDate}{\ExplFileVersion}{\ExplFileDescription}
\keys_define:nn { coffin }
  {
    coffin1-hpole     .tl_set:N        = \l_coffin_A_hpole_tl          ,
    coffin1-hpole     .value_required:                                 ,
    coffin1-vpole     .tl_set:N        = \l_coffin_A_vpole_tl          ,
    coffin1-vpole     .value_required:                                 ,
    coffin2-hpole     .tl_set:N        = \l_coffin_B_hpole_tl          ,
    coffin2-hpole     .value_required:                                 ,
    coffin2-vpole     .tl_set:N        = \l_coffin_B_vpole_tl          ,
    coffin2-vpole     .value_required:                                 ,
    grow-bounding-box .bool_set:N      = \l_coffin_bound_box_grow_bool ,
    grow-bounding-box .default:n       = true                          ,
    hoffset           .dim_set:N       = \l_coffin_hoffset_dim         ,
    hoffset           .value_required:                                 ,
    voffset           .dim_set:N       = \l_coffin_voffset_dim         ,
    voffset           .value_required:
  }
\keys_set:nn { coffin }
  {
    coffin1-hpole     = H    ,
    coffin1-vpole     = l    ,
    coffin2-hpole     = H    ,
    coffin2-vpole     = l    ,
    grow-bounding-box = true ,
    hoffset           = 0 pt ,
    voffset           = 0 pt
  }
\NewDocumentCommand \NewCoffin { m }
  { \coffin_new:N #1 }
\NewDocumentCommand \BoxToCoffin { m }
  {
    \prop_clear_new:c { l_coffin_corners_ \int_value:w #1 _prop }
    \prop_clear_new:c { l_coffin_poles_   \int_value:w #1 _prop }
    \coffin_update_corners:N #1
    \coffin_update_poles:N #1
  }
\NewDocumentCommand \SetHorizontalCoffin { m +m }
  { \hcoffin_set:Nn #1 {#2} }
\NewDocumentCommand \SetVerticalCoffin { m m +m }
  { \vcoffin_set:Nnn #1 {#2} {#3} }
\NewDocumentCommand \SetHorizontalPole { m m m }
  { \coffin_set_horizontal_pole:Nnn #1 {#2} {#3} }
\NewDocumentCommand \SetVerticalPole { m m m }
  { \coffin_set_vertical_pole:Nnn #1 {#2} {#3} }
\NewDocumentCommand \JoinCoffins
  {
    o
    s
    m
    > { \SplitArgument { 1 } { , } } O { H , l }
    m
    > { \SplitArgument { 1 } { , } } O { H , l }
    > { \SplitArgument { 1 } { , } } D ( ) { 0 pt , 0 pt }
  }
  {
    \IfNoValueTF {#1}
      {
        \IfBooleanTF #2
          { \coffin_attach:NnnNnnnn #3 #4 #5 #6 #7 }
          { \coffin_join:NnnNnnnn #3 #4 #5 #6 #7 }
      }
      {
        \group_begin:
          \keys_set:nn { coffin } {#1}
          \tl_set:Nx \l_coffin_tmp_tl
            {
              \group_end:
              \bool_if:NTF \l_coffin_bound_box_grow_bool
                { \coffin_join:NnnNnnnn }
                { \coffin_attach:NnnNnnnn }
              \exp_not:N #3
              { \exp_not:o { \l_coffin_A_hpole_tl } }
              { \exp_not:o { \l_coffin_A_vpole_tl } }
              \exp_not:N #5
              { \exp_not:o { \l_coffin_B_hpole_tl } }
              { \exp_not:o { \l_coffin_B_vpole_tl } }
              { \dim_use:N \l_coffin_hoffset_dim }
              { \dim_use:N \l_coffin_voffset_dim }
            }
        \l_coffin_tmp_tl
      }
  }
\NewDocumentCommand \TypesetCoffin
  {
     m
     > { \SplitArgument { 1 } { , } } O { H , l }
     > { \SplitArgument { 1 } { , } } D ( ) { 0 pt , 0 pt }
  }
  { \coffin_typeset:Nnnnn #1 #2 #3 }
\NewDocumentCommand \RotateCoffin  { m m }
  { \coffin_rotate:Nn #1 {#2} }
\NewDocumentCommand \ResizeCoffin  { m m m }
  { \coffin_resize:Nnn #1 {#2} {#3} }
\NewDocumentCommand \ScaleCoffin  { m m m }
  { \coffin_scale:Nnn #1 {#2} {#3} }
\NewDocumentCommand \CoffinDepth { m }
  { \coffin_dp:N #1 }
\NewDocumentCommand \CoffinHeight { m }
  { \coffin_ht:N #1 }
\NewDocumentCommand \CoffinTotalHeight { m }
  { \dim_eval:w \coffin_ht:N #1 + \coffin_dp:N #1 \dim_eval_end: }
\NewDocumentCommand \CoffinWidth { m }
  { \coffin_wd:N #1 }
\NewDocumentCommand \DisplayCoffinHandles { m m }
  {
    \cs_if_exist:cTF { l_coffin_poles_ \int_value:w #1 _prop }
      { \coffin_display_handles:Nn #1 {#2} }
      { \msg_kernel_error:nx { unknown-coffin } { \token_to_str:N #1 } }
  }
\NewDocumentCommand \MarkCoffinHandle
  { m > { \SplitArgument { 1 } { , } } O { H , l } m }
  {
    \cs_if_exist:cTF { l_coffin_poles_ \int_value:w #1 _prop }
      { \coffin_mark_handle:Nnnn #1 #2 {#3} }
      { \msg_kernel_error:nx { unknown-coffin } { \token_to_str:N #1 }
  }
}
\NewDocumentCommand \ShowCoffinStructure { m }
  { \coffin_show_structure:N #1 }
%% 
%%
%% End of file `xcoffins.sty'.
