1 2 /****************************************************************************** 3 * MODULE : format.hpp 4 * DESCRIPTION: standard formats for placing material 5 * COPYRIGHT : (C) 1999 Joris van der Hoeven 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 #ifndef FORMAT_H 13 #define FORMAT_H 14 #include "formatter.hpp" 15 #include "Format/line_item.hpp" 16 17 struct format_none_rep: public format_rep { format_none_repformat_none_rep18 format_none_rep (): 19 format_rep (FORMAT_NONE) {} format_none_repformat_none_rep20 format_none_rep (format_type ft): 21 format_rep (ft) {} 22 bool equal (format fm); 23 operator tree (); 24 }; 25 26 struct format_none { 27 EXTEND_NULL(format,format_none); 28 }; 29 EXTEND_NULL_CODE(format,format_none); 30 31 struct format_width_rep: public format_rep { 32 SI width; format_width_repformat_width_rep33 format_width_rep (SI width2): format_rep (FORMAT_WIDTH), width (width2) 34 { ref_count= 1; } 35 bool equal (format fm); 36 operator tree (); 37 }; 38 39 struct format_width { 40 EXTEND_NULL(format,format_width); 41 }; 42 EXTEND_NULL_CODE(format,format_width); 43 44 struct format_cell_rep: public format_rep { 45 SI width; 46 int vpos; 47 SI depth; 48 SI height; format_cell_repformat_cell_rep49 format_cell_rep (SI w2, int v2, SI d2, SI h2): 50 format_rep (FORMAT_CELL), 51 width (w2), vpos (v2), depth (d2), height (h2) 52 { ref_count= 1; } 53 bool equal (format fm); 54 operator tree (); 55 }; 56 57 struct format_cell { 58 EXTEND(format,format_cell); 59 }; 60 EXTEND_CODE(format,format_cell); 61 62 struct format_vstream_rep: public format_rep { 63 SI width; 64 array<line_item> before; 65 array<line_item> after; format_vstream_repformat_vstream_rep66 format_vstream_rep (SI w2, array<line_item> bef2, array<line_item> aft2): 67 format_rep (FORMAT_VSTREAM), width (w2), before (bef2), after (aft2) 68 { ref_count= 1; } 69 bool equal (format fm); 70 operator tree (); 71 }; 72 73 struct format_vstream { 74 EXTEND(format,format_vstream); 75 }; 76 EXTEND_CODE(format,format_vstream); 77 78 struct query_vstream_width_rep: public format_rep { 79 array<line_item> before; 80 array<line_item> after; query_vstream_width_repquery_vstream_width_rep81 query_vstream_width_rep (array<line_item> bef2, array<line_item> aft2): 82 format_rep (QUERY_VSTREAM_WIDTH), before (bef2), after (aft2) 83 { ref_count= 1; } 84 bool equal (format fm); 85 operator tree (); 86 }; 87 88 struct query_vstream_width { 89 EXTEND(format,query_vstream_width); 90 }; 91 EXTEND_CODE(format,query_vstream_width); 92 93 format make_format_vstream (SI w, array<line_item> bef, array<line_item> aft); 94 format make_query_vstream_width (array<line_item> bef, array<line_item> aft); 95 96 #endif // defined FORMAT_H 97