Back to index

texmacs  1.0.7.15
format.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : format.hpp
00004 * DESCRIPTION: standard formats for placing material
00005 * COPYRIGHT  : (C) 1999  Joris van der Hoeven
00006 *******************************************************************************
00007 * This software falls under the GNU general public license version 3 or later.
00008 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010 ******************************************************************************/
00011 
00012 #ifndef FORMAT_H
00013 #define FORMAT_H
00014 #include "formatter.hpp"
00015 #include "Format/line_item.hpp"
00016 
00017 struct format_none_rep: public format_rep {
00018   format_none_rep ():
00019     format_rep (FORMAT_NONE) {}
00020   format_none_rep (format_type ft):
00021     format_rep (ft) {}
00022   bool equal (format fm);
00023   operator tree ();
00024 };
00025 
00026 struct format_none {
00027   EXTEND_NULL(format,format_none);
00028 };
00029 EXTEND_NULL_CODE(format,format_none);
00030 
00031 struct format_width_rep: public format_rep {
00032   SI width;
00033   format_width_rep (SI width2): format_rep (FORMAT_WIDTH), width (width2)
00034   { ref_count= 1; }
00035   bool equal (format fm);
00036   operator tree ();
00037 };
00038 
00039 struct format_width {
00040   EXTEND_NULL(format,format_width);
00041 };
00042 EXTEND_NULL_CODE(format,format_width);
00043 
00044 struct format_cell_rep: public format_rep {
00045   SI  width;
00046   int vpos;
00047   SI  depth;
00048   SI  height;
00049   format_cell_rep (SI w2, int v2, SI d2, SI h2):
00050     format_rep (FORMAT_CELL),
00051     width (w2), vpos (v2), depth (d2), height (h2)
00052   { ref_count= 1; }
00053   bool equal (format fm);
00054   operator tree ();
00055 };
00056 
00057 struct format_cell {
00058   EXTEND(format,format_cell);
00059 };
00060 EXTEND_CODE(format,format_cell);
00061 
00062 struct format_vstream_rep: public format_rep {
00063   SI width;
00064   array<line_item> before;
00065   array<line_item> after;
00066   format_vstream_rep (SI w2, array<line_item> bef2, array<line_item> aft2):
00067     format_rep (FORMAT_VSTREAM), width (w2), before (bef2), after (aft2)
00068   { ref_count= 1; }
00069   bool equal (format fm);
00070   operator tree ();
00071 };
00072 
00073 struct format_vstream {
00074   EXTEND(format,format_vstream);
00075 };
00076 EXTEND_CODE(format,format_vstream);
00077 
00078 struct query_vstream_width_rep: public format_rep {
00079   array<line_item> before;
00080   array<line_item> after;
00081   query_vstream_width_rep (array<line_item> bef2, array<line_item> aft2):
00082     format_rep (QUERY_VSTREAM_WIDTH), before (bef2), after (aft2)
00083   { ref_count= 1; }
00084   bool equal (format fm);
00085   operator tree ();
00086 };
00087 
00088 struct query_vstream_width {
00089   EXTEND(format,query_vstream_width);
00090 };
00091 EXTEND_CODE(format,query_vstream_width);
00092 
00093 format make_format_vstream (SI w, array<line_item> bef, array<line_item> aft);
00094 format make_query_vstream_width (array<line_item> bef, array<line_item> aft);
00095 
00096 #endif // defined FORMAT_H