Back to index

texmacs  1.0.7.15
Functions
pager.cpp File Reference
#include "pager.hpp"
#include "Boxes/construct.hpp"

Go to the source code of this file.

Functions

box format_stack (path ip, array< box > bx, array< space > ht)
box format_stack (path ip, array< box > bx, array< space > ht, SI height, bool may_stretch)
box format_stack (path ip, array< page_item > l)
box format_stack (path ip, array< page_item > l, SI height, bool may_stretch)
box page_box (path ip, box b, tree page, SI width, SI height, SI left, SI top, SI bot, box header, box footer, SI head_sep, SI foot_sep)

Function Documentation

box format_stack ( path  ip,
array< box bx,
array< space ht 
)

Definition at line 58 of file pager.cpp.

                                                       {
  int i, n= N(bx);
  array<SI> spc (n);
  for (i=0; i<n-1; i++) spc[i]= ht[i]->def;
  return stack_box (ip, bx, spc);  
}

Here is the call graph for this function:

box format_stack ( path  ip,
array< box bx,
array< space ht,
SI  height,
bool  may_stretch 
)

Definition at line 66 of file pager.cpp.

{
  int i, n= N(bx);
  array<SI> spc (n);
  space total (0);
  for (i=0; i<n-1; i++) total += space (bx[i]->h()) + ht[i];
  total += space (bx[i]->h());

  // stretching case
  if (may_stretch && (total->def < height) && (total->max > total->def)) {
    double f=
      ((double) (height - total->def)) /
      ((double) (total->max - total->def));
    for (i=0; i<n-1; i++)
      spc[i]= ht[i]->def+
       ((SI) (f*((double) ht[i]->max- ht[i]->def)));
  }

  // shrinking case
  else if ((total->def > height) && (total->def > total->min)) {
    double f=
      ((double) (total->def - height)) /
      ((double) (total->def - total->min));
    if (f>1.0) f=1.0;
    for (i=0; i<n-1; i++)
      spc[i]= ht[i]->def-
       ((SI) (f*((double) ht[i]->def- ht[i]->min)));
  }

  // normal case
  else for (i=0; i<n-1; i++) spc[i]= ht[i]->def;

  return stack_box (ip, bx, spc);
}

Here is the call graph for this function:

Here is the caller graph for this function:

box format_stack ( path  ip,
array< page_item l 
)

Definition at line 103 of file pager.cpp.

                                           {
  int i, n= N(l);
  array<box> bs  (n);
  array<SI>  spc (n);
  for (i=0; i<n-1; i++) {
    bs [i]= l[i]->b;
    spc[i]= l[i]->spc->def;
  }
  if (i<n) bs [i]= l[i]->b;
  return stack_box (ip, bs, spc);  
}

Here is the call graph for this function:

box format_stack ( path  ip,
array< page_item l,
SI  height,
bool  may_stretch 
)

Definition at line 116 of file pager.cpp.

                                                                        {
  int i, n= N(l);
  array<box>   bs  (n);
  array<space> spc (n);
  for (i=0; i<n-1; i++) {
    bs [i]= l[i]->b;
    spc[i]= l[i]->spc;
  }
  if (i<n) bs [i]= l[i]->b;
  return format_stack (ip, bs, spc, height, may_stretch);
}

Here is the call graph for this function:

box page_box ( path  ip,
box  b,
tree  page,
SI  width,
SI  height,
SI  left,
SI  top,
SI  bot,
box  header,
box  footer,
SI  head_sep,
SI  foot_sep 
)

Definition at line 129 of file pager.cpp.

{
  SI h_y= -top- header->y1+ head_sep;
  SI f_y= -bot- footer->y2- foot_sep;

  array<box> bs     (1); bs     [0]= b;
  array<SI>  bs_x   (1); bs_x   [0]= left;
  array<SI>  bs_y   (1); bs_y   [0]= -top;
  array<box> decs   (2); decs   [0]= header; decs   [1]= footer;
  array<SI>  decs_x (2); decs_x [0]= left  ; decs_x [1]= left;
  array<SI>  decs_y (2); decs_y [0]= h_y   ; decs_y [1]= f_y;

  return page_box (ip, page, width, height,
                 bs, bs_x, bs_y,
                 decs, decs_x, decs_y);
}

Here is the call graph for this function: