Author: jackson
Date: 2007-11-01 17:19:50 -0500 (Thu, 01 Nov 2007)
New Revision: 88693

Modified:
   trunk/moon/src/animation.h
   trunk/moon/src/brush.h
   trunk/moon/src/geometry.h
   trunk/moon/src/panel.h
   trunk/moon/src/text.h
   trunk/moon/src/transform.h
   trunk/moon/src/trigger.h
   trunk/moon/src/type.cpp
   trunk/moon/src/type.cpp.in
   trunk/moon/src/type.h
   trunk/moon/src/type.h.in
   trunk/moon/src/typegen.cs
Log:

        * trigger.h:
        * text.h:
        * geometry.h
        * transform.h:
        * animation.h:
        * brush.h:
        * panel.h: Add ContentProperty 'attributes'.
        * typegen.cs:
        * type.cpp|h:  Add content property information to types.  This
        will be used by the parser and will allow the parser to drop
it's
        special type system.




Modified: trunk/moon/src/animation.h
===================================================================
--- trunk/moon/src/animation.h  2007-11-01 22:16:01 UTC (rev 88692)
+++ trunk/moon/src/animation.h  2007-11-01 22:19:50 UTC (rev 88693)
@@ -457,7 +457,7 @@
 };
 
 
-
+/* @ContentProperty="KeyFrames" */
 class DoubleAnimationUsingKeyFrames : public DoubleAnimation {
  public:
        DoubleAnimationUsingKeyFrames ();
@@ -480,7 +480,7 @@
 };
 
 
-
+/* ContentProperty="KeyFrames" */
 class ColorAnimationUsingKeyFrames : public ColorAnimation {
  public:
        ColorAnimationUsingKeyFrames ();
@@ -502,6 +502,7 @@
        virtual Duration GetNaturalDurationCore (Clock* clock);
 };
 
+/* @ContentProperty="KeyFrames" */
 class PointAnimationUsingKeyFrames : public PointAnimation {
  public:
        PointAnimationUsingKeyFrames ();
@@ -523,6 +524,7 @@
        virtual Duration GetNaturalDurationCore (Clock* clock);
 };
 
+/* @ContentProperty="Children" */
 class Storyboard : public ParallelTimeline {
  public:
        Storyboard ();
@@ -559,6 +561,7 @@
        static void invoke_completed (EventObject *sender, gpointer calldata, 
gpointer data);
 };
 
+/* @ContentProperty="Storyboard" */
 class BeginStoryboard : public TriggerAction {
  public:
        BeginStoryboard () { }

Modified: trunk/moon/src/brush.h
===================================================================
--- trunk/moon/src/brush.h      2007-11-01 22:16:01 UTC (rev 88692)
+++ trunk/moon/src/brush.h      2007-11-01 22:19:50 UTC (rev 88693)
@@ -94,6 +94,7 @@
 
 
 // note: abstract in C#
+/* @ContentProperty="GradientStops" */
 class GradientBrush : public Brush {
  public:
        static DependencyProperty* ColorInterpolationModeProperty;

Modified: trunk/moon/src/geometry.h
===================================================================
--- trunk/moon/src/geometry.h   2007-11-01 22:16:01 UTC (rev 88692)
+++ trunk/moon/src/geometry.h   2007-11-01 22:19:50 UTC (rev 88693)
@@ -77,6 +77,7 @@
 //
 // GeometryGroup
 //
+/* @ContentProperty="Children" */
 class GeometryGroup : public Geometry {
  public:
        static DependencyProperty* ChildrenProperty;
@@ -154,6 +155,7 @@
 //
 // PathGeometry
 //
+/* @ContentProperty="Figures" */
 class PathGeometry : public Geometry {
  public:
        static DependencyProperty* FiguresProperty;
@@ -213,6 +215,7 @@
 //
 // PathFigure
 //
+/* @ContentProperty="Segments" */
 class PathFigure : public DependencyObject {
  protected:
        int path_size;

Modified: trunk/moon/src/panel.h
===================================================================
--- trunk/moon/src/panel.h      2007-11-01 22:16:01 UTC (rev 88692)
+++ trunk/moon/src/panel.h      2007-11-01 22:19:50 UTC (rev 88693)
@@ -12,6 +12,7 @@
 
 #include "frameworkelement.h"
 
+/* @ContentProperty="Children" */
 class Panel : public FrameworkElement {
        Brush *background;
 

Modified: trunk/moon/src/text.h
===================================================================
--- trunk/moon/src/text.h       2007-11-01 22:16:01 UTC (rev 88692)
+++ trunk/moon/src/text.h       2007-11-01 22:19:50 UTC (rev 88693)
@@ -81,6 +81,7 @@
 LineBreak *line_break_new (void);
 
 
+/* @ContentProperty="Text" */
 class Run : public Inline {
 public:
        static DependencyProperty *TextProperty;
@@ -96,6 +97,7 @@
 void run_set_text (Run *run, const char *value);
 
 
+/* @ContentProperty="Inlines" */
 class TextBlock : public FrameworkElement {
        union {
                PangoFontDescription *pango;

Modified: trunk/moon/src/transform.h
===================================================================
--- trunk/moon/src/transform.h  2007-11-01 22:16:01 UTC (rev 88692)
+++ trunk/moon/src/transform.h  2007-11-01 22:19:50 UTC (rev 88693)
@@ -162,6 +162,7 @@
 };
 TransformCollection* transform_collection_new ();
 
+/* @ContentProperty="Children" */
 class TransformGroup : public Transform {
 public:
        static DependencyProperty* ChildrenProperty;

Modified: trunk/moon/src/trigger.h
===================================================================
--- trunk/moon/src/trigger.h    2007-11-01 22:16:01 UTC (rev 88692)
+++ trunk/moon/src/trigger.h    2007-11-01 22:19:50 UTC (rev 88693)
@@ -21,6 +21,7 @@
 };
 
 
+/* @ContentProperty="Actions" */
 class EventTrigger : public DependencyObject {
  public:
        EventTrigger ();

Modified: trunk/moon/src/type.cpp
===================================================================
--- trunk/moon/src/type.cpp     2007-11-01 22:16:01 UTC (rev 88692)
+++ trunk/moon/src/type.cpp     2007-11-01 22:19:50 UTC (rev 88693)
@@ -130,9 +130,15 @@
 Type *
 Type::RegisterType (const char *name, Type::Kind type, bool value_type)
 {
-       return RegisterType (name, type, Type::INVALID, NULL, value_type);
+       return RegisterType (name, type, Type::INVALID, NULL, NULL, value_type);
 }
 
+Type *
+Type::RegisterType (const char *name, Type::Kind type, Type::Kind parent)
+{
+       return RegisterType (name, type, parent, NULL, NULL, false);
+}
+
 void
 Type::free_type (gpointer type)
 {
@@ -140,20 +146,14 @@
 }
 
 Type *
-Type::RegisterType (const char *name, Type::Kind type, Type::Kind parent)
+Type::RegisterType (const char *name, Type::Kind type, Type::Kind parent, 
create_inst_func *create_inst, const char *content_property)
 {
-       return RegisterType (name, type, parent, NULL, false);
+       return RegisterType (name, type, parent, create_inst, content_property, 
false);
 }
 
 Type *
-Type::RegisterType (const char *name, Type::Kind type, Type::Kind parent, 
create_inst_func *create_inst)
+Type::RegisterType (const char *name, Type::Kind type, Type::Kind parent, 
create_inst_func *create_inst, const char *content_property, bool value_type)
 {
-       return RegisterType (name, type, parent, create_inst, false);
-}
-
-Type *
-Type::RegisterType (const char *name, Type::Kind type, Type::Kind parent, 
create_inst_func *create_inst, bool value_type)
-{
        if (types == NULL) {
                types = (Type**)calloc (Type::LASTTYPE, sizeof (Type*));
        }
@@ -171,6 +171,7 @@
        g_hash_table_insert (types_by_name, result->name, result);
 
        result->create_inst = create_inst;
+       result->content_property = content_property;
 
        return result;
 }
@@ -376,120 +377,120 @@
 void
 types_init (void)
 {
-       Type::RegisterType ("DependencyObject", Type::DEPENDENCY_OBJECT, 
Type::EVENTOBJECT);
-       Type::RegisterType ("Animation", Type::ANIMATION, Type::TIMELINE);
-       Type::RegisterType ("AnimationClock", Type::ANIMATIONCLOCK, 
Type::CLOCK);
-       Type::RegisterType ("ArcSegment", Type::ARCSEGMENT, Type::PATHSEGMENT, 
(create_inst_func *) arc_segment_new);
-       Type::RegisterType ("BeginStoryboard", Type::BEGINSTORYBOARD, 
Type::TRIGGERACTION, (create_inst_func *) begin_storyboard_new);
-       Type::RegisterType ("BezierSegment", Type::BEZIERSEGMENT, 
Type::PATHSEGMENT, (create_inst_func *) bezier_segment_new);
-       Type::RegisterType ("Brush", Type::BRUSH, Type::DEPENDENCY_OBJECT, 
(create_inst_func *) brush_new);
-       Type::RegisterType ("Canvas", Type::CANVAS, Type::PANEL, 
(create_inst_func *) canvas_new);
-       Type::RegisterType ("Clock", Type::CLOCK, Type::DEPENDENCY_OBJECT);
-       Type::RegisterType ("ClockGroup", Type::CLOCKGROUP, Type::CLOCK);
-       Type::RegisterType ("Collection", Type::COLLECTION, 
Type::DEPENDENCY_OBJECT);
-       Type::RegisterType ("ColorAnimation", Type::COLORANIMATION, 
Type::ANIMATION, (create_inst_func *) color_animation_new);
-       Type::RegisterType ("ColorAnimationUsingKeyFrames", 
Type::COLORANIMATIONUSINGKEYFRAMES, Type::COLORANIMATION, (create_inst_func *) 
color_animation_using_key_frames_new);
-       Type::RegisterType ("ColorKeyFrame", Type::COLORKEYFRAME, 
Type::KEYFRAME, (create_inst_func *) color_key_frame_new);
-       Type::RegisterType ("ColorKeyFrameCollection", 
Type::COLORKEYFRAME_COLLECTION, Type::KEYFRAME_COLLECTION, (create_inst_func *) 
color_key_frame_collection_new);
-       Type::RegisterType ("Control", Type::CONTROL, Type::FRAMEWORKELEMENT, 
(create_inst_func *) control_new);
-       Type::RegisterType ("DiscreteColorKeyFrame", 
Type::DISCRETECOLORKEYFRAME, Type::COLORKEYFRAME, (create_inst_func *) 
discrete_color_key_frame_new);
-       Type::RegisterType ("DiscreteDoubleKeyFrame", 
Type::DISCRETEDOUBLEKEYFRAME, Type::DOUBLEKEYFRAME, (create_inst_func *) 
discrete_double_key_frame_new);
-       Type::RegisterType ("DiscretePointKeyFrame", 
Type::DISCRETEPOINTKEYFRAME, Type::POINTKEYFRAME, (create_inst_func *) 
discrete_point_key_frame_new);
-       Type::RegisterType ("DoubleAnimation", Type::DOUBLEANIMATION, 
Type::ANIMATION, (create_inst_func *) double_animation_new);
-       Type::RegisterType ("DoubleAnimationUsingKeyFrames", 
Type::DOUBLEANIMATIONUSINGKEYFRAMES, Type::DOUBLEANIMATION, (create_inst_func 
*) double_animation_using_key_frames_new);
-       Type::RegisterType ("DoubleKeyFrame", Type::DOUBLEKEYFRAME, 
Type::KEYFRAME, (create_inst_func *) double_key_frame_new);
-       Type::RegisterType ("DoubleKeyFrameCollection", 
Type::DOUBLEKEYFRAME_COLLECTION, Type::KEYFRAME_COLLECTION, (create_inst_func 
*) double_key_frame_collection_new);
-       Type::RegisterType ("Downloader", Type::DOWNLOADER, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) downloader_new);
-       Type::RegisterType ("DrawingAttributes", Type::DRAWINGATTRIBUTES, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) drawing_attributes_new);
-       Type::RegisterType ("Ellipse", Type::ELLIPSE, Type::SHAPE, 
(create_inst_func *) ellipse_new);
-       Type::RegisterType ("EllipseGeometry", Type::ELLIPSEGEOMETRY, 
Type::GEOMETRY, (create_inst_func *) ellipse_geometry_new);
-       Type::RegisterType ("EventTrigger", Type::EVENTTRIGGER, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) event_trigger_new);
-       Type::RegisterType ("FrameworkElement", Type::FRAMEWORKELEMENT, 
Type::UIELEMENT, (create_inst_func *) framework_element_new);
-       Type::RegisterType ("Geometry", Type::GEOMETRY, 
Type::DEPENDENCY_OBJECT);
-       Type::RegisterType ("GeometryCollection", Type::GEOMETRY_COLLECTION, 
Type::COLLECTION, (create_inst_func *) geometry_collection_new);
-       Type::RegisterType ("GeometryGroup", Type::GEOMETRYGROUP, 
Type::GEOMETRY);
-       Type::RegisterType ("Glyphs", Type::GLYPHS, Type::FRAMEWORKELEMENT, 
(create_inst_func *) glyphs_new);
-       Type::RegisterType ("GradientBrush", Type::GRADIENTBRUSH, Type::BRUSH, 
(create_inst_func *) gradient_brush_new);
-       Type::RegisterType ("GradientStop", Type::GRADIENTSTOP, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) gradient_stop_new);
-       Type::RegisterType ("GradientStopCollection", 
Type::GRADIENTSTOP_COLLECTION, Type::COLLECTION, (create_inst_func *) 
gradient_stop_collection_new);
-       Type::RegisterType ("Image", Type::IMAGE, Type::MEDIABASE, 
(create_inst_func *) image_new);
-       Type::RegisterType ("ImageBrush", Type::IMAGEBRUSH, Type::TILEBRUSH, 
(create_inst_func *) image_brush_new);
-       Type::RegisterType ("InkPresenter", Type::INKPRESENTER, Type::CANVAS, 
(create_inst_func *) ink_presenter_new);
-       Type::RegisterType ("Inline", Type::INLINE, Type::DEPENDENCY_OBJECT);
-       Type::RegisterType ("Inlines", Type::INLINES, Type::COLLECTION, 
(create_inst_func *) inlines_new);
-       Type::RegisterType ("KeyFrame", Type::KEYFRAME, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) key_frame_new);
-       Type::RegisterType ("KeyFrameCollection", Type::KEYFRAME_COLLECTION, 
Type::COLLECTION);
-       Type::RegisterType ("KeySpline", Type::KEYSPLINE, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) key_spline_new);
-       Type::RegisterType ("Line", Type::LINE, Type::SHAPE, (create_inst_func 
*) line_new);
-       Type::RegisterType ("LinearColorKeyFrame", Type::LINEARCOLORKEYFRAME, 
Type::COLORKEYFRAME, (create_inst_func *) linear_color_key_frame_new);
-       Type::RegisterType ("LinearDoubleKeyFrame", Type::LINEARDOUBLEKEYFRAME, 
Type::DOUBLEKEYFRAME, (create_inst_func *) linear_double_key_frame_new);
-       Type::RegisterType ("LinearGradientBrush", Type::LINEARGRADIENTBRUSH, 
Type::GRADIENTBRUSH, (create_inst_func *) linear_gradient_brush_new);
-       Type::RegisterType ("LinearPointKeyFrame", Type::LINEARPOINTKEYFRAME, 
Type::POINTKEYFRAME, (create_inst_func *) linear_point_key_frame_new);
-       Type::RegisterType ("LineBreak", Type::LINEBREAK, Type::INLINE, 
(create_inst_func *) line_break_new);
-       Type::RegisterType ("LineGeometry", Type::LINEGEOMETRY, Type::GEOMETRY, 
(create_inst_func *) line_geometry_new);
-       Type::RegisterType ("LineSegment", Type::LINESEGMENT, 
Type::PATHSEGMENT, (create_inst_func *) line_segment_new);
-       Type::RegisterType ("MatrixTransform", Type::MATRIXTRANSFORM, 
Type::TRANSFORM, (create_inst_func *) matrix_transform_new);
-       Type::RegisterType ("MediaAttribute", Type::MEDIAATTRIBUTE, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) media_attribute_new);
-       Type::RegisterType ("MediaAttributeCollection", 
Type::MEDIAATTRIBUTE_COLLECTION, Type::COLLECTION, (create_inst_func *) 
media_attribute_collection_new);
-       Type::RegisterType ("MediaBase", Type::MEDIABASE, 
Type::FRAMEWORKELEMENT, (create_inst_func *) media_base_new);
-       Type::RegisterType ("MediaElement", Type::MEDIAELEMENT, 
Type::MEDIABASE, (create_inst_func *) media_element_new);
-       Type::RegisterType ("NameScope", Type::NAMESCOPE, 
Type::DEPENDENCY_OBJECT);
-       Type::RegisterType ("Panel", Type::PANEL, Type::FRAMEWORKELEMENT, 
(create_inst_func *) panel_new);
-       Type::RegisterType ("ParallelTimeline", Type::PARALLELTIMELINE, 
Type::TIMELINEGROUP, (create_inst_func *) parallel_timeline_new);
-       Type::RegisterType ("Path", Type::PATH, Type::SHAPE, (create_inst_func 
*) path_new);
-       Type::RegisterType ("PathFigure", Type::PATHFIGURE, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) path_figure_new);
-       Type::RegisterType ("PathFigureCollection", 
Type::PATHFIGURE_COLLECTION, Type::COLLECTION, (create_inst_func *) 
path_figure_collection_new);
-       Type::RegisterType ("PathGeometry", Type::PATHGEOMETRY, Type::GEOMETRY);
-       Type::RegisterType ("PathSegment", Type::PATHSEGMENT, 
Type::DEPENDENCY_OBJECT);
-       Type::RegisterType ("PathSegmentCollection", 
Type::PATHSEGMENT_COLLECTION, Type::COLLECTION, (create_inst_func *) 
path_segment_collection_new);
-       Type::RegisterType ("PointAnimation", Type::POINTANIMATION, 
Type::ANIMATION, (create_inst_func *) point_animation_new);
-       Type::RegisterType ("PointAnimationUsingKeyFrames", 
Type::POINTANIMATIONUSINGKEYFRAMES, Type::POINTANIMATION, (create_inst_func *) 
point_animation_using_key_frames_new);
-       Type::RegisterType ("PointKeyFrame", Type::POINTKEYFRAME, 
Type::KEYFRAME, (create_inst_func *) point_key_frame_new);
-       Type::RegisterType ("PointKeyFrameCollection", 
Type::POINTKEYFRAME_COLLECTION, Type::KEYFRAME_COLLECTION, (create_inst_func *) 
point_key_frame_collection_new);
-       Type::RegisterType ("PolyBezierSegment", Type::POLYBEZIERSEGMENT, 
Type::PATHSEGMENT, (create_inst_func *) poly_bezier_segment_new);
-       Type::RegisterType ("Polygon", Type::POLYGON, Type::SHAPE);
-       Type::RegisterType ("Polyline", Type::POLYLINE, Type::SHAPE);
-       Type::RegisterType ("PolyLineSegment", Type::POLYLINESEGMENT, 
Type::PATHSEGMENT, (create_inst_func *) poly_line_segment_new);
-       Type::RegisterType ("PolyQuadraticBezierSegment", 
Type::POLYQUADRATICBEZIERSEGMENT, Type::PATHSEGMENT, (create_inst_func *) 
poly_quadratic_bezier_segment_new);
-       Type::RegisterType ("QuadraticBezierSegment", 
Type::QUADRATICBEZIERSEGMENT, Type::PATHSEGMENT, (create_inst_func *) 
quadratic_bezier_segment_new);
-       Type::RegisterType ("RadialGradientBrush", Type::RADIALGRADIENTBRUSH, 
Type::GRADIENTBRUSH, (create_inst_func *) radial_gradient_brush_new);
-       Type::RegisterType ("Rectangle", Type::RECTANGLE, Type::SHAPE, 
(create_inst_func *) rectangle_new);
-       Type::RegisterType ("RectangleGeometry", Type::RECTANGLEGEOMETRY, 
Type::GEOMETRY, (create_inst_func *) rectangle_geometry_new);
-       Type::RegisterType ("ResourceDictionary", Type::RESOURCE_DICTIONARY, 
Type::COLLECTION, (create_inst_func *) resource_dictionary_new);
-       Type::RegisterType ("RotateTransform", Type::ROTATETRANSFORM, 
Type::TRANSFORM, (create_inst_func *) rotate_transform_new);
-       Type::RegisterType ("Run", Type::RUN, Type::INLINE, (create_inst_func 
*) run_new);
-       Type::RegisterType ("ScaleTransform", Type::SCALETRANSFORM, 
Type::TRANSFORM, (create_inst_func *) scale_transform_new);
-       Type::RegisterType ("Shape", Type::SHAPE, Type::FRAMEWORKELEMENT);
-       Type::RegisterType ("SkewTransform", Type::SKEWTRANSFORM, 
Type::TRANSFORM, (create_inst_func *) skew_transform_new);
-       Type::RegisterType ("SolidColorBrush", Type::SOLIDCOLORBRUSH, 
Type::BRUSH, (create_inst_func *) solid_color_brush_new);
-       Type::RegisterType ("SplineColorKeyFrame", Type::SPLINECOLORKEYFRAME, 
Type::COLORKEYFRAME, (create_inst_func *) spline_color_key_frame_new);
-       Type::RegisterType ("SplineDoubleKeyFrame", Type::SPLINEDOUBLEKEYFRAME, 
Type::DOUBLEKEYFRAME, (create_inst_func *) spline_double_key_frame_new);
-       Type::RegisterType ("SplinePointKeyFrame", Type::SPLINEPOINTKEYFRAME, 
Type::POINTKEYFRAME, (create_inst_func *) spline_point_key_frame_new);
-       Type::RegisterType ("Storyboard", Type::STORYBOARD, 
Type::PARALLELTIMELINE, (create_inst_func *) storyboard_new);
-       Type::RegisterType ("Stroke", Type::STROKE, Type::DEPENDENCY_OBJECT, 
(create_inst_func *) stroke_new);
-       Type::RegisterType ("StrokeCollection", Type::STROKE_COLLECTION, 
Type::COLLECTION, (create_inst_func *) stroke_collection_new);
-       Type::RegisterType ("StylusInfo", Type::STYLUSINFO, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) stylus_info_new);
-       Type::RegisterType ("StylusPoint", Type::STYLUSPOINT, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) stylus_point_new);
-       Type::RegisterType ("StylusPointCollection", 
Type::STYLUSPOINT_COLLECTION, Type::COLLECTION, (create_inst_func *) 
stylus_point_collection_new);
-       Type::RegisterType ("TextBlock", Type::TEXTBLOCK, 
Type::FRAMEWORKELEMENT, (create_inst_func *) text_block_new);
-       Type::RegisterType ("TileBrush", Type::TILEBRUSH, Type::BRUSH, 
(create_inst_func *) tile_brush_new);
-       Type::RegisterType ("Timeline", Type::TIMELINE, 
Type::DEPENDENCY_OBJECT);
-       Type::RegisterType ("TimelineCollection", Type::TIMELINE_COLLECTION, 
Type::COLLECTION, (create_inst_func *) timeline_collection_new);
-       Type::RegisterType ("TimelineGroup", Type::TIMELINEGROUP, 
Type::TIMELINE, (create_inst_func *) timeline_group_new);
-       Type::RegisterType ("TimelineMarker", Type::TIMELINEMARKER, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) timeline_marker_new);
-       Type::RegisterType ("TimelineMarkerCollection", 
Type::TIMELINEMARKER_COLLECTION, Type::COLLECTION, (create_inst_func *) 
timeline_marker_collection_new);
-       Type::RegisterType ("Transform", Type::TRANSFORM, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) transform_new);
-       Type::RegisterType ("TransformCollection", Type::TRANSFORM_COLLECTION, 
Type::COLLECTION, (create_inst_func *) transform_collection_new);
-       Type::RegisterType ("TransformGroup", Type::TRANSFORMGROUP, 
Type::TRANSFORM, (create_inst_func *) transform_group_new);
-       Type::RegisterType ("TranslateTransform", Type::TRANSLATETRANSFORM, 
Type::TRANSFORM, (create_inst_func *) translate_transform_new);
-       Type::RegisterType ("TriggerAction", Type::TRIGGERACTION, 
Type::DEPENDENCY_OBJECT);
-       Type::RegisterType ("TriggerActionCollection", 
Type::TRIGGERACTION_COLLECTION, Type::COLLECTION, (create_inst_func *) 
trigger_action_collection_new);
-       Type::RegisterType ("TriggerCollection", Type::TRIGGER_COLLECTION, 
Type::COLLECTION, (create_inst_func *) trigger_collection_new);
-       Type::RegisterType ("UIElement", Type::UIELEMENT, Type::VISUAL, 
(create_inst_func *) uielement_new);
-       Type::RegisterType ("VideoBrush", Type::VIDEOBRUSH, Type::TILEBRUSH, 
(create_inst_func *) video_brush_new);
-       Type::RegisterType ("Visual", Type::VISUAL, Type::DEPENDENCY_OBJECT);
-       Type::RegisterType ("VisualBrush", Type::VISUALBRUSH, Type::TILEBRUSH, 
(create_inst_func *) visual_brush_new);
-       Type::RegisterType ("VisualCollection", Type::VISUAL_COLLECTION, 
Type::COLLECTION, (create_inst_func *) visual_collection_new);
+       Type::RegisterType ("DependencyObject", Type::DEPENDENCY_OBJECT, 
Type::EVENTOBJECT, NULL, NULL);
+       Type::RegisterType ("Animation", Type::ANIMATION, Type::TIMELINE, NULL, 
NULL);
+       Type::RegisterType ("AnimationClock", Type::ANIMATIONCLOCK, 
Type::CLOCK, NULL, NULL);
+       Type::RegisterType ("ArcSegment", Type::ARCSEGMENT, Type::PATHSEGMENT, 
(create_inst_func *) arc_segment_new, NULL);
+       Type::RegisterType ("BeginStoryboard", Type::BEGINSTORYBOARD, 
Type::TRIGGERACTION, (create_inst_func *) begin_storyboard_new, "Storyboard");
+       Type::RegisterType ("BezierSegment", Type::BEZIERSEGMENT, 
Type::PATHSEGMENT, (create_inst_func *) bezier_segment_new, NULL);
+       Type::RegisterType ("Brush", Type::BRUSH, Type::DEPENDENCY_OBJECT, 
(create_inst_func *) brush_new, NULL);
+       Type::RegisterType ("Canvas", Type::CANVAS, Type::PANEL, 
(create_inst_func *) canvas_new, NULL);
+       Type::RegisterType ("Clock", Type::CLOCK, Type::DEPENDENCY_OBJECT, 
NULL, NULL);
+       Type::RegisterType ("ClockGroup", Type::CLOCKGROUP, Type::CLOCK, NULL, 
NULL);
+       Type::RegisterType ("Collection", Type::COLLECTION, 
Type::DEPENDENCY_OBJECT, NULL, NULL);
+       Type::RegisterType ("ColorAnimation", Type::COLORANIMATION, 
Type::ANIMATION, (create_inst_func *) color_animation_new, NULL);
+       Type::RegisterType ("ColorAnimationUsingKeyFrames", 
Type::COLORANIMATIONUSINGKEYFRAMES, Type::COLORANIMATION, (create_inst_func *) 
color_animation_using_key_frames_new, NULL);
+       Type::RegisterType ("ColorKeyFrame", Type::COLORKEYFRAME, 
Type::KEYFRAME, (create_inst_func *) color_key_frame_new, NULL);
+       Type::RegisterType ("ColorKeyFrameCollection", 
Type::COLORKEYFRAME_COLLECTION, Type::KEYFRAME_COLLECTION, (create_inst_func *) 
color_key_frame_collection_new, NULL);
+       Type::RegisterType ("Control", Type::CONTROL, Type::FRAMEWORKELEMENT, 
(create_inst_func *) control_new, NULL);
+       Type::RegisterType ("DiscreteColorKeyFrame", 
Type::DISCRETECOLORKEYFRAME, Type::COLORKEYFRAME, (create_inst_func *) 
discrete_color_key_frame_new, NULL);
+       Type::RegisterType ("DiscreteDoubleKeyFrame", 
Type::DISCRETEDOUBLEKEYFRAME, Type::DOUBLEKEYFRAME, (create_inst_func *) 
discrete_double_key_frame_new, NULL);
+       Type::RegisterType ("DiscretePointKeyFrame", 
Type::DISCRETEPOINTKEYFRAME, Type::POINTKEYFRAME, (create_inst_func *) 
discrete_point_key_frame_new, NULL);
+       Type::RegisterType ("DoubleAnimation", Type::DOUBLEANIMATION, 
Type::ANIMATION, (create_inst_func *) double_animation_new, NULL);
+       Type::RegisterType ("DoubleAnimationUsingKeyFrames", 
Type::DOUBLEANIMATIONUSINGKEYFRAMES, Type::DOUBLEANIMATION, (create_inst_func 
*) double_animation_using_key_frames_new, "KeyFrames");
+       Type::RegisterType ("DoubleKeyFrame", Type::DOUBLEKEYFRAME, 
Type::KEYFRAME, (create_inst_func *) double_key_frame_new, NULL);
+       Type::RegisterType ("DoubleKeyFrameCollection", 
Type::DOUBLEKEYFRAME_COLLECTION, Type::KEYFRAME_COLLECTION, (create_inst_func 
*) double_key_frame_collection_new, NULL);
+       Type::RegisterType ("Downloader", Type::DOWNLOADER, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) downloader_new, NULL);
+       Type::RegisterType ("DrawingAttributes", Type::DRAWINGATTRIBUTES, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) drawing_attributes_new, NULL);
+       Type::RegisterType ("Ellipse", Type::ELLIPSE, Type::SHAPE, 
(create_inst_func *) ellipse_new, NULL);
+       Type::RegisterType ("EllipseGeometry", Type::ELLIPSEGEOMETRY, 
Type::GEOMETRY, (create_inst_func *) ellipse_geometry_new, NULL);
+       Type::RegisterType ("EventTrigger", Type::EVENTTRIGGER, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) event_trigger_new, "Actions");
+       Type::RegisterType ("FrameworkElement", Type::FRAMEWORKELEMENT, 
Type::UIELEMENT, (create_inst_func *) framework_element_new, NULL);
+       Type::RegisterType ("Geometry", Type::GEOMETRY, 
Type::DEPENDENCY_OBJECT, NULL, NULL);
+       Type::RegisterType ("GeometryCollection", Type::GEOMETRY_COLLECTION, 
Type::COLLECTION, (create_inst_func *) geometry_collection_new, NULL);
+       Type::RegisterType ("GeometryGroup", Type::GEOMETRYGROUP, 
Type::GEOMETRY, NULL, "Children");
+       Type::RegisterType ("Glyphs", Type::GLYPHS, Type::FRAMEWORKELEMENT, 
(create_inst_func *) glyphs_new, NULL);
+       Type::RegisterType ("GradientBrush", Type::GRADIENTBRUSH, Type::BRUSH, 
(create_inst_func *) gradient_brush_new, "GradientStops");
+       Type::RegisterType ("GradientStop", Type::GRADIENTSTOP, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) gradient_stop_new, NULL);
+       Type::RegisterType ("GradientStopCollection", 
Type::GRADIENTSTOP_COLLECTION, Type::COLLECTION, (create_inst_func *) 
gradient_stop_collection_new, NULL);
+       Type::RegisterType ("Image", Type::IMAGE, Type::MEDIABASE, 
(create_inst_func *) image_new, NULL);
+       Type::RegisterType ("ImageBrush", Type::IMAGEBRUSH, Type::TILEBRUSH, 
(create_inst_func *) image_brush_new, NULL);
+       Type::RegisterType ("InkPresenter", Type::INKPRESENTER, Type::CANVAS, 
(create_inst_func *) ink_presenter_new, NULL);
+       Type::RegisterType ("Inline", Type::INLINE, Type::DEPENDENCY_OBJECT, 
NULL, NULL);
+       Type::RegisterType ("Inlines", Type::INLINES, Type::COLLECTION, 
(create_inst_func *) inlines_new, NULL);
+       Type::RegisterType ("KeyFrame", Type::KEYFRAME, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) key_frame_new, NULL);
+       Type::RegisterType ("KeyFrameCollection", Type::KEYFRAME_COLLECTION, 
Type::COLLECTION, NULL, NULL);
+       Type::RegisterType ("KeySpline", Type::KEYSPLINE, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) key_spline_new, NULL);
+       Type::RegisterType ("Line", Type::LINE, Type::SHAPE, (create_inst_func 
*) line_new, NULL);
+       Type::RegisterType ("LinearColorKeyFrame", Type::LINEARCOLORKEYFRAME, 
Type::COLORKEYFRAME, (create_inst_func *) linear_color_key_frame_new, NULL);
+       Type::RegisterType ("LinearDoubleKeyFrame", Type::LINEARDOUBLEKEYFRAME, 
Type::DOUBLEKEYFRAME, (create_inst_func *) linear_double_key_frame_new, NULL);
+       Type::RegisterType ("LinearGradientBrush", Type::LINEARGRADIENTBRUSH, 
Type::GRADIENTBRUSH, (create_inst_func *) linear_gradient_brush_new, NULL);
+       Type::RegisterType ("LinearPointKeyFrame", Type::LINEARPOINTKEYFRAME, 
Type::POINTKEYFRAME, (create_inst_func *) linear_point_key_frame_new, NULL);
+       Type::RegisterType ("LineBreak", Type::LINEBREAK, Type::INLINE, 
(create_inst_func *) line_break_new, NULL);
+       Type::RegisterType ("LineGeometry", Type::LINEGEOMETRY, Type::GEOMETRY, 
(create_inst_func *) line_geometry_new, NULL);
+       Type::RegisterType ("LineSegment", Type::LINESEGMENT, 
Type::PATHSEGMENT, (create_inst_func *) line_segment_new, NULL);
+       Type::RegisterType ("MatrixTransform", Type::MATRIXTRANSFORM, 
Type::TRANSFORM, (create_inst_func *) matrix_transform_new, NULL);
+       Type::RegisterType ("MediaAttribute", Type::MEDIAATTRIBUTE, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) media_attribute_new, NULL);
+       Type::RegisterType ("MediaAttributeCollection", 
Type::MEDIAATTRIBUTE_COLLECTION, Type::COLLECTION, (create_inst_func *) 
media_attribute_collection_new, NULL);
+       Type::RegisterType ("MediaBase", Type::MEDIABASE, 
Type::FRAMEWORKELEMENT, (create_inst_func *) media_base_new, NULL);
+       Type::RegisterType ("MediaElement", Type::MEDIAELEMENT, 
Type::MEDIABASE, (create_inst_func *) media_element_new, NULL);
+       Type::RegisterType ("NameScope", Type::NAMESCOPE, 
Type::DEPENDENCY_OBJECT, NULL, NULL);
+       Type::RegisterType ("Panel", Type::PANEL, Type::FRAMEWORKELEMENT, 
(create_inst_func *) panel_new, "Children");
+       Type::RegisterType ("ParallelTimeline", Type::PARALLELTIMELINE, 
Type::TIMELINEGROUP, (create_inst_func *) parallel_timeline_new, NULL);
+       Type::RegisterType ("Path", Type::PATH, Type::SHAPE, (create_inst_func 
*) path_new, NULL);
+       Type::RegisterType ("PathFigure", Type::PATHFIGURE, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) path_figure_new, "Segments");
+       Type::RegisterType ("PathFigureCollection", 
Type::PATHFIGURE_COLLECTION, Type::COLLECTION, (create_inst_func *) 
path_figure_collection_new, NULL);
+       Type::RegisterType ("PathGeometry", Type::PATHGEOMETRY, Type::GEOMETRY, 
NULL, "Figures");
+       Type::RegisterType ("PathSegment", Type::PATHSEGMENT, 
Type::DEPENDENCY_OBJECT, NULL, NULL);
+       Type::RegisterType ("PathSegmentCollection", 
Type::PATHSEGMENT_COLLECTION, Type::COLLECTION, (create_inst_func *) 
path_segment_collection_new, NULL);
+       Type::RegisterType ("PointAnimation", Type::POINTANIMATION, 
Type::ANIMATION, (create_inst_func *) point_animation_new, NULL);
+       Type::RegisterType ("PointAnimationUsingKeyFrames", 
Type::POINTANIMATIONUSINGKEYFRAMES, Type::POINTANIMATION, (create_inst_func *) 
point_animation_using_key_frames_new, "KeyFrames");
+       Type::RegisterType ("PointKeyFrame", Type::POINTKEYFRAME, 
Type::KEYFRAME, (create_inst_func *) point_key_frame_new, NULL);
+       Type::RegisterType ("PointKeyFrameCollection", 
Type::POINTKEYFRAME_COLLECTION, Type::KEYFRAME_COLLECTION, (create_inst_func *) 
point_key_frame_collection_new, NULL);
+       Type::RegisterType ("PolyBezierSegment", Type::POLYBEZIERSEGMENT, 
Type::PATHSEGMENT, (create_inst_func *) poly_bezier_segment_new, NULL);
+       Type::RegisterType ("Polygon", Type::POLYGON, Type::SHAPE, NULL, NULL);
+       Type::RegisterType ("Polyline", Type::POLYLINE, Type::SHAPE, NULL, 
NULL);
+       Type::RegisterType ("PolyLineSegment", Type::POLYLINESEGMENT, 
Type::PATHSEGMENT, (create_inst_func *) poly_line_segment_new, NULL);
+       Type::RegisterType ("PolyQuadraticBezierSegment", 
Type::POLYQUADRATICBEZIERSEGMENT, Type::PATHSEGMENT, (create_inst_func *) 
poly_quadratic_bezier_segment_new, NULL);
+       Type::RegisterType ("QuadraticBezierSegment", 
Type::QUADRATICBEZIERSEGMENT, Type::PATHSEGMENT, (create_inst_func *) 
quadratic_bezier_segment_new, NULL);
+       Type::RegisterType ("RadialGradientBrush", Type::RADIALGRADIENTBRUSH, 
Type::GRADIENTBRUSH, (create_inst_func *) radial_gradient_brush_new, NULL);
+       Type::RegisterType ("Rectangle", Type::RECTANGLE, Type::SHAPE, 
(create_inst_func *) rectangle_new, NULL);
+       Type::RegisterType ("RectangleGeometry", Type::RECTANGLEGEOMETRY, 
Type::GEOMETRY, (create_inst_func *) rectangle_geometry_new, NULL);
+       Type::RegisterType ("ResourceDictionary", Type::RESOURCE_DICTIONARY, 
Type::COLLECTION, (create_inst_func *) resource_dictionary_new, NULL);
+       Type::RegisterType ("RotateTransform", Type::ROTATETRANSFORM, 
Type::TRANSFORM, (create_inst_func *) rotate_transform_new, NULL);
+       Type::RegisterType ("Run", Type::RUN, Type::INLINE, (create_inst_func 
*) run_new, "Text");
+       Type::RegisterType ("ScaleTransform", Type::SCALETRANSFORM, 
Type::TRANSFORM, (create_inst_func *) scale_transform_new, NULL);
+       Type::RegisterType ("Shape", Type::SHAPE, Type::FRAMEWORKELEMENT, NULL, 
NULL);
+       Type::RegisterType ("SkewTransform", Type::SKEWTRANSFORM, 
Type::TRANSFORM, (create_inst_func *) skew_transform_new, NULL);
+       Type::RegisterType ("SolidColorBrush", Type::SOLIDCOLORBRUSH, 
Type::BRUSH, (create_inst_func *) solid_color_brush_new, NULL);
+       Type::RegisterType ("SplineColorKeyFrame", Type::SPLINECOLORKEYFRAME, 
Type::COLORKEYFRAME, (create_inst_func *) spline_color_key_frame_new, NULL);
+       Type::RegisterType ("SplineDoubleKeyFrame", Type::SPLINEDOUBLEKEYFRAME, 
Type::DOUBLEKEYFRAME, (create_inst_func *) spline_double_key_frame_new, NULL);
+       Type::RegisterType ("SplinePointKeyFrame", Type::SPLINEPOINTKEYFRAME, 
Type::POINTKEYFRAME, (create_inst_func *) spline_point_key_frame_new, NULL);
+       Type::RegisterType ("Storyboard", Type::STORYBOARD, 
Type::PARALLELTIMELINE, (create_inst_func *) storyboard_new, "Children");
+       Type::RegisterType ("Stroke", Type::STROKE, Type::DEPENDENCY_OBJECT, 
(create_inst_func *) stroke_new, NULL);
+       Type::RegisterType ("StrokeCollection", Type::STROKE_COLLECTION, 
Type::COLLECTION, (create_inst_func *) stroke_collection_new, NULL);
+       Type::RegisterType ("StylusInfo", Type::STYLUSINFO, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) stylus_info_new, NULL);
+       Type::RegisterType ("StylusPoint", Type::STYLUSPOINT, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) stylus_point_new, NULL);
+       Type::RegisterType ("StylusPointCollection", 
Type::STYLUSPOINT_COLLECTION, Type::COLLECTION, (create_inst_func *) 
stylus_point_collection_new, NULL);
+       Type::RegisterType ("TextBlock", Type::TEXTBLOCK, 
Type::FRAMEWORKELEMENT, (create_inst_func *) text_block_new, "Inlines");
+       Type::RegisterType ("TileBrush", Type::TILEBRUSH, Type::BRUSH, 
(create_inst_func *) tile_brush_new, NULL);
+       Type::RegisterType ("Timeline", Type::TIMELINE, 
Type::DEPENDENCY_OBJECT, NULL, NULL);
+       Type::RegisterType ("TimelineCollection", Type::TIMELINE_COLLECTION, 
Type::COLLECTION, (create_inst_func *) timeline_collection_new, NULL);
+       Type::RegisterType ("TimelineGroup", Type::TIMELINEGROUP, 
Type::TIMELINE, (create_inst_func *) timeline_group_new, NULL);
+       Type::RegisterType ("TimelineMarker", Type::TIMELINEMARKER, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) timeline_marker_new, NULL);
+       Type::RegisterType ("TimelineMarkerCollection", 
Type::TIMELINEMARKER_COLLECTION, Type::COLLECTION, (create_inst_func *) 
timeline_marker_collection_new, NULL);
+       Type::RegisterType ("Transform", Type::TRANSFORM, 
Type::DEPENDENCY_OBJECT, (create_inst_func *) transform_new, NULL);
+       Type::RegisterType ("TransformCollection", Type::TRANSFORM_COLLECTION, 
Type::COLLECTION, (create_inst_func *) transform_collection_new, NULL);
+       Type::RegisterType ("TransformGroup", Type::TRANSFORMGROUP, 
Type::TRANSFORM, (create_inst_func *) transform_group_new, "Children");
+       Type::RegisterType ("TranslateTransform", Type::TRANSLATETRANSFORM, 
Type::TRANSFORM, (create_inst_func *) translate_transform_new, NULL);
+       Type::RegisterType ("TriggerAction", Type::TRIGGERACTION, 
Type::DEPENDENCY_OBJECT, NULL, NULL);
+       Type::RegisterType ("TriggerActionCollection", 
Type::TRIGGERACTION_COLLECTION, Type::COLLECTION, (create_inst_func *) 
trigger_action_collection_new, NULL);
+       Type::RegisterType ("TriggerCollection", Type::TRIGGER_COLLECTION, 
Type::COLLECTION, (create_inst_func *) trigger_collection_new, NULL);
+       Type::RegisterType ("UIElement", Type::UIELEMENT, Type::VISUAL, 
(create_inst_func *) uielement_new, NULL);
+       Type::RegisterType ("VideoBrush", Type::VIDEOBRUSH, Type::TILEBRUSH, 
(create_inst_func *) video_brush_new, NULL);
+       Type::RegisterType ("Visual", Type::VISUAL, Type::DEPENDENCY_OBJECT, 
NULL, NULL);
+       Type::RegisterType ("VisualBrush", Type::VISUALBRUSH, Type::TILEBRUSH, 
(create_inst_func *) visual_brush_new, NULL);
+       Type::RegisterType ("VisualCollection", Type::VISUAL_COLLECTION, 
Type::COLLECTION, (create_inst_func *) visual_collection_new, NULL);
        types_init_manually ();
        types_init_register_events ();
 }

Modified: trunk/moon/src/type.cpp.in
===================================================================
--- trunk/moon/src/type.cpp.in  2007-11-01 22:16:01 UTC (rev 88692)
+++ trunk/moon/src/type.cpp.in  2007-11-01 22:19:50 UTC (rev 88693)
@@ -125,9 +125,15 @@
 Type *
 Type::RegisterType (const char *name, Type::Kind type, bool value_type)
 {
-       return RegisterType (name, type, Type::INVALID, NULL, value_type);
+       return RegisterType (name, type, Type::INVALID, NULL, NULL, value_type);
 }
 
+Type *
+Type::RegisterType (const char *name, Type::Kind type, Type::Kind parent)
+{
+       return RegisterType (name, type, parent, NULL, NULL, false);
+}
+
 void
 Type::free_type (gpointer type)
 {
@@ -135,20 +141,14 @@
 }
 
 Type *
-Type::RegisterType (const char *name, Type::Kind type, Type::Kind parent)
+Type::RegisterType (const char *name, Type::Kind type, Type::Kind parent, 
create_inst_func *create_inst, const char *content_property)
 {
-       return RegisterType (name, type, parent, NULL, false);
+       return RegisterType (name, type, parent, create_inst, content_property, 
false);
 }
 
 Type *
-Type::RegisterType (const char *name, Type::Kind type, Type::Kind parent, 
create_inst_func *create_inst)
+Type::RegisterType (const char *name, Type::Kind type, Type::Kind parent, 
create_inst_func *create_inst, const char *content_property, bool value_type)
 {
-       return RegisterType (name, type, parent, create_inst, false);
-}
-
-Type *
-Type::RegisterType (const char *name, Type::Kind type, Type::Kind parent, 
create_inst_func *create_inst, bool value_type)
-{
        if (types == NULL) {
                types = (Type**)calloc (Type::LASTTYPE, sizeof (Type*));
        }
@@ -166,6 +166,7 @@
        g_hash_table_insert (types_by_name, result->name, result);
 
        result->create_inst = create_inst;
+       result->content_property = content_property;
 
        return result;
 }

Modified: trunk/moon/src/type.h
===================================================================
--- trunk/moon/src/type.h       2007-11-01 22:16:01 UTC (rev 88692)
+++ trunk/moon/src/type.h       2007-11-01 22:19:50 UTC (rev 88693)
@@ -173,10 +173,11 @@
        // END_MANAGED_MAPPING
                };
 
-       static Type* RegisterType (const char *name, Type::Kind type, 
Type::Kind parent, create_inst_func *create_inst, bool value_type);
-       static Type* RegisterType (const char *name, Type::Kind type, 
Type::Kind parent, create_inst_func *create_inst);
+       static Type* RegisterType (const char *name, Type::Kind type, 
Type::Kind parent, create_inst_func *create_inst, const char *content_property, 
bool value_type);
+       static Type* RegisterType (const char *name, Type::Kind type, 
Type::Kind parent, create_inst_func *create_inst, const char *content_property);
        static Type* RegisterType (const char *name, Type::Kind type, 
Type::Kind parent);
        static Type* RegisterType (const char *name, Type::Kind type, bool 
value_type);
+
        static Type* Find (const char *name);
        static Type* Find (Type::Kind type);
        
@@ -184,6 +185,7 @@
        Type::Kind parent;
        Type::Kind type;
        char *name;
+       const char *content_property;
        bool value_type;
 
        void RegisterEvent (const char *event_name);

Modified: trunk/moon/src/type.h.in
===================================================================
--- trunk/moon/src/type.h.in    2007-11-01 22:16:01 UTC (rev 88692)
+++ trunk/moon/src/type.h.in    2007-11-01 22:19:50 UTC (rev 88693)
@@ -55,10 +55,11 @@
        // END_MANAGED_MAPPING
                };
 
-       static Type* RegisterType (const char *name, Type::Kind type, 
Type::Kind parent, create_inst_func *create_inst, bool value_type);
-       static Type* RegisterType (const char *name, Type::Kind type, 
Type::Kind parent, create_inst_func *create_inst);
+       static Type* RegisterType (const char *name, Type::Kind type, 
Type::Kind parent, create_inst_func *create_inst, const char *content_property, 
bool value_type);
+       static Type* RegisterType (const char *name, Type::Kind type, 
Type::Kind parent, create_inst_func *create_inst, const char *content_property);
        static Type* RegisterType (const char *name, Type::Kind type, 
Type::Kind parent);
        static Type* RegisterType (const char *name, Type::Kind type, bool 
value_type);
+
        static Type* Find (const char *name);
        static Type* Find (Type::Kind type);
        
@@ -66,6 +67,7 @@
        Type::Kind parent;
        Type::Kind type;
        char *name;
+       const char *content_property;
        bool value_type;
 
        void RegisterEvent (const char *event_name);

Modified: trunk/moon/src/typegen.cs
===================================================================
--- trunk/moon/src/typegen.cs   2007-11-01 22:16:01 UTC (rev 88692)
+++ trunk/moon/src/typegen.cs   2007-11-01 22:19:50 UTC (rev 88693)
@@ -13,10 +13,11 @@
                ArrayList classes = new ArrayList ();
                Hashtable bases = new Hashtable ();
                Hashtable cctors = new Hashtable ();
+               Hashtable contprops = new Hashtable ();
 
-               GetClasses (classes, bases, cctors);
+               GetClasses (classes, bases, cctors, contprops);
 
-               GenerateTypeCpp (classes, bases, cctors);
+               GenerateTypeCpp (classes, bases, cctors, contprops);
                GenerateValueH (classes, bases);        
                GenerateValueCpp (classes, bases);
                GenerateTypeH (classes, bases);
@@ -76,10 +77,11 @@
                }
        }
 
-       static void GetClasses (ArrayList classes, Hashtable bases, Hashtable 
cctors)
+       static void GetClasses (ArrayList classes, Hashtable bases, Hashtable 
cctors, Hashtable contprops)
        {
                string [] files = Directory.GetFiles 
(Environment.CurrentDirectory, "*.h");
                ArrayList tmp = new ArrayList ();
+               string next_content_property = null;
 
                foreach (string file in files) {
                        string [] lines = File.ReadAllLines (file);
@@ -88,13 +90,15 @@
 
                                // This could probably be replaced by a regexp
                                if (!l.Trim ().StartsWith ("class ")) {
-                               // Console.WriteLine ("line:  " + l);
+
+
+                                       Match m = Regex.Match (l, 
"@ContentProperty\\s*=\\s*\"(.*)\"");
+                                       if (m.Success) {
+                                               next_content_property = 
m.Groups [1].Value;
+                                       }
+
+
                                         if (Regex.IsMatch (l, 
"_new\\s*\\(\\s*(void)?\\s*\\);")) {
-                               // cctors [CToPascal (l.Trim ())] = CCtor 
(l.Trim ());
-                               // Console.WriteLine ("{0}  == {1}", CToPascal 
(l.Trim ()), CCtor (l.Trim ()));
-                               //                              
ClassNameFromCCtor (l.Trim ());
-                               // CCtor (l.Trim ());
-
                                                 MapClassNameToCCtor (l.Trim 
(), cctors);
                                         }
                                        continue;
@@ -126,10 +130,14 @@
                                        //Console.WriteLine ("Already added " + 
c);
                                } else {
                                        tmp.Add (c.Trim ());
+                                       if (next_content_property != null) {
+                                               contprops [c.Trim ()] = 
next_content_property;
+                                       }
                                }
                                if (p != null && p != string.Empty) 
                                        bases.Add (c.Trim (), p.Trim ());
