[HarfBuzz] harfbuzz: Branch 'master' - 3 commits
Behdad Esfahbod
behdad at kemper.freedesktop.org
Thu Sep 5 16:35:26 PDT 2013
docs/reference/Makefile.am | 3
src/Makefile.am | 3
src/hb-blob.cc | 160 ++++++++++++++++++++++++++++++++++++++++++++-
src/hb-buffer.cc | 78 +++++++++++++++++++++
src/hb-version.h.in | 17 ++++
5 files changed, 253 insertions(+), 8 deletions(-)
New commits:
commit ae9dc717d37d58efdd3fabbe4a9c3c2bf9dc3568
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Thu Sep 5 16:40:37 2013 -0400
[gtk-doc] Pass source files to gtk-doc
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
index 7817648..ffbcb70 100644
--- a/docs/reference/Makefile.am
+++ b/docs/reference/Makefile.am
@@ -32,7 +32,7 @@ SCAN_OPTIONS=--rebuild-types --deprecated-guards="HB_DISABLE_DEPRECATED"
# Extra options to supply to gtkdoc-mkdb.
# e.g. MKDB_OPTIONS=--xml-mode --output-format=xml
-MKDB_OPTIONS=--xml-mode --output-format=xml
+MKDB_OPTIONS=--source-suffixes=h,cc --xml-mode --output-format=xml
# Extra options to supply to gtkdoc-mktmpl
# e.g. MKTMPL_OPTIONS=--only-section-tmpl
@@ -60,7 +60,6 @@ EXTRA_HFILES=$(top_builddir)/src/hb-version.h
IGNORE_HFILES=`cd $(top_srcdir)/src; find . -path './hb-*/*.h' | sed 's@^.*/@@'`
if HAVE_GOBJECT
else
-# XXX Prevent "make dist"
IGNORE_HFILES+=hb-gobject.h hb-gobject-enums.h hb-gobject-structs.h
endif
commit 5f512017ba615ba6ac8e5da2ea0c57a72db2c26b
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Wed Sep 4 18:28:39 2013 -0400
[docs] Document a few symbols
diff --git a/src/hb-blob.cc b/src/hb-blob.cc
index dfd134b..b312546 100644
--- a/src/hb-blob.cc
+++ b/src/hb-blob.cc
@@ -76,6 +76,22 @@ _hb_blob_destroy_user_data (hb_blob_t *blob)
}
}
+/**
+ * hb_blob_create:
+ * @data: (array length=length) (allow-none): Pointer to blob data.
+ * @length: Length of @data in bytes.
+ * @mode: Memory mode for @data.
+ * @user_data: (allow-none): Data parameter to pass to @destroy.
+ * @destroy: (allow-none) (closure user_data): Callback to call when @data is not needed anymore.
+ *
+ * Creates a new "blob" object wrapping @data. The @mode parameter is used
+ * to negotiate ownership and lifecycle of @data.
+ *
+ * Returns: New blob, or the empty blob if something failed or if @length is
+ * zero. Destroy with hb_blob_destroy().
+ *
+ * Since: 1.0
+ **/
hb_blob_t *
hb_blob_create (const char *data,
unsigned int length,
@@ -109,6 +125,26 @@ hb_blob_create (const char *data,
return blob;
}
+/**
+ * hb_blob_create_sub_blob:
+ * @parent: Parent blob.
+ * @offset: Start offset of sub-blob within @parent, in bytes.
+ * @length: Length of sub-blob.
+ *
+ * Returns a blob that represents a range of bytes in @parent. The new
+ * blob is always created with %HB_MEMORY_MODE_READONLY, meaning that it
+ * will never modify data in the parent blob. The parent data is not
+ * expected to be modified, and will result in undefined behavior if it
+ * is.
+ *
+ * Makes @parent immutable.
+ *
+ * Returns: New blob, or the empty blob if something failed or if @length is
+ * zero or @offset is beyond the end of @parent's data. Destroy with
+ * hb_blob_destroy().
+ *
+ * Since: 1.0
+ **/
hb_blob_t *
hb_blob_create_sub_blob (hb_blob_t *parent,
unsigned int offset,
@@ -130,6 +166,17 @@ hb_blob_create_sub_blob (hb_blob_t *parent,
return blob;
}
+/**
+ * hb_blob_get_empty:
+ *
+ * Returns the singleton empty blob.
+ *
+ * See TODO:link object types for more information.
+ *
+ * Returns: The empty blob.
+ *
+ * Since: 1.0
+ **/
hb_blob_t *
hb_blob_get_empty (void)
{
@@ -149,12 +196,36 @@ hb_blob_get_empty (void)
return const_cast<hb_blob_t *> (&_hb_blob_nil);
}
+/**
+ * hb_blob_reference:
+ * @blob: a blob.
+ *
+ * Increases the reference count on @blob.
+ *
+ * See TODO:link object types for more information.
+ *
+ * Returns: @blob.
+ *
+ * Since: 1.0
+ **/
hb_blob_t *
hb_blob_reference (hb_blob_t *blob)
{
return hb_object_reference (blob);
}
+/**
+ * hb_blob_destroy:
+ * @blob: a blob.
+ *
+ * Descreases the reference count on @blob, and if it reaches zero, destroys
+ * @blob, freeing all memory, possibly calling the destroy-callback the blob
+ * was created for if it has not been called already.
+ *
+ * See TODO:link object types for more information.
+ *
+ * Since: 1.0
+ **/
void
hb_blob_destroy (hb_blob_t *blob)
{
@@ -165,6 +236,22 @@ hb_blob_destroy (hb_blob_t *blob)
free (blob);
}
+/**
+ * hb_blob_set_user_data:
+ * @blob: a blob.
+ * @key: key for data to set.
+ * @data: data to set.
+ * @destroy: callback to call when @data is not needed anymore.
+ * @replace: whether to replace an existing data with the same key.
+ *
+ * Attaches a piece of data to the object.
+ *
+ * See TODO:link object types for more information.
+ *
+ * Returns: TODO
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_blob_set_user_data (hb_blob_t *blob,
hb_user_data_key_t *key,
@@ -175,6 +262,19 @@ hb_blob_set_user_data (hb_blob_t *blob,
return hb_object_set_user_data (blob, key, data, destroy, replace);
}
+/**
+ * hb_blob_get_user_data:
+ * @blob: a blob.
+ * @key: key for data to get.
+ *
+ * TODO
+ *
+ * See TODO:link object types for more information.
+ *
+ * Returns: (transfer none): data, or TODO
+ *
+ * Since: 1.0
+ **/
void *
hb_blob_get_user_data (hb_blob_t *blob,
hb_user_data_key_t *key)
@@ -183,6 +283,16 @@ hb_blob_get_user_data (hb_blob_t *blob,
}
+/**
+ * hb_blob_make_immutable:
+ * @blob: a blob.
+ *
+ * TODO
+ *
+ * See TODO:link object types for more information.
+ *
+ * Since: 1.0
+ **/
void
hb_blob_make_immutable (hb_blob_t *blob)
{
@@ -192,6 +302,18 @@ hb_blob_make_immutable (hb_blob_t *blob)
blob->immutable = true;
}
+/**
+ * hb_blob_is_immutable:
+ * @blob: a blob.
+ *
+ * TODO
+ *
+ * See TODO:link object types for more information.
+ *
+ * Returns: TODO
+ *
+ * Since: 1.0
+ **/
hb_bool_t
hb_blob_is_immutable (hb_blob_t *blob)
{
@@ -199,12 +321,33 @@ hb_blob_is_immutable (hb_blob_t *blob)
}
+/**
+ * hb_blob_get_length:
+ * @blob: a blob.
+ *
+ * TODO
+ *
+ * Returns: the length of blob data in bytes.
+ *
+ * Since: 1.0
+ **/
unsigned int
hb_blob_get_length (hb_blob_t *blob)
{
return blob->length;
}
+/**
+ * hb_blob_get_data:
+ * @blob: a blob.
+ * @length: (out) TODO
+ *
+ * TODO
+ *
+ * Returns: (transfer none): TODO
+ *
+ * Since: 1.0
+ **/
const char *
hb_blob_get_data (hb_blob_t *blob, unsigned int *length)
{
@@ -214,6 +357,21 @@ hb_blob_get_data (hb_blob_t *blob, unsigned int *length)
return blob->data;
}
+/**
+ * hb_blob_get_data_writable:
+ * @blob: a blob.
+ * @length: (out): output length of the writable data.
+ *
+ * Tries to make blob data writable (possibly copying it) and
+ * return pointer to data.
+ *
+ * Fails if blob has been made immutable, or if memory allocation
+ * fails.
+ *
+ * Returns: (transfer none): Writable blob data, or %NULL if failed.
+ *
+ * Since: 1.0
+ **/
char *
hb_blob_get_data_writable (hb_blob_t *blob, unsigned int *length)
{
@@ -324,5 +482,3 @@ _try_writable (hb_blob_t *blob)
return true;
}
-
-
diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc
index 340bd53..495e702 100644
--- a/src/hb-buffer.cc
+++ b/src/hb-buffer.cc
@@ -853,13 +853,34 @@ hb_buffer_set_length (hb_buffer_t *buffer,
return true;
}
+/**
+ * hb_buffer_get_length:
+ * @buffer: a buffer.
+ *
+ * Returns the number of items in the buffer.
+ *
+ * Return value: buffer length.
+ *
+ * Since: 1.0
+ */
unsigned int
hb_buffer_get_length (hb_buffer_t *buffer)
{
return buffer->len;
}
-/* Return value valid as long as buffer not modified */
+/**
+ * hb_buffer_get_glyph_infos:
+ * @buffer: a buffer.
+ * @length: (out): output array length.
+ *
+ * Returns buffer glyph information array. Returned pointer
+ * is valid as long as buffer contents are not modified.
+ *
+ * Return value: (transfer none) (array length=length): buffer glyph information array.
+ *
+ * Since: 1.0
+ */
hb_glyph_info_t *
hb_buffer_get_glyph_infos (hb_buffer_t *buffer,
unsigned int *length)
@@ -870,7 +891,18 @@ hb_buffer_get_glyph_infos (hb_buffer_t *buffer,
return (hb_glyph_info_t *) buffer->info;
}
-/* Return value valid as long as buffer not modified */
+/**
+ * hb_buffer_get_glyph_positions:
+ * @buffer: a buffer.
+ * @length: (out): output length.
+ *
+ * Returns buffer glyph position array. Returned pointer
+ * is valid as long as buffer contents are not modified.
+ *
+ * Return value: (transfer none) (array length=length): buffer glyph position array.
+ *
+ * Since: 1.0
+ */
hb_glyph_position_t *
hb_buffer_get_glyph_positions (hb_buffer_t *buffer,
unsigned int *length)
@@ -884,18 +916,60 @@ hb_buffer_get_glyph_positions (hb_buffer_t *buffer,
return (hb_glyph_position_t *) buffer->pos;
}
+/**
+ * hb_buffer_reverse:
+ * @buffer: a buffer.
+ *
+ * Reverses buffer contents.
+ *
+ * Since: 1.0
+ */
void
hb_buffer_reverse (hb_buffer_t *buffer)
{
buffer->reverse ();
}
+/**
+ * hb_buffer_reverse_clusters:
+ * @buffer: a buffer.
+ *
+ * Reverses buffer clusters. That is, the buffer contents are
+ * reversed, then each cluster (consecutive items having the
+ * same cluster number) are reversed again.
+ *
+ * Since: 1.0
+ */
void
hb_buffer_reverse_clusters (hb_buffer_t *buffer)
{
buffer->reverse_clusters ();
}
+/**
+ * hb_buffer_guess_segment_properties:
+ * @buffer: a buffer.
+ *
+ * Sets unset buffer segment properties based on buffer Unicode
+ * contents. If buffer is not empty, it must have content type
+ * %HB_BUFFER_CONTENT_TYPE_UNICODE.
+ *
+ * If buffer script is not set (ie. is %HB_SCRIPT_INVALID), it
+ * will be set to the Unicode script of the first character in
+ * the buffer that has a script other than %HB_SCRIPT_COMMON,
+ * %HB_SCRIPT_INHERITED, and %HB_SCRIPT_UNKNOWN.
+ *
+ * Next, if buffer direction is not set (ie. is %HB_DIRECTION_INVALID),
+ * it will be set to the natural horizontal direction of the
+ * buffer script as returned by hb_script_get_horizontal_direction().
+ *
+ * Finally, if buffer language is not set (ie. is %HB_LANGUAGE_INVALID),
+ * it will be set to the process's default language as returned by
+ * hb_language_get_default(). This may change in the future by
+ * taking buffer script into consideration when choosing a language.
+ *
+ * Since: 1.0
+ */
void
hb_buffer_guess_segment_properties (hb_buffer_t *buffer)
{
diff --git a/src/hb-version.h.in b/src/hb-version.h.in
index 43634f9..c7e9d98 100644
--- a/src/hb-version.h.in
+++ b/src/hb-version.h.in
@@ -47,11 +47,28 @@ HB_BEGIN_DECLS
HB_VERSION_MAJOR*10000+HB_VERSION_MINOR*100+HB_VERSION_MICRO)
+/**
+ * hb_version:
+ * @major: (out): Library major version component.
+ * @minor: (out): Library minor version component.
+ * @micro: (out): Library micro version component.
+ *
+ * Returns library version as three integer components.
+ *
+ * Since: 1.0
+ */
void
hb_version (unsigned int *major,
unsigned int *minor,
unsigned int *micro);
+/**
+ * hb_version_string:
+ *
+ * Returns library version as a string with three components.
+ *
+ * Since: 1.0
+ */
const char *
hb_version_string (void);
commit e0dbf99b4497be305d689a528282fd37214e7f1c
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Thu Sep 5 16:00:47 2013 -0400
[introspection] Pass source files to scanner
diff --git a/src/Makefile.am b/src/Makefile.am
index a776822..f5d8cf4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -179,7 +179,6 @@ endif
endif
libharfbuzz_la_SOURCES = $(HBSOURCES) $(HBHEADERS) $(HBNODISTHEADERS)
-nodist_libharfbuzz_la_SOURCES = $(nodist_HBSOURCES)
libharfbuzz_la_CPPFLAGS = $(HBCFLAGS)
libharfbuzz_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(HB_LIBTOOL_VERSION_INFO) $(export_symbols) -no-undefined
libharfbuzz_la_LIBADD = $(HBLIBS)
@@ -263,7 +262,6 @@ GENERATORS = \
gen-arabic-table.py \
gen-indic-table.py \
$(NULL)
-
EXTRA_DIST += $(GENERATORS)
unicode-tables: arabic-table indic-table
@@ -371,6 +369,7 @@ HarfBuzz_0_0_gir_LIBS = \
HarfBuzz_0_0_gir_FILES = \
$(HBHEADERS) \
$(HBNODISTHEADERS) \
+ $(HBSOURCES) \
hb-gobject-enums.h \
hb-gobject-structs.h \
$(NULL)
More information about the HarfBuzz
mailing list