Commit dda7794f authored by Keith Packard's avatar Keith Packard
Browse files

Add "same" binding for edits to inherit binding from matched element

parent 602e6b1f
......@@ -145,7 +145,7 @@
<!ATTLIST edit
name CDATA #REQUIRED
mode (assign|assign_replace|prepend|append|prepend_first|append_last) "assign"
binding (weak|strong) "weak">
binding (weak|strong|same) "weak">
<!--
Elements of expressions follow
......
......@@ -917,8 +917,16 @@ FcConfigAdd (FcValueList **head,
FcBool append,
FcValueList *new)
{
FcValueList **prev, *last;
FcValueList **prev, *last, *v;
FcValueBinding sameBinding;
if (position)
sameBinding = position->binding;
else
sameBinding = FcValueBindingWeak;
for (v = new; v; v = v->next)
if (v->binding == FcValueBindingSame)
v->binding = sameBinding;
if (append)
{
if (position)
......
......@@ -97,7 +97,7 @@ typedef struct _FcSymbolic {
#define FC_MEM_NUM 29
typedef enum _FcValueBinding {
FcValueBindingWeak, FcValueBindingStrong
FcValueBindingWeak, FcValueBindingStrong, FcValueBindingSame
} FcValueBinding;
typedef struct _FcValueList {
......
......@@ -1513,6 +1513,8 @@ FcParseEdit (FcConfigParse *parse)
binding = FcValueBindingWeak;
else if (!strcmp ((char *) binding_string, "strong"))
binding = FcValueBindingStrong;
else if (!strcmp ((char *) binding_string, "same"))
binding = FcValueBindingSame;
else
{
FcConfigMessage (parse, FcSevereWarning, "invalid edit binding \"%s\"", binding_string);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment