From cf11e920312b335c5eaa21021a1176fe9f913d9b Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sat, 16 Dec 2000 06:46:40 +0000 Subject: move pango_shape and pango_reorder_items in here. 2000-12-15 Havoc Pennington * pango/pango-glyph.h: move pango_shape and pango_reorder_items in here. * pango/pango-break.h: move most of pango.h in here, so that pango.h can be the only file that includes pango-enum-types.h, so that changing any header doesn't end up rebuilding all of pango due to a rebuild of pango-enum-types.h. * pango/makeenums.pl: script to generate pango-enum-types.[hc] * pango/Makefile.am (pango_headers): built pango-enum-types.h, pango-enum-types.c that do enum type registration; add pango-break.h; do some assorted rearranging to handle the built headers * pango/pango.h: moved most of it to pango-break.h * pango/break.c: include individual headers, not pango.h * pango/shape.c: ditto * pango/reorder-items.c: ditto * pango/querymodules.c: ditto * pango/pango-layout.c: ditto * pango/pango-indic.c: ditto * pango/mapping.c: ditto * pango/itemize.c: ditto * pango/fonts.c: ditto --- ChangeLog | 37 +++++++ ChangeLog.pre-1-0 | 37 +++++++ ChangeLog.pre-1-10 | 37 +++++++ ChangeLog.pre-1-2 | 37 +++++++ ChangeLog.pre-1-4 | 37 +++++++ ChangeLog.pre-1-6 | 37 +++++++ ChangeLog.pre-1-8 | 37 +++++++ pango/Makefile.am | 24 ++++- pango/break.c | 2 +- pango/fonts.c | 4 +- pango/itemize.c | 2 +- pango/makeenums.pl | 279 ++++++++++++++++++++++++++++++++++++++++++++++++++ pango/mapping.c | 2 +- pango/pango-break.h | 103 +++++++++++++++++++ pango/pango-glyph.h | 10 ++ pango/pango-indic.c | 2 +- pango/pango-layout.c | 5 +- pango/pango.h | 78 +------------- pango/querymodules.c | 4 +- pango/reorder-items.c | 2 +- pango/shape.c | 3 +- 21 files changed, 691 insertions(+), 88 deletions(-) create mode 100755 pango/makeenums.pl create mode 100644 pango/pango-break.h diff --git a/ChangeLog b/ChangeLog index 62360d9b..841b9f3e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,40 @@ +2000-12-15 Havoc Pennington + + * pango/pango-glyph.h: move pango_shape and pango_reorder_items in + here. + + * pango/pango-break.h: move most of pango.h in here, so that + pango.h can be the only file that includes pango-enum-types.h, so + that changing any header doesn't end up rebuilding all of pango + due to a rebuild of pango-enum-types.h. + + * pango/makeenums.pl: script to generate pango-enum-types.[hc] + + * pango/Makefile.am (pango_headers): built pango-enum-types.h, + pango-enum-types.c that do enum type registration; add + pango-break.h; do some assorted rearranging to handle the + built headers + + * pango/pango.h: moved most of it to pango-break.h + + * pango/break.c: include individual headers, not pango.h + + * pango/shape.c: ditto + + * pango/reorder-items.c: ditto + + * pango/querymodules.c: ditto + + * pango/pango-layout.c: ditto + + * pango/pango-indic.c: ditto + + * pango/mapping.c: ditto + + * pango/itemize.c: ditto + + * pango/fonts.c: ditto + 2000-12-15 Havoc Pennington * modules/Makefile.am (install-data-local): touch diff --git a/ChangeLog.pre-1-0 b/ChangeLog.pre-1-0 index 62360d9b..841b9f3e 100644 --- a/ChangeLog.pre-1-0 +++ b/ChangeLog.pre-1-0 @@ -1,3 +1,40 @@ +2000-12-15 Havoc Pennington + + * pango/pango-glyph.h: move pango_shape and pango_reorder_items in + here. + + * pango/pango-break.h: move most of pango.h in here, so that + pango.h can be the only file that includes pango-enum-types.h, so + that changing any header doesn't end up rebuilding all of pango + due to a rebuild of pango-enum-types.h. + + * pango/makeenums.pl: script to generate pango-enum-types.[hc] + + * pango/Makefile.am (pango_headers): built pango-enum-types.h, + pango-enum-types.c that do enum type registration; add + pango-break.h; do some assorted rearranging to handle the + built headers + + * pango/pango.h: moved most of it to pango-break.h + + * pango/break.c: include individual headers, not pango.h + + * pango/shape.c: ditto + + * pango/reorder-items.c: ditto + + * pango/querymodules.c: ditto + + * pango/pango-layout.c: ditto + + * pango/pango-indic.c: ditto + + * pango/mapping.c: ditto + + * pango/itemize.c: ditto + + * pango/fonts.c: ditto + 2000-12-15 Havoc Pennington * modules/Makefile.am (install-data-local): touch diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10 index 62360d9b..841b9f3e 100644 --- a/ChangeLog.pre-1-10 +++ b/ChangeLog.pre-1-10 @@ -1,3 +1,40 @@ +2000-12-15 Havoc Pennington + + * pango/pango-glyph.h: move pango_shape and pango_reorder_items in + here. + + * pango/pango-break.h: move most of pango.h in here, so that + pango.h can be the only file that includes pango-enum-types.h, so + that changing any header doesn't end up rebuilding all of pango + due to a rebuild of pango-enum-types.h. + + * pango/makeenums.pl: script to generate pango-enum-types.[hc] + + * pango/Makefile.am (pango_headers): built pango-enum-types.h, + pango-enum-types.c that do enum type registration; add + pango-break.h; do some assorted rearranging to handle the + built headers + + * pango/pango.h: moved most of it to pango-break.h + + * pango/break.c: include individual headers, not pango.h + + * pango/shape.c: ditto + + * pango/reorder-items.c: ditto + + * pango/querymodules.c: ditto + + * pango/pango-layout.c: ditto + + * pango/pango-indic.c: ditto + + * pango/mapping.c: ditto + + * pango/itemize.c: ditto + + * pango/fonts.c: ditto + 2000-12-15 Havoc Pennington * modules/Makefile.am (install-data-local): touch diff --git a/ChangeLog.pre-1-2 b/ChangeLog.pre-1-2 index 62360d9b..841b9f3e 100644 --- a/ChangeLog.pre-1-2 +++ b/ChangeLog.pre-1-2 @@ -1,3 +1,40 @@ +2000-12-15 Havoc Pennington + + * pango/pango-glyph.h: move pango_shape and pango_reorder_items in + here. + + * pango/pango-break.h: move most of pango.h in here, so that + pango.h can be the only file that includes pango-enum-types.h, so + that changing any header doesn't end up rebuilding all of pango + due to a rebuild of pango-enum-types.h. + + * pango/makeenums.pl: script to generate pango-enum-types.[hc] + + * pango/Makefile.am (pango_headers): built pango-enum-types.h, + pango-enum-types.c that do enum type registration; add + pango-break.h; do some assorted rearranging to handle the + built headers + + * pango/pango.h: moved most of it to pango-break.h + + * pango/break.c: include individual headers, not pango.h + + * pango/shape.c: ditto + + * pango/reorder-items.c: ditto + + * pango/querymodules.c: ditto + + * pango/pango-layout.c: ditto + + * pango/pango-indic.c: ditto + + * pango/mapping.c: ditto + + * pango/itemize.c: ditto + + * pango/fonts.c: ditto + 2000-12-15 Havoc Pennington * modules/Makefile.am (install-data-local): touch diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4 index 62360d9b..841b9f3e 100644 --- a/ChangeLog.pre-1-4 +++ b/ChangeLog.pre-1-4 @@ -1,3 +1,40 @@ +2000-12-15 Havoc Pennington + + * pango/pango-glyph.h: move pango_shape and pango_reorder_items in + here. + + * pango/pango-break.h: move most of pango.h in here, so that + pango.h can be the only file that includes pango-enum-types.h, so + that changing any header doesn't end up rebuilding all of pango + due to a rebuild of pango-enum-types.h. + + * pango/makeenums.pl: script to generate pango-enum-types.[hc] + + * pango/Makefile.am (pango_headers): built pango-enum-types.h, + pango-enum-types.c that do enum type registration; add + pango-break.h; do some assorted rearranging to handle the + built headers + + * pango/pango.h: moved most of it to pango-break.h + + * pango/break.c: include individual headers, not pango.h + + * pango/shape.c: ditto + + * pango/reorder-items.c: ditto + + * pango/querymodules.c: ditto + + * pango/pango-layout.c: ditto + + * pango/pango-indic.c: ditto + + * pango/mapping.c: ditto + + * pango/itemize.c: ditto + + * pango/fonts.c: ditto + 2000-12-15 Havoc Pennington * modules/Makefile.am (install-data-local): touch diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6 index 62360d9b..841b9f3e 100644 --- a/ChangeLog.pre-1-6 +++ b/ChangeLog.pre-1-6 @@ -1,3 +1,40 @@ +2000-12-15 Havoc Pennington + + * pango/pango-glyph.h: move pango_shape and pango_reorder_items in + here. + + * pango/pango-break.h: move most of pango.h in here, so that + pango.h can be the only file that includes pango-enum-types.h, so + that changing any header doesn't end up rebuilding all of pango + due to a rebuild of pango-enum-types.h. + + * pango/makeenums.pl: script to generate pango-enum-types.[hc] + + * pango/Makefile.am (pango_headers): built pango-enum-types.h, + pango-enum-types.c that do enum type registration; add + pango-break.h; do some assorted rearranging to handle the + built headers + + * pango/pango.h: moved most of it to pango-break.h + + * pango/break.c: include individual headers, not pango.h + + * pango/shape.c: ditto + + * pango/reorder-items.c: ditto + + * pango/querymodules.c: ditto + + * pango/pango-layout.c: ditto + + * pango/pango-indic.c: ditto + + * pango/mapping.c: ditto + + * pango/itemize.c: ditto + + * pango/fonts.c: ditto + 2000-12-15 Havoc Pennington * modules/Makefile.am (install-data-local): touch diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8 index 62360d9b..841b9f3e 100644 --- a/ChangeLog.pre-1-8 +++ b/ChangeLog.pre-1-8 @@ -1,3 +1,40 @@ +2000-12-15 Havoc Pennington + + * pango/pango-glyph.h: move pango_shape and pango_reorder_items in + here. + + * pango/pango-break.h: move most of pango.h in here, so that + pango.h can be the only file that includes pango-enum-types.h, so + that changing any header doesn't end up rebuilding all of pango + due to a rebuild of pango-enum-types.h. + + * pango/makeenums.pl: script to generate pango-enum-types.[hc] + + * pango/Makefile.am (pango_headers): built pango-enum-types.h, + pango-enum-types.c that do enum type registration; add + pango-break.h; do some assorted rearranging to handle the + built headers + + * pango/pango.h: moved most of it to pango-break.h + + * pango/break.c: include individual headers, not pango.h + + * pango/shape.c: ditto + + * pango/reorder-items.c: ditto + + * pango/querymodules.c: ditto + + * pango/pango-layout.c: ditto + + * pango/pango-indic.c: ditto + + * pango/mapping.c: ditto + + * pango/itemize.c: ditto + + * pango/fonts.c: ditto + 2000-12-15 Havoc Pennington * modules/Makefile.am (install-data-local): touch diff --git a/pango/Makefile.am b/pango/Makefile.am index 02e2a871..c1f57ffd 100644 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@ -23,6 +23,11 @@ lib_LTLIBRARIES = libpango.la libpangox.la $(XFT_BUILD_LIBS) bin_PROGRAMS = pango-querymodules +pango_built_headers= pango-enum-types.h +pango_built_cfiles= pango-enum-types.c + +BUILT_SOURCES=$(pango_built_headers) $(pango_built_cfiles) + libpango_la_SOURCES = \ break.c \ fonts.c \ @@ -41,7 +46,8 @@ libpango_la_SOURCES = \ pango-tabs.c \ pango-utils.c \ reorder-items.c \ - shape.c + shape.c \ + $(pango_built_cfiles) libpangox_la_SOURCES = \ modules.h \ @@ -74,9 +80,10 @@ libpangoxft_la_LDFLAGS = -release $(VERSION) pangoincludedir=$(includedir)/pango-1.0/pango -pangoinclude_HEADERS = \ +pango_headers= \ pango.h \ pango-attributes.h \ + pango-break.h \ pango-context.h \ pango-coverage.h \ pango-engine.h \ @@ -91,7 +98,17 @@ pangoinclude_HEADERS = \ pango-types.h \ pango-utils.h \ pangox.h \ - $(XFT_HFILES) + $(XFT_HFILES) + +pangoinclude_HEADERS = \ + $(pango_headers) \ + $(pango_built_headers) + +pango-enum-types.h: $(pango_headers) makeenums.pl + makeenums.pl include $(pango_headers) > pango-enum-types.h + +pango-enum-types.c: $(pango_headers) makeenums.pl + makeenums.pl cfile $(pango_headers) > pango-enum-types.c # # As a temporary hack, we pull in libpangox here so that we can link @@ -105,6 +122,7 @@ pango_querymodules_LDADD = libpangox.la libpango.la $(GLIB_LIBS) $(FRIBIDI_LIBS) endif EXTRA_DIST = \ + makeenums.pl \ module-defs.c.win32 \ pango.def \ pangowin32.def \ diff --git a/pango/break.c b/pango/break.c index ce1d7dfb..e27d9980 100644 --- a/pango/break.c +++ b/pango/break.c @@ -19,7 +19,7 @@ * Boston, MA 02111-1307, USA. */ -#include "pango.h" +#include "pango-break.h" #include "pango-modules.h" #include diff --git a/pango/fonts.c b/pango/fonts.c index 9dc7a8fc..379ad294 100644 --- a/pango/fonts.c +++ b/pango/fonts.c @@ -24,7 +24,9 @@ #include #include -#include "pango.h" +#include "pango-types.h" +#include "pango-font.h" +#include "pango-fontmap.h" /** * pango_font_description_copy: diff --git a/pango/itemize.c b/pango/itemize.c index 147393c6..b50101c4 100644 --- a/pango/itemize.c +++ b/pango/itemize.c @@ -19,7 +19,7 @@ * Boston, MA 02111-1307, USA. */ -#include "pango.h" +#include "pango-context.h" #include "modules.h" static void add_engines (PangoContext *context, diff --git a/pango/makeenums.pl b/pango/makeenums.pl new file mode 100755 index 00000000..51356db1 --- /dev/null +++ b/pango/makeenums.pl @@ -0,0 +1,279 @@ +#!/usr/bin/perl -w + +# Information about the current enumeration + +my $flags; # Is enumeration a bitmask +my $seenbitshift; # Have we seen bitshift operators? +my $prefix; # Prefix for this enumeration +my $enumname; # Name for this enumeration +my $firstenum = 1; # Is this the first enumeration in file? +my @entries; # [ $name, $val ] for each entry + +sub parse_options { + my $opts = shift; + my @opts; + + for $opt (split /\s*,\s*/, $opts) { + my ($key,$val) = $opt =~ /\s*(\w+)(?:=(\S+))?/; + defined $val or $val = 1; + push @opts, $key, $val; + } + @opts; +} +sub parse_entries { + my $file = shift; + + while (<$file>) { + # Read lines until we have no open comments + while (m@/\* + ([^*]|\*(?!/))*$ + @x) { + my $new; + defined ($new = <$file>) || die "Unmatched comment"; + $_ .= $new; + } + # Now strip comments + s@/\*(?!<) + ([^*]+|\*(?!/))* + \*/@@gx; + + s@\n@ @; + + next if m@^\s*$@; + + # Handle include files + if (/^\#include\s*<([^>]*)>/ ) { + my $file= "../$1"; + open NEWFILE, $file or die "Cannot open include file $file: $!\n"; + + if (parse_entries (\*NEWFILE)) { + return 1; + } else { + next; + } + } + + if (/^\s*\}\s*(\w+)/) { + $enumname = $1; + return 1; + } + + if (m@^\s* + (\w+)\s* # name + (?:=( # value + (?:[^,/]|/(?!\*))* + ))?,?\s* + (?:/\*< # options + (([^*]|\*(?!/))*) + >\*/)? + \s*$ + @x) { + my ($name, $value, $options) = ($1,$2,$3); + + if (!defined $flags && defined $value && $value =~ /<) { + if (eof) { + close (ARGV); # reset line numbering + $firstenum = 1; # Flag to print filename at next enum + } + + if (m@^\s*typedef\s+enum\s* + ({)?\s* + (?:/\*< + (([^*]|\*(?!/))*) + >\*/)? + @x) { + print "\n"; + if (defined $2) { + my %options = parse_options($2); + $prefix = $options{prefix}; + $flags = $options{flags}; + } else { + $prefix = undef; + $flags = undef; + } + # Didn't have trailing '{' look on next lines + if (!defined $1) { + while (<>) { + if (s/^\s*\{//) { + last; + } + } + } + + $seenbitshift = 0; + @entries = (); + + # Now parse the entries + parse_entries (\*ARGV); + + # figure out if this was a flags or enums enumeration + + if (!defined $flags) { + $flags = $seenbitshift; + } + + # Autogenerate a prefix + + if (!defined $prefix) { + for (@entries) { + my $name = $_->[0]; + if (defined $prefix) { + my $tmp = ~ ($name ^ $prefix); + ($tmp) = $tmp =~ /(^\xff*)/; + $prefix = $prefix & $tmp; + } else { + $prefix = $name; + } + } + # Trim so that it ends in an underscore + $prefix =~ s/_[^_]*$/_/; + } + + for $entry (@entries) { + my ($name,$nick) = @{$entry}; + if (!defined $nick) { + ($nick = $name) =~ s/^$prefix//; + $nick =~ tr/_/-/; + $nick = lc($nick); + @{$entry} = ($name, $nick); + } + } + + # Spit out the output + + my $valuename = $enumname; + $valuename =~ s/([^A-Z])([A-Z])/$1_$2/g; + $valuename =~ s/([A-Z][A-Z])([A-Z][0-9a-z])/$1_$2/g; + $valuename = lc($valuename); + + my $typemacro = $enumname; + $typemacro =~ s/([^A-Z])([A-Z])/$1_$2/g; + $typemacro =~ s/([A-Z][A-Z])([A-Z][0-9a-z])/$1_$2/g; + $typemacro = uc($valuename); + $typemacro =~ s/PANGO_/PANGO_TYPE_/g; + + if ($gen_defs) { + if ($firstenum) { + print qq(\n; enumerations from "$ARGV"\n); + $firstenum = 0; + } + + print "\n(define-".($flags ? "flags" : "enum")." $enumname"; + + for (@entries) { + my ($name,$nick) = @{$_}; + print "\n ($nick $name)"; + } + print ")\n"; + + } elsif ($gen_arrays) { + + print "static const GtkEnumValue _${valuename}_values[] = {\n"; + for (@entries) { + my ($name,$nick) = @{$_}; + print qq( { $name, "$name", "$nick" },\n); + } + print " { 0, NULL, NULL }\n"; + print "};\n"; + } elsif ($gen_includes) { + print "GType ${valuename}_get_type (void);\n"; + print "#define ${typemacro} ${valuename}_get_type ()\n"; + } elsif ($gen_cfile) { + print (< +#include /** * pango_glyph_string_index_to_x: diff --git a/pango/pango-break.h b/pango/pango-break.h new file mode 100644 index 00000000..74bdda00 --- /dev/null +++ b/pango/pango-break.h @@ -0,0 +1,103 @@ +/* Pango + * pango-break.h: + * + * Copyright (C) 1999 Red Hat Software + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef __PANGO_BREAK_H__ +#define __PANGO_BREAK_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#include + +/* Logical attributes of a character. + */ +struct _PangoLogAttr +{ + guint is_break : 1; /* Can break line in front of character */ + + guint is_mandatory_break : 1; /* Must break line in front of character */ + + guint is_white : 1; /* Whitespace character */ + + /* cursor can appear in front of character (i.e. this is a grapheme + * boundary, or the first character in the text) + */ + guint is_cursor_position : 1; + + /* Note that in degenerate cases, you could have both start/end set on + * some text, most likely for sentences (e.g. no space after a period, so + * the next sentence starts right away) + */ + + guint is_word_start : 1; /* first character in a word */ + guint is_word_end : 1; /* is first non-word char after a word */ + + /* There are two ways to divide sentences. The first assigns all + * intersentence whitespace/control/format chars to some sentence, + * so all chars are in some sentence; is_sentence_boundary denotes + * the boundaries there. The second way doesn't assign + * between-sentence spaces, etc. to any sentence, so + * is_sentence_start/is_sentence_end mark the boundaries of those + * sentences. + */ + guint is_sentence_boundary : 1; + guint is_sentence_start : 1; /* first character in a sentence */ + guint is_sentence_end : 1; /* first non-sentence char after a sentence */ +}; + +/* Determine information about cluster/word/line breaks in a string + * of Unicode text. + */ +void pango_break (const gchar *text, + gint length, + PangoAnalysis *analysis, + PangoLogAttr *attrs); + +void pango_find_paragraph_boundary (const gchar *text, + gint length, + gint *paragraph_delimiter_index, + gint *next_paragraph_start); + +void pango_get_log_attrs (const char *text, + int length, + int level, + const char *language, + PangoLogAttr *log_attrs); + +/* This is the default break algorithm, used if no language + * engine overrides it. Normally you should use pango_break() + * instead; this function is mostly useful for chaining up + * from a language engine override. + */ +void pango_default_break (const gchar *text, + gint length, + PangoAnalysis *analysis, + PangoLogAttr *attrs); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif /* __PANGO_BREAK_H__ */ diff --git a/pango/pango-glyph.h b/pango/pango-glyph.h index 789ae897..aefe833d 100644 --- a/pango/pango-glyph.h +++ b/pango/pango-glyph.h @@ -122,6 +122,16 @@ void pango_justify (PangoGlyphString *glyphs, gint new_line_width, gint min_kashida_width); + +/* Turn a string of characters into a string of glyphs + */ +void pango_shape (const gchar *text, + gint length, + PangoAnalysis *analysis, + PangoGlyphString *glyphs); + +GList *pango_reorder_items (GList *logical_items); + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/pango/pango-indic.c b/pango/pango-indic.c index 5845a035..0bd417cb 100755 --- a/pango/pango-indic.c +++ b/pango/pango-indic.c @@ -21,7 +21,7 @@ * Boston, MA 02111-1307, USA. */ -#include "pango.h" +#include "pango-glyph.h" #include "pango-indic.h" /** diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 3d4f6f8c..4a3315bc 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -19,8 +19,11 @@ * Boston, MA 02111-1307, USA. */ -#include /* For pango_shape() */ +#include /* For pango_shape() */ #include +#include +#include +#include #include #define LINE_IS_VALID(line) ((line)->layout != NULL) diff --git a/pango/pango.h b/pango/pango.h index 3cbc0f59..b5691901 100644 --- a/pango/pango.h +++ b/pango/pango.h @@ -22,16 +22,16 @@ #ifndef __PANGO_H__ #define __PANGO_H__ -#include - #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #include +#include #include #include #include +#include #include #include #include @@ -39,80 +39,6 @@ extern "C" { #include #include -/* Logical attributes of a character. - */ -struct _PangoLogAttr -{ - guint is_break : 1; /* Can break line in front of character */ - - guint is_mandatory_break : 1; /* Must break line in front of character */ - - guint is_white : 1; /* Whitespace character */ - - /* cursor can appear in front of character (i.e. this is a grapheme - * boundary, or the first character in the text) - */ - guint is_cursor_position : 1; - - /* Note that in degenerate cases, you could have both start/end set on - * some text, most likely for sentences (e.g. no space after a period, so - * the next sentence starts right away) - */ - - guint is_word_start : 1; /* first character in a word */ - guint is_word_end : 1; /* is first non-word char after a word */ - - /* There are two ways to divide sentences. The first assigns all - * intersentence whitespace/control/format chars to some sentence, - * so all chars are in some sentence; is_sentence_boundary denotes - * the boundaries there. The second way doesn't assign - * between-sentence spaces, etc. to any sentence, so - * is_sentence_start/is_sentence_end mark the boundaries of those - * sentences. - */ - guint is_sentence_boundary : 1; - guint is_sentence_start : 1; /* first character in a sentence */ - guint is_sentence_end : 1; /* first non-sentence char after a sentence */ -}; - -/* Determine information about cluster/word/line breaks in a string - * of Unicode text. - */ -void pango_break (const gchar *text, - gint length, - PangoAnalysis *analysis, - PangoLogAttr *attrs); - -void pango_find_paragraph_boundary (const gchar *text, - gint length, - gint *paragraph_delimiter_index, - gint *next_paragraph_start); - -void pango_get_log_attrs (const char *text, - int length, - int level, - const char *language, - PangoLogAttr *log_attrs); - -/* Turn a string of characters into a string of glyphs - */ -void pango_shape (const gchar *text, - gint length, - PangoAnalysis *analysis, - PangoGlyphString *glyphs); - -GList *pango_reorder_items (GList *logical_items); - -/* This is the default break algorithm, used if no language - * engine overrides it. Normally you should use pango_break() - * instead; this function is mostly useful for chaining up - * from a language engine override. - */ -void pango_default_break (const gchar *text, - gint length, - PangoAnalysis *analysis, - PangoLogAttr *attrs); - #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/pango/querymodules.c b/pango/querymodules.c index 58945522..165dde70 100644 --- a/pango/querymodules.c +++ b/pango/querymodules.c @@ -26,8 +26,10 @@ #include #endif #include -#include "pango.h" +#include "pango-break.h" +#include "pango-context.h" #include "pango-utils.h" +#include "pango-engine.h" #include #include diff --git a/pango/reorder-items.c b/pango/reorder-items.c index 3e938240..39320da0 100644 --- a/pango/reorder-items.c +++ b/pango/reorder-items.c @@ -19,7 +19,7 @@ * Boston, MA 02111-1307, USA. */ -#include +#include /* * NB: The contents of the file implement the exact same algorithm diff --git a/pango/shape.c b/pango/shape.c index 4d6291c4..8d242747 100644 --- a/pango/shape.c +++ b/pango/shape.c @@ -19,7 +19,8 @@ * Boston, MA 02111-1307, USA. */ -#include +#include +#include /** * pango_shape: -- cgit v1.2.1