Back to index

texmacs  1.0.7.15
lazy_typeset.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : lazy_typeset.hpp
00004 * DESCRIPTION: Lazy typesetting of various primitives
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 LAZY_TYPESET_H
00013 #define LAZY_TYPESET_H
00014 #include "formatter.hpp"
00015 #include "Format/line_item.hpp"
00016 
00017 struct lazy_document_rep: public lazy_rep {
00018   array<lazy> par;   // the paragraphs
00019 
00020   lazy_document_rep (edit_env env, tree t, path ip);
00021   inline operator tree () { return "Document"; }
00022   lazy produce (lazy_type request, format fm);
00023   format query (lazy_type request, format fm);
00024 };
00025 
00026 struct lazy_document {
00027   EXTEND_NULL(lazy,lazy_document);
00028   inline lazy_document (edit_env env, tree t, path ip):
00029     rep (tm_new<lazy_document_rep> (env, t, ip)) { rep->ref_count= 1; }
00030 };
00031 EXTEND_NULL_CODE(lazy,lazy_document);
00032 
00033 struct lazy_surround_rep: public lazy_rep {
00034   array<line_item> a;    // left surrounding
00035   array<line_item> b;    // right surrounding
00036   lazy             par;  // the surrounded paragraph
00037 
00038   lazy_surround_rep (edit_env env, tree t, path ip);
00039   lazy_surround_rep (array<line_item> a, array<line_item> b, lazy p, path ip);
00040   inline operator tree () { return "Surround"; }
00041   lazy produce (lazy_type request, format fm);
00042   format query (lazy_type request, format fm);
00043 };
00044 
00045 struct lazy_surround {
00046   EXTEND_NULL(lazy,lazy_surround);
00047   inline lazy_surround (edit_env env, tree t, path ip):
00048     rep (tm_new<lazy_surround_rep> (env, t, ip)) { rep->ref_count= 1; }
00049   inline lazy_surround (array<line_item> a, array<line_item> b,
00050                      lazy par, path ip):
00051     rep (tm_new<lazy_surround_rep> (a, b, par, ip)) { rep->ref_count= 1; }
00052 };
00053 EXTEND_NULL_CODE(lazy,lazy_surround);
00054 
00055 #endif // defined LAZY_TYPESET_H