Author: fejj
Date: 2007-06-13 15:59:30 -0400 (Wed, 13 Jun 2007)
New Revision: 79496

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/brush.cpp
   trunk/moon/src/brush.h
   trunk/moon/src/text.cpp
   trunk/moon/src/text.h
Log:
2007-06-13  Jeffrey Stedfast  <[EMAIL PROTECTED]>

        * brush.cpp (OnPropertyChanged): Free list nodes as we iterate
        (soptimsation, woot).

        * text.cpp: Implemented c wrappers for Inline



Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-06-13 19:44:11 UTC (rev 79495)
+++ trunk/moon/src/ChangeLog    2007-06-13 19:59:30 UTC (rev 79496)
@@ -1,3 +1,10 @@
+2007-06-13  Jeffrey Stedfast  <[EMAIL PROTECTED]>
+
+       * brush.cpp (OnPropertyChanged): Free list nodes as we iterate
+       (soptimsation, woot).
+
+       * text.cpp: Implemented c wrappers for Inline
+
 2007-06-13  Sebastien Pouliot  <[EMAIL PROTECTED]> 
 
        * brush.cpp: Implemented LinearGradientBrush::SetupBrush

Modified: trunk/moon/src/brush.cpp
===================================================================
--- trunk/moon/src/brush.cpp    2007-06-13 19:44:11 UTC (rev 79495)
+++ trunk/moon/src/brush.cpp    2007-06-13 19:59:30 UTC (rev 79496)
@@ -429,18 +429,23 @@
 
        if (prop == GradientStopsProperty){
                // The new value has already been set, so unref the old 
collection
-
                GradientStopCollection *newcol = GetValue 
(prop)->AsGradientStopCollection();
 
                if (newcol != children){
-                       if (children){
-                               for (GSList *l = children->list; l != NULL; l = 
l->next){
-                                       DependencyObject *dob = 
(DependencyObject *) l->data;
-                                       
+                       if (children) {
+                               DependencyObject *dob;
+                               GSList *node, *next;
+                               
+                               node = children->list;
+                               while (node != NULL) {
+                                       dob = (DependencyObject *) node->data;
                                        base_unref (dob);
+                                       next = node->next;
+                                       g_slist_free_1 (node);
+                                       node = next;
                                }
+                               
                                base_unref (children);
-                               g_slist_free (children->list);
                        }
 
                        children = newcol;

Modified: trunk/moon/src/brush.h
===================================================================
--- trunk/moon/src/brush.h      2007-06-13 19:44:11 UTC (rev 79495)
+++ trunk/moon/src/brush.h      2007-06-13 19:59:30 UTC (rev 79496)
@@ -28,12 +28,11 @@
        static DependencyProperty* RelativeTransformProperty;
        static DependencyProperty* TransformProperty;
 
-       Brush ()
-       {
-       }
+       Brush () { }
        Value::Kind GetObjectType () { return Value::BRUSH; };
        virtual void SetupBrush (cairo_t *cairo, UIElement *uielement) = 0;
 };
+
 double         brush_get_opacity               (Brush *brush);
 void           brush_set_opacity               (Brush *brush, double opacity);
 TransformGroup *brush_get_relative_transform   (Brush *brush);
@@ -43,7 +42,6 @@
 
 
 class SolidColorBrush : public Brush {
-
  public:
        static DependencyProperty* ColorProperty;
 
@@ -53,6 +51,7 @@
 
        virtual void SetupBrush (cairo_t *cairo, UIElement *uielement);
 };
+
 SolidColorBrush        *solid_color_brush_new ();
 Color          *solid_color_brush_get_color (SolidColorBrush 
*solid_color_brush);
 void           solid_color_brush_set_color (SolidColorBrush 
*solid_color_brush, Color *color);
@@ -73,6 +72,7 @@
        virtual void OnPropertyChanged (DependencyProperty *prop);
        virtual void SetupPattern (cairo_pattern_t *pattern);
 };
+
 ColorInterpolationMode gradient_brush_get_color_interpolation_mode 
(GradientBrush *brush);
 void gradient_brush_set_color_interpolation_mode (GradientBrush *brush, 
ColorInterpolationMode mode);
 GradientStopCollection *gradient_brush_get_gradient_stops (GradientBrush 
*brush);
@@ -104,6 +104,7 @@
 
        virtual void SetupBrush (cairo_t *cairo, UIElement *uielement);
 };
+
 LinearGradientBrush *linear_gradient_brush_new ();
 Point  *linear_gradient_brush_get_end_point    (LinearGradientBrush *brush);
 void   linear_gradient_brush_set_end_point     (LinearGradientBrush *brush, 
Point *point);
@@ -122,6 +123,7 @@
 
        virtual void SetupBrush (cairo_t *cairo, UIElement *uielement);
 };
+
 RadialGradientBrush *radial_gradient_brush_new ();
 Point* radial_gradient_brush_get_center                (RadialGradientBrush 
*brush);
 void   radial_gradient_brush_set_center                (RadialGradientBrush 
*brush, Point *center);
@@ -141,6 +143,7 @@
        virtual void Remove (void *data);
        
 };
+
 GradientStopCollection *gradient_stop_collection_new ();
 
 class GradientStop : public DependencyObject {
@@ -150,6 +153,7 @@
 
        Value::Kind GetObjectType () { return Value::GRADIENTSTOP; }
 };
+
 GradientStop* gradient_stop_new ();
 Color  *gradient_stop_get_color        (GradientStop *stop);
 void   gradient_stop_set_color         (GradientStop *stop, Color *color);

Modified: trunk/moon/src/text.cpp
===================================================================
--- trunk/moon/src/text.cpp     2007-06-13 19:44:11 UTC (rev 79495)
+++ trunk/moon/src/text.cpp     2007-06-13 19:59:30 UTC (rev 79496)
@@ -23,14 +23,97 @@
 
 DependencyProperty *Inline::FontFamilyProperty;
 DependencyProperty *Inline::FontSizeProperty;
-DependencyProperty *Inline::FontStrechProperty;
+DependencyProperty *Inline::FontStretchProperty;
 DependencyProperty *Inline::FontStyleProperty;
 DependencyProperty *Inline::FontWeightProperty;
 DependencyProperty *Inline::ForegroundProperty;
 DependencyProperty *Inline::TextDecorationsProperty;
 
+char *
+inline_get_font_family (Inline *inline_)
+{
+       return (char *) inline_->GetValue 
(Inline::FontFamilyProperty)->AsString ();
+}
 
+void
+inline_set_font_family (Inline *inline_, char *value)
+{
+       inline_->SetValue (Inline::FontFamilyProperty, Value (value));
+}
 
+double
+inline_get_font_size (Inline *inline_)
+{
+       return (double) inline_->GetValue (Inline::FontSizeProperty)->AsDouble 
();
+}
+
+void
+inline_set_font_size (Inline *inline_, double value)
+{
+       inline_->SetValue (Inline::FontSizeProperty, Value (value));
+}
+
+FontStretches
+inline_get_font_stretch (Inline *inline_)
+{
+       return (FontStretches) inline_->GetValue 
(Inline::FontStretchProperty)->AsInt32 ();
+}
+
+void
+inline_set_font_stretch (Inline *inline_, FontStretches value)
+{
+       inline_->SetValue (Inline::FontStretchProperty, Value (value));
+}
+
+FontStyles
+inline_get_font_style (Inline *inline_)
+{
+       return (FontStyles) inline_->GetValue 
(Inline::FontStyleProperty)->AsInt32 ();
+}
+
+void
+inline_set_font_style (Inline *inline_, FontStyles value)
+{
+       inline_->SetValue (Inline::FontStyleProperty, Value (value));
+}
+
+FontWeights
+inline_get_font_weight (Inline *inline_)
+{
+       return (FontWeights) inline_->GetValue 
(Inline::FontWeightProperty)->AsInt32 ();
+}
+
+void
+inline_set_font_weight (Inline *inline_, FontWeights value)
+{
+       inline_->SetValue (Inline::FontWeightProperty, Value (value));
+}
+
+Brush *
+inline_get_foreground (Inline *inline_)
+{
+       return (Brush *) inline_->GetValue 
(Inline::ForegroundProperty)->AsBrush ();
+}
+
+void
+inline_set_foreground (Inline *inline_, Brush *value)
+{
+       inline_->SetValue (Inline::ForegroundProperty, Value (value));
+}
+
+TextDecorations
+inline_get_text_decorations (Inline *inline_)
+{
+       return (TextDecorations) inline_->GetValue 
(Inline::TextDecorationsProperty)->AsInt32 ();
+}
+
+void
+inline_set_text_decorations (Inline *inline_, TextDecorations value)
+{
+       inline_->SetValue (Inline::TextDecorationsProperty, Value (value));
+}
+
+
 // TextBlock
 
 DependencyProperty *TextBlock::ActualHeightProperty;

Modified: trunk/moon/src/text.h
===================================================================
--- trunk/moon/src/text.h       2007-06-13 19:44:11 UTC (rev 79495)
+++ trunk/moon/src/text.h       2007-06-13 19:59:30 UTC (rev 79496)
@@ -6,20 +6,6 @@
 #include "brush.h"
 #include "runtime.h"
 
-class Inline : public DependencyObject {
- public:
-       static DependencyProperty *FontFamilyProperty;
-       static DependencyProperty *FontSizeProperty;
-       static DependencyProperty *FontStrechProperty;
-       static DependencyProperty *FontStyleProperty;
-       static DependencyProperty *FontWeightProperty;
-       static DependencyProperty *ForegroundProperty;
-       static DependencyProperty *TextDecorationsProperty;
-       
-       Inline () { }
-       Value::Kind GetObjectType () { return Value::INLINE; }  
-};
-
 enum FontStretches {
        FontStretchesUltraCondensed,
        FontStretchesExtraCondensed,
@@ -69,6 +55,42 @@
        TextWrappingWrapWithOverflow
 };
 
+class Inline : public DependencyObject {
+ public:
+       static DependencyProperty *FontFamilyProperty;
+       static DependencyProperty *FontSizeProperty;
+       static DependencyProperty *FontStretchProperty;
+       static DependencyProperty *FontStyleProperty;
+       static DependencyProperty *FontWeightProperty;
+       static DependencyProperty *ForegroundProperty;
+       static DependencyProperty *TextDecorationsProperty;
+       
+       Inline () { }
+       Value::Kind GetObjectType () { return Value::INLINE; }  
+};
+
+char *inline_get_font_family (Inline *inline_);
+void inline_set_font_family (Inline *inline_, char *value);
+
+double inline_get_font_size (Inline *inline_);
+void inline_set_font_size (Inline *inline_, double value);
+
+FontStretches inline_get_font_stretch (Inline *inline_);
+void inline_set_font_stretch (Inline *inline_, FontStretches value);
+
+FontStyles inline_get_font_style (Inline *inline_);
+void inline_set_font_style (Inline *inline_, FontStyles value);
+
+FontWeights inline_get_font_weight (Inline *inline_);
+void inline_set_font_weight (Inline *inline_, FontWeights value);
+
+Brush *inline_get_foreground (Inline *inline_);
+void inline_set_foreground (Inline *inline_, Brush *value);
+
+TextDecorations inline_get_text_decorations (Inline *inline_);
+void inline_set_text_decorations (Inline *inline_, TextDecorations value);
+
+
 class TextBlock : public FrameworkElement {
 public:
        static DependencyProperty *ActualHeightProperty;

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

Reply via email to