~ubuntu-branches/ubuntu/natty/texmacs/natty

« back to all changes in this revision

Viewing changes to src/Typeset/Boxes/Basic/rubber_boxes.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Atsuhito KOHDA
  • Date: 2010-11-05 14:47:00 UTC
  • mfrom: (4.1.10 sid)
  • Revision ID: james.westby@ubuntu.com-20101105144700-t2ju0m1o53cqtyed
Tags: 1:1.0.7.7-1
* New Upstream Release.
* Updated patches/09_ipa.dpatch for new upstream sources.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#define Absolute        1031
31
31
 
32
32
/*****************************************************************************/
33
 
// The empty box
 
33
// Empty boxes
34
34
/*****************************************************************************/
35
35
 
36
36
struct empty_box_rep: public box_rep {
40
40
  void display (renderer ren) { (void) ren; }
41
41
};
42
42
 
 
43
struct marker_box_rep: public box_rep {
 
44
  int pos;
 
45
  marker_box_rep (path ip2, int x1b, int y1b, int x2b, int y2b):
 
46
    box_rep (is_accessible (ip2)? ip2->next: ip2),
 
47
    pos (is_accessible (ip2)? ip2->item: 0) {
 
48
      x3= x4= y3= y4= 0; x1= x1b; y1= y1b; x2= x2b; y2= y2b; }
 
49
  operator tree () { return "marker"; }
 
50
  void display (renderer ren) { (void) ren; }
 
51
  path find_box_path (SI x, SI y, SI delta, bool force) {
 
52
    (void) x; (void) y; (void) delta; (void) force; return path (0); }
 
53
  path find_lip () {
 
54
    return is_accessible (ip)? descend (ip, pos): ip; }
 
55
  path find_rip () {
 
56
    return is_accessible (ip)? descend (ip, pos): ip; }
 
57
  path find_right_box_path () {
 
58
    return path (0); }
 
59
  path find_box_path (path p, bool& found) {
 
60
    found= !is_nil (p) && is_accessible (ip);
 
61
    return path (0); }
 
62
  path find_tree_path (path bp) {
 
63
    if (is_accessible (ip)) return reverse (descend (ip, pos));
 
64
    else return reverse (descend_decode (ip, 0)); }
 
65
  cursor find_cursor (path bp) {
 
66
    (void) bp; return cursor (0, 0, 0, y1, y2); }
 
67
  selection find_selection (path lbp, path rbp) {
 
68
    return selection (rectangles (),
 
69
                      find_tree_path (lbp), find_tree_path (rbp)); }
 
70
};
 
71
 
43
72
/*****************************************************************************/
44
73
// Brackets
45
74
/*****************************************************************************/
185
214
}
186
215
 
187
216
box
 
217
marker_box (path ip, int x1, int y1, int x2, int y2) {
 
218
  return tm_new<marker_box_rep> (ip, x1, y1, x2, y2);
 
219
}
 
220
 
 
221
box
188
222
bracket_box (path ip, int br_type, SI penw, color col, SI y1, SI y2) {
189
223
  return tm_new<bracket_box_rep> (ip, br_type, penw, col, y1, y2);
190
224
}