On Sun, Mar 23, 2008 at 1:55 PM, The Rasterman Carsten Haitzler
<[EMAIL PROTECTED]> wrote:
> On Sun, 23 Mar 2008 04:20:05 -0400 Jose Gonzalez <[EMAIL PROTECTED]> babbled:
>
>
>  > > > In general I don't have any objections to the addition of size
>  > > > hints to Edje, these could actually be useful to EWL as we could
>  > > > use them in place of some of the existing size hints we get from
>  > > > Edje. I'm not really certain why you want the ability to set the
>  > > > min and max sizes programmatically since these are normally
>  > > > determined by the EDC description, but I don't really see a
>  > > > problem with it. It might be a
>  > >
>  > > the problem comes when you swallow something into a edje - it does
>  > > not know the constraints of the object being swallowed - thus edje
>  > > has calls like:
>  > >
>  > > edje_extern_object_min_size_set()
>  > > edje_extern_object_max_size_set()
>  > > edje_extern_object_aspect_set()
>  > >
>  > > these attach hints via a generic data + string key attaching
>  > > mechanism so edje can pick them up when swallowing. of course
>  > > formalising these as intrinsic properties of an evas object
>  > > would make this cleaner and provide more usefulness for other
>  > > things.
>  > >
>  >     Yeah, but that's just so that you can *get* the min/max sizes -
>  > because there's no other way since arbitrary evas objs don't have
>  > such min/max_size properties. If they did, you could just 'get' them.
>
>  bingo. that's the whole point of it - set them, be able to get them, have
>  callbacks and events when they change (just like resize, move etc.).
>
>
>  >     These min/max values could actually change, as other properties
>  > of the object (which can be 'set') are varied, due to internal
>  > constraints and whatnot, but it makes little sense to 'set' the
>  > min/max values of anything that's potentially intrinsic to an object.
>  > Does it make sense to set the min/max values of the min_size property?
>
>  this is just min and max size - these are not properties of properties. :)
>
>
>  >     One can imagine setting lower/upper bounds for values of
>  > properties (subject to those being constrained by the min/max ones),
>  > with the meaning that setting arbitrary values for the property
>  > will be stopped at those limits, but not really directly setting
>  > min/max ones.
>  >
>  >     It's a bit of a semantic run-around, but not any more mojo
>  > than the usual. :)

anyone really looked at the patch? It says it all :-)

In any case, patch is here, again...

-- 
Gustavo Sverzut Barbieri
http://profusion.mobi
Embedded Systems
--------------------------------------
MSN: [EMAIL PROTECTED]
Skype: gsbarbieri
Mobile: +55 (81) 9927 0010
Index: Evas.h
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/Evas.h,v
retrieving revision 1.114
diff -u -p -r1.114 Evas.h
--- Evas.h      14 Mar 2008 16:49:47 -0000      1.114
+++ Evas.h      21 Mar 2008 08:12:37 -0000
@@ -50,7 +50,8 @@ typedef enum _Evas_Callback_Type
    EVAS_CALLBACK_MOVE, /**< Move Event */
    EVAS_CALLBACK_RESIZE, /**< Resize Event */
    EVAS_CALLBACK_RESTACK, /**< Restack Event */
-   EVAS_CALLBACK_DEL /**< Object Being Deleted (called before Free) */
+   EVAS_CALLBACK_DEL, /**< Object Being Deleted (called before Free) */
+   EVAS_CALLBACK_CHANGED_SIZE_HINTS /**< Size hints changed event */
 } Evas_Callback_Type; /**< The type of event to trigger the callback */
 
 typedef enum _Evas_Button_Flags
@@ -688,6 +689,13 @@ extern "C" {
    EAPI void              evas_object_move                  (Evas_Object *obj, 
Evas_Coord x, Evas_Coord y);
    EAPI void              evas_object_resize                (Evas_Object *obj, 
Evas_Coord w, Evas_Coord h);
    EAPI void              evas_object_geometry_get          (const Evas_Object 
*obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
+
+   EAPI void              evas_object_size_hint_min_get     (const Evas_Object 
*obj, Evas_Coord *w, Evas_Coord *h);
+   EAPI void              evas_object_size_hint_min_set     (Evas_Object *obj, 
Evas_Coord w, Evas_Coord h);
+   EAPI void              evas_object_size_hint_max_get     (const Evas_Object 
*obj, Evas_Coord *w, Evas_Coord *h);
+   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_show                  (Evas_Object *obj);
    EAPI void              evas_object_hide                  (Evas_Object *obj);
Index: canvas/evas_object_inform.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/canvas/evas_object_inform.c,v
retrieving revision 1.3
diff -u -p -r1.3 evas_object_inform.c
--- canvas/evas_object_inform.c 18 Jun 2005 01:00:29 -0000      1.3
+++ canvas/evas_object_inform.c 21 Mar 2008 08:12:37 -0000
@@ -32,3 +32,9 @@ evas_object_inform_call_restack(Evas_Obj
 {
    evas_object_event_callback_call(obj, EVAS_CALLBACK_RESTACK, NULL);
 }
+
+void
+evas_object_inform_call_changed_size_hints(Evas_Object *obj)
+{
+   evas_object_event_callback_call(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, 
NULL);
+}
Index: canvas/evas_object_main.c
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/canvas/evas_object_main.c,v
retrieving revision 1.63
diff -u -p -r1.63 evas_object_main.c
--- canvas/evas_object_main.c   8 Feb 2008 22:35:19 -0000       1.63
+++ canvas/evas_object_main.c   21 Mar 2008 08:12:38 -0000
@@ -671,6 +671,243 @@ evas_object_geometry_get(const Evas_Obje
 }
 
 /**
+ * @defgroup Evas_Object_Size_Hints_Group Generic Object Size Hints Functions
+ *
+ * Functions that deals with hints about object size.
+ */
+
+/**
+ * Retrieves the size hint for the minimum size.
+ *
+ * This is not a size enforcement in any way, it's just a hint that should
+ * be used whenever appropriate.
+ *
+ * Note that if any of @p w or @p h are @c NULL, the @c NULL
+ * parameters are ignored.
+ *
+ * @param obj The given evas object.
+ * @param   w Pointer to an integer in which to store the minimum width.
+ * @param   h Pointer to an integer in which to store the minimum height.
+ * @ingroup Evas_Object_Size_Hints_Group
+ */
+EAPI void
+evas_object_size_hint_min_get(const Evas_Object *obj, Evas_Coord *w, 
Evas_Coord *h)
+{
+   MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+   if (w) *w = 0; if (h) *h = 0;
+   return;
+   MAGIC_CHECK_END();
+   if (obj->delete_me)
+     {
+       if (w) *w = 0; if (h) *h = 0;
+       return;
+     }
+   if (w) *w = obj->size_hints.min.w;
+   if (h) *h = obj->size_hints.min.h;
+}
+
+/**
+ * Sets the size hint for the minimum size.
+ *
+ * This is not a size enforcement in any way, it's just a hint that should
+ * be used whenever appropriate.
+ *
+ * @param obj The given evas object.
+ * @param   w Integer to use as the minimum width hint.
+ * @param   h Integer to use as the minimum height hint.
+ * @ingroup Evas_Object_Size_Hints_Group
+ */
+EAPI void
+evas_object_size_hint_min_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
+{
+   MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+   return;
+   MAGIC_CHECK_END();
+   if (obj->delete_me)
+     return;
+
+   obj->size_hints.min.w = w;
+   obj->size_hints.min.h = h;
+
+   evas_object_inform_call_changed_size_hints(obj);
+}
+
+/**
+ * Retrieves the size hint for the maximum size.
+ *
+ * This is not a size enforcement in any way, it's just a hint that should
+ * be used whenever appropriate.
+ *
+ * Note that if any of @p w or @p h are @c NULL, the @c NULL
+ * parameters are ignored.
+ *
+ * @param obj The given evas object.
+ * @param   w Pointer to an integer in which to store the maximum width.
+ * @param   h Pointer to an integer in which to store the maximum height.
+ * @ingroup Evas_Object_Size_Hints_Group
+ */
+EAPI void
+evas_object_size_hint_max_get(const Evas_Object *obj, Evas_Coord *w, 
Evas_Coord *h)
+{
+   MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+   if (w) *w = 0; if (h) *h = 0;
+   return;
+   MAGIC_CHECK_END();
+   if (obj->delete_me)
+     {
+       if (w) *w = 0; if (h) *h = 0;
+       return;
+     }
+   if (w) *w = obj->size_hints.max.w;
+   if (h) *h = obj->size_hints.max.h;
+}
+
+/**
+ * Sets the size hint for the maximum size.
+ *
+ * This is not a size enforcement in any way, it's just a hint that should
+ * be used whenever appropriate.
+ *
+ * @param obj The given evas object.
+ * @param   w Integer to use as the maximum width hint.
+ * @param   h Integer to use as the maximum height hint.
+ * @ingroup Evas_Object_Size_Hints_Group
+ */
+EAPI void
+evas_object_size_hint_max_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
+{
+   MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+   return;
+   MAGIC_CHECK_END();
+   if (obj->delete_me)
+     return;
+
+   obj->size_hints.max.w = w;
+   obj->size_hints.max.h = h;
+
+   evas_object_inform_call_changed_size_hints(obj);
+}
+
+/**
+ * Retrieves the size request hint.
+ *
+ * This is not a size enforcement in any way, it's just a hint that should
+ * be used whenever appropriate.
+ *
+ * Note that if any of @p w or @p h are @c NULL, the @c NULL
+ * parameters are ignored.
+ *
+ * @param obj The given evas object.
+ * @param   w Pointer to an integer in which to store the requested width.
+ * @param   h Pointer to an integer in which to store the requested height.
+ * @ingroup Evas_Object_Size_Hints_Group
+ */
+EAPI void
+evas_object_size_hint_request_get(const Evas_Object *obj, Evas_Coord *w, 
Evas_Coord *h)
+{
+   MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+   if (w) *w = 0; if (h) *h = 0;
+   return;
+   MAGIC_CHECK_END();
+   if (obj->delete_me)
+     {
+       if (w) *w = 0; if (h) *h = 0;
+       return;
+     }
+   if (w) *w = obj->size_hints.request.w;
+   if (h) *h = obj->size_hints.request.h;
+}
+
+/**
+ * Sets the requested size hint.
+ *
+ * This is not a size enforcement in any way, it's just a hint that should
+ * be used whenever appropriate.
+ *
+ * @param obj The given evas object.
+ * @param   w Integer to use as the preferred width hint.
+ * @param   h Integer to use as the preferred height hint.
+ * @ingroup Evas_Object_Size_Hints_Group
+ */
+EAPI void
+evas_object_size_hint_request_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
+{
+   MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+   return;
+   MAGIC_CHECK_END();
+   if (obj->delete_me)
+     return;
+
+   obj->size_hints.request.w = w;
+   obj->size_hints.request.h = h;
+
+   evas_object_inform_call_changed_size_hints(obj);
+}
+
+/**
+ * Retrieves the size aspect control hint.
+ *
+ * This is not a size enforcement in any way, it's just a hint that should
+ * be used whenever appropriate.
+ *
+ * Note that if any of @p aspect, @p w or @p h are @c NULL, the @c NULL
+ * parameters are ignored.
+ *
+ * @param    obj The given evas object.
+ * @param aspect Returns the hint on how size should be calculated.
+ * @param      w Pointer to an integer in which to store the aspect width.
+ * @param      h Pointer to an integer in which to store the aspect height.
+ * @ingroup Evas_Object_Size_Hints_Group
+ */
+EAPI void
+evas_object_size_hint_aspect_get(const Evas_Object *obj, Evas_Aspect_Control 
*aspect, Evas_Coord *w, Evas_Coord *h)
+{
+   MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+   if (aspect) *aspect = EVAS_ASPECT_CONTROL_NONE;
+   if (w) *w = 0; if (h) *h = 0;
+   return;
+   MAGIC_CHECK_END();
+   if (obj->delete_me)
+     {
+       if (aspect) *aspect = EVAS_ASPECT_CONTROL_NONE;
+       if (w) *w = 0; if (h) *h = 0;
+       return;
+     }
+   if (aspect) *aspect = obj->size_hints.aspect.mode;
+   if (w) *w = obj->size_hints.aspect.size.w;
+   if (h) *h = obj->size_hints.aspect.size.h;
+}
+
+/**
+ * Sets the size aspect control hint.
+ *
+ * This is not a size enforcement in any way, it's just a hint that should
+ * be used whenever appropriate.
+ *
+ * @param    obj The given evas object.
+ * @param aspect Hint on how to calculate size.
+ * @param      w Integer to use as aspect width hint.
+ * @param      h Integer to use as aspect height hint.
+ * @ingroup Evas_Object_Size_Hints_Group
+ */
+EAPI void
+evas_object_size_hint_aspect_set(Evas_Object *obj, Evas_Aspect_Control aspect, 
Evas_Coord w, Evas_Coord h)
+{
+   MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
+   return;
+   MAGIC_CHECK_END();
+   if (obj->delete_me)
+     return;
+
+   obj->size_hints.aspect.mode = aspect;
+   obj->size_hints.aspect.size.w = w;
+   obj->size_hints.aspect.size.h = h;
+
+   evas_object_inform_call_changed_size_hints(obj);
+}
+
+
+/**
  * @defgroup Evas_Object_Visibility_Group Generic Object Visibility Functions
  *
  * Functions that deal with the visibility of evas objects.
Index: include/evas_private.h
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/include/evas_private.h,v
retrieving revision 1.91
diff -u -p -r1.91 evas_private.h
--- include/evas_private.h      21 Mar 2008 07:13:46 -0000      1.91
+++ include/evas_private.h      21 Mar 2008 08:12:38 -0000
@@ -81,6 +81,10 @@ struct _Evas_Module_Engine
 #define RENDER_METHOD_INVALID            0x00000000
 
 typedef struct _Evas_Layer                  Evas_Layer;
+typedef struct _Evas_Size                   Evas_Size;
+typedef enum _Evas_Aspect_Control           Evas_Aspect_Control;
+typedef struct _Evas_Aspect                 Evas_Aspect;
+typedef struct _Evas_Size_Hints             Evas_Size_Hints;
 typedef struct _Evas_Font_Dir               Evas_Font_Dir;
 typedef struct _Evas_Font                   Evas_Font;
 typedef struct _Evas_Font_Alias             Evas_Font_Alias;
@@ -368,6 +372,32 @@ struct _Evas_Layer
    unsigned char     delete_me : 1;
 };
 
+struct _Evas_Size
+{
+   Evas_Coord w, h;
+};
+
+enum _Evas_Aspect_Control
+{
+   EVAS_ASPECT_CONTROL_NONE = 0,
+   EVAS_ASPECT_CONTROL_NEITHER = 1,
+   EVAS_ASPECT_CONTROL_HORIZONTAL = 2,
+   EVAS_ASPECT_CONTROL_VERTICAL = 3,
+   EVAS_ASPECT_CONTROL_BOTH = 4
+};
+
+struct _Evas_Aspect
+{
+   Evas_Aspect_Control mode;
+   Evas_Size size;
+};
+
+struct _Evas_Size_Hints
+{
+   Evas_Size min, max, request;
+   Evas_Aspect aspect;
+};
+
 struct _Evas_Object
 {
    Evas_Object_List  _list_data;
@@ -440,6 +470,8 @@ struct _Evas_Object
       unsigned char     deletions_waiting : 1;
    } smart;
 
+   Evas_Size_Hints      size_hints;
+
    int                         last_mouse_down_counter;
    int                         last_mouse_up_counter;
    int                         mouse_grabbed;
@@ -727,6 +759,7 @@ void evas_object_inform_call_hide(Evas_O
 void evas_object_inform_call_move(Evas_Object *obj);
 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_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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to