Hello, in order to implement the layout objects for my SoC project I need to 
know if it would be possible to add size hints to Evas Objects.

I attached a patch file with the required changes. I tried following the 
implementation of size hints since its a similar concept but I can't compile 
the code.

I defined Evas_Fill_Policy type in Evas.h but I cannot use it in 
evas_private.h. Even when it includes "Evas.h" I still get the error 
message:  "../../src/lib/include/evas_private.h:474: error: expected 
specifier-qualifier-list before 'Evas_Fill_Policy'".

Than ks 
Index: src/lib/Evas.h
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/Evas.h,v
retrieving revision 1.116
diff -u -r1.116 Evas.h
--- src/lib/Evas.h	11 Apr 2008 23:12:19 -0000	1.116
+++ src/lib/Evas.h	30 Apr 2008 14:35:41 -0000
@@ -52,7 +52,8 @@
    EVAS_CALLBACK_RESTACK, /**< Restack Event */
    EVAS_CALLBACK_DEL, /**< Object Being Deleted (called before Free) */
    EVAS_CALLBACK_HOLD, /**< Events go on/off hold */
-   EVAS_CALLBACK_CHANGED_SIZE_HINTS /**< Size hints changed event */
+   EVAS_CALLBACK_CHANGED_SIZE_HINTS, /**< Size hints changed event */
+   EVAS_CALLBACK_CHANGED_FILL_POLICY /**< Fill policy changed event */
 } Evas_Callback_Type; /**< The type of event to trigger the callback */
 
 typedef enum _Evas_Button_Flags
@@ -84,6 +85,18 @@
    EVAS_COLORSPACE_RGB565_A5P /**< 16bit rgb565 + Alpha plane at end - 5 bits of the 8 being used per alpha byte */
 } Evas_Colorspace; /**< Colorspaces for pixel data supported by Evas */
 
+typedef enum _Evas_Fill_Policy
+{
+   EVAS_FILL_POLICY_NONE,    /**< Do not fill or shrink in any direction */
+   EVAS_FILL_POLICY_VSHRINK,  /**< Vertically shrink */
+   EVAS_FILL_POLICY_HSHRINK, /**< Horizontally shrink */
+   EVAS_FILL_POLICY_SHRINK,  /**< Shrink both horizontally and vertically */
+   EVAS_FILL_POLICY_VFILL,   /**< Vertically fill */
+   EVAS_FILL_POLICY_HFILL,   /**< Horizontally fill */
+   EVAS_FILL_POLICY_FILL,    /**< Fill both horizontally and vertically */
+   EVAS_FILL_POLICY_ALL      /**< Shrink or fill as needed */
+} Evas_Fill_Policy; /**< Possible fill policies for an Evas Object */
+
 typedef struct _Evas_List             Evas_List; /**< A generic linked list node handle */
 typedef struct _Evas_Rectangle        Evas_Rectangle; /**< A generic rectangle handle */
 typedef struct _Evas_Smart_Class      Evas_Smart_Class; /**< A smart object base class */
@@ -707,6 +720,9 @@
    EAPI void              evas_object_size_hint_max_set     (Evas_Object *obj, Evas_Coord w, Evas_Coord h);
    EAPI void              evas_object_size_hint_request_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h);
    EAPI void              evas_object_size_hint_request_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h);
+
+   EAPI void              evas_object_fill_policy_set       (Evas_Object *obj, Evas_Fill_Policy fp);
+   EAPI void              evas_object_fill_policy_get       (Evas_Object *obj, Evas_Fill_Policy *fp);
 
    EAPI void              evas_object_show                  (Evas_Object *obj);
    EAPI void              evas_object_hide                  (Evas_Object *obj);
Index: src/lib/canvas/evas_object_inform.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/canvas/evas_object_inform.c,v
retrieving revision 1.4
diff -u -r1.4 evas_object_inform.c
--- src/lib/canvas/evas_object_inform.c	11 Apr 2008 23:12:19 -0000	1.4
+++ src/lib/canvas/evas_object_inform.c	30 Apr 2008 14:35:41 -0000
@@ -38,3 +38,9 @@
 {
    evas_object_event_callback_call(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, NULL);
 }
+
+void
+evas_object_inform_call_changed_fill_policy(Evas_Object *obj)
+{
+   evas_object_event_callback_call(obj, EVAS_CALLBACK_CHANGED_FILL_POLICY, NULL);
+}
Index: src/lib/canvas/evas_object_main.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/canvas/evas_object_main.c,v
retrieving revision 1.64
diff -u -r1.64 evas_object_main.c
--- src/lib/canvas/evas_object_main.c	11 Apr 2008 23:12:19 -0000	1.64
+++ src/lib/canvas/evas_object_main.c	30 Apr 2008 14:35:41 -0000
@@ -906,6 +906,52 @@
    evas_object_inform_call_changed_size_hints(obj);
 }
 
+/**
+ * Sets the fill policy for a given Evas Object
+ *
+ * Similarly to size hints, fill policies are to be considered by functions
+ * manipulating the object. Thew will not be enforced internally in any way.
+ * @sa Evas_Fill_Policy.
+ *
+ * @param obj The given Evas Object
+ * @param  fp The fill policy to set from the 
+ */
+EAPI void
+evas_object_fill_policy_set(Evas_Object *obj, Evas_Fill_Policy fp)
+{
+   MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+   return;
+   MAGIC_CHECK_END();
+   if (obj->delete_me)
+     return;
+
+   obj->fill_policy = fp;
+
+   evas_object_inform_call_changed_fill_policy(obj);
+}
+
+/**
+ * Retrieves the fill policy set to a given Evas Object
+ *
+ * Similarly to size hints, fill policies are not enforced in any way. This
+ * function allows a function manipulating the object to know the kind of fill
+ * policy desierd when manipulating the object's size.
+ * 
+ * @param obj The given Evas Object
+ * @param  fp A pointer to store the fill policy
+ */
+EAPI void
+evas_object_fill_policy_get(Evas_Object *obj, Evas_Fill_Policy *fp)
+{
+   MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+   return;
+   MAGIC_CHECK_END();
+   if (obj->delete_me)
+     return;
+
+   if(fp) *fp = obj->fill_policy;
+}
+
 
 /**
  * @defgroup Evas_Object_Visibility_Group Generic Object Visibility Functions
Index: src/lib/include/evas_private.h
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/include/evas_private.h,v
retrieving revision 1.92
diff -u -r1.92 evas_private.h
--- src/lib/include/evas_private.h	11 Apr 2008 23:12:20 -0000	1.92
+++ src/lib/include/evas_private.h	30 Apr 2008 14:35:41 -0000
@@ -471,6 +471,7 @@
    } smart;
 
    Evas_Size_Hints      size_hints;
+   Evas_Fill_Policy     fill_policy;
 
    int                         last_mouse_down_counter;
    int                         last_mouse_up_counter;
@@ -760,6 +761,7 @@
 void evas_object_inform_call_resize(Evas_Object *obj);
 void evas_object_inform_call_restack(Evas_Object *obj);
 void evas_object_inform_call_changed_size_hints(Evas_Object *obj);
+void evas_object_inform_call_changed_fill_policy(Evas_Object *obj);
 void evas_object_intercept_cleanup(Evas_Object *obj);
 int evas_object_intercept_call_show(Evas_Object *obj);
 int evas_object_intercept_call_hide(Evas_Object *obj);
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to