-                               
+
+                               next_content_property = null;
                        }
                }
                tmp.Sort ();
@@ -266,7 +274,7 @@
 //             File.WriteAllText (file, text.ToString ());
        }
 
-       static void GenerateTypeCpp (ArrayList classes, Hashtable hash, 
Hashtable cctors)
+       static void GenerateTypeCpp (ArrayList classes, Hashtable hash, 
Hashtable cctors, Hashtable contprops)
        {
                StringBuilder text = new StringBuilder ();
                text.AppendLine ("/*");
@@ -284,8 +292,10 @@
 
                        if (p != null && p != string.Empty) {
                                 string cctor = cctors [c] as string;
-                               text.AppendLine (String.Format 
("\tType::RegisterType (\"{0}\", Type::{1}, Type::{2}{3});", c, getU(c), getU 
(p),
-                                                cctor != null ? String.Concat 
(", (create_inst_func *) ", cctor) : String.Empty));
+                               string ctprp = contprops [c] as string;
+                               text.AppendLine (String.Format 
("\tType::RegisterType (\"{0}\", Type::{1}, Type::{2}, {3}, {4});", c, getU(c), 
getU (p),
+                                                cctor != null ? String.Concat 
("(create_inst_func *) ", cctor) : "NULL",
+                                               ctprp != null ? String.Concat 
("\"", ctprp, "\"") : "NULL"));
                        }
                }
                text.AppendLine ("\ttypes_init_manually ();");

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

Reply via email to