summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/harfbuzz-ng/src/hb-set.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/hb-set.cc')
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-set.cc109
1 files changed, 89 insertions, 20 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-set.cc b/src/3rdparty/harfbuzz-ng/src/hb-set.cc
index 0b4f871e85..10638a7e6d 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-set.cc
+++ b/src/3rdparty/harfbuzz-ng/src/hb-set.cc
@@ -24,10 +24,19 @@
* Google Author(s): Behdad Esfahbod
*/
-#include "hb-set-private.hh"
+#include "hb-set.hh"
-/* Public API */
+/**
+ * SECTION:hb-set
+ * @title: hb-set
+ * @short_description: Object representing a set of integers
+ * @include: hb.h
+ *
+ * Set objects represent a mathematical set of integer values. They are
+ * used in non-shaping API to query certain set of characters or glyphs,
+ * or other integer values.
+ **/
/**
@@ -38,14 +47,14 @@
* Since: 0.9.2
**/
hb_set_t *
-hb_set_create (void)
+hb_set_create ()
{
hb_set_t *set;
if (!(set = hb_object_create<hb_set_t> ()))
return hb_set_get_empty ();
- set->init ();
+ set->init_shallow ();
return set;
}
@@ -58,16 +67,9 @@ hb_set_create (void)
* Since: 0.9.2
**/
hb_set_t *
-hb_set_get_empty (void)
+hb_set_get_empty ()
{
- static const hb_set_t _hb_set_nil = {
- HB_OBJECT_HEADER_STATIC,
- true, /* in_error */
-
- {0} /* elts */
- };
-
- return const_cast<hb_set_t *> (&_hb_set_nil);
+ return const_cast<hb_set_t *> (&Null(hb_set_t));
}
/**
@@ -95,7 +97,7 @@ hb_set_destroy (hb_set_t *set)
{
if (!hb_object_destroy (set)) return;
- set->finish ();
+ set->fini_shallow ();
free (set);
}
@@ -150,9 +152,9 @@ hb_set_get_user_data (hb_set_t *set,
* Since: 0.9.2
**/
hb_bool_t
-hb_set_allocation_successful (const hb_set_t *set HB_UNUSED)
+hb_set_allocation_successful (const hb_set_t *set)
{
- return !set->in_error;
+ return set->successful;
}
/**
@@ -274,11 +276,11 @@ hb_set_del_range (hb_set_t *set,
/**
* hb_set_is_equal:
* @set: a set.
- * @other:
+ * @other: other set.
*
*
*
- * Return value:
+ * Return value: %TRUE if the two sets are equal, %FALSE otherwise.
*
* Since: 0.9.7
**/
@@ -290,6 +292,24 @@ hb_set_is_equal (const hb_set_t *set,
}
/**
+ * hb_set_is_subset:
+ * @set: a set.
+ * @larger_set: other set.
+ *
+ *
+ *
+ * Return value: %TRUE if the @set is a subset of (or equal to) @larger_set, %FALSE otherwise.
+ *
+ * Since: 1.8.1
+ **/
+hb_bool_t
+hb_set_is_subset (const hb_set_t *set,
+ const hb_set_t *larger_set)
+{
+ return set->is_subset (larger_set);
+}
+
+/**
* hb_set_set:
* @set: a set.
* @other:
@@ -369,6 +389,7 @@ hb_set_symmetric_difference (hb_set_t *set,
set->symmetric_difference (other);
}
+#ifndef HB_DISABLE_DEPRECATED
/**
* hb_set_invert:
* @set: a set.
@@ -380,9 +401,10 @@ hb_set_symmetric_difference (hb_set_t *set,
* Deprecated: 1.6.1
**/
void
-hb_set_invert (hb_set_t *set)
+hb_set_invert (hb_set_t *set HB_UNUSED)
{
}
+#endif
/**
* hb_set_get_population:
@@ -437,7 +459,9 @@ hb_set_get_max (const hb_set_t *set)
* @set: a set.
* @codepoint: (inout):
*
- *
+ * Gets the next number in @set that is greater than current value of @codepoint.
+ *
+ * Set @codepoint to %HB_SET_VALUE_INVALID to get started.
*
* Return value: whether there was a next value.
*
@@ -451,6 +475,26 @@ hb_set_next (const hb_set_t *set,
}
/**
+ * hb_set_previous:
+ * @set: a set.
+ * @codepoint: (inout):
+ *
+ * Gets the previous number in @set that is lower than current value of @codepoint.
+ *
+ * Set @codepoint to %HB_SET_VALUE_INVALID to get started.
+ *
+ * Return value: whether there was a previous value.
+ *
+ * Since: 1.8.0
+ **/
+hb_bool_t
+hb_set_previous (const hb_set_t *set,
+ hb_codepoint_t *codepoint)
+{
+ return set->previous (codepoint);
+}
+
+/**
* hb_set_next_range:
* @set: a set.
* @first: (out): output first codepoint in the range.
@@ -459,6 +503,8 @@ hb_set_next (const hb_set_t *set,
* Gets the next consecutive range of numbers in @set that
* are greater than current value of @last.
*
+ * Set @last to %HB_SET_VALUE_INVALID to get started.
+ *
* Return value: whether there was a next range.
*
* Since: 0.9.7
@@ -470,3 +516,26 @@ hb_set_next_range (const hb_set_t *set,
{
return set->next_range (first, last);
}
+
+/**
+ * hb_set_previous_range:
+ * @set: a set.
+ * @first: (inout): input current first and output first codepoint in the range.
+ * @last: (out): output last codepoint in the range.
+ *
+ * Gets the previous consecutive range of numbers in @set that
+ * are less than current value of @first.
+ *
+ * Set @first to %HB_SET_VALUE_INVALID to get started.
+ *
+ * Return value: whether there was a previous range.
+ *
+ * Since: 1.8.0
+ **/
+hb_bool_t
+hb_set_previous_range (const hb_set_t *set,
+ hb_codepoint_t *first,
+ hb_codepoint_t *last)
+{
+ return set->previous_range (first, last);
+}