Author: toshok
Date: 2007-06-07 00:42:18 -0400 (Thu, 07 Jun 2007)
New Revision: 78817

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/animation.cpp
   trunk/moon/src/animation.h
   trunk/moon/src/geometry.cpp
   trunk/moon/src/runtime.cpp
   trunk/moon/src/runtime.h
   trunk/moon/src/transform.h
Log:
2007-06-06  Chris Toshok  <[EMAIL PROTECTED]>

        * animation.h: add prototype for timeline_set_repeat_behavior.
        
        * animation.cpp (animation_init): register the RepeatBehavior
        property.
        (timeline_set_repeat_behavior): new function.

        * runtime.h: a better solution to enforcing types in the Value
        ctors - make Value (void*) private.  this gives compilation errors
        at all usage points where you're passing an unrecognized pointer
        type.  Also, add RepeatBehavior support to Value.

        * runtime.cpp: add repeatbehavior support to Value.
        
        * geometry.cpp: change all Value(pointer-to-struct) calls to
        Value(struct) calls.

        * transform.h: we need do define TransformGroup as a subclass of
        Transform, or the functions that SetValue a transformgroup fail to
        compile (since it's not a descendent of DependencyObject.)



Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-06-07 04:34:54 UTC (rev 78816)
+++ trunk/moon/src/ChangeLog    2007-06-07 04:42:18 UTC (rev 78817)
@@ -1,3 +1,25 @@
+2007-06-06  Chris Toshok  <[EMAIL PROTECTED]>
+
+       * animation.h: add prototype for timeline_set_repeat_behavior.
+       
+       * animation.cpp (animation_init): register the RepeatBehavior
+       property.
+       (timeline_set_repeat_behavior): new function.
+
+       * runtime.h: a better solution to enforcing types in the Value
+       ctors - make Value (void*) private.  this gives compilation errors
+       at all usage points where you're passing an unrecognized pointer
+       type.  Also, add RepeatBehavior support to Value.
+
+       * runtime.cpp: add repeatbehavior support to Value.
+       
+       * geometry.cpp: change all Value(pointer-to-struct) calls to
+       Value(struct) calls.
+
+       * transform.h: we need do define TransformGroup as a subclass of
+       Transform, or the functions that SetValue a transformgroup fail to
+       compile (since it's not a descendent of DependencyObject.)
+
 2007-06-07  Jackson Harper  <[EMAIL PROTECTED]>
 
        * xaml.cpp: Get object element property setting working.

Modified: trunk/moon/src/animation.cpp
===================================================================
--- trunk/moon/src/animation.cpp        2007-06-07 04:34:54 UTC (rev 78816)
+++ trunk/moon/src/animation.cpp        2007-06-07 04:42:18 UTC (rev 78817)
@@ -330,6 +330,12 @@
        timeline->SetValue (Timeline::DurationProperty, Value(duration));
 }
 
+void
+timeline_set_repeat_behavior (Timeline *timeline, RepeatBehavior behavior)
+{
+       timeline->SetValue (Timeline::RepeatBehaviorProperty, Value(behavior));
+}
+
 /* timeline group */
 
 TimelineGroup::TimelineGroup ()
@@ -623,8 +629,8 @@
        Timeline::AutoReverseProperty = DependencyObject::Register 
(Value::TIMELINE, "AutoReverse", new Value (false));
        Timeline::BeginTimeProperty = DependencyObject::Register 
(Value::TIMELINE, "BeginTime", new Value ((guint64)0));
        Timeline::DurationProperty = DependencyObject::Register 
(Value::TIMELINE, "Duration", new Value ((guint64)0));
+       Timeline::RepeatBehaviorProperty = DependencyObject::Register 
(Value::TIMELINE, "RepeatBehavior", new Value (RepeatBehavior ((double)1)));
        //DependencyObject::Register (DependencyObject::TIMELINE, 
"FillBehavior", new Value (0));
-       //DependencyObject::Register (DependencyObject::TIMELINE, 
"RepeatBehavior", new Value (0));
        //DependencyObject::Register (DependencyObject::TIMELINE, "SpeedRatio", 
new Value (0));
 
 

Modified: trunk/moon/src/animation.h
===================================================================
--- trunk/moon/src/animation.h  2007-06-07 04:34:54 UTC (rev 78816)
+++ trunk/moon/src/animation.h  2007-06-07 04:42:18 UTC (rev 78817)
@@ -194,6 +194,7 @@
 };
 
 void timeline_set_duration (Timeline *timeline, guint64 duration);
+void timeline_set_repeat_behavior (Timeline *timeline, RepeatBehavior 
behavior);
 
 
 

Modified: trunk/moon/src/geometry.cpp
===================================================================
--- trunk/moon/src/geometry.cpp 2007-06-07 04:34:54 UTC (rev 78816)
+++ trunk/moon/src/geometry.cpp 2007-06-07 04:42:18 UTC (rev 78817)
@@ -80,7 +80,7 @@
 void
 ellipse_geometry_set_center (EllipseGeometry *ellipse_geometry, Point *point)
 {
-       ellipse_geometry->SetValue (EllipseGeometry::CenterProperty, Value 
(point));
+       ellipse_geometry->SetValue (EllipseGeometry::CenterProperty, Value 
(*point));
 }
 
 double
@@ -130,7 +130,7 @@
 void
 line_geometry_set_end_point (LineGeometry* line_geometry, Point *end_point)
 {
-       line_geometry->SetValue (LineGeometry::EndPointProperty, Value 
(end_point));
+       line_geometry->SetValue (LineGeometry::EndPointProperty, Value 
(*end_point));
 }
 
 Point*
@@ -143,7 +143,7 @@
 void
 line_geometry_set_start_point (LineGeometry* line_geometry, Point *start_point)
 {
-       line_geometry->SetValue (LineGeometry::StartPointProperty, Value 
(start_point));
+       line_geometry->SetValue (LineGeometry::StartPointProperty, Value 
(*start_point));
 }
 
 LineGeometry*
@@ -206,7 +206,7 @@
 void
 rectangle_geometry_set_rect (RectangleGeometry *rectangle_geometry, Rect *rect)
 {
-       rectangle_geometry->SetValue (RectangleGeometry::RectProperty, Value 
(rect));
+       rectangle_geometry->SetValue (RectangleGeometry::RectProperty, Value 
(*rect));
 }
 
 RectangleGeometry*
@@ -266,7 +266,7 @@
 void
 path_figure_set_start_point (PathFigure *path_figure, Point *point)
 {
-       path_figure->SetValue (PathFigure::StartPointProperty, Value (point));
+       path_figure->SetValue (PathFigure::StartPointProperty, Value (*point));
 }
 
 //
@@ -307,7 +307,7 @@
 void
 arc_segment_set_point (ArcSegment *segment, Point *point)
 {
-       segment->SetValue (ArcSegment::PointProperty, Value (point));
+       segment->SetValue (ArcSegment::PointProperty, Value (*point));
 }
 
 double
@@ -332,7 +332,7 @@
 void
 arc_segment_set_size (ArcSegment *segment, Point *size)
 {
-       segment->SetValue (ArcSegment::SizeProperty, Value (size));
+       segment->SetValue (ArcSegment::SizeProperty, Value (*size));
 }
 
 SweepDirection
@@ -371,7 +371,7 @@
 void
 bezier_segment_set_point1 (BezierSegment *segment, Point *point)
 {
-       segment->SetValue (BezierSegment::Point1Property, Value (point));
+       segment->SetValue (BezierSegment::Point1Property, Value (*point));
 }
 
 Point*
@@ -384,7 +384,7 @@
 void
 bezier_segment_set_point2 (BezierSegment *segment, Point *point)
 {
-       segment->SetValue (BezierSegment::Point2Property, Value (point));
+       segment->SetValue (BezierSegment::Point2Property, Value (*point));
 }
 
 Point*
@@ -397,7 +397,7 @@
 void
 bezier_segment_set_point3 (BezierSegment *segment, Point *point)
 {
-       segment->SetValue (BezierSegment::Point3Property, Value (point));
+       segment->SetValue (BezierSegment::Point3Property, Value (*point));
 }
 
 //
@@ -422,7 +422,7 @@
 void
 line_segment_set_point (LineSegment *segment, Point *point)
 {
-       segment->SetValue (LineSegment::PointProperty, Value (point));
+       segment->SetValue (LineSegment::PointProperty, Value (*point));
 }
 
 //

Modified: trunk/moon/src/runtime.cpp
===================================================================
--- trunk/moon/src/runtime.cpp  2007-06-07 04:34:54 UTC (rev 78816)
+++ trunk/moon/src/runtime.cpp  2007-06-07 04:42:18 UTC (rev 78817)
@@ -154,6 +154,13 @@
        u.rect = new Rect (rect);
 }
 
+Value::Value (RepeatBehavior repeat)
+{
+       Init();
+       k = REPEATBEHAVIOR;
+       u.repeat = new RepeatBehavior (repeat);
+}
+
 Value::Value (const char* s)
 {
        Init ();
@@ -161,10 +168,6 @@
        u.s= g_strdup (s);
 }
 
-Value::Value (void*)
-{
-       g_warning ("This is not what you want to do here.  You're passing an 
unrecognized pointer type to Value.  usually this means you need to deref a 
structured type and hitting the void* ctor");
-}
 
 Value::~Value ()
 {

Modified: trunk/moon/src/runtime.h
===================================================================
--- trunk/moon/src/runtime.h    2007-06-07 04:34:54 UTC (rev 78816)
+++ trunk/moon/src/runtime.h    2007-06-07 04:42:18 UTC (rev 78817)
@@ -156,6 +156,7 @@
                COLOR = 7,
                POINT = 8,
                RECT = 9,
+               REPEATBEHAVIOR = 10,
 
                DEPENDENCY_OBJECT = 1000,
 
@@ -214,6 +215,7 @@
                Color *color;
                Point *point;
                Rect *rect;
+               RepeatBehavior *repeat;
        } u;
 
        void Init ();
@@ -228,8 +230,8 @@
        Value (DependencyObject *obj);
        Value (Point pt);
        Value (Rect rect);
+       Value (RepeatBehavior repeat);
        Value (const char* s);
-       Value (void* v); // this is for finding improper uses of the Value 
ctors - do NOT use this.
        
        ~Value ();
 
@@ -252,6 +254,13 @@
 
                return true;
        }
+  private:
+       // You don't want to be using this ctor.  it's here to help
+       // c++ recognize bad unspecified pointer args to Value ctors
+       // (it normally converts them to bool, which we handle, so you
+       // never see the error of your ways).  So do the world a
+       // favor, and don't expose this ctor. :)
+       Value (void* v) { }
 };
 
 //

Modified: trunk/moon/src/transform.h
===================================================================
--- trunk/moon/src/transform.h  2007-06-07 04:34:54 UTC (rev 78816)
+++ trunk/moon/src/transform.h  2007-06-07 04:42:18 UTC (rev 78817)
@@ -103,6 +103,10 @@
 void           matrix_transform_set_matrix (MatrixTransform *t, cairo_matrix_t 
matrix);
 cairo_matrix_t matrix_transform_get_matrix (MatrixTransform *t);
 
+
+class TransformGroup : public Transform {
+};
+
 G_END_DECLS
 
 #endif

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to