PageRenderTime 45ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/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. * MODULE : superpose.cpp
  3. * DESCRIPTION: Superpositions of arrays of boxes
  4. * COPYRIGHT : (C) 2005 Henri Lesourd
  5. *******************************************************************************
  6. * This software falls under the GNU general public license version 3 or later.
  7. * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
  8. * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
  9. ******************************************************************************/
  10. #include "Boxes/composite.hpp"
  11. #include "Boxes/construct.hpp"
  12. /******************************************************************************
  13. * The superpose_box representation
  14. ******************************************************************************/
  15. struct superpose_box_rep: public concrete_composite_box_rep {
  16. superpose_box_rep (path ip, array<box> bs, bool bfl):
  17. concrete_composite_box_rep (ip, bs, bfl) {}
  18. operator tree ();
  19. int reindex (int i, int item, int n);
  20. };
  21. superpose_box_rep::operator tree () {
  22. int i, n= N(bs);
  23. tree t (TUPLE, n+1);
  24. t[0]= "superpose";
  25. for (i=0; i<n; i++) t[i+1]= (tree) bs[i];
  26. return t;
  27. }
  28. int
  29. superpose_box_rep::reindex (int i, int item, int n) {
  30. (void) item; (void) n;
  31. return i;
  32. }
  33. /******************************************************************************
  34. * User interface
  35. ******************************************************************************/
  36. box
  37. superpose_box (path ip, array<box> bs, bool bfl) {
  38. return tm_new<superpose_box_rep> (ip, bs, bfl);
  39. }