Back to index

texmacs  1.0.7.15
line_item.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : line_item.hpp
00004 * DESCRIPTION: A line in a paragraph consist of an array of line items.
00005 *              A line item contains spacing and hyphenation information.
00006 *              Furthermore, different types of line items exist,
00007 *              in order to typeset brackets, scripts and large operators.
00008 * COPYRIGHT  : (C) 1999  Joris van der Hoeven
00009 *******************************************************************************
00010 * This software falls under the GNU general public license version 3 or later.
00011 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00012 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00013 ******************************************************************************/
00014 
00015 #ifndef LINE_ITEM_H
00016 #define LINE_ITEM_H
00017 #include "boxes.hpp"
00018 #include "env.hpp"
00019 
00020 #define OBSOLETE_ITEM          0
00021 #define STD_ITEM               1
00022 #define MARKER_ITEM            2
00023 #define STRING_ITEM            3
00024 #define LEFT_BRACKET_ITEM      4
00025 #define MIDDLE_BRACKET_ITEM    5
00026 #define RIGHT_BRACKET_ITEM     6
00027 #define CONTROL_ITEM           7
00028 #define FLOAT_ITEM             8
00029 
00030 #define LSUB_ITEM              9
00031 #define LSUP_ITEM             11
00032 #define RSUB_ITEM             12
00033 #define RSUP_ITEM             13
00034 #define GLUE_LSUBS_ITEM       14
00035 #define GLUE_RSUBS_ITEM       15
00036 #define GLUE_LEFT_ITEM        16
00037 #define GLUE_RIGHT_ITEM       17
00038 #define GLUE_BOTH_ITEM        18
00039 
00040 extern int line_item_count;
00041 class line_item;
00042 class line_item_rep: public concrete_struct {
00043 public:
00044   int        type;      // type of the line item
00045   int        op_type;   // operator type for mathematical symbols
00046   box        b;         // the box
00047   space      spc;       // separation space
00048   int        penalty;   // penalty for a linebreak after this line_item
00049   bool       limits;    // line items has limits
00050   language   lan;       // language for hyphenating strings
00051   tree       t;         // for control items
00052 
00053   line_item_rep (int type, int ot_type, box b, int penalty);
00054   line_item_rep (int type, int ot_type, box b, int penalty, language lan);
00055   line_item_rep (int type, int ot_type, box b, int penalty, tree t);
00056   ~line_item_rep ();
00057 };
00058 
00059 class line_item {
00060   CONCRETE_NULL(line_item);
00061   line_item (int type, int ot_type, box b, int penalty);
00062   line_item (int type, int ot_type, box b, int penalty, language lan);
00063   line_item (int type, int ot_type, box b, int penalty, tree t);
00064   bool operator == (line_item item2);
00065   bool operator != (line_item item2);
00066 };
00067 CONCRETE_NULL_CODE(line_item);
00068 
00069 tm_ostream& operator << (tm_ostream& out, line_item item);
00070 
00071 #endif // defined LINE_ITEM_H