Back to index

texmacs  1.0.7.15
Public Member Functions | Public Attributes
lazy_document_rep Struct Reference

#include <lazy_typeset.hpp>

Inheritance diagram for lazy_document_rep:
Inheritance graph
[legend]
Collaboration diagram for lazy_document_rep:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 lazy_document_rep (edit_env env, tree t, path ip)
 operator tree ()
lazy produce (lazy_type request, format fm)
format query (lazy_type request, format fm)
virtual void append (lazy lz)

Public Attributes

array< lazypar
lazy_type type
path ip
int ref_count

Detailed Description

Definition at line 17 of file lazy_typeset.hpp.


Constructor & Destructor Documentation

Definition at line 32 of file lazy_typeset.cpp.

                                                                  :
  lazy_rep (LAZY_DOCUMENT, ip), par (N(t))
{
  int i, n= N(t);
  for (i=0; i<n; i++)
    par[i]= make_lazy (env, t[i], descend (ip, i));
}

Here is the call graph for this function:


Member Function Documentation

void lazy_rep::append ( lazy  lz) [virtual, inherited]

Definition at line 92 of file formatter.cpp.

                         {
  (void) lz;
  cout << "\nThe lazy structure was " << ((tree) (*this)) << "\n";
  FAILED ("lazy structure is not a stream");
}
lazy_document_rep::operator tree ( ) [inline, virtual]

Implements lazy_rep.

Definition at line 21 of file lazy_typeset.hpp.

{ return "Document"; }
lazy lazy_document_rep::produce ( lazy_type  request,
format  fm 
) [virtual]

Reimplemented from lazy_rep.

Definition at line 63 of file lazy_typeset.cpp.

                                                        {
  if (request == type) return this;
  if (request == LAZY_VSTREAM) {
    int i, n= N(par);
    SI width= 1;
    array<line_item> before;
    array<line_item> after;
    if (fm->type == FORMAT_VSTREAM) {
      format_vstream fs= (format_vstream) fm;
      width = fs->width ;
      before= fs->before;
      after = fs->after ;
    }
    array<page_item> l;
    stack_border     sb;
    for (i=0; i<n; i++) {
      format tmp_fm= make_format_vstream (width,
        i==0  ? before: array<line_item> (),
       i==n-1? after : array<line_item> ());
      lazy tmp= par[i]->produce (request, tmp_fm);
      lazy_vstream tmp_vs= (lazy_vstream) tmp;
      if (i == 0) {
       l = tmp_vs->l ;
       sb= tmp_vs->sb;
      }
      else merge_stack (l, sb, tmp_vs->l, tmp_vs->sb);
    }
    return lazy_vstream (ip, "", l, sb);
  }
  return lazy_rep::produce (request, fm);
}

Here is the call graph for this function:

format lazy_document_rep::query ( lazy_type  request,
format  fm 
) [virtual]

Reimplemented from lazy_rep.

Definition at line 41 of file lazy_typeset.cpp.

                                                      {
  if ((request == LAZY_BOX) && (fm->type == QUERY_VSTREAM_WIDTH)) {
    query_vstream_width qvw= (query_vstream_width) fm;
    array<line_item> before= qvw->before;
    array<line_item> after = qvw->after;

    SI w= 1;
    int i, n= N(par);
    for (i=0; i<n; i++) {
      format tmp_fm= make_query_vstream_width (
        i==0  ? before: array<line_item> (),
       i==n-1? after : array<line_item> ());
      format ret_fm= par[i]->query (request, tmp_fm);
      format_width fmw= (format_width) ret_fm;
      w= max (w, fmw->width);
    }
    return make_format_width (w);
  }
  return lazy_rep::query (request, fm);
}

Here is the call graph for this function:


Member Data Documentation

path lazy_rep::ip [inherited]

Definition at line 69 of file formatter.hpp.

Definition at line 18 of file lazy_typeset.hpp.

int abstract_struct::ref_count [inherited]

Definition at line 142 of file basic.hpp.

Definition at line 68 of file formatter.hpp.


The documentation for this struct was generated from the following files: