Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-15 09:49:54

0001 /* Pango
0002  * pango-break.h:
0003  *
0004  * Copyright (C) 1999 Red Hat Software
0005  *
0006  * This library is free software; you can redistribute it and/or
0007  * modify it under the terms of the GNU Library General Public
0008  * License as published by the Free Software Foundation; either
0009  * version 2 of the License, or (at your option) any later version.
0010  *
0011  * This library is distributed in the hope that it will be useful,
0012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0014  * Library General Public License for more details.
0015  *
0016  * You should have received a copy of the GNU Library General Public
0017  * License along with this library; if not, write to the
0018  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0019  * Boston, MA 02111-1307, USA.
0020  */
0021 
0022 #ifndef __PANGO_BREAK_H__
0023 #define __PANGO_BREAK_H__
0024 
0025 #include <glib.h>
0026 
0027 G_BEGIN_DECLS
0028 
0029 #include <pango/pango-item.h>
0030 
0031 /* Logical attributes of a character.
0032  */
0033 /**
0034  * PangoLogAttr:
0035  * @is_line_break: if set, can break line in front of character
0036  * @is_mandatory_break: if set, must break line in front of character
0037  * @is_char_break: if set, can break here when doing character wrapping
0038  * @is_white: is whitespace character
0039  * @is_cursor_position: if set, cursor can appear in front of character.
0040  *   i.e. this is a grapheme boundary, or the first character in the text.
0041  *   This flag implements Unicode's
0042  *   [Grapheme Cluster Boundaries](http://www.unicode.org/reports/tr29/)
0043  *   semantics.
0044  * @is_word_start: is first character in a word
0045  * @is_word_end: is first non-word char after a word
0046  *   Note that in degenerate cases, you could have both @is_word_start
0047  *   and @is_word_end set for some character.
0048  * @is_sentence_boundary: is a sentence boundary.
0049  *   There are two ways to divide sentences. The first assigns all
0050  *   inter-sentence whitespace/control/format chars to some sentence,
0051  *   so all chars are in some sentence; @is_sentence_boundary denotes
0052  *   the boundaries there. The second way doesn't assign
0053  *   between-sentence spaces, etc. to any sentence, so
0054  *   @is_sentence_start/@is_sentence_end mark the boundaries of those sentences.
0055  * @is_sentence_start: is first character in a sentence
0056  * @is_sentence_end: is first char after a sentence.
0057  *   Note that in degenerate cases, you could have both @is_sentence_start
0058  *   and @is_sentence_end set for some character. (e.g. no space after a
0059  *   period, so the next sentence starts right away)
0060  * @backspace_deletes_character: if set, backspace deletes one character
0061  *   rather than the entire grapheme cluster. This field is only meaningful
0062  *   on grapheme boundaries (where @is_cursor_position is set). In some languages,
0063  *   the full grapheme (e.g. letter + diacritics) is considered a unit, while in
0064  *   others, each decomposed character in the grapheme is a unit. In the default
0065  *   implementation of [func@break], this bit is set on all grapheme boundaries
0066  *   except those following Latin, Cyrillic or Greek base characters.
0067  * @is_expandable_space: is a whitespace character that can possibly be
0068  *   expanded for justification purposes. (Since: 1.18)
0069  * @is_word_boundary: is a word boundary, as defined by UAX#29.
0070  *   More specifically, means that this is not a position in the middle of a word.
0071  *   For example, both sides of a punctuation mark are considered word boundaries.
0072  *   This flag is particularly useful when selecting text word-by-word. This flag
0073  *   implements Unicode's [Word Boundaries](http://www.unicode.org/reports/tr29/)
0074  *   semantics. (Since: 1.22)
0075  * @break_inserts_hyphen: when breaking lines before this char, insert a hyphen.
0076  *   Since: 1.50
0077  * @break_removes_preceding: when breaking lines before this char, remove the
0078  *   preceding char. Since 1.50
0079  *
0080  * The `PangoLogAttr` structure stores information about the attributes of a
0081  * single character.
0082  */
0083 struct _PangoLogAttr
0084 {
0085   guint is_line_break               : 1;
0086   guint is_mandatory_break          : 1;
0087   guint is_char_break               : 1;
0088   guint is_white                    : 1;
0089   guint is_cursor_position          : 1;
0090   guint is_word_start               : 1;
0091   guint is_word_end                 : 1;
0092   guint is_sentence_boundary        : 1;
0093   guint is_sentence_start           : 1;
0094   guint is_sentence_end             : 1;
0095   guint backspace_deletes_character : 1;
0096   guint is_expandable_space         : 1;
0097   guint is_word_boundary            : 1;
0098   guint break_inserts_hyphen        : 1;
0099   guint break_removes_preceding     : 1;
0100 
0101   guint reserved                    : 17;
0102 };
0103 
0104 PANGO_DEPRECATED_IN_1_44
0105 void                    pango_break             (const char    *text,
0106                                                  int            length,
0107                                                  PangoAnalysis *analysis,
0108                                                  PangoLogAttr  *attrs,
0109                                                  int            attrs_len);
0110 
0111 PANGO_AVAILABLE_IN_ALL
0112 void                    pango_get_log_attrs     (const char    *text,
0113                                                  int            length,
0114                                                  int            level,
0115                                                  PangoLanguage *language,
0116                                                  PangoLogAttr  *attrs,
0117                                                  int            attrs_len);
0118 
0119 PANGO_AVAILABLE_IN_ALL
0120 void                    pango_default_break     (const char    *text,
0121                                                  int            length,
0122                                                  PangoAnalysis *analysis,
0123                                                  PangoLogAttr  *attrs,
0124                                                  int            attrs_len);
0125 
0126 PANGO_AVAILABLE_IN_1_44
0127 void                    pango_tailor_break      (const char    *text,
0128                                                  int            length,
0129                                                  PangoAnalysis *analysis,
0130                                                  int            offset,
0131                                                  PangoLogAttr  *attrs,
0132                                                  int            attrs_len);
0133 
0134 PANGO_AVAILABLE_IN_1_50
0135 void                    pango_attr_break        (const char    *text,
0136                                                  int            length,
0137                                                  PangoAttrList *attr_list,
0138                                                  int            offset,
0139                                                  PangoLogAttr  *attrs,
0140                                                  int            attrs_len);
0141 
0142 G_END_DECLS
0143 
0144 #endif /* __PANGO_BREAK_H__ */