Back to index

texmacs  1.0.7.15
Functions
lazy_vstream.cpp File Reference
#include "Line/lazy_vstream.hpp"
#include "Boxes/construct.hpp"
#include "Line/lazy_paragraph.hpp"

Go to the source code of this file.

Functions

array< line_itemtypeset_concat_or_table (edit_env env, tree t, path ip)
lazy make_lazy_vstream (edit_env env, tree t, path ip, tree channel)
box format_vstream_as_box (array< page_item > l, path ip, int vpos, SI depth, SI height)
box typeset_as_paragraph (edit_env env, tree t, path ip)

Function Documentation

box format_vstream_as_box ( array< page_item l,
path  ip,
int  vpos,
SI  depth,
SI  height 
)

Definition at line 45 of file lazy_vstream.cpp.

{
  int i, n= N(l);
  array<box> lines_bx (n);
  array<SI>  lines_ht (n);
  for (i=0; i<n; i++) {
    page_item item= copy (l[i]);
    lines_bx[i]= item->b;
    lines_ht[i]= item->spc->def;
  }

  box b= stack_box (ip, lines_bx, lines_ht);
  SI dy= 0, bot= 0, top= 0;
  if (n>0) {
    if (vpos>0) dy= b->sy (0);
    else if (vpos<0) dy= b->sy (n-1);
    else dy= (b->sy (n>>1) + b->sy ((n-1)>>1)) >> 1;
    if (depth  > 0) bot= max (0, depth + b[n-1]->y1);
    if (height > 0) top= max (0, height- b[0  ]->y2);
  }
  if (dy != 0) b= move_box (ip, b, 0, -dy);
  if ((top != 0) || (bot != 0))
    b= resize_box (ip, b, b->x1, b->y1 - bot, b->x2, b->y2 + top);
  return b;
}

Here is the call graph for this function:

Here is the caller graph for this function:

lazy make_lazy_vstream ( edit_env  env,
tree  t,
path  ip,
tree  channel 
)

Definition at line 28 of file lazy_vstream.cpp.

                                                                {
  SI width, d1, d2, d3, d4, d5, d6, d7;
  env->get_page_pars (width, d1, d2, d3, d4, d5, d6, d7);
  lazy lz= make_lazy (env, t, ip);
  lz= lz->produce (LAZY_VSTREAM, make_format_vstream (width, 0, 0));
  lazy_vstream lwvs= (lazy_vstream) lz;
  lwvs->channel= channel;
  /* Direct modification of y1 and y2 limits should be avoided */
  box& tb= lwvs->l[0]->b;
  if (tb->y2 < env->fn->y2) tb->y2= env->fn->y2;
  box& bb= lwvs->l[N(lwvs->l)-1]->b;
  if (bb->y1 > env->fn->y1) bb->y1= env->fn->y1;
  /*************************************************************/
  return lwvs;
}

Here is the call graph for this function:

Here is the caller graph for this function:

box typeset_as_paragraph ( edit_env  env,
tree  t,
path  ip 
)

Definition at line 73 of file lazy_vstream.cpp.

                                                     {
  // cout << "Typeset paragraph " << t << "\n";
  lazy_paragraph par (env, ip);
  par->a= typeset_concat_or_table (env, t, ip);
  par->format_paragraph ();
  array<page_item> l= par->sss->l;
  return format_vstream_as_box (l, ip, 1, -env->fn->y1, env->fn->y2);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 488 of file lazy_paragraph.cpp.

                                                        {
  if (is_func (t, TABLE)) {
    array<box> bs= typeset_as_var_table (env, t, ip);
    return convert (env, bs, ip);
  }
  else return typeset_concat (env, t, ip);
}

Here is the call graph for this function:

Here is the caller graph for this function: