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.
23 // The type used to hold characters in paragraphs
24 //typedef uint32_t char_type; // Possibly the ucs-4 type we will use
25 //typedef wchar_t char_type; // The wide char type CJK-LyX uses
26 typedef char char_type; // Current narrow char type in use
29 /// a type for positions used in paragraphs
30 // needs to be signed for a while to hold the special value -1 that is
32 typedef ptrdiff_t pos_type;
34 /// a type for paragraph offsets
35 // FIXME: should be unsigned as well.
36 // however, simply changing it breaks a downward loop somewhere...
37 typedef ptrdiff_t pit_type;
39 /// a type for the nesting depth of a paragraph
40 typedef size_t depth_type;
42 // set this to '0' if you want to have really safe types
46 typedef size_t size_type;
48 /// a type used for numbering text classes
49 typedef size_t textclass_type;
53 // These structs wrap simple things to make them distinguishible
55 // It's a shame that different typedefs are not "really" different
59 typedef size_t base_type;
61 size_type(base_type t) { data_ = t; }
63 operator base_type() const { return data_; }
69 struct textclass_type {
71 typedef size_t base_type;
73 textclass_type(base_type t) { data_ = t; }
75 operator base_type() const { return data_; }
86 // the word around the cursor, only if the cursor is
89 // the word around the cursor
91 /// the word begining from the cursor position
93 /// the word around the cursor or before the cursor
95 /// the next word (not yet used)
101 #endif // LYX_TYPES_H