~registry/texmacs/trunk

« back to all changes in this revision

Viewing changes to src/src/Typeset/Bridge/bridge.hpp

  • Committer: mgubi
  • Date: 2009-06-04 15:13:41 UTC
  • Revision ID: svn-v4:64cb5145-927a-446d-8aed-2fb7b4773692:trunk:2717
Support for X11 TeXmacs.app on Mac

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/******************************************************************************
 
3
* MODULE     : bridge.hpp
 
4
* DESCRIPTION: Bridge between logical and physically typesetted document
 
5
* COPYRIGHT  : (C) 1999  Joris van der Hoeven
 
6
*******************************************************************************
 
7
* This software falls under the GNU general public license version 3 or later.
 
8
* It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
 
9
* in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
 
10
******************************************************************************/
 
11
 
 
12
#ifndef BRIDGE_H
 
13
#define BRIDGE_H
 
14
#include "typesetter.hpp"
 
15
#include "Concat/concater.hpp"
 
16
#include "Stack/stacker.hpp"
 
17
#include "Format/page_item.hpp"
 
18
#include "Page/vpenalty.hpp"
 
19
#include "Page/skeleton.hpp"
 
20
#include "Page/pager.hpp"
 
21
 
 
22
#define VALID_MASK        1
 
23
#define CORRUPTED         0
 
24
#define PROCESSED         1
 
25
 
 
26
#define WANTED_MASK       2
 
27
#define WANTED_PARAGRAPH  0
 
28
#define WANTED_PARUNIT    2
 
29
 
 
30
#define MACRO_ASSIGN      0
 
31
#define MACRO_INSERT      1
 
32
#define MACRO_REMOVE      2
 
33
 
 
34
class bridge;
 
35
class bridge_rep: public abstract_struct {
 
36
public:
 
37
  typesetter           ttt;      // the underlying typesetter
 
38
  edit_env&            env;      // the environment
 
39
  tree                 st;       // the present subtree
 
40
  path                 ip;       // source location of the paragraph
 
41
  int                  status;   // status among above values
 
42
  hashmap<string,tree> changes;  // changes in the environment
 
43
 
 
44
  array<page_item>     l;        // the typesetted lines of st
 
45
  stack_border         sb;       // border properties of l
 
46
  link_repository      link_env; // loci and links declared inside bridge
 
47
 
 
48
public:
 
49
  bridge_rep (typesetter ttt, tree st, path ip);
 
50
  inline virtual ~bridge_rep () {}
 
51
 
 
52
  virtual void notify_assign (path p, tree u) = 0;
 
53
  virtual void notify_insert (path p, tree u);
 
54
  virtual void notify_remove (path p, int nr);
 
55
  virtual void notify_split  (path p);
 
56
  virtual void notify_join   (path p);
 
57
  virtual bool notify_macro  (int type, string var, int l, path p, tree u) = 0;
 
58
  virtual void notify_change () = 0;
 
59
 
 
60
  virtual void my_clean_links ();
 
61
  virtual void my_exec_until (path p);
 
62
  virtual bool my_typeset_will_be_complete ();
 
63
  virtual void my_typeset (int desired_status);
 
64
  virtual void exec_until (path p, bool skip_flag= false);
 
65
  void typeset (int desired_status);
 
66
};
 
67
 
 
68
class bridge {
 
69
  ABSTRACT_NULL(bridge);
 
70
  bool operator == (bridge br2);
 
71
  bool operator != (bridge br2);
 
72
  friend bridge make_bridge (typesetter ttt, tree st, path ip);
 
73
  friend void   replace_bridge (bridge& br, tree st, path ip);
 
74
};
 
75
ABSTRACT_NULL_CODE(bridge);
 
76
 
 
77
bridge make_bridge (typesetter ttt, tree t, path p);
 
78
ostream& operator << (ostream& out, bridge br);
 
79
extern bridge nil_bridge;
 
80
tree substitute (tree t, path p, tree u);
 
81
 
 
82
#include "impl_typesetter.hpp"
 
83
 
 
84
#endif // defined BRIDGE_H