summaryrefslogtreecommitdiff
path: root/src/option.cpp
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@opencompositing.org>2008-08-14 13:56:14 +0200
committerDennis kasprzyk <onestone@opencompositing.org>2008-08-14 13:56:14 +0200
commitfa7e9361989282eddfc3012ffc392fadebf2b3c5 (patch)
tree9f9d6926eae7c793e4b9e878da65406e872b754a /src/option.cpp
parentc9b8f6dff3c7457f5e05802335327200fa169110 (diff)
downloadunity-window-decorator-fa7e9361989282eddfc3012ffc392fadebf2b3c5.tar.gz
unity-window-decorator-fa7e9361989282eddfc3012ffc392fadebf2b3c5.tar.bz2
Implementation of CompMatch as C++ class.
Diffstat (limited to 'src/option.cpp')
-rw-r--r--src/option.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/option.cpp b/src/option.cpp
index e7b46ef..87bbb3c 100644
--- a/src/option.cpp
+++ b/src/option.cpp
@@ -83,7 +83,8 @@ compFiniOptionValue (CompOptionValue *v,
free (v->s);
break;
case CompOptionTypeMatch:
- matchFini (&v->match);
+ delete (v->match);
+ v->match = NULL;
break;
case CompOptionTypeList:
for (i = 0; i < v->list.nValue; i++)
@@ -292,22 +293,20 @@ Bool
compSetMatchOption (CompOption *option,
CompOptionValue *value)
{
- CompDisplay *display = option->value.match.display;
+ CompDisplay *display = option->value.match->display ();
CompMatch match;
- if (matchEqual (&option->value.match, &value->match))
+ if (*option->value.match == *value->match)
return FALSE;
- if (!matchCopy (&match, &value->match))
- return FALSE;
+ match = *value->match;
- matchFini (&option->value.match);
+ delete option->value.match;
- option->value.match.op = match.op;
- option->value.match.nOp = match.nOp;
+ option->value.match = new CompMatch (*value->match);
if (display)
- matchUpdate (display, &option->value.match);
+ option->value.match->update (display);
return TRUE;
}
@@ -338,7 +337,8 @@ compSetOptionList (CompOption *option,
free (option->value.list.value[i].s);
break;
case CompOptionTypeMatch:
- matchFini (&option->value.list.value[i].match);
+ delete option->value.list.value[i].match;
+ option->value.list.value[i].match = NULL;
default:
break;
}
@@ -524,7 +524,7 @@ getMatchOptionNamed (CompOption *option,
{
if (option->type == CompOptionTypeMatch)
if (strcmp (option->name, name) == 0)
- return &option->value.match;
+ return option->value.match;
option++;
}