Back to index

texmacs  1.0.7.15
stacker.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : stacker.hpp
00004 * DESCRIPTION: Vertical formatting of paragraphs
00005 * COPYRIGHT  : (C) 1999  Joris van der Hoeven
00006 *******************************************************************************
00007 * This software falls under the GNU general public license version 3 or later.
00008 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010 ******************************************************************************/
00011 
00012 #ifndef STACKER_H
00013 #define STACKER_H
00014 #include "formatter.hpp"
00015 #include "typesetter.hpp"
00016 #include "Format/stack_border.hpp"
00017 #include "Format/page_item.hpp"
00018 #include "Format/line_item.hpp"
00019 
00020 struct stacker_rep {
00021   path              ip;      // source location of the stacker
00022   array<page_item>  l;       // the vertically formatted paragraph(s)
00023   stack_border      sb;      // the border properties
00024 
00025 private:
00026   bool              unit_flag;      // did we just start a new unit ?
00027   int               unit_start;     // start of last unit
00028   stack_border      unit_sb;        // border properties of last unit
00029   array<page_item>  unit_ctrl;      // control items
00030 
00031 public:
00032   void set_env_vars (SI h, SI s, SI hs, SI vs, SI bot, SI top);
00033   void print (box b, array<lazy> fl= 0, int nr_cols= 1);
00034   void print (tree t, int nr_cols= 1, bool before= false);
00035   void print (space spc);
00036   void flush ();
00037   void penalty (int pen);
00038   void new_paragraph (space par_sep);
00039   void vspace_before (space spc);
00040   void vspace_after (space spc);
00041   void no_page_break_before ();
00042   void no_page_break_after ();
00043 
00044   stacker_rep ();
00045 };
00046 
00047 typedef stacker_rep* stacker;
00048 
00049 array<page_item> typeset_stack (edit_env env, tree t, path ip,
00050                             array<line_item> a, array<line_item> b,
00051                             stack_border& sb);
00052 
00053 void merge_stack (array<page_item>& l, stack_border& sb,
00054                 array<page_item> l2, stack_border sb2);
00055 
00056 #endif // defined STACKER_H