Back to index

texmacs  1.0.7.15
pager.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : pager.cpp
00004 * DESCRIPTION: Places typesetted paragraphs on pages
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 PAGER_H
00013 #define PAGER_H
00014 #include "typesetter.hpp"
00015 #include "Format/line_item.hpp"
00016 #include "Format/page_item.hpp"
00017 #include "Format/stack_border.hpp"
00018 #include "Page/skeleton.hpp"
00019 
00020 class pager_rep {
00021 public:
00022   path                 ip;
00023   edit_env             env;
00024   hashmap<string,tree> style;
00025   array<page_item>     l;
00026 
00027   bool         paper;
00028   int          quality;
00029   bool         show_hf;
00030   SI           text_width;
00031   SI           text_height;
00032   SI           width;
00033   SI           height;
00034   SI           odd;
00035   SI           even;
00036   SI           top;
00037   SI           bot;
00038   SI           may_extend;
00039   SI           may_shrink;
00040   SI           head_sep;
00041   SI           foot_sep;
00042   SI           col_sep;
00043   space        fn_sep;
00044   space        fnote_sep;
00045   SI           fnote_bl;
00046   space        float_sep;
00047   SI           mnote_sep;
00048 
00049   int          page_offset;
00050   SI           cur_top;
00051   array<box>   pages;
00052 
00053   array<box>   lines_bx;
00054   array<space> lines_ht;
00055 
00056 protected: // making papyrus boxes
00057   array<page_item> pap_main;
00058   array<page_item> pap_fnote;
00059 
00060   void papyrus_fnote_float (array<page_item> from, array<page_item>& to);
00061   void papyrus_mcolumn (array<page_item>& l);
00062   void papyrus_make (array<page_item> l);
00063 
00064 protected: // making page boxes
00065   box  pages_format (array<page_item> l, SI ht, SI tcor, SI bcor);
00066   box  pages_format (insertion ins);
00067   box  pages_format (pagelet pg);
00068   box  pages_make_page (pagelet pg);
00069   void pages_make ();
00070   void papyrus_make ();
00071 
00072 public:
00073   pager_rep (path ip, edit_env env, array<page_item> l);
00074 
00075   //void start_page ();
00076   //void print (page_item item);
00077   //void end_page (bool flag);
00078   box  make_header (bool empty_flag);
00079   box  make_footer (bool empty_flag);
00080   box  make_pages ();
00081 
00082   friend struct stacker_rep;
00083   friend box typeset_paragraph (edit_env env, tree t, path ip);
00084   friend box typeset_document (edit_env env, tree t, path ip);
00085 };
00086 
00087 typedef pager_rep* pager;
00088 
00089 #endif // defined PAGER_H