/TeXmacs-1.0.7.11-src/src/Typeset/Boxes/Composite/superpose_boxes.cpp
C++ | 47 lines | 24 code | 8 blank | 15 comment | 1 complexity | 0245084ae7a4525b72c41a4074b6072c MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, MPL-2.0-no-copyleft-exception
1
2/******************************************************************************
3* MODULE : superpose.cpp
4* DESCRIPTION: Superpositions of arrays of boxes
5* COPYRIGHT : (C) 2005 Henri Lesourd
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#include "Boxes/composite.hpp"
13#include "Boxes/construct.hpp"
14
15/******************************************************************************
16* The superpose_box representation
17******************************************************************************/
18
19struct superpose_box_rep: public concrete_composite_box_rep {
20 superpose_box_rep (path ip, array<box> bs, bool bfl):
21 concrete_composite_box_rep (ip, bs, bfl) {}
22 operator tree ();
23 int reindex (int i, int item, int n);
24};
25
26superpose_box_rep::operator tree () {
27 int i, n= N(bs);
28 tree t (TUPLE, n+1);
29 t[0]= "superpose";
30 for (i=0; i<n; i++) t[i+1]= (tree) bs[i];
31 return t;
32}
33
34int
35superpose_box_rep::reindex (int i, int item, int n) {
36 (void) item; (void) n;
37 return i;
38}
39
40/******************************************************************************
41* User interface
42******************************************************************************/
43
44box
45superpose_box (path ip, array<box> bs, bool bfl) {
46 return tm_new<superpose_box_rep> (ip, bs, bfl);
47}