[HarfBuzz] harfbuzz-ng: Branch 'master' - 7 commits
Behdad Esfahbod
behdad at kemper.freedesktop.org
Sat Jun 16 12:40:29 PDT 2012
TODO | 3 +++
configure.ac | 1 +
src/Makefile.am | 23 +++++++++++++++++++++--
src/hb-blob.cc | 2 +-
src/hb-blob.h | 2 +-
src/hb-buffer-private.hh | 4 ++--
src/hb-buffer.h | 6 +++---
src/hb-common.cc | 2 +-
src/hb-common.h | 4 ++--
src/hb-font-private.hh | 6 +++---
src/hb-font.cc | 2 +-
src/hb-font.h | 8 ++++----
src/hb-mutex-private.hh | 9 +++++++++
src/hb-object-private.hh | 32 ++++++++++++++++++++++++++------
src/hb-set-private.hh | 2 +-
src/hb-set.h | 2 +-
src/hb-shape.h | 2 +-
src/hb-unicode-private.hh | 2 +-
src/hb-unicode.h | 2 +-
test/api/hb-test.h | 2 ++
20 files changed, 85 insertions(+), 31 deletions(-)
New commits:
commit 49f8e0cd9a5493ae26857c43bac0711cdf47c80d
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sat Jun 16 15:40:03 2012 -0400
GStaticMutex is deprecated
diff --git a/src/hb-mutex-private.hh b/src/hb-mutex-private.hh
index f9bd679..8efd27e 100644
--- a/src/hb-mutex-private.hh
+++ b/src/hb-mutex-private.hh
@@ -67,12 +67,21 @@ typedef pthread_mutex_t hb_mutex_impl_t;
#elif !defined(HB_NO_MT) && defined(HAVE_GLIB)
#include <glib.h>
+#if !GLIB_CHECK_VERSION(2,32,0)
typedef GStaticMutex hb_mutex_impl_t;
#define HB_MUTEX_IMPL_INIT G_STATIC_MUTEX_INIT
#define hb_mutex_impl_init(M) g_static_mutex_init (M)
#define hb_mutex_impl_lock(M) g_static_mutex_lock (M)
#define hb_mutex_impl_unlock(M) g_static_mutex_unlock (M)
#define hb_mutex_impl_finish(M) g_static_mutex_free (M)
+#else
+typedef GMutex hb_mutex_impl_t;
+#define HB_MUTEX_IMPL_INIT {0}
+#define hb_mutex_impl_init(M) g_mutex_init (M)
+#define hb_mutex_impl_lock(M) g_mutex_lock (M)
+#define hb_mutex_impl_unlock(M) g_mutex_unlock (M)
+#define hb_mutex_impl_finish(M) g_mutex_clear (M)
+#endif
#elif !defined(HB_NO_MT) && defined(HAVE_INTEL_ATOMIC_PRIMITIVES)
commit 5e113a4b7921ced6af2d53460a7a2f1d0185c02a
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sat Jun 16 15:26:13 2012 -0400
g_thread_init() is deprecated
diff --git a/test/api/hb-test.h b/test/api/hb-test.h
index f36d53b..d569757 100644
--- a/test/api/hb-test.h
+++ b/test/api/hb-test.h
@@ -75,7 +75,9 @@ srcdir (void)
static inline void
hb_test_init (int *argc, char ***argv)
{
+#if !GLIB_CHECK_VERSION(2,32,0)
g_thread_init (NULL);
+#endif
g_test_init (argc, argv, NULL);
}
commit 1bc1cb3603167f5da309336f7018c8b0608ac104
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sat Jun 16 15:21:55 2012 -0400
Make source more digestable for gobject-introspection
diff --git a/src/hb-blob.cc b/src/hb-blob.cc
index 3cc2d9d..b6e696b 100644
--- a/src/hb-blob.cc
+++ b/src/hb-blob.cc
@@ -46,7 +46,7 @@
#endif
-struct _hb_blob_t {
+struct hb_blob_t {
hb_object_header_t header;
ASSERT_POD ();
diff --git a/src/hb-blob.h b/src/hb-blob.h
index 360310b..1a93baa 100644
--- a/src/hb-blob.h
+++ b/src/hb-blob.h
@@ -43,7 +43,7 @@ typedef enum {
HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE
} hb_memory_mode_t;
-typedef struct _hb_blob_t hb_blob_t;
+typedef struct hb_blob_t hb_blob_t;
hb_blob_t *
hb_blob_create (const char *data,
diff --git a/src/hb-buffer-private.hh b/src/hb-buffer-private.hh
index 39b6e5c..9bd80e0 100644
--- a/src/hb-buffer-private.hh
+++ b/src/hb-buffer-private.hh
@@ -40,7 +40,7 @@
ASSERT_STATIC (sizeof (hb_glyph_info_t) == 20);
ASSERT_STATIC (sizeof (hb_glyph_info_t) == sizeof (hb_glyph_position_t));
-typedef struct _hb_segment_properties_t {
+typedef struct hb_segment_properties_t {
hb_direction_t direction;
hb_script_t script;
hb_language_t language;
@@ -48,7 +48,7 @@ typedef struct _hb_segment_properties_t {
} hb_segment_properties_t;
-struct _hb_buffer_t {
+struct hb_buffer_t {
hb_object_header_t header;
ASSERT_POD ();
diff --git a/src/hb-buffer.h b/src/hb-buffer.h
index fe53197..73adc2e 100644
--- a/src/hb-buffer.h
+++ b/src/hb-buffer.h
@@ -40,9 +40,9 @@
HB_BEGIN_DECLS
-typedef struct _hb_buffer_t hb_buffer_t;
+typedef struct hb_buffer_t hb_buffer_t;
-typedef struct _hb_glyph_info_t {
+typedef struct hb_glyph_info_t {
hb_codepoint_t codepoint;
hb_mask_t mask;
uint32_t cluster;
@@ -52,7 +52,7 @@ typedef struct _hb_glyph_info_t {
hb_var_int_t var2;
} hb_glyph_info_t;
-typedef struct _hb_glyph_position_t {
+typedef struct hb_glyph_position_t {
hb_position_t x_advance;
hb_position_t y_advance;
hb_position_t x_offset;
diff --git a/src/hb-common.cc b/src/hb-common.cc
index 331d255..baf5977 100644
--- a/src/hb-common.cc
+++ b/src/hb-common.cc
@@ -98,7 +98,7 @@ hb_direction_to_string (hb_direction_t direction)
/* hb_language_t */
-struct _hb_language_t {
+struct hb_language_impl_t {
const char s[1];
};
diff --git a/src/hb-common.h b/src/hb-common.h
index 562b04c..78bc43c 100644
--- a/src/hb-common.h
+++ b/src/hb-common.h
@@ -124,7 +124,7 @@ hb_direction_to_string (hb_direction_t direction);
/* hb_language_t */
-typedef struct _hb_language_t *hb_language_t;
+typedef struct hb_language_impl_t *hb_language_t;
/* len=-1 means str is NUL-terminated */
hb_language_t
@@ -333,7 +333,7 @@ hb_script_get_horizontal_direction (hb_script_t script);
/* User data */
-typedef struct _hb_user_data_key_t {
+typedef struct hb_user_data_key_t {
/*< private >*/
char unused;
} hb_user_data_key_t;
diff --git a/src/hb-font-private.hh b/src/hb-font-private.hh
index 91a4304..2f74cfa 100644
--- a/src/hb-font-private.hh
+++ b/src/hb-font-private.hh
@@ -54,7 +54,7 @@
HB_FONT_FUNC_IMPLEMENT (glyph_from_name) \
/* ^--- Add new callbacks here */
-struct _hb_font_funcs_t {
+struct hb_font_funcs_t {
hb_object_header_t header;
ASSERT_POD ();
@@ -86,7 +86,7 @@ struct _hb_font_funcs_t {
* hb_face_t
*/
-struct _hb_face_t {
+struct hb_face_t {
hb_object_header_t header;
ASSERT_POD ();
@@ -107,7 +107,7 @@ struct _hb_face_t {
* hb_font_t
*/
-struct _hb_font_t {
+struct hb_font_t {
hb_object_header_t header;
ASSERT_POD ();
diff --git a/src/hb-font.cc b/src/hb-font.cc
index 109caff..7c62fbe 100644
--- a/src/hb-font.cc
+++ b/src/hb-font.cc
@@ -619,7 +619,7 @@ hb_face_create_for_tables (hb_reference_table_func_t reference_table,
}
-typedef struct _hb_face_for_data_closure_t {
+typedef struct hb_face_for_data_closure_t {
hb_blob_t *blob;
unsigned int index;
} hb_face_for_data_closure_t;
diff --git a/src/hb-font.h b/src/hb-font.h
index b98759b..ae4fc9b 100644
--- a/src/hb-font.h
+++ b/src/hb-font.h
@@ -37,8 +37,8 @@
HB_BEGIN_DECLS
-typedef struct _hb_face_t hb_face_t;
-typedef struct _hb_font_t hb_font_t;
+typedef struct hb_face_t hb_face_t;
+typedef struct hb_font_t hb_font_t;
/*
* hb_face_t
@@ -110,7 +110,7 @@ hb_face_get_upem (hb_face_t *face);
* hb_font_funcs_t
*/
-typedef struct _hb_font_funcs_t hb_font_funcs_t;
+typedef struct hb_font_funcs_t hb_font_funcs_t;
hb_font_funcs_t *
hb_font_funcs_create (void);
@@ -145,7 +145,7 @@ hb_font_funcs_is_immutable (hb_font_funcs_t *ffuncs);
/* funcs */
-typedef struct _hb_glyph_extents_t
+typedef struct hb_glyph_extents_t
{
hb_position_t x_bearing;
hb_position_t y_bearing;
diff --git a/src/hb-set-private.hh b/src/hb-set-private.hh
index 7f478e4..3b3f7fe 100644
--- a/src/hb-set-private.hh
+++ b/src/hb-set-private.hh
@@ -34,7 +34,7 @@
/* TODO Make this faster and memmory efficient. */
-struct _hb_set_t
+struct hb_set_t
{
hb_object_header_t header;
ASSERT_POD ();
diff --git a/src/hb-set.h b/src/hb-set.h
index 9f849cf..1838889 100644
--- a/src/hb-set.h
+++ b/src/hb-set.h
@@ -36,7 +36,7 @@
HB_BEGIN_DECLS
-typedef struct _hb_set_t hb_set_t;
+typedef struct hb_set_t hb_set_t;
hb_set_t *
diff --git a/src/hb-shape.h b/src/hb-shape.h
index 1a0d6cf..84bf3e7 100644
--- a/src/hb-shape.h
+++ b/src/hb-shape.h
@@ -38,7 +38,7 @@
HB_BEGIN_DECLS
-typedef struct _hb_feature_t {
+typedef struct hb_feature_t {
hb_tag_t tag;
uint32_t value;
unsigned int start;
diff --git a/src/hb-unicode-private.hh b/src/hb-unicode-private.hh
index 8a34174..eaf151a 100644
--- a/src/hb-unicode-private.hh
+++ b/src/hb-unicode-private.hh
@@ -61,7 +61,7 @@
HB_UNICODE_FUNC_IMPLEMENT (hb_script_t, script) \
/* ^--- Add new simple callbacks here */
-struct _hb_unicode_funcs_t {
+struct hb_unicode_funcs_t {
hb_object_header_t header;
ASSERT_POD ();
diff --git a/src/hb-unicode.h b/src/hb-unicode.h
index 205e4c7..808c6e1 100644
--- a/src/hb-unicode.h
+++ b/src/hb-unicode.h
@@ -44,7 +44,7 @@ HB_BEGIN_DECLS
* hb_unicode_funcs_t
*/
-typedef struct _hb_unicode_funcs_t hb_unicode_funcs_t;
+typedef struct hb_unicode_funcs_t hb_unicode_funcs_t;
/*
commit 84d781e54cc75c81a06ba43fd7b1a74b8c7d9591
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sat Jun 16 15:21:41 2012 -0400
Flesh out gobject-introspection stuff a bit
diff --git a/configure.ac b/configure.ac
index 2fb058f..8911e25 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,6 +49,7 @@ m4_define([hb_libtool_current],
HB_LIBTOOL_VERSION_INFO=hb_libtool_current:hb_libtool_revision:hb_libtool_age
AC_SUBST(HB_LIBTOOL_VERSION_INFO)
+GOBJECT_INTROSPECTION_CHECK([0.9.0])
dnl GTK_DOC_CHECK([1.15],[--flavour no-tmpl])
# Functions and headers
diff --git a/src/Makefile.am b/src/Makefile.am
index 98c6cd5..2326b40 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -6,6 +6,7 @@ EXTRA_DIST =
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
+DISTCHECK_CONFIGURE_FLAGS = --enable-introspection
# The following warning options are useful for debugging: -Wpadded -Wcast-align
#AM_CXXFLAGS =
@@ -208,8 +209,26 @@ TESTS_ENVIRONMENT = \
HBHEADERS="$(HBHEADERS)" \
$(NULL)
-scan:
- g-ir-scanner $(HBCFLAGS) $(HBHEADERS) -n hb --strip-prefix=hb --library libharfbuzz.la
+-include $(INTROSPECTION_MAKEFILE)
+INTROSPECTION_GIRS = hb-1.0.gir
+INTROSPECTION_SCANNER_ARGS = -I$(srcdir) -n hb --identifier-prefix=hb_
+INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
+if HAVE_INTROSPECTION
+
+hb-1.0.gir: libharfbuzz.la
+hb_1_0_gir_INCLUDES = GObject-2.0
+hb_1_0_gir_CFLAGS = $(INCLUDES) $(HBCFLAGS) -DHB_H -DHB_H_IN -DHB_OT_H -DHB_OT_H_IN
+hb_1_0_gir_LIBS = libharfbuzz.la
+hb_1_0_gir_FILES = $(HBHEADERS)
+
+girdir = $(datadir)/gir-1.0
+gir_DATA = $(INTROSPECTION_GIRS)
+
+typelibdir = $(libdir)/girepository-1.0
+typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
+
+CLEANFILES += $(gir_DATA) $(typelib_DATA)
+endif
-include $(top_srcdir)/git.mk
commit 49ee12ccd00870d4976339dc546c74eaf08a8fc0
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sat Jun 16 14:53:51 2012 -0400
Add TODO item
diff --git a/TODO b/TODO
index b9c2600..7b02c55 100644
--- a/TODO
+++ b/TODO
@@ -85,6 +85,7 @@ API additions
hb-view / hb-shape enhancements:
===============================
+- --output-format should list available formats.
- Add --width, --height, --auto-size, --align, etc?
- Add XML and JSON formats to hb-shape
- --features="init=medi=isol=fina=0"
commit d3c8115d1ad09404b8970b98e6b5ab74510a35f6
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Tue Jun 12 09:52:57 2012 -0400
Minor
diff --git a/TODO b/TODO
index c171c94..b9c2600 100644
--- a/TODO
+++ b/TODO
@@ -51,6 +51,8 @@ API issues to fix before 1.0:
API additions
=============
+- Language to/from script.
+
- Buffer (de)serialize API ala hb-shape?
- Move feature parsing from util into the library
commit 2cf301968cb8c1150cead0ab909457cdd3ee2d01
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Sat Jun 9 14:58:01 2012 -0400
Add hb_object_lock/unlock()
diff --git a/src/hb-object-private.hh b/src/hb-object-private.hh
index e7f6eda..c48f242 100644
--- a/src/hb-object-private.hh
+++ b/src/hb-object-private.hh
@@ -103,7 +103,7 @@ struct hb_user_data_array_t
struct hb_object_header_t
{
hb_reference_count_t ref_count;
- hb_mutex_t lock;
+ hb_mutex_t mutex;
hb_user_data_array_t user_data;
#define HB_OBJECT_HEADER_STATIC {HB_REFERENCE_COUNT_INVALID, HB_MUTEX_INIT, HB_USER_DATA_ARRAY_INIT}
@@ -119,7 +119,7 @@ struct hb_object_header_t
inline void init (void) {
ref_count.init (1);
- lock.init ();
+ mutex.init ();
user_data.init ();
}
@@ -140,12 +140,20 @@ struct hb_object_header_t
return false;
ref_count.finish (); /* Do this before user_data */
- user_data.finish (lock);
- lock.finish ();
+ user_data.finish (mutex);
+ mutex.finish ();
return true;
}
+ inline void lock (void) {
+ mutex.lock ();
+ }
+
+ inline void unlock (void) {
+ mutex.unlock ();
+ }
+
inline bool set_user_data (hb_user_data_key_t *key,
void * data,
hb_destroy_func_t destroy_func,
@@ -153,14 +161,14 @@ struct hb_object_header_t
if (unlikely (!this || this->is_inert ()))
return false;
- return user_data.set (key, data, destroy_func, replace, lock);
+ return user_data.set (key, data, destroy_func, replace, mutex);
}
inline void *get_user_data (hb_user_data_key_t *key) {
if (unlikely (!this || this->is_inert ()))
return NULL;
- return user_data.get (key, lock);
+ return user_data.get (key, mutex);
}
inline void trace (const char *function) const {
@@ -211,6 +219,18 @@ static inline bool hb_object_destroy (Type *obj)
return obj->header.destroy ();
}
template <typename Type>
+static inline void hb_object_lock (Type *obj)
+{
+ hb_object_trace (obj, HB_FUNC);
+ return obj->header.lock ();
+}
+template <typename Type>
+static inline void hb_object_unlock (Type *obj)
+{
+ hb_object_trace (obj, HB_FUNC);
+ return obj->header.unlock ();
+}
+template <typename Type>
static inline bool hb_object_set_user_data (Type *obj,
hb_user_data_key_t *key,
void * data,
More information about the HarfBuzz
mailing list