diff --git a/src/Makefile.am b/src/Makefile.am index 30e4099c2..4fb271211 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -63,6 +63,7 @@ HBHEADERS = \ hb-blob.h \ hb-buffer.h \ hb-common.h \ + hb-deprecated.h \ hb-face.h \ hb-font.h \ hb-set.h \ diff --git a/src/hb-buffer.cc b/src/hb-buffer.cc index c0ca484f9..340bd5351 100644 --- a/src/hb-buffer.cc +++ b/src/hb-buffer.cc @@ -176,7 +176,7 @@ hb_buffer_t::clear (void) hb_segment_properties_t default_props = HB_SEGMENT_PROPERTIES_DEFAULT; props = default_props; - flags = HB_BUFFER_FLAGS_DEFAULT; + flags = HB_BUFFER_FLAG_DEFAULT; content_type = HB_BUFFER_CONTENT_TYPE_INVALID; in_error = false; @@ -624,7 +624,7 @@ hb_buffer_get_empty (void) const_cast (&_hb_unicode_funcs_nil), HB_SEGMENT_PROPERTIES_DEFAULT, - HB_BUFFER_FLAGS_DEFAULT, + HB_BUFFER_FLAG_DEFAULT, HB_BUFFER_CONTENT_TYPE_INVALID, true, /* in_error */ diff --git a/src/hb-buffer.h b/src/hb-buffer.h index 55a404571..87c4ce58e 100644 --- a/src/hb-buffer.h +++ b/src/hb-buffer.h @@ -171,8 +171,8 @@ void hb_buffer_guess_segment_properties (hb_buffer_t *buffer); -typedef enum { - HB_BUFFER_FLAGS_DEFAULT = 0x00000000, +typedef enum { /*< flags >*/ + HB_BUFFER_FLAG_DEFAULT = 0x00000000, HB_BUFFER_FLAG_BOT = 0x00000001, /* Beginning-of-text */ HB_BUFFER_FLAG_EOT = 0x00000002, /* End-of-text */ HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES = 0x00000004 @@ -274,8 +274,8 @@ hb_buffer_normalize_glyphs (hb_buffer_t *buffer); * Serialize */ -typedef enum { - HB_BUFFER_SERIALIZE_FLAGS_DEFAULT = 0x00000000, +typedef enum { /*< flags >*/ + HB_BUFFER_SERIALIZE_FLAG_DEFAULT = 0x00000000, HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS = 0x00000001, HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS = 0x00000002, HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES = 0x00000004 diff --git a/src/hb-common.h b/src/hb-common.h index 5040b9088..9079b2c04 100644 --- a/src/hb-common.h +++ b/src/hb-common.h @@ -273,11 +273,6 @@ typedef enum /*---*/ HB_SCRIPT_INVALID = HB_TAG_NONE } hb_script_t; -#ifndef HB_DISABLE_DEPRECATED -/* Deprecated misspelling. */ -#define HB_SCRIPT_CANADIAN_ABORIGINAL HB_SCRIPT_CANADIAN_SYLLABICS -#endif - /* These are moved out of hb_script_t because glib-mkenums chokes otherwise. */ #if 0 /*7.0*/ HB_SCRIPT_BASSA_VAH = HB_TAG ('B','a','s','s'), diff --git a/src/hb-deprecated.h b/src/hb-deprecated.h new file mode 100644 index 000000000..30ae4b1ca --- /dev/null +++ b/src/hb-deprecated.h @@ -0,0 +1,51 @@ +/* + * Copyright © 2013 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_H_IN +#error "Include instead." +#endif + +#ifndef HB_DEPRECATED_H +#define HB_DEPRECATED_H + +#include "hb-common.h" +#include "hb-unicode.h" +#include "hb-font.h" + +HB_BEGIN_DECLS + +#ifndef HB_DISABLE_DEPRECATED + +#define HB_SCRIPT_CANADIAN_ABORIGINAL HB_SCRIPT_CANADIAN_SYLLABICS + +#define HB_BUFFER_FLAGS_DEFAULT HB_BUFFER_FLAG_DEFAULT +#define HB_BUFFER_SERIALIZE_FLAGS_DEFAULT HB_BUFFER_SERIALIZE_FLAG_DEFAULT + +#endif + +HB_END_DECLS + +#endif /* HB_DEPRECATED_H */ diff --git a/src/hb.h b/src/hb.h index 5a6e9fd49..c5a938a38 100644 --- a/src/hb.h +++ b/src/hb.h @@ -31,6 +31,7 @@ #include "hb-blob.h" #include "hb-buffer.h" #include "hb-common.h" +#include "hb-deprecated.h" #include "hb-face.h" #include "hb-font.h" #include "hb-set.h" diff --git a/src/test-buffer-serialize.cc b/src/test-buffer-serialize.cc index 3577dbf68..827b0513b 100644 --- a/src/test-buffer-serialize.cc +++ b/src/test-buffer-serialize.cc @@ -114,7 +114,7 @@ main (int argc, char **argv) hb_buffer_serialize_glyphs (buf, 0, hb_buffer_get_length (buf), out, sizeof (out), NULL, font, HB_BUFFER_SERIALIZE_FORMAT_JSON, - HB_BUFFER_SERIALIZE_FLAGS_DEFAULT); + HB_BUFFER_SERIALIZE_FLAG_DEFAULT); puts (out); } diff --git a/test/api/test-buffer.c b/test/api/test-buffer.c index 77fa78650..13465ef8d 100644 --- a/test/api/test-buffer.c +++ b/test/api/test-buffer.c @@ -110,7 +110,7 @@ test_buffer_properties (fixture_t *fixture, gconstpointer user_data) g_assert (hb_buffer_get_direction (b) == HB_DIRECTION_INVALID); g_assert (hb_buffer_get_script (b) == HB_SCRIPT_INVALID); g_assert (hb_buffer_get_language (b) == NULL); - g_assert (hb_buffer_get_flags (b) == HB_BUFFER_FLAGS_DEFAULT); + g_assert (hb_buffer_get_flags (b) == HB_BUFFER_FLAG_DEFAULT); /* test property changes are retained */ diff --git a/util/Makefile.am b/util/Makefile.am index 944b1aaad..51a584b89 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -9,6 +9,7 @@ MAINTAINERCLEANFILES = bin_PROGRAMS = AM_CPPFLAGS = \ + -DHB_DISABLE_DEPRECATED \ -I$(top_srcdir)/src/ \ -I$(top_builddir)/src/ \ $(GLIB_CFLAGS) \ diff --git a/util/hb-shape.cc b/util/hb-shape.cc index b62f744f2..c239f0d1e 100644 --- a/util/hb-shape.cc +++ b/util/hb-shape.cc @@ -60,7 +60,7 @@ struct output_buffer_t output_format = HB_BUFFER_SERIALIZE_FORMAT_TEXT; } - unsigned int flags = HB_BUFFER_SERIALIZE_FLAGS_DEFAULT; + unsigned int flags = HB_BUFFER_SERIALIZE_FLAG_DEFAULT; if (!format.show_glyph_names) flags |= HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES; if (!format.show_clusters) diff --git a/util/options.hh b/util/options.hh index 9302427f6..075bf8c8f 100644 --- a/util/options.hh +++ b/util/options.hh @@ -167,7 +167,7 @@ struct shape_options_t : option_group_t hb_buffer_set_direction (buffer, hb_direction_from_string (direction, -1)); hb_buffer_set_script (buffer, hb_script_from_string (script, -1)); hb_buffer_set_language (buffer, hb_language_from_string (language, -1)); - hb_buffer_set_flags (buffer, (hb_buffer_flags_t) (HB_BUFFER_FLAGS_DEFAULT | + hb_buffer_set_flags (buffer, (hb_buffer_flags_t) (HB_BUFFER_FLAG_DEFAULT | (bot ? HB_BUFFER_FLAG_BOT : 0) | (eot ? HB_BUFFER_FLAG_EOT : 0) | (preserve_default_ignorables ? HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES : 0)));