4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * Provide a set of typedefs for commonly used things like sizes and
8 * indices wile trying to stay compatible with types used
9 * by the standard containers.
11 * \author André Pönitz
13 * Full author contact details are available in file CREDITS.
24 * A type for positions used in paragraphs.
25 * Each position is either occupied by a single character or an inset.
26 * For insets, the placeholder META_INSET is stored in the paragraph
27 * text, and the actual insets are maintained separately.
29 // FIXME: should be unsigned, but needs to be signed for a while to
30 // hold the special value -1 that is used somewhere
31 // Specifically, TexRow::getDocIteratorsFromEntries uses negative pos
32 // the way Python does: counting from the end. So maybe this should just
34 // Note that the signed property is also used in loops counting to zero.
35 typedef ptrdiff_t pos_type;
38 * A type for paragraph offsets.
39 * This is used to address paragraphs in ParagraphList, Text etc.
41 // FIXME: should be unsigned as well.
42 // however, simply changing it breaks a downward loop somewhere...
43 typedef ptrdiff_t pit_type;
45 /// a type for the nesting depth of a paragraph
46 typedef size_t depth_type;
48 // set this to '0' if you want to have really safe types
52 typedef size_t size_type;
56 // These structs wrap simple things to make them distinguishible
58 // It's a shame that different typedefs are not "really" different
62 typedef size_t base_type;
64 size_type(base_type t) { data_ = t; }
66 operator base_type() const { return data_; }
76 /// the word around the cursor, only if the cursor is
79 // the word around the cursor
81 /// the word beginning from the cursor position
83 /// the word around the cursor or before the cursor
85 /// the next word (not yet used)