Author: toshok
Date: 2007-06-06 23:59:29 -0400 (Wed, 06 Jun 2007)
New Revision: 78811
Modified:
trunk/moon/src/ChangeLog
trunk/moon/src/brush.cpp
trunk/moon/src/runtime.cpp
trunk/moon/src/runtime.h
Log:
* runtime.h: make the point/color/rect copy constructors take a
ref, not a pointer. also, make the value contructors for struct
types by-value.
* runtime.cpp: make the value constructors for struct types
by-value.
* brush.cpp (brush_init): pass the Color by value.
2007-06-06 Chris Toshok <[EMAIL PROTECTED]>
Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog 2007-06-07 03:44:55 UTC (rev 78810)
+++ trunk/moon/src/ChangeLog 2007-06-07 03:59:29 UTC (rev 78811)
@@ -1,5 +1,16 @@
2007-06-06 Chris Toshok <[EMAIL PROTECTED]>
+ * runtime.h: make the point/color/rect copy constructors take a
+ ref, not a pointer. also, make the value contructors for struct
+ types by-value.
+
+ * runtime.cpp: make the value constructors for struct types
+ by-value.
+
+ * brush.cpp (brush_init): pass the Color by value.
+
+2007-06-06 Chris Toshok <[EMAIL PROTECTED]>
+
* runtime.h, runtime.cpp: move the Value implementation (for
everything but the operators) to the .cpp file.
Modified: trunk/moon/src/brush.cpp
===================================================================
--- trunk/moon/src/brush.cpp 2007-06-07 03:44:55 UTC (rev 78810)
+++ trunk/moon/src/brush.cpp 2007-06-07 03:59:29 UTC (rev 78811)
@@ -199,5 +199,5 @@
Brush::TransformProperty = DependencyObject::Register (Value::BRUSH,
"TransformProperty", new Value ());
/* SolidColorBrush fields */
- SolidColorBrush::ColorProperty = DependencyObject::Register
(Value::SOLIDCOLORBRUSH, "Color", new Value (new Color (0x00FFFFFF)));
+ SolidColorBrush::ColorProperty = DependencyObject::Register
(Value::SOLIDCOLORBRUSH, "Color", new Value (Color (0x00FFFFFF)));
}
Modified: trunk/moon/src/runtime.cpp
===================================================================
--- trunk/moon/src/runtime.cpp 2007-06-07 03:44:55 UTC (rev 78810)
+++ trunk/moon/src/runtime.cpp 2007-06-07 03:59:29 UTC (rev 78811)
@@ -26,6 +26,7 @@
#include <cairo-xlib.h>
#include "runtime.h"
#include "transform.h"
+#include "animation.h"
#if AGG
struct _SurfacePrivate {
@@ -123,7 +124,7 @@
u.i32 = i;
}
-Value::Value (Color* c)
+Value::Value (Color c)
{
Init ();
k = COLOR;
@@ -139,19 +140,15 @@
u.dependency_object = obj;
}
-Value::Value (Point *pt)
+Value::Value (Point pt)
{
- g_assert (pt != NULL);
-
Init ();
k = POINT;
u.point = new Point (pt);
}
-Value::Value (Rect *rect)
+Value::Value (Rect rect)
{
- g_assert (rect != NULL);
-
Init ();
k = RECT;
u.rect = new Rect (rect);
Modified: trunk/moon/src/runtime.h
===================================================================
--- trunk/moon/src/runtime.h 2007-06-07 03:44:55 UTC (rev 78810)
+++ trunk/moon/src/runtime.h 2007-06-07 03:59:29 UTC (rev 78811)
@@ -21,6 +21,7 @@
GHashTable *event_hash;
};
+struct RepeatBehavior;
class Transform;
class TransformGroup;
class Surface;
@@ -40,10 +41,10 @@
this->y = y;
}
- Point (Point *point)
+ Point (const Point &point)
{
- x = point->x;
- y = point->y;
+ x = point.x;
+ y = point.y;
}
};
@@ -61,12 +62,12 @@
h = height;
}
- Rect (Rect *rect)
+ Rect (const Rect &rect)
{
- x = rect->x;
- y = rect->y;
- w = rect->w;
- h = rect->h;
+ x = rect.x;
+ y = rect.y;
+ w = rect.w;
+ h = rect.h;
}
};
@@ -91,17 +92,12 @@
this->a = a;
}
- Color (Color *color)
+ Color (const Color &color)
{
- if (color) {
- r = color->r;
- g = color->g;
- b = color->b;
- a = color->a;
- } else {
- r = g = b = 1.0;
- a = 0.0;
- }
+ r = color.r;
+ g = color.g;
+ b = color.b;
+ a = color.a;
}
};
@@ -228,10 +224,10 @@
Value (guint64 i);
Value (gint64 i);
Value (gint32 i);
- Value (Color *c);
+ Value (Color c);
Value (DependencyObject *obj);
- Value (Point *pt);
- Value (Rect *rect);
+ Value (Point pt);
+ Value (Rect rect);
Value (const char* s);
~Value ();
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches