Enlightenment CVS committal

Author  : moom16
Project : e17
Module  : proto

Dir     : e17/proto/etk/src/lib


Modified Files:
        etk_label.c etk_property.h etk_type.c etk_widget.c 


Log Message:
* Sets the default value of a property at the creation of the object 
only if the property has the flag ETK_PROPERTY_CONSTRUCT. It should 
improve the creation of widgets, and fix some bugs


===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_label.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- etk_label.c 29 Oct 2005 19:57:20 -0000      1.4
+++ etk_label.c 30 Oct 2005 11:56:05 -0000      1.5
@@ -175,7 +175,7 @@
    label->clip = NULL;
    label->text = NULL;
 
-   label->xalign = 0.5;
+   label->xalign = 0.0;
    label->yalign = 0.5;
 
    widget->size_request = _etk_label_size_request;
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_property.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- etk_property.h      23 Oct 2005 08:05:34 -0000      1.2
+++ etk_property.h      30 Oct 2005 11:56:05 -0000      1.3
@@ -31,13 +31,15 @@
 
 /** 
  * @enum Etk_Property_Flags
- * @brief  Describes if the property is readable, writable or both
+ * @brief Describes if the property is readable, writable or both. @n
+ * YOu can also specify if the property needs to be initialized to its default 
value at the constuction of a new object (ETK_PROPERTY_CONSTRUCT)
  */
 enum _Etk_Property_Flags
 {
    ETK_PROPERTY_READABLE = 1 << 0,
    ETK_PROPERTY_WRITABLE = 1 << 1,
-   ETK_PROPERTY_READABLE_WRITABLE = ETK_PROPERTY_READABLE | 
ETK_PROPERTY_WRITABLE
+   ETK_PROPERTY_READABLE_WRITABLE = ETK_PROPERTY_READABLE | 
ETK_PROPERTY_WRITABLE,
+   ETK_PROPERTY_CONSTRUCT = 1 << 2
 };
 
 /**
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_type.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- etk_type.c  1 Oct 2005 16:29:45 -0000       1.1
+++ etk_type.c  30 Oct 2005 11:56:05 -0000      1.2
@@ -145,7 +145,10 @@
       etk_type_property_list(type->hierarchy[i], properties);
       ecore_list_goto_first(properties);
       while ((property = ecore_list_next(properties)))
-         type->hierarchy[i]->property_set(object, property->id, 
property->default_value);
+      {
+         if (property->default_value && (property->flags & 
ETK_PROPERTY_CONSTRUCT))
+            type->hierarchy[i]->property_set(object, property->id, 
property->default_value);
+      }
       ecore_list_destroy(properties);
    }
    if (type->property_set)
@@ -154,7 +157,10 @@
       etk_type_property_list(type, properties);
       ecore_list_goto_first(properties);
       while ((property = ecore_list_next(properties)))
-         type->property_set(object, property->id, property->default_value);
+      {
+         if (property->default_value && (property->flags & 
ETK_PROPERTY_CONSTRUCT))
+            type->property_set(object, property->id, property->default_value);
+      }
       ecore_list_destroy(properties);
    }
 }
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/etk/src/lib/etk_widget.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- etk_widget.c        29 Oct 2005 19:57:21 -0000      1.5
+++ etk_widget.c        30 Oct 2005 11:56:05 -0000      1.6
@@ -1164,7 +1164,7 @@
    widget->theme_object = NULL;
    widget->theme_min_width = 0;
    widget->theme_min_height = 0;
-   widget->theme_file = NULL;
+   widget->theme_file = strdup(ETK_DEFAULT_THEME_FILE);
    widget->theme_group = NULL;
 
    widget->smart_object = NULL;




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to