summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2001-06-25 15:09:39 +0000
committerOwen Taylor <otaylor@src.gnome.org>2001-06-25 15:09:39 +0000
commitac5989fb0fec8273fd4955611b6efb0317d138c1 (patch)
treefdc7bce2f7529c43f1e8446ef84f7991f398e12a
parent003e41182f16892fab9478530063b590e3852b74 (diff)
downloadpango-ac5989fb0fec8273fd4955611b6efb0317d138c1.tar.gz
pango/pango-markup.c: modules/arabic/arabic-xft.c (arabic_engine_shape):
Sat Jun 23 10:01:20 2001 Owen Taylor <otaylor@redhat.com> * pango/pangowin32-fontmap.c (pango_win32_font_entry_get_coverage): * pango/pangoft2-fontmap.c (pango_ft2_font_entry_get_coverage): pango/pango-markup.c: modules/arabic/arabic-xft.c (arabic_engine_shape): modules/arabic/arabic-x.c (arabic_engine_shape): pango/pango-context.c (pango_itemize): pango/pangox.c (get_font_metrics_from_string): pango/pangoft2.c (get_font_metrics_from_string): Adapt to 64-bit changes in glib. * pango/Makefile.am: Modify generation rules to use glib-mkenums (ugh, loong command lines), and to reduce rebuilding by using stamp files.
-rw-r--r--modules/arabic/arabic-x.c2
-rw-r--r--pango/Makefile.am45
-rwxr-xr-xpango/makeenums.pl279
-rw-r--r--pango/pango-context.c2
-rw-r--r--pango/pango-markup.c10
-rw-r--r--pango/pangoft2-fontmap.c6
-rw-r--r--pango/pangoft2.c2
-rw-r--r--pango/pangowin32-fontmap.c4
-rw-r--r--pango/pangox.c2
9 files changed, 49 insertions, 303 deletions
diff --git a/modules/arabic/arabic-x.c b/modules/arabic/arabic-x.c
index 75534025..42b4815a 100644
--- a/modules/arabic/arabic-x.c
+++ b/modules/arabic/arabic-x.c
@@ -178,7 +178,7 @@ arabic_engine_shape (PangoFont *font,
PangoGlyphString *glyphs)
{
PangoXSubfont subfont;
- int n_chars;
+ long n_chars;
int i;
ArabicFontInfo *fs;
const char *p;
diff --git a/pango/Makefile.am b/pango/Makefile.am
index 6b2028bc..5c0574e1 100644
--- a/pango/Makefile.am
+++ b/pango/Makefile.am
@@ -49,10 +49,10 @@ lib_LTLIBRARIES = libpango.la $(X_BUILD_LIBS) $(XFT_BUILD_LIBS) $(FT2_BUILD_LIBS
bin_PROGRAMS = pango-querymodules
-pango_built_headers= pango-enum-types.h
-pango_built_cfiles= pango-enum-types.c
+pango_built_headers = pango-enum-types.h
+pango_built_cfiles = pango-enum-types.c
-BUILT_SOURCES=$(pango_built_headers) $(pango_built_cfiles)
+$(OBJECTS): $(pango_built_headers)
libpango_la_SOURCES = \
break.c \
@@ -147,13 +147,34 @@ pangoinclude_HEADERS = \
$(XFT_HFILES) \
$(FT2_HFILES)
-pango-enum-types.h: @REBUILD@ $(pango_headers) makeenums.pl
- cd $(srcdir) \
- && $(PERL) ./makeenums.pl include $(pango_headers) > pango-enum-types.h
+pango-enum-types.h: s-enum-types-h
+ @true
+
+s-enum-types-h: @REBUILD@ $(pango_headers) Makefile
+ ( cd $(srcdir) && glib-mkenums \
+ --fhead "#ifndef __PANGO_ENUM_TYPES_H__\n#define __PANGO_ENUM_TYPES_H__\n" \
+ --fprod "/* enumerations from \"@filename@\" */\n" \
+ --vhead "GType @enum_name@_get_type (void);\n#define PANGO_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
+ --ftail "#endif /* __PANGO_ENUM_TYPES_H__ */" \
+ $(pango_headers) ) > tmp-pango-enum-types.h \
+ && (cmp -s tmp-pango-enum-types.h $(srcdir)/pango-enum-types.h || cp tmp-pango-enum-types.h $(srcdir)/pango-enum-types.h ) \
+ && rm -f tmp-pango-enum-types.h \
+ && echo timestamp > $(@F)
+
+pango-enum-types.c: s-enum-types-c
+ @true
-pango-enum-types.c: @REBUILD@ $(pango_headers) makeenums.pl
- cd $(srcdir) \
- && $(PERL) ./makeenums.pl cfile $(pango_headers) > pango-enum-types.c
+s-enum-types-c: @REBUILD@ $(pango_headers) Makefile
+ ( cd $(srcdir) && glib-mkenums \
+ --fhead "#include <pango.h>" \
+ --fprod "\n/* enumerations from \"@filename@\" */" \
+ --vhead "GType\n@enum_name@_get_type (void)\n{\n static GType etype = 0;\n if (etype == 0) {\n static const GEnumValue values[] = {" \
+ --vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
+ --vtail " { 0, NULL, NULL }\n };\n etype = g_enum_register_static (\"@EnumName@\", values);\n }\n return etype;\n}\n" \
+ $(pango_headers) ) > tmp-pango-enum-types.c \
+ && (cmp -s tmp-pango-enum-types.c $(srcdir)/pango-enum-types.c || cp tmp-pango-enum-types.c $(srcdir)/pango-enum-types.c ) \
+ && rm -f tmp-pango-enum-types.c \
+ && echo timestamp > $(@F)
#
# As a temporary hack, we pull in libpangox here so that we can link
@@ -169,7 +190,6 @@ endif
EXTRA_DIST = \
$(pango_built_headers) \
- makeenums.pl \
module-defs-ft2.c.win32 \
module-defs-win32.c.win32 \
module-defs.h \
@@ -201,3 +221,8 @@ $(INCLUDED_X_MODULES) $(INCLUDED_XFT_MODULES) $(INCLUDED_FT2_MODULES): included-
.PHONY: included-modules
endif
+CLEANFILES = \
+ pango-enum-types.h \
+ s-pango-enum-types.h \
+ pango-enum-types.c \
+ s-pango-enum-types.c
diff --git a/pango/makeenums.pl b/pango/makeenums.pl
deleted file mode 100755
index 51356db1..00000000
--- a/pango/makeenums.pl
+++ /dev/null
@@ -1,279 +0,0 @@
-#!/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 =~ /<</) {
- $seenbitshift = 1;
- }
- if (defined $options) {
- my %options = parse_options($options);
- if (!defined $options{skip}) {
- push @entries, [ $name, $options{nick} ];
- }
- } else {
- push @entries, [ $name ];
- }
- } else {
- print STDERR "Can't understand: $_\n";
- }
- }
- return 0;
-}
-
-
-my $gen_arrays = 0;
-my $gen_defs = 0;
-my $gen_includes = 0;
-my $gen_cfile = 0;
-
-# Parse arguments
-
-if (@ARGV) {
- if ($ARGV[0] eq "arrays") {
- shift @ARGV;
- $gen_arrays = 1;
- } elsif ($ARGV[0] eq "defs") {
- shift @ARGV;
- $gen_defs = 1;
- } elsif ($ARGV[0] eq "include") {
- shift @ARGV;
- $gen_includes = 1;
- } elsif ($ARGV[0] eq "cfile") {
- shift @ARGV;
- $gen_cfile = 1;
- }
-}
-
-if ($gen_defs) {
- print ";; generated by makeenums.pl ; -*- scheme -*-\n\n";
-} else {
- print "/* Generated by makeenums.pl */\n\n";
-}
-
-if ($gen_includes) {
- print "#ifndef __PANGO_ENUM_TYPES_H__\n";
- print "#define __PANGO_ENUM_TYPES_H__\n";
-}
-
-if ($gen_cfile) {
- print "#include \"pango.h\"\n";
-}
-
-ENUMERATION:
-while (<>) {
- 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 (<<EOF);
-GType
-${valuename}_get_type (void)
-{
- static GType etype = 0;
- if (etype == 0)
- {
-EOF
- if ($flags) {
- print " static const GFlagsValue values[] = {\n";
- } else {
- print " static const GEnumValue values[] = {\n";
- }
- for (@entries) {
- my ($name,$nick) = @{$_};
- print qq( { $name, "$name", "$nick" },\n);
- }
- print " { 0, NULL, NULL }\n";
- print " };\n";
-
- if ($flags) {
- print " etype = g_flags_register_static (\"$enumname\", values);\n";
- } else {
- print " etype = g_enum_register_static (\"$enumname\", values);\n";
- }
-
- print (<<EOF);
- }
- return etype;
-}
-EOF
- }
- print "\n";
- }
- }
-
-
-if ($gen_includes) {
- print "#endif /* __PANGO_ENUMS_H__ */\n";
-}
diff --git a/pango/pango-context.c b/pango/pango-context.c
index 056e4c32..b8ebf937 100644
--- a/pango/pango-context.c
+++ b/pango/pango-context.c
@@ -520,7 +520,7 @@ pango_itemize (PangoContext *context,
PangoAttrIterator *cached_iter)
{
gunichar *text_ucs4;
- int n_chars, i;
+ long n_chars, i;
guint8 *embedding_levels;
PangoDirection base_dir;
PangoItem *item;
diff --git a/pango/pango-markup.c b/pango/pango-markup.c
index b408fc26..4b50d36b 100644
--- a/pango/pango-markup.c
+++ b/pango/pango-markup.c
@@ -56,7 +56,7 @@ struct _MarkupData
PangoAttrList *attr_list;
GString *text;
GSList *tag_stack;
- gint index;
+ size_t index;
GSList *to_apply;
gunichar accel_marker;
gunichar accel_char;
@@ -67,7 +67,7 @@ typedef struct _OpenTag OpenTag;
struct _OpenTag
{
GSList *attrs;
- gint start_index;
+ size_t start_index;
/* Current total scale level; reset whenever
* an absolute size is set.
* Each "larger" ups it 1, each "smaller" decrements it 1
@@ -421,7 +421,7 @@ end_element_handler (GMarkupParseContext *context,
static void
text_handler (GMarkupParseContext *context,
const gchar *text,
- gint text_len,
+ size_t text_len,
gpointer user_data,
GError **error)
{
@@ -443,8 +443,8 @@ text_handler (GMarkupParseContext *context,
const gchar *range_start;
const gchar *range_end;
gboolean just_saw_marker;
- gint uline_index = -1;
- gint uline_len = -1;
+ ssize_t uline_index = -1;
+ size_t uline_len = -1;
range_end = NULL;
range_start = text;
diff --git a/pango/pangoft2-fontmap.c b/pango/pangoft2-fontmap.c
index e796732c..5a15e3ff 100644
--- a/pango/pangoft2-fontmap.c
+++ b/pango/pangoft2-fontmap.c
@@ -965,10 +965,10 @@ pango_ft2_font_entry_get_coverage (PangoFT2FontEntry *entry,
GHashTable *coverage_hash;
PangoFontDescription *description;
FILE *cache_file;
- gchar *cache_file_name;
- gchar *font_as_filename;
+ char *cache_file_name;
+ char *font_as_filename;
guchar *buf;
- int buflen;
+ size_t buflen;
if (entry)
if (entry->coverage)
diff --git a/pango/pangoft2.c b/pango/pangoft2.c
index f50ff43c..8cdf7fb1 100644
--- a/pango/pangoft2.c
+++ b/pango/pangoft2.c
@@ -562,7 +562,7 @@ get_font_metrics_from_string (PangoFont *font,
PangoEngineShape *shaper, *last_shaper;
int last_level;
gunichar *text_ucs4;
- int n_chars, i;
+ long n_chars, i;
guint8 *embedding_levels;
PangoDirection base_dir = PANGO_DIRECTION_LTR;
GSList *subfonts = NULL;
diff --git a/pango/pangowin32-fontmap.c b/pango/pangowin32-fontmap.c
index 6a025e16..95d9640a 100644
--- a/pango/pangowin32-fontmap.c
+++ b/pango/pangowin32-fontmap.c
@@ -1378,9 +1378,9 @@ pango_win32_font_entry_get_coverage (PangoWin32FontEntry *entry,
PangoCoverage *result = NULL;
PangoFontDescription *description;
FILE *cache_file;
- gchar *cache_file_name;
+ char *cache_file_name;
guchar *buf;
- int buflen;
+ size_t buflen;
if (entry->coverage)
{
diff --git a/pango/pangox.c b/pango/pangox.c
index d5909883..f7741d38 100644
--- a/pango/pangox.c
+++ b/pango/pangox.c
@@ -779,7 +779,7 @@ get_font_metrics_from_string (PangoFont *font,
PangoEngineShape *shaper, *last_shaper;
int last_level;
gunichar *text_ucs4;
- int n_chars, i;
+ long n_chars, i;
guint8 *embedding_levels;
PangoDirection base_dir = PANGO_DIRECTION_LTR;
GSList *subfonts = NULL;