PageRenderTime 59ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/TeXmacs-1.0.7.11-src/src/Typeset/Format/format.hpp

#
C++ Header | 96 lines | 73 code | 14 blank | 9 comment | 0 complexity | 4c20214a9da1cdf10c788c22f9a649c0 MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0, MPL-2.0-no-copyleft-exception
  1. /******************************************************************************
  2. * MODULE : format.hpp
  3. * DESCRIPTION: standard formats for placing material
  4. * COPYRIGHT : (C) 1999 Joris van der Hoeven
  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. #ifndef FORMAT_H
  11. #define FORMAT_H
  12. #include "formatter.hpp"
  13. #include "Format/line_item.hpp"
  14. struct format_none_rep: public format_rep {
  15. format_none_rep ():
  16. format_rep (FORMAT_NONE) {}
  17. format_none_rep (format_type ft):
  18. format_rep (ft) {}
  19. bool equal (format fm);
  20. operator tree ();
  21. };
  22. struct format_none {
  23. EXTEND_NULL(format,format_none);
  24. };
  25. EXTEND_NULL_CODE(format,format_none);
  26. struct format_width_rep: public format_rep {
  27. SI width;
  28. format_width_rep (SI width2): format_rep (FORMAT_WIDTH), width (width2)
  29. { ref_count= 1; }
  30. bool equal (format fm);
  31. operator tree ();
  32. };
  33. struct format_width {
  34. EXTEND_NULL(format,format_width);
  35. };
  36. EXTEND_NULL_CODE(format,format_width);
  37. struct format_cell_rep: public format_rep {
  38. SI width;
  39. int vpos;
  40. SI depth;
  41. SI height;
  42. format_cell_rep (SI w2, int v2, SI d2, SI h2):
  43. format_rep (FORMAT_CELL),
  44. width (w2), vpos (v2), depth (d2), height (h2)
  45. { ref_count= 1; }
  46. bool equal (format fm);
  47. operator tree ();
  48. };
  49. struct format_cell {
  50. EXTEND(format,format_cell);
  51. };
  52. EXTEND_CODE(format,format_cell);
  53. struct format_vstream_rep: public format_rep {
  54. SI width;
  55. array<line_item> before;
  56. array<line_item> after;
  57. format_vstream_rep (SI w2, array<line_item> bef2, array<line_item> aft2):
  58. format_rep (FORMAT_VSTREAM), width (w2), before (bef2), after (aft2)
  59. { ref_count= 1; }
  60. bool equal (format fm);
  61. operator tree ();
  62. };
  63. struct format_vstream {
  64. EXTEND(format,format_vstream);
  65. };
  66. EXTEND_CODE(format,format_vstream);
  67. struct query_vstream_width_rep: public format_rep {
  68. array<line_item> before;
  69. array<line_item> after;
  70. query_vstream_width_rep (array<line_item> bef2, array<line_item> aft2):
  71. format_rep (QUERY_VSTREAM_WIDTH), before (bef2), after (aft2)
  72. { ref_count= 1; }
  73. bool equal (format fm);
  74. operator tree ();
  75. };
  76. struct query_vstream_width {
  77. EXTEND(format,query_vstream_width);
  78. };
  79. EXTEND_CODE(format,query_vstream_width);
  80. format make_format_vstream (SI w, array<line_item> bef, array<line_item> aft);
  81. format make_query_vstream_width (array<line_item> bef, array<line_item> aft);
  82. #endif // defined FORMAT_H