summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-08-10 23:50:51 -0400
committerBehdad Esfahbod <behdad@behdad.org>2009-08-10 23:50:51 -0400
commit620858ee966c7999b206dd3a883542a1057a8d41 (patch)
tree40ff50d104c3d7251a503cc19ac0daaef86e9c71
parent3f57b1a9e78a50651a6dcca7443085bf9fc307b2 (diff)
downloadpango-620858ee966c7999b206dd3a883542a1057a8d41.tar.gz
[HB] Add hb_font_funcs_make_immutable()
-rw-r--r--pango/opentype/hb-font-private.h4
-rw-r--r--pango/opentype/hb-font.cc17
-rw-r--r--pango/opentype/hb-font.h3
3 files changed, 22 insertions, 2 deletions
diff --git a/pango/opentype/hb-font-private.h b/pango/opentype/hb-font-private.h
index 6ec1e997..efd71098 100644
--- a/pango/opentype/hb-font-private.h
+++ b/pango/opentype/hb-font-private.h
@@ -43,6 +43,8 @@ HB_BEGIN_DECLS
struct _hb_font_funcs_t {
hb_reference_count_t ref_count;
+ hb_bool_t immutable;
+
/*
hb_font_get_glyph_func_t glyph_func;
hb_font_get_contour_point_func_t contour_point_func;
@@ -51,6 +53,8 @@ struct _hb_font_funcs_t {
*/
};
+HB_INTERNAL hb_font_funcs_t
+_hb_font_funcs_nil;
/*
* hb_face_t
diff --git a/pango/opentype/hb-font.cc b/pango/opentype/hb-font.cc
index 784dc564..b090ad97 100644
--- a/pango/opentype/hb-font.cc
+++ b/pango/opentype/hb-font.cc
@@ -37,8 +37,11 @@
* hb_font_funcs_t
*/
-static hb_font_funcs_t _hb_font_funcs_nil = {
- HB_REFERENCE_COUNT_INVALID /* ref_count */
+hb_font_funcs_t _hb_font_funcs_nil = {
+ HB_REFERENCE_COUNT_INVALID, /* ref_count */
+
+ TRUE /* immutable */
+
/*
hb_font_get_glyph_func_t glyph_func;
hb_font_get_contour_point_func_t contour_point_func;
@@ -90,10 +93,20 @@ hb_font_funcs_copy (hb_font_funcs_t *other_ffuncs)
/* re-init refcount */
HB_OBJECT_DO_INIT (ffuncs);
+ ffuncs->immutable = FALSE;
return ffuncs;
}
+void
+hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs)
+{
+ if (HB_OBJECT_IS_INERT (ffuncs))
+ return;
+
+ ffuncs->immutable = TRUE;
+}
+
/*
diff --git a/pango/opentype/hb-font.h b/pango/opentype/hb-font.h
index 4535d1b1..26e49bb7 100644
--- a/pango/opentype/hb-font.h
+++ b/pango/opentype/hb-font.h
@@ -91,6 +91,9 @@ hb_font_funcs_destroy (hb_font_funcs_t *ffuncs);
hb_font_funcs_t *
hb_font_funcs_copy (hb_font_funcs_t *ffuncs);
+void
+hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs);
+
/*
void