diff options
author | Owen Taylor <otaylor@redhat.com> | 2000-02-01 18:52:17 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2000-02-01 18:52:17 +0000 |
commit | 82d8346691a72e4dd37a1e3999a939be269df32d (patch) | |
tree | 644477eb228b5e7f96460ae3e94bd718006d8937 /pango | |
parent | 532c6902c34f47d5f838623c951e53d5fcdd395f (diff) | |
download | pango-82d8346691a72e4dd37a1e3999a939be269df32d.tar.gz |
Conditionally define G_N_ELEMENTS() when using glib-1.3.
Wed Feb 2 11:12:12 2000 Owen Taylor <otaylor@redhat.com>
* libpango/pango-types.h: Conditionally define G_N_ELEMENTS() when
using glib-1.3.
* modules/basic/basic.c modules/hangul/hangul.c modules/tamil/tamil.c:
Replace MEMBERS() with G_N_ELEMENTS().
* libpango/pango-engine.h: Added a get_coverage() function
to the PangoEngineShape vtable.
* modules/basic/basic.c modules/hangul/hangul.c modules/tamil/tamil.c:
Added get_coverage() functions. The basic.c one is incredibly
inefficient (but caching may make that matter that much).
The Hangul one needs checking.
Diffstat (limited to 'pango')
-rw-r--r-- | pango/pango-engine.h | 6 | ||||
-rw-r--r-- | pango/pango-types.h | 7 | ||||
-rw-r--r-- | pango/pangox.c | 4 | ||||
-rw-r--r-- | pango/utils.c | 22 | ||||
-rw-r--r-- | pango/utils.h | 6 |
5 files changed, 25 insertions, 20 deletions
diff --git a/pango/pango-engine.h b/pango/pango-engine.h index ccd7b219..9d56163a 100644 --- a/pango/pango-engine.h +++ b/pango/pango-engine.h @@ -67,7 +67,7 @@ struct _PangoEngine struct _PangoEngineLang { PangoEngine engine; - void (*script_break) (gchar *text, + void (*script_break) (const char *text, int len, PangoAnalysis *analysis, PangoLogAttr *attrs); @@ -77,10 +77,12 @@ struct _PangoEngineShape { PangoEngine engine; void (*script_shape) (PangoFont *font, - char *text, + const char *text, int length, PangoAnalysis *analysis, PangoGlyphString *glyphs); + PangoCoverage *(*get_coverage) (PangoFont *font, + const char *lang); }; /* A module should export the following functions */ diff --git a/pango/pango-types.h b/pango/pango-types.h index f702a722..46dc794b 100644 --- a/pango/pango-types.h +++ b/pango/pango-types.h @@ -23,6 +23,13 @@ #define __PANGO_TYPES_H__ #include <glib.h> + +/* Include this here, since we don't depend on GLib 1.3 yet */ + +#ifndef G_N_ELEMENTS +#define G_N_ELEMENTS(arr) (sizeof(arr) / sizeof((arr)[0])) +#endif + typedef struct _PangoAnalysis PangoAnalysis; typedef struct _PangoItem PangoItem; typedef struct _PangoLangRange PangoLangRange; diff --git a/pango/pangox.c b/pango/pangox.c index 60dda86b..94b70297 100644 --- a/pango/pangox.c +++ b/pango/pangox.c @@ -33,10 +33,6 @@ typedef struct _PangoXSubfontInfo PangoXSubfontInfo; typedef struct _PangoXFamilyEntry PangoXFamilyEntry; typedef struct _PangoXFontEntry PangoXFontEntry; -#ifndef G_N_ELEMENTS -#define G_N_ELEMENTS(arr) (sizeof(arr) / sizeof((arr)[0])) -#endif - struct _PangoXFontEntry { char *xlfd_prefix; diff --git a/pango/utils.c b/pango/utils.c index d3ab9fdd..6790113d 100644 --- a/pango/utils.c +++ b/pango/utils.c @@ -25,10 +25,10 @@ #include <unicode.h> gboolean -_pango_utf8_iterate (gchar *cur, char **next, GUChar4 *wc_out) +_pango_utf8_iterate (const char *cur, const char **next, GUChar4 *wc_out) { - gchar *p = cur; - gchar c = *p; + const char *p = cur; + char c = *p; GUChar4 wc; gint length; @@ -83,12 +83,12 @@ _pango_utf8_iterate (gchar *cur, char **next, GUChar4 *wc_out) return TRUE; } -gint -_pango_utf8_len (gchar *str, gint limit) +int +_pango_utf8_len (const char *str, int limit) { - gchar *cur = str; - gchar *next; - gint len = 0; + const char *cur = str; + const char *next; + int len = 0; while (*cur) { @@ -112,11 +112,11 @@ _pango_utf8_len (gchar *str, gint limit) #endif GUChar2 * -_pango_utf8_to_ucs2 (gchar *str, gint len) +_pango_utf8_to_ucs2 (const char *str, int len) { iconv_t cd; - gchar *outbuf, *result; - gchar *inbuf; + char *outbuf, *result; + const char *inbuf; size_t inbytesleft; size_t outbytesleft; gint outlen; diff --git a/pango/utils.h b/pango/utils.h index 2777b5d9..cfb82d0a 100644 --- a/pango/utils.h +++ b/pango/utils.h @@ -27,8 +27,8 @@ typedef guint16 GUChar2; typedef guint32 GUChar4; -gboolean _pango_utf8_iterate (gchar *cur, char **next, GUChar4 *wc_out); -GUChar2 *_pango_utf8_to_ucs2 (gchar *str, gint len); -gint _pango_utf8_len (gchar *str, gint limit); +gboolean _pango_utf8_iterate (const char *cur, const char **next, GUChar4 *wc_out); +GUChar2 *_pango_utf8_to_ucs2 (const char *str, gint len); +int _pango_utf8_len (const char *str, gint limit); #endif /* __UTILS_H__ */ |