Back to index

texmacs  1.0.7.15
Public Member Functions | Public Attributes
lazy_canvas_rep Struct Reference
Inheritance diagram for lazy_canvas_rep:
Inheritance graph
[legend]
Collaboration diagram for lazy_canvas_rep:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 lazy_canvas_rep (canvas_properties props2, lazy par2, 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

canvas_properties props
lazy par
lazy_type type
path ip
int ref_count

Detailed Description

Definition at line 24 of file lazy_gui.cpp.


Constructor & Destructor Documentation

lazy_canvas_rep::lazy_canvas_rep ( canvas_properties  props2,
lazy  par2,
path  ip 
) [inline]

Definition at line 28 of file lazy_gui.cpp.

                                                                :
    lazy_rep (LAZY_CANVAS, ip), props (props2), par (par2) {}

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_canvas_rep::operator tree ( ) [inline, virtual]

Implements lazy_rep.

Definition at line 30 of file lazy_gui.cpp.

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

Reimplemented from lazy_rep.

Definition at line 81 of file lazy_gui.cpp.

                                                      {
  if (request == type) return this;
  if (request == LAZY_VSTREAM || request == LAZY_BOX) {
    SI delta= 0;
    string type= props->type;
    if (type != "plain") {
      SI hpad= props->hpadding;
      SI w   = props->bar_width;
      SI pad = props->bar_padding;
      SI bor = props->border;
      if (ends (type, "w") || ends (type, "e"))
       delta= max (0, w + pad);
      delta += 2 * bor + 2 * hpad;
    }
    format bfm= fm;
    if (request == LAZY_VSTREAM) {
      format_vstream fvs= (format_vstream) fm;
      bfm= make_format_width (fvs->width - delta);
    }
    box b= (box) par->produce (LAZY_BOX, bfm);
    format_width fmw= (format_width) bfm;
    SI width= fmw->width + delta;
    edit_env env= props->env;
    tree old1= env->local_begin (PAGE_MEDIUM, "papyrus");
    tree old2= env->local_begin (PAR_LEFT, "0tmpt");
    tree old3= env->local_begin (PAR_RIGHT, "0tmpt");
    tree old4= env->local_begin (PAR_MODE, "justify");
    tree old5= env->local_begin (PAR_NO_FIRST, "true");
    tree old6= env->local_begin (PAR_WIDTH, tree (TMLEN, as_string (width)));
    SI x1, x2, scx;
    get_canvas_horizontal (props, b->x1, b->x2, x1, x2, scx);
    SI y1, y2, scy;
    get_canvas_vertical (props, b->y1, b->y2, y1, y2, scy);
    env->local_end (PAR_WIDTH, old6);
    env->local_end (PAR_NO_FIRST, old5);
    env->local_end (PAR_MODE, old4);
    env->local_end (PAR_RIGHT, old3);
    env->local_end (PAR_LEFT, old2);
    env->local_end (PAGE_MEDIUM, old1);
    path dip= (type == "plain"? ip: decorate (ip));
    box rb= clip_box (dip, b, x1, y1, x2, y2, props->xt, props->yt, scx, scy);
    if (type != "plain") rb= put_scroll_bars (props, rb, ip, b, scx, scy);
    if (request == LAZY_BOX) return make_lazy_box (rb);
    else {
      array<page_item> l;
      l << page_item (rb);
      return lazy_vstream (ip, "", l, stack_border ());
    }
  }
  return lazy_rep::produce (request, fm);
}

Here is the call graph for this function:

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

Reimplemented from lazy_rep.

Definition at line 44 of file lazy_gui.cpp.

                                                    {
  if ((request == LAZY_BOX) && (fm->type == QUERY_VSTREAM_WIDTH)) {
    format body_fm= par->query (request, fm);
    format_width fmw= (format_width) body_fm;
    SI width= fmw->width;
    edit_env env= props->env;
    tree old1= env->local_begin (PAGE_MEDIUM, "papyrus");
    tree old2= env->local_begin (PAR_LEFT, "0tmpt");
    tree old3= env->local_begin (PAR_RIGHT, "0tmpt");
    tree old4= env->local_begin (PAR_MODE, "justify");
    tree old5= env->local_begin (PAR_NO_FIRST, "true");
    tree old6= env->local_begin (PAR_WIDTH, tree (TMLEN, as_string (width)));
    SI x1, x2, scx;
    get_canvas_horizontal (props, 0, fmw->width, x1, x2, scx);
    env->local_end (PAR_WIDTH, old6);
    env->local_end (PAR_NO_FIRST, old5);
    env->local_end (PAR_MODE, old4);
    env->local_end (PAR_RIGHT, old3);
    env->local_end (PAR_LEFT, old2);
    env->local_end (PAGE_MEDIUM, old1);
    SI delta= 0;
    string type= props->type;
    if (type != "plain") {
      SI hpad= props->hpadding;
      SI w   = props->bar_width;
      SI pad = props->bar_padding;
      SI bor = props->border;
      if (ends (type, "w") || ends (type, "e"))
       delta= max (0, w + pad);
      delta += 2 * bor + 2 * hpad;
    }
    return make_format_width (x2 - x1 + delta);
  }
  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 26 of file lazy_gui.cpp.

Definition at line 25 of file lazy_gui.cpp.

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 file: