summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2015-07-28 12:48:40 +0900
committerAkira TAGOH <akira@tagoh.org>2017-07-07 15:43:59 +0900
commitee2000494c4c8367fe20593709a979d158687855 (patch)
tree0fa6fa45e33f60d8b3839975ed1d7d1b88a29e47 /src
parent01085e07857cddf382db736a9e061f92f50397d6 (diff)
Add FcPatternGetWithBinding() to obtain the binding type of the value in FcPattern.
https://bugs.freedesktop.org/show_bug.cgi?id=19375
Diffstat (limited to 'src')
-rw-r--r--src/fcint.h9
-rw-r--r--src/fcpat.c18
2 files changed, 19 insertions, 8 deletions
diff --git a/src/fcint.h b/src/fcint.h
index dad34c5a..360d80de 100644
--- a/src/fcint.h
+++ b/src/fcint.h
@@ -116,12 +116,6 @@ extern pfnSHGetFolderPathA pSHGetFolderPathA;
FC_ASSERT_STATIC (sizeof (FcRef) == sizeof (int));
-typedef enum _FcValueBinding {
- FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame,
- /* to make sure sizeof (FcValueBinding) == 4 even with -fshort-enums */
- FcValueBindingEnd = INT_MAX
-} FcValueBinding;
-
#define FcStrdup(s) ((FcChar8 *) strdup ((const char *) (s)))
#define FcFree(s) (free ((FcChar8 *) (s)))
@@ -1000,6 +994,9 @@ FcPrivate FcBool
FcPatternObjectAddWeak (FcPattern *p, FcObject object, FcValue value, FcBool append);
FcPrivate FcResult
+FcPatternObjectGetWithBinding (const FcPattern *p, FcObject object, int id, FcValue *v, FcValueBinding *b);
+
+FcPrivate FcResult
FcPatternObjectGet (const FcPattern *p, FcObject object, int id, FcValue *v);
FcPrivate FcBool
diff --git a/src/fcpat.c b/src/fcpat.c
index 3ef1ed21..cc303c64 100644
--- a/src/fcpat.c
+++ b/src/fcpat.c
@@ -883,7 +883,7 @@ FcPatternAddRange (FcPattern *p, const char *object, const FcRange *r)
}
FcResult
-FcPatternObjectGet (const FcPattern *p, FcObject object, int id, FcValue *v)
+FcPatternObjectGetWithBinding (const FcPattern *p, FcObject object, int id, FcValue *v, FcValueBinding *b)
{
FcPatternElt *e;
FcValueListPtr l;
@@ -898,6 +898,8 @@ FcPatternObjectGet (const FcPattern *p, FcObject object, int id, FcValue *v)
if (!id)
{
*v = FcValueCanonicalize(&l->value);
+ if (b)
+ *b = l->binding;
return FcResultMatch;
}
id--;
@@ -906,9 +908,21 @@ FcPatternObjectGet (const FcPattern *p, FcObject object, int id, FcValue *v)
}
FcResult
+FcPatternObjectGet (const FcPattern *p, FcObject object, int id, FcValue *v)
+{
+ return FcPatternObjectGetWithBinding (p, object, id, v, NULL);
+}
+
+FcResult
+FcPatternGetWithBinding (const FcPattern *p, const char *object, int id, FcValue *v, FcValueBinding *b)
+{
+ return FcPatternObjectGetWithBinding (p, FcObjectFromName (object), id, v, b);
+}
+
+FcResult
FcPatternGet (const FcPattern *p, const char *object, int id, FcValue *v)
{
- return FcPatternObjectGet (p, FcObjectFromName (object), id, v);
+ return FcPatternObjectGetWithBinding (p, FcObjectFromName (object), id, v, NULL);
}
FcResult