Author: jackson
Date: 2007-10-31 13:02:30 -0500 (Wed, 31 Oct 2007)
New Revision: 88588

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/animation.cpp
   trunk/moon/src/canvas.cpp
   trunk/moon/src/dependencyobject.cpp
   trunk/moon/src/dependencyobject.h
Log:

        * dependencyobject.h|cpp: Give DependencyProperties the ability
        * to
        be readonly.
        * canvas.cpp:
        * animation.cpp: Signature updates



Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-10-31 17:51:31 UTC (rev 88587)
+++ trunk/moon/src/ChangeLog    2007-10-31 18:02:30 UTC (rev 88588)
@@ -1,3 +1,10 @@
+2007-10-31  Jackson Harper  <[EMAIL PROTECTED]>
+
+       * dependencyobject.h|cpp: Give DependencyProperties the ability to
+       be readonly.
+       * canvas.cpp:
+       * animation.cpp: Signature updates
+       
 2007-10-30  Jackson Harper  <[EMAIL PROTECTED]>
 
        * xaml.h: Add the error args to the loader.

Modified: trunk/moon/src/animation.cpp
===================================================================
--- trunk/moon/src/animation.cpp        2007-10-31 17:51:31 UTC (rev 88587)
+++ trunk/moon/src/animation.cpp        2007-10-31 18:02:30 UTC (rev 88588)
@@ -1671,9 +1671,9 @@
 
        /* Storyboard properties */
        Storyboard::TargetPropertyProperty = DependencyObject::RegisterFull 
(Type::STORYBOARD, "TargetProperty", 
-                                                                            
NULL, Type::STRING, true);
+                                                                            
NULL, Type::STRING, true, false);
        Storyboard::TargetNameProperty     = DependencyObject::RegisterFull 
(Type::STORYBOARD, "TargetName", 
-                                                                            
NULL, Type::STRING, true);
+                                                                            
NULL, Type::STRING, true, false);
 
        /* BeginStoryboard properties */
        BeginStoryboard::StoryboardProperty = DependencyObject::Register 
(Type::BEGINSTORYBOARD, "Storyboard",  Type::STORYBOARD);

Modified: trunk/moon/src/canvas.cpp
===================================================================
--- trunk/moon/src/canvas.cpp   2007-10-31 17:51:31 UTC (rev 88587)
+++ trunk/moon/src/canvas.cpp   2007-10-31 18:02:30 UTC (rev 88588)
@@ -97,8 +97,8 @@
 void 
 canvas_init (void)
 {
-       Canvas::TopProperty = DependencyObject::RegisterFull (Type::CANVAS, 
"Top", new Value (0.0), Type::DOUBLE, true);
-       Canvas::LeftProperty = DependencyObject::RegisterFull (Type::CANVAS, 
"Left", new Value (0.0), Type::DOUBLE, true);
+       Canvas::TopProperty = DependencyObject::RegisterFull (Type::CANVAS, 
"Top", new Value (0.0), Type::DOUBLE, true, false);
+       Canvas::LeftProperty = DependencyObject::RegisterFull (Type::CANVAS, 
"Left", new Value (0.0), Type::DOUBLE, true, false);
 }
 
 

Modified: trunk/moon/src/dependencyobject.cpp
===================================================================
--- trunk/moon/src/dependencyobject.cpp 2007-10-31 17:51:31 UTC (rev 88587)
+++ trunk/moon/src/dependencyobject.cpp 2007-10-31 18:02:30 UTC (rev 88588)
@@ -669,7 +669,7 @@
 {
        g_return_val_if_fail (name != NULL, NULL);
 
-       return RegisterFull (type, name, NULL, vtype, false);
+       return RegisterFull (type, name, NULL, vtype, false, false);
 }
 
 //
@@ -681,7 +681,7 @@
        g_return_val_if_fail (default_value != NULL, NULL);
        g_return_val_if_fail (name != NULL, NULL);
 
-       return RegisterFull (type, name, default_value, default_value->GetKind 
(), false);
+       return RegisterFull (type, name, default_value, default_value->GetKind 
(), false, false);
 }
 
 static void
@@ -708,7 +708,7 @@
        g_return_val_if_fail (default_value != NULL, NULL);
        g_return_val_if_fail (name != NULL, NULL);
 
-       return RegisterFull (type, name, default_value, vtype, false);
+       return RegisterFull (type, name, default_value, vtype, false, false);
 }
 
 DependencyProperty *
@@ -746,11 +746,11 @@
 // stored in the dependency property is of type @vtype
 //
 DependencyProperty *
-DependencyObject::RegisterFull (Type::Kind type, const char *name, Value 
*default_value, Type::Kind vtype, bool attached)
+DependencyObject::RegisterFull (Type::Kind type, const char *name, Value 
*default_value, Type::Kind vtype, bool attached, bool readonly)
 {
        GHashTable *table;
 
-       DependencyProperty *property = new DependencyProperty (type, name, 
default_value, vtype, attached);
+       DependencyProperty *property = new DependencyProperty (type, name, 
default_value, vtype, attached, readonly);
        
        /* first add the property to the global 2 level property hash */
        if (properties == NULL)
@@ -845,13 +845,14 @@
 /*
  *     DependencyProperty
  */
-DependencyProperty::DependencyProperty (Type::Kind type, const char *name, 
Value *default_value, Type::Kind value_type, bool attached)
+DependencyProperty::DependencyProperty (Type::Kind type, const char *name, 
Value *default_value, Type::Kind value_type, bool attached, bool readonly)
 {
        this->type = type;
        this->name = g_strdup (name);
        this->default_value = default_value;
        this->value_type = value_type;
        this->is_attached_property = attached;
+       this->is_readonly = readonly;
 }
 
 DependencyProperty::~DependencyProperty ()

Modified: trunk/moon/src/dependencyobject.h
===================================================================
--- trunk/moon/src/dependencyobject.h   2007-10-31 17:51:31 UTC (rev 88587)
+++ trunk/moon/src/dependencyobject.h   2007-10-31 18:02:30 UTC (rev 88588)
@@ -149,7 +149,7 @@
        static DependencyProperty *Register (Type::Kind type, const char *name, 
Type::Kind vtype);
        static DependencyProperty *Register (Type::Kind type, const char *name, 
Value *default_value, Type::Kind vtype);
        static DependencyProperty *RegisterNullable (Type::Kind type, const 
char *name, Type::Kind vtype);
-       static DependencyProperty *RegisterFull (Type::Kind type, const char 
*name, Value *default_value, Type::Kind vtype, bool attached);
+       static DependencyProperty *RegisterFull (Type::Kind type, const char 
*name, Value *default_value, Type::Kind vtype, bool attached, bool readonly);
        
        static DependencyProperty *GetDependencyProperty (Type::Kind type, 
const char *name);
        static DependencyProperty *GetDependencyProperty (Type::Kind type, 
const char *name, bool inherits);
@@ -228,7 +228,7 @@
  public:
        DependencyProperty () {} ;
        ~DependencyProperty ();
-       DependencyProperty (Type::Kind type, const char *name, Value 
*default_value, Type::Kind value_type, bool attached);
+       DependencyProperty (Type::Kind type, const char *name, Value 
*default_value, Type::Kind value_type, bool attached, bool readonly);
 
        char *name;
        Value *default_value;
@@ -236,7 +236,12 @@
        bool is_attached_property;
        Type::Kind value_type;
        bool is_nullable;
+
        bool IsNullable () { return is_nullable; }
+       bool IsReadOnly () { return is_readonly; }
+
+ private:
+       bool is_readonly;
 };
 
 G_BEGIN_DECLS

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

Reply via email to