[pango/harfbuzz-ng: 18/57] [HB] Add get_reference_count()
- From: Behdad Esfahbod <behdad src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pango/harfbuzz-ng: 18/57] [HB] Add get_reference_count()
- Date: Tue, 4 Aug 2009 20:02:51 +0000 (UTC)
commit 7f5ea9cb73607efaa77923f43e0636a3b051218c
Author: Behdad Esfahbod <behdad behdad org>
Date: Sat Aug 1 21:36:15 2009 -0400
[HB] Add get_reference_count()
pango/opentype/hb-blob.c | 6 ++++++
pango/opentype/hb-blob.h | 3 +++
pango/opentype/hb-font.c | 24 ++++++++++++++++++++++++
pango/opentype/hb-font.h | 12 ++++++++++++
pango/opentype/hb-object-private.h | 7 +++++++
5 files changed, 52 insertions(+), 0 deletions(-)
---
diff --git a/pango/opentype/hb-blob.c b/pango/opentype/hb-blob.c
index 512bec9..cf9dd53 100644
--- a/pango/opentype/hb-blob.c
+++ b/pango/opentype/hb-blob.c
@@ -95,6 +95,12 @@ hb_blob_reference (hb_blob_t *blob)
HB_OBJECT_DO_REFERENCE (blob);
}
+unsigned int
+hb_blob_get_reference_count (hb_blob_t *blob)
+{
+ HB_OBJECT_DO_GET_REFERENCE_COUNT (blob);
+}
+
void
hb_blob_destroy (hb_blob_t *blob)
{
diff --git a/pango/opentype/hb-blob.h b/pango/opentype/hb-blob.h
index 1066821..21aa365 100644
--- a/pango/opentype/hb-blob.h
+++ b/pango/opentype/hb-blob.h
@@ -49,6 +49,9 @@ hb_blob_create (const char *data,
hb_blob_t *
hb_blob_reference (hb_blob_t *blob);
+unsigned int
+hb_blob_get_reference_count (hb_blob_t *blob);
+
void
hb_blob_destroy (hb_blob_t *blob);
diff --git a/pango/opentype/hb-font.c b/pango/opentype/hb-font.c
index b2cf440..078a3bc 100644
--- a/pango/opentype/hb-font.c
+++ b/pango/opentype/hb-font.c
@@ -62,6 +62,12 @@ hb_font_callbacks_reference (hb_font_callbacks_t *fcallbacks)
HB_OBJECT_DO_REFERENCE (fcallbacks);
}
+unsigned int
+hb_font_callbacks_get_reference_count (hb_font_callbacks_t *fcallbacks)
+{
+ HB_OBJECT_DO_GET_REFERENCE_COUNT (fcallbacks);
+}
+
void
hb_font_callbacks_destroy (hb_font_callbacks_t *fcallbacks)
{
@@ -120,6 +126,12 @@ hb_unicode_callbacks_reference (hb_unicode_callbacks_t *ucallbacks)
HB_OBJECT_DO_REFERENCE (ucallbacks);
}
+unsigned int
+hb_unicode_callbacks_get_reference_count (hb_unicode_callbacks_t *ucallbacks)
+{
+ HB_OBJECT_DO_GET_REFERENCE_COUNT (ucallbacks);
+}
+
void
hb_unicode_callbacks_destroy (hb_unicode_callbacks_t *ucallbacks)
{
@@ -203,6 +215,12 @@ hb_face_reference (hb_face_t *face)
HB_OBJECT_DO_REFERENCE (face);
}
+unsigned int
+hb_face_get_reference_count (hb_face_t *face)
+{
+ HB_OBJECT_DO_GET_REFERENCE_COUNT (face);
+}
+
void
hb_face_destroy (hb_face_t *face)
{
@@ -280,6 +298,12 @@ hb_font_reference (hb_font_t *font)
HB_OBJECT_DO_REFERENCE (font);
}
+unsigned int
+hb_font_get_reference_count (hb_font_t *font)
+{
+ HB_OBJECT_DO_GET_REFERENCE_COUNT (font);
+}
+
void
hb_font_destroy (hb_font_t *font)
{
diff --git a/pango/opentype/hb-font.h b/pango/opentype/hb-font.h
index d287145..2c85339 100644
--- a/pango/opentype/hb-font.h
+++ b/pango/opentype/hb-font.h
@@ -41,6 +41,9 @@ hb_font_callbacks_create (void);
hb_font_callbacks_t *
hb_font_callbacks_reference (hb_font_callbacks_t *fcallbacks);
+unsigned int
+hb_font_callbacks_get_reference_count (hb_font_callbacks_t *fcallbacks);
+
void
hb_font_callbacks_destroy (hb_font_callbacks_t *fcallbacks);
@@ -78,6 +81,9 @@ hb_unicode_callbacks_create (void);
hb_unicode_callbacks_t *
hb_unicode_callbacks_reference (hb_unicode_callbacks_t *ucallbacks);
+unsigned int
+hb_unicode_callbacks_get_reference_count (hb_unicode_callbacks_t *ucallbacks);
+
void
hb_unicode_callbacks_destroy (hb_unicode_callbacks_t *ucallbacks);
@@ -126,6 +132,9 @@ hb_face_create_for_tables (hb_get_table_func_t get_table,
hb_face_t *
hb_face_reference (hb_face_t *face);
+unsigned int
+hb_face_get_reference_count (hb_face_t *face);
+
void
hb_face_destroy (hb_face_t *face);
@@ -151,6 +160,9 @@ hb_font_create (hb_face_t *face);
hb_font_t *
hb_font_reference (hb_font_t *font);
+unsigned int
+hb_font_get_reference_count (hb_font_t *font);
+
void
hb_font_destroy (hb_font_t *font);
diff --git a/pango/opentype/hb-object-private.h b/pango/opentype/hb-object-private.h
index 541bad9..4ef2823 100644
--- a/pango/opentype/hb-object-private.h
+++ b/pango/opentype/hb-object-private.h
@@ -84,6 +84,13 @@ typedef struct {
return obj; \
} HB_STMT_END
+#define HB_OBJECT_DO_GET_REFERENCE_COUNT(obj) \
+ HB_STMT_START { \
+ if (HB_OBJECT_IS_INERT (obj)) \
+ return 0; \
+ return HB_REFERENCE_COUNT_GET_VALUE (obj->ref_count); \
+ } HB_STMT_END
+
#define HB_OBJECT_DO_DESTROY(obj) \
HB_STMT_START { \
if (HB_OBJECT_IS_INERT (obj)) \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]