Enlightenment CVS committal

Author  : pfritz
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_object.c ewl_object.h ewl_widget.c ewl_widget.h 


Log Message:
make many macros read only

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_object.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- ewl_object.c        26 Dec 2007 18:10:36 -0000      1.25
+++ ewl_object.c        16 Feb 2008 18:59:16 -0000      1.26
@@ -226,7 +226,7 @@
         */
        old_size = PREFERRED_W(o);
 
-       PREFERRED_W(o) = w;
+       o->preferred.w = w;
 
        if (CURRENT_W(o) < PREFERRED_W(o))
                fill = EWL_FLAG_FILL_HSHRINK;
@@ -271,7 +271,7 @@
         */
        old_size = PREFERRED_H(o);
 
-       PREFERRED_H(o) = h;
+       o->preferred.h = h;
 
        if (CURRENT_H(o) < PREFERRED_H(o))
                fill = EWL_FLAG_FILL_VSHRINK;
@@ -513,7 +513,7 @@
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR(o);
 
-       CURRENT_X(o) = x + PADDING_LEFT(o) + INSET_LEFT(o);
+       o->current.x = x + PADDING_LEFT(o) + INSET_LEFT(o);
        ewl_widget_configure(EWL_WIDGET(o));
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -534,7 +534,7 @@
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR(o);
 
-       CURRENT_Y(o) = y + PADDING_TOP(o) + INSET_TOP(o);
+       o->current.y = y + PADDING_TOP(o) + INSET_TOP(o);
        ewl_widget_configure(EWL_WIDGET(o));
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -574,7 +574,7 @@
        else if (w > MAXIMUM_W(o))
                w = MAXIMUM_W(o);
 
-       CURRENT_W(o) = w;
+       o->current.w = w;
        ewl_widget_configure(EWL_WIDGET(o));
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -614,7 +614,7 @@
        else if (h > MAXIMUM_H(o))
                h = MAXIMUM_H(o);
 
-       CURRENT_H(o) = h;
+       o->current.h = h;
        ewl_widget_configure(EWL_WIDGET(o));
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -668,10 +668,10 @@
                w = EWL_OBJECT_MAX_SIZE;
 
        old_size = MINIMUM_W(o);
-       new_size = MINIMUM_W(o) = w;
+       new_size = o->minimum.w = w;
 
        if (MAXIMUM_W(o) < w)
-               MAXIMUM_W(o) = w;
+               o->minimum.w = w;
 
        if (PREFERRED_W(o) < MINIMUM_W(o))
                ewl_container_child_resize(EWL_WIDGET(o),
@@ -709,10 +709,10 @@
                h = EWL_OBJECT_MAX_SIZE;
 
        old_size = MINIMUM_H(o);
-       new_size = MINIMUM_H(o) = h;
+       new_size = o->minimum.h = h;
 
        if (MAXIMUM_H(o) < h)
-               MAXIMUM_H(o) = h;
+               o->minimum.h = h;
 
        if (PREFERRED_H(o) < MINIMUM_H(o))
                ewl_container_child_resize(EWL_WIDGET(o),
@@ -836,10 +836,10 @@
        if (w > EWL_OBJECT_MAX_SIZE)
                w = EWL_OBJECT_MAX_SIZE;
 
-       MAXIMUM_W(o) = w;
+       o->maximum.w = w;
 
        if (MINIMUM_W(o) > w)
-               MINIMUM_W(o) = w;
+               o->maximum.w = w;
 
        if (PREFERRED_W(o) > MAXIMUM_W(o))
                ewl_object_preferred_inner_w_set(o, PREFERRED_W(o));
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_object.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -3 -r1.28 -r1.29
--- ewl_object.h        11 Nov 2007 02:12:36 -0000      1.28
+++ ewl_object.h        16 Feb 2008 18:59:16 -0000      1.29
@@ -347,25 +347,25 @@
  * @def PADDING_TOP(o)
  * Retrieve the size of the top pad
  */
-#define PADDING_TOP(o) EWL_OBJECT(o)->pad.t
+#define PADDING_TOP(o) ((const Ewl_Object *)(o))->pad.t
 
 /**
  * @def PADDING_BOTTOM(o)
  * Retrieve the size of the bottom pad
  */
-#define PADDING_BOTTOM(o) EWL_OBJECT(o)->pad.b
+#define PADDING_BOTTOM(o) ((const Ewl_Object *)(o))->pad.b
 
 /**
  * @def PADDING_LEFT(o)
  * Retrieve the size of the left pad
  */
-#define PADDING_LEFT(o) EWL_OBJECT(o)->pad.l
+#define PADDING_LEFT(o) ((const Ewl_Object *)(o))->pad.l
 
 /**
  * @def PADDING_RIGHT(o)
  * Retrieve the size of the right pad
  */
-#define PADDING_RIGHT(o) EWL_OBJECT(o)->pad.r
+#define PADDING_RIGHT(o) ((const Ewl_Object *)(o))->pad.r
 
 /**
  * @def PADDING_HORIZONTAL(o)
@@ -383,25 +383,25 @@
  * @def INSET_LEFT(o)
  * Retrieve the size of the left inset
  */
-#define INSET_LEFT(o) EWL_OBJECT(o)->insets.l
+#define INSET_LEFT(o) ((const Ewl_Object *)(o))->insets.l
 
 /**
  * @def INSET_RIGHT(o)
  * Retrieve the size of the right inset
  */
-#define INSET_RIGHT(o) EWL_OBJECT(o)->insets.r
+#define INSET_RIGHT(o) ((const Ewl_Object *)(o))->insets.r
 
 /**
  * @def INSET_TOP(o)
  * Retrieve the size of the top inset
  */
-#define INSET_TOP(o) EWL_OBJECT(o)->insets.t
+#define INSET_TOP(o) ((const Ewl_Object *)(o))->insets.t
 
 /**
  * @def INSET_BOTTOM(o)
  * Retrieve the size of the bottom inset
  */
-#define INSET_BOTTOM(o) EWL_OBJECT(o)->insets.b
+#define INSET_BOTTOM(o) ((const Ewl_Object *)(o))->insets.b
 
 /**
  * @def INSET_HORIZONTAL(o)
@@ -419,61 +419,61 @@
  * @def CURRENT_X(o)
  * Retrieve the current x position of the object
  */
-#define CURRENT_X(o) EWL_OBJECT(o)->current.x
+#define CURRENT_X(o) ((const Ewl_Object *)(o))->current.x
 
 /**
  * @def CURRENT_Y(o)
  * Retrieve the current y position of the object
  */
-#define CURRENT_Y(o) EWL_OBJECT(o)->current.y
+#define CURRENT_Y(o) ((const Ewl_Object *)(o))->current.y
 
 /**
  * @def CURRENT_W(o)
  * Retrieve the current width of the object without insets or padding
  */
-#define CURRENT_W(o) EWL_OBJECT(o)->current.w
+#define CURRENT_W(o) ((const Ewl_Object *)(o))->current.w
 
 /**
  * @def CURRENT_H(o)
  * Retrieve the current height of the object without insets or padding
  */
-#define CURRENT_H(o) EWL_OBJECT(o)->current.h
+#define CURRENT_H(o) ((const Ewl_Object *)(o))->current.h
 
 /**
  * @def PREFERRED_W(o)
- * Set the preferred width of the widget
+ * Retrieve the preferred width of the widget
  */
-#define PREFERRED_W(o) EWL_OBJECT(o)->preferred.w
+#define PREFERRED_W(o) ((const Ewl_Object *)(o))->preferred.w
 
 /**
  * @def PREFERRED_H(o)
- * Set the preferred height of the widget
+ * Retrieve the preferred height of the widget
  */
-#define PREFERRED_H(o) EWL_OBJECT(o)->preferred.h
+#define PREFERRED_H(o) ((const Ewl_Object *)(o))->preferred.h
 
 /**
  * @def MAXIMUM_W(o)
- * Set the maximum width of the widget
+ * Retrieve the maximum width of the widget
  */
-#define MAXIMUM_W(o) EWL_OBJECT(o)->maximum.w
+#define MAXIMUM_W(o) ((const Ewl_Object *)(o))->maximum.w
 
 /**
  * @def MAXIMUM_H(o)
- * Set the maximum height of the object
+ * Retrieve the maximum height of the object
  */
-#define MAXIMUM_H(o) EWL_OBJECT(o)->maximum.h
+#define MAXIMUM_H(o) ((const Ewl_Object *)(o))->maximum.h
 
 /**
  * @def MINIMUM_W(o)
- * Set the minimum width of the object
+ * Retrieve the minimum width of the object
  */
-#define MINIMUM_W(o) EWL_OBJECT(o)->minimum.w
+#define MINIMUM_W(o) ((const Ewl_Object *)(o))->minimum.w
 
 /**
  * @def MINIMUM_H(o)
- * Set the minimum height of the object
+ * Retrieve the minimum height of the object
  */
-#define MINIMUM_H(o) EWL_OBJECT(o)->minimum.h
+#define MINIMUM_H(o) ((const Ewl_Object *)(o))->minimum.h
 
 /**
  * @def ewl_object_custom_size_set(o, w, h)
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_widget.c,v
retrieving revision 1.157
retrieving revision 1.158
diff -u -3 -r1.157 -r1.158
--- ewl_widget.c        15 Feb 2008 23:52:22 -0000      1.157
+++ ewl_widget.c        16 Feb 2008 18:59:16 -0000      1.158
@@ -1634,7 +1634,7 @@
                                "of a widget that has already a parent!\n");
                DRETURN(DLEVEL_STABLE);
        }
-       UNMANAGED(w) = !!val;
+       w->unmanaged = !!val;
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_widget.h,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -3 -r1.69 -r1.70
--- ewl_widget.h        15 Feb 2008 23:52:22 -0000      1.69
+++ ewl_widget.h        16 Feb 2008 18:59:16 -0000      1.70
@@ -253,7 +253,7 @@
 int             ewl_widget_parent_of(Ewl_Widget *c, Ewl_Widget *w);
 
 
-#define UNMANAGED(w) (EWL_WIDGET(w)->unmanaged)
+#define UNMANAGED(w) (((const Ewl_Widget *)(w))->unmanaged)
 
 /*
  * Internally used callbacks, override at your own risk.



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to