diff options
author | marha <marha@users.sourceforge.net> | 2013-02-01 09:32:47 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-02-01 09:32:47 +0100 |
commit | a6d5f8de1394c338d01b65be7dba3520bf8bdf4b (patch) | |
tree | aa72f6b1bc151de3cee3b0fb619d066ea37a0920 /fontconfig/src | |
parent | 436f8246cd5a377596f6e42e6562da186ef8df48 (diff) | |
download | vcxsrv-a6d5f8de1394c338d01b65be7dba3520bf8bdf4b.tar.gz vcxsrv-a6d5f8de1394c338d01b65be7dba3520bf8bdf4b.tar.bz2 vcxsrv-a6d5f8de1394c338d01b65be7dba3520bf8bdf4b.zip |
xkeyboard-config fontconfig mesa git update 1 feb 2013
xkeyboard-config: 20191810d1fea7c2f49b65ffee3e4d5e2bc0bac3
fontconfig: 20191810d1fea7c2f49b65ffee3e4d5e2bc0bac3
mesa: b68a3b865be2dbd002f1fb8fc3eba20c4293a5bd
Diffstat (limited to 'fontconfig/src')
-rw-r--r-- | fontconfig/src/fccfg.c | 10 | ||||
-rw-r--r-- | fontconfig/src/fcdbg.c | 6 | ||||
-rw-r--r-- | fontconfig/src/fcint.h | 1 | ||||
-rw-r--r-- | fontconfig/src/fcxml.c | 57 |
4 files changed, 72 insertions, 2 deletions
diff --git a/fontconfig/src/fccfg.c b/fontconfig/src/fccfg.c index 12d7e1a97..db878d5f4 100644 --- a/fontconfig/src/fccfg.c +++ b/fontconfig/src/fccfg.c @@ -1701,6 +1701,16 @@ FcConfigSubstituteWithPat (FcConfig *config, case FcOpAppendLast: FcConfigPatternAdd (p, e->object, l, FcTrue); break; + case FcOpDelete: + if (t) + { + FcConfigDel (&st[i].elt->values, st[i].value); + break; + } + /* fall through ... */ + case FcOpDeleteAll: + FcConfigPatternDel (p, e->object); + break; default: FcValueListDestroy (l); break; diff --git a/fontconfig/src/fcdbg.c b/fontconfig/src/fcdbg.c index 270d79179..9d02f5ac7 100644 --- a/fontconfig/src/fcdbg.c +++ b/fontconfig/src/fcdbg.c @@ -79,7 +79,7 @@ void FcValuePrintWithPosition (const FcValue v, FcBool show_pos_mark) { if (show_pos_mark) - printf (" [insert here] "); + printf (" [marker] "); else printf (" "); _FcValuePrintFile (stdout, v); @@ -110,7 +110,7 @@ FcValueListPrintWithPosition (FcValueListPtr l, const FcValueListPtr pos) FcValueBindingPrint (l); } if (!pos) - printf (" [insert here]"); + printf (" [marker]"); } void @@ -222,6 +222,8 @@ FcOpPrint (FcOp op_) case FcOpPrependFirst: printf ("PrependFirst"); break; case FcOpAppend: printf ("Append"); break; case FcOpAppendLast: printf ("AppendLast"); break; + case FcOpDelete: printf ("Delete"); break; + case FcOpDeleteAll: printf ("DeleteAll"); break; case FcOpQuest: printf ("Quest"); break; case FcOpOr: printf ("Or"); break; case FcOpAnd: printf ("And"); break; diff --git a/fontconfig/src/fcint.h b/fontconfig/src/fcint.h index 71b734150..fceb8cc7b 100644 --- a/fontconfig/src/fcint.h +++ b/fontconfig/src/fcint.h @@ -208,6 +208,7 @@ typedef enum _FcOp { FcOpField, FcOpConst, FcOpAssign, FcOpAssignReplace, FcOpPrependFirst, FcOpPrepend, FcOpAppend, FcOpAppendLast, + FcOpDelete, FcOpDeleteAll, FcOpQuest, FcOpOr, FcOpAnd, FcOpEqual, FcOpNotEqual, FcOpContains, FcOpListing, FcOpNotContains, diff --git a/fontconfig/src/fcxml.c b/fontconfig/src/fcxml.c index 2a0d088c1..470e44fac 100644 --- a/fontconfig/src/fcxml.c +++ b/fontconfig/src/fcxml.c @@ -260,6 +260,8 @@ FcExprDestroy (FcExpr *e) case FcOpPrependFirst: case FcOpAppend: case FcOpAppendLast: + case FcOpDelete: + case FcOpDeleteAll: break; case FcOpOr: case FcOpAnd: @@ -2321,6 +2323,8 @@ static const FcOpMap fcModeOps[] = { { "prepend_first", FcOpPrependFirst }, { "append", FcOpAppend }, { "append_last", FcOpAppendLast }, + { "delete", FcOpDelete }, + { "delete_all", FcOpDeleteAll }, }; #define NUM_MODE_OPS (int) (sizeof fcModeOps / sizeof fcModeOps[0]) @@ -2363,6 +2367,13 @@ FcParseEdit (FcConfigParse *parse) return; expr = FcPopBinary (parse, FcOpComma); + if ((mode == FcOpDelete || mode == FcOpDeleteAll) && + expr != NULL) + { + FcConfigMessage (parse, FcSevereWarning, "Expression doesn't take any effects for delete and delete_all"); + FcExprDestroy (expr); + expr = NULL; + } edit = FcEditCreate (parse, FcObjectFromName ((char *) name), mode, expr, binding); if (!edit) @@ -2375,6 +2386,11 @@ FcParseEdit (FcConfigParse *parse) FcEditDestroy (edit); } +typedef struct FcSubstStack { + FcTest *test; + FcEdit *edit; +} FcSubstStack; + static void FcParseMatch (FcConfigParse *parse) { @@ -2383,6 +2399,9 @@ FcParseMatch (FcConfigParse *parse) FcTest *test = 0; FcEdit *edit = 0; FcVStack *vstack; + FcBool tested = FcFalse; + FcSubstStack *sstack = NULL; + int len, pos = 0; kind_name = FcConfigGetAttribute (parse, "target"); if (!kind_name) @@ -2401,6 +2420,16 @@ FcParseMatch (FcConfigParse *parse) return; } } + len = FcVStackElements(parse); + if (len > 0) + { + sstack = malloc (sizeof (FcSubstStack) * (len + 1)); + if (!sstack) + { + FcConfigMessage (parse, FcSevereError, "out of memory"); + return; + } + } while ((vstack = FcVStackPeek (parse))) { switch ((int) vstack->tag) { @@ -2408,8 +2437,22 @@ FcParseMatch (FcConfigParse *parse) vstack->u.test->next = test; test = vstack->u.test; vstack->tag = FcVStackNone; + tested = FcTrue; break; case FcVStackEdit: + /* due to the reverse traversal, <edit> node appears faster than + * <test> node if any. so we have to deal with it here rather than + * the above in FcVStackTest, and put recipes in reverse order. + */ + if (tested) + { + sstack[pos].test = test; + sstack[pos].edit = edit; + pos++; + test = NULL; + edit = NULL; + tested = FcFalse; + } vstack->u.edit->next = edit; edit = vstack->u.edit; vstack->tag = FcVStackNone; @@ -2428,6 +2471,20 @@ FcParseMatch (FcConfigParse *parse) } if (!FcConfigAddEdit (parse->config, test, edit, kind)) FcConfigMessage (parse, FcSevereError, "out of memory"); + if (sstack) + { + int i; + + for (i = 0; i < pos; i++) + { + if (!FcConfigAddEdit (parse->config, sstack[pos - i - 1].test, sstack[pos - i - 1].edit, kind)) + { + FcConfigMessage (parse, FcSevereError, "out of memory"); + return; + } + } + free (sstack); + } } static void |