Author: spouliot
Date: 2007-06-14 14:14:12 -0400 (Thu, 14 Jun 2007)
New Revision: 79596
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/xaml.cpp
Log:
2007-06-14 Sebastien Pouliot <[EMAIL PROTECTED]>
* xaml.cpp: Add support for Matrix (non-DO) type.
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-06-14 18:03:25 UTC (rev 79595)
+++ trunk/moon/src/ChangeLog 2007-06-14 18:14:12 UTC (rev 79596)
@@ -1,3 +1,7 @@
+2007-06-14 Sebastien Pouliot <[EMAIL PROTECTED]>
+
+ * xaml.cpp: Add support for Matrix (non-DO) type.
+
2007-06-14 Chris Toshok <[EMAIL PROTECTED]>
* runtime.cpp (downloader_write): add C-style downloader_write
Modified: trunk/moon/src/xaml.cpp
===================================================================
--- trunk/moon/src/xaml.cpp 2007-06-14 18:03:25 UTC (rev 79595)
+++ trunk/moon/src/xaml.cpp 2007-06-14 18:14:12 UTC (rev 79596)
@@ -610,7 +610,28 @@
return Duration (timespan_from_str (str));
}
+// sepcial case, we return a Value, to avoid allocating/freeing a Matrix
+Value*
+matrix_value_from_str (const char *str)
+{
+ cairo_matrix_t matrix;
+ int count = 0;
+ double* values = double_array_from_str (str, &count);
+ if (count == 6) {
+ matrix.xx = values [0];
+ matrix.yx = values [1];
+ matrix.xy = values [2];
+ matrix.yy = values [3];
+ matrix.x0 = values [4];
+ matrix.y0 = values [5];
+ } else
+ cairo_matrix_init_identity (&matrix);
+ g_free (values);
+
+ return new Value (&matrix);
+}
+
///
/// ENUMS
///
@@ -1101,6 +1122,9 @@
dep->SetValue (prop, Value (points, count));
}
break;
+ case Value::MATRIX:
+ dep->SetValue (prop, matrix_value_from_str
(attr [i + 1]));
+ break;
default:
#ifdef DEBUG_XAML
printf ("could not find value type for: %s::%s
%d\n", pname, attr [i + 1], prop->value_type);
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches