summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2007-10-25 23:37:11 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2007-10-25 23:37:11 +0000
commit481f02efdb53542ce6fb1f5821cb6a4cfc83abee (patch)
tree0b88eadb7adbdcbb00c365f926d11c47e7a97c51 /pango
parent18247866c5843087f0e32c871449400f0d74b7f4 (diff)
downloadpango-481f02efdb53542ce6fb1f5821cb6a4cfc83abee.tar.gz
Even more cleanup and more type renames.
2007-10-25 Behdad Esfahbod <behdad@gnome.org> * pango/opentype/*: Even more cleanup and more type renames. svn path=/trunk/; revision=2478
Diffstat (limited to 'pango')
-rw-r--r--pango/opentype/harfbuzz-buffer.h3
-rw-r--r--pango/opentype/harfbuzz-global.h6
-rw-r--r--pango/opentype/harfbuzz-impl.c16
-rw-r--r--pango/opentype/harfbuzz-impl.h22
-rw-r--r--pango/opentype/harfbuzz-open.h3
-rw-r--r--pango/pango-ot-buffer.c2
-rw-r--r--pango/pango-ot-info.c26
-rw-r--r--pango/pango-ot-ruleset.c12
8 files changed, 46 insertions, 44 deletions
diff --git a/pango/opentype/harfbuzz-buffer.h b/pango/opentype/harfbuzz-buffer.h
index 701d083e..e659ce33 100644
--- a/pango/opentype/harfbuzz-buffer.h
+++ b/pango/opentype/harfbuzz-buffer.h
@@ -14,8 +14,7 @@
#ifndef HARFBUZZ_BUFFER_H
#define HARFBUZZ_BUFFER_H
-#include <ft2build.h>
-#include FT_FREETYPE_H
+#include "harfbuzz-global.h"
HB_BEGIN_HEADER
diff --git a/pango/opentype/harfbuzz-global.h b/pango/opentype/harfbuzz-global.h
index 9aed8ca8..bb35db07 100644
--- a/pango/opentype/harfbuzz-global.h
+++ b/pango/opentype/harfbuzz-global.h
@@ -13,6 +13,9 @@
#ifndef HARFBUZZ_GLOBAL_H
#define HARFBUZZ_GLOBAL_H
+#include <ft2build.h>
+#include FT_FREETYPE_H
+
#ifdef __cplusplus
#define HB_BEGIN_HEADER extern "C" {
#define HB_END_HEADER }
@@ -23,11 +26,14 @@
HB_BEGIN_HEADER
+typedef unsigned char HB_Byte;
+typedef signed char HB_Char;
typedef unsigned short HB_UShort;
typedef signed short HB_Short;
typedef unsigned int HB_UInt;
typedef signed int HB_Int;
typedef int HB_Bool;
+typedef void *HB_Pointer;
typedef enum {
diff --git a/pango/opentype/harfbuzz-impl.c b/pango/opentype/harfbuzz-impl.c
index 1d2b6990..fcdbc33a 100644
--- a/pango/opentype/harfbuzz-impl.c
+++ b/pango/opentype/harfbuzz-impl.c
@@ -25,12 +25,12 @@ _hb_log( const char* format, ... )
#endif
/* only used internally */
-static FT_Pointer
+static HB_Pointer
_hb_qalloc( HB_UInt size,
HB_Error *perror )
{
HB_Error error = 0;
- FT_Pointer block = NULL;
+ HB_Pointer block = NULL;
if ( size > 0 )
{
@@ -47,12 +47,12 @@ _hb_qalloc( HB_UInt size,
#define QALLOC(ptr,size) ( (ptr) = _hb_qalloc( (size), &error ), error != 0 )
-HB_INTERNAL FT_Pointer
+HB_INTERNAL HB_Pointer
_hb_alloc( HB_UInt size,
HB_Error *perror )
{
HB_Error error = 0;
- FT_Pointer block = NULL;
+ HB_Pointer block = NULL;
if ( size > 0 )
{
@@ -68,12 +68,12 @@ _hb_alloc( HB_UInt size,
}
-HB_INTERNAL FT_Pointer
-_hb_realloc( FT_Pointer block,
+HB_INTERNAL HB_Pointer
+_hb_realloc( HB_Pointer block,
HB_UInt new_size,
HB_Error *perror )
{
- FT_Pointer block2 = NULL;
+ HB_Pointer block2 = NULL;
HB_Error error = 0;
block2 = realloc( block, new_size );
@@ -89,7 +89,7 @@ _hb_realloc( FT_Pointer block,
HB_INTERNAL void
-_hb_free( FT_Pointer block )
+_hb_free( HB_Pointer block )
{
if ( block )
free( block );
diff --git a/pango/opentype/harfbuzz-impl.h b/pango/opentype/harfbuzz-impl.h
index 3e7ac1c0..69c9ea90 100644
--- a/pango/opentype/harfbuzz-impl.h
+++ b/pango/opentype/harfbuzz-impl.h
@@ -81,18 +81,18 @@ typedef FT_Stream HB_Stream;
#define GET_Byte() (*stream->cursor++)
#define GET_Short() (stream->cursor += 2, (HB_Short)( \
- (*(((FT_Byte*)stream->cursor)-2) << 8) | \
- *(((FT_Byte*)stream->cursor)-1) \
+ (*(((HB_Byte*)stream->cursor)-2) << 8) | \
+ *(((HB_Byte*)stream->cursor)-1) \
))
#define GET_Long() (stream->cursor += 4, (HB_Int)( \
- (*(((FT_Byte*)stream->cursor)-4) << 24) | \
- (*(((FT_Byte*)stream->cursor)-3) << 16) | \
- (*(((FT_Byte*)stream->cursor)-2) << 8) | \
- *(((FT_Byte*)stream->cursor)-1) \
+ (*(((HB_Byte*)stream->cursor)-4) << 24) | \
+ (*(((HB_Byte*)stream->cursor)-3) << 16) | \
+ (*(((HB_Byte*)stream->cursor)-2) << 8) | \
+ *(((HB_Byte*)stream->cursor)-1) \
))
-#define GET_Char() ((FT_Char)GET_Byte())
+#define GET_Char() ((HB_Char)GET_Byte())
#define GET_UShort() ((HB_UShort)GET_Short())
#define GET_ULong() ((HB_UInt)GET_Long())
#define GET_Tag4() GET_ULong()
@@ -143,17 +143,17 @@ _hb_face_goto_table( FT_Face face,
#define ERR(err) _hb_err (err)
-HB_INTERNAL FT_Pointer
+HB_INTERNAL HB_Pointer
_hb_alloc( HB_UInt size,
HB_Error *perror_ );
-HB_INTERNAL FT_Pointer
-_hb_realloc( FT_Pointer block,
+HB_INTERNAL HB_Pointer
+_hb_realloc( HB_Pointer block,
HB_UInt new_size,
HB_Error *perror_ );
HB_INTERNAL void
-_hb_free( FT_Pointer block );
+_hb_free( HB_Pointer block );
/* helper func to set a breakpoint on */
diff --git a/pango/opentype/harfbuzz-open.h b/pango/opentype/harfbuzz-open.h
index d7cc9f01..46ea68fc 100644
--- a/pango/opentype/harfbuzz-open.h
+++ b/pango/opentype/harfbuzz-open.h
@@ -13,9 +13,6 @@
#ifndef HARFBUZZ_OPEN_H
#define HARFBUZZ_OPEN_H
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
#include "harfbuzz-global.h"
HB_BEGIN_HEADER
diff --git a/pango/pango-ot-buffer.c b/pango/pango-ot-buffer.c
index 7feb10f0..3c47d01a 100644
--- a/pango/pango-ot-buffer.c
+++ b/pango/pango-ot-buffer.c
@@ -362,7 +362,7 @@ pango_ot_buffer_output (const PangoOTBuffer *buffer,
{
PangoRectangle logical_rect;
- FT_UShort property;
+ HB_UShort property;
if (buffer->zero_width_marks &&
gdef &&
diff --git a/pango/pango-ot-info.c b/pango/pango-ot-info.c
index d6cb0ab2..50792bad 100644
--- a/pango/pango-ot-info.c
+++ b/pango/pango-ot-info.c
@@ -148,8 +148,8 @@ is_truetype (FT_Face face)
typedef struct _GlyphInfo GlyphInfo;
struct _GlyphInfo {
- FT_UShort glyph;
- FT_UShort class;
+ HB_UShort glyph;
+ HB_UShort class;
};
static int
@@ -168,7 +168,7 @@ compare_glyph_info (gconstpointer a,
*/
static gboolean
get_glyph_class (gunichar charcode,
- FT_UShort *class)
+ HB_UShort *class)
{
/* For characters mapped into the Arabic Presentation forms, using properties
* derived as we apply GSUB substitutions will be more reliable
@@ -217,10 +217,10 @@ static void
synthesize_class_def (PangoOTInfo *info)
{
GArray *glyph_infos;
- FT_UShort *glyph_indices;
- FT_UShort *classes;
- FT_ULong charcode;
- FT_UInt glyph;
+ HB_UShort *glyph_indices;
+ HB_UShort *classes;
+ HB_UInt charcode;
+ HB_UInt glyph;
unsigned int i, j;
FT_CharMap old_charmap;
@@ -254,8 +254,8 @@ synthesize_class_def (PangoOTInfo *info)
*/
g_array_sort (glyph_infos, compare_glyph_info);
- glyph_indices = g_new (FT_UShort, glyph_infos->len);
- classes = g_new (FT_UShort, glyph_infos->len);
+ glyph_indices = g_new (HB_UShort, glyph_infos->len);
+ classes = g_new (HB_UShort, glyph_infos->len);
for (i = 0, j = 0; i < glyph_infos->len; i++)
{
@@ -459,7 +459,7 @@ pango_ot_info_find_script (PangoOTInfo *info,
}
/* try with 'dflt'; MS site has had typos and many fonts use it now :( */
- script_tag = FT_MAKE_TAG ('d', 'f', 'l', 't');
+ script_tag = PANGO_OT_TAG_MAKE ('d', 'f', 'l', 't');
for (i=0; i < script_list->ScriptCount; i++)
{
@@ -538,7 +538,7 @@ pango_ot_info_find_language (PangoOTInfo *info,
}
/* try with 'dflt'; MS site has had typos and many fonts use it now :( */
- language_tag = FT_MAKE_TAG ('d', 'f', 'l', 't');
+ language_tag = PANGO_OT_TAG_MAKE ('d', 'f', 'l', 't');
for (i = 0; i < script->LangSysCount; i++)
{
@@ -623,7 +623,7 @@ pango_ot_info_find_feature (PangoOTInfo *info,
for (i = 0; i < lang_sys->FeatureCount; i++)
{
- FT_UShort index = lang_sys->FeatureIndex[i];
+ HB_UShort index = lang_sys->FeatureIndex[i];
if (feature_list->FeatureRecord[index].FeatureTag == feature_tag)
{
@@ -778,7 +778,7 @@ pango_ot_info_list_features (PangoOTInfo *info,
for (i = 0; i < lang_sys->FeatureCount; i++)
{
- FT_UShort index = lang_sys->FeatureIndex[i];
+ HB_UShort index = lang_sys->FeatureIndex[i];
result[i] = feature_list->FeatureRecord[index].FeatureTag;
}
diff --git a/pango/pango-ot-ruleset.c b/pango/pango-ot-ruleset.c
index ddd92c3f..f2686e39 100644
--- a/pango/pango-ot-ruleset.c
+++ b/pango/pango-ot-ruleset.c
@@ -29,7 +29,7 @@ typedef struct _PangoOTRule PangoOTRule;
struct _PangoOTRule
{
gulong property_bit;
- FT_UShort feature_index;
+ HB_UShort feature_index;
guint table_type : 1;
};
@@ -414,7 +414,7 @@ pango_ot_ruleset_maybe_add_feature (PangoOTRuleset *ruleset,
*
* This is a convenience function that
* for each feature in the feature map array @features
- * converts the feature name to a #PangoOTTag feature tag using FT_MAKE_TAG()
+ * converts the feature name to a #PangoOTTag feature tag using PANGO_OT_TAG_MAKE()
* and calls pango_ot_ruleset_maybe_add_feature() on it.
*
* Return value: The number of features in @features that were found
@@ -435,10 +435,10 @@ pango_ot_ruleset_maybe_add_features (PangoOTRuleset *ruleset,
for (i = 0; i < n_features; i++)
{
- PangoOTTag feature_tag = FT_MAKE_TAG (features[i].feature_name[0],
- features[i].feature_name[1],
- features[i].feature_name[2],
- features[i].feature_name[3]);
+ PangoOTTag feature_tag = PANGO_OT_TAG_MAKE (features[i].feature_name[0],
+ features[i].feature_name[1],
+ features[i].feature_name[2],
+ features[i].feature_name[3]);
n_found_features += pango_ot_ruleset_maybe_add_feature (ruleset,
table_type,