Re: [E-devel] Esmart container clipping
Sevcsik András schrieb: > I hope this version works with the current cvs. > > Yup, thanks. In cvs. - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] Esmart container clipping
I hope this version works with the current cvs. On Fri, Jul 18, 2008 at 5:02 PM, Sevcsik András <[EMAIL PROTECTED]> wrote: > > > On Fri, Jul 18, 2008 at 4:48 PM, Peter Wehrfritz <[EMAIL PROTECTED]> > wrote: > >> Sevcsik András schrieb: >> >>> Thanks for the help guys, here's my second version, that deals with >>> show/hide and applies clip_elements_set() to all elements. >>> >>> >> @@ -444,9 +485,12 @@ >> >> 485 evas_object_repeat_events_set(el->grabber, 1); >> 486 evas_object_color_set(el->grabber, 0, 0, 0, 0); >> 487 evas_object_show(el->grabber); >> -447 >> +488 >> 489 el->container = cont; >> -449 evas_object_clip_set(el->obj, cont->clipper); >> +490 >> +491 if (cont->clip_elements) >> +492 evas_object_clip_set(el->obj, cont->clipper); >> +493 I think this should be: if (cont->clip_elemets || >> !evas_object_visible_get(cont->obj)) evas_object_clip_set(el->obj, >> cont->clipper); Besides that looks good to me. > > > You've got a point. I attached the fixed version. > > > > -- > Minden jót, > Sevcsik András > -- Minden jót, Sevcsik András Index: src/lib/esmart_container/Esmart_Container.h === RCS file: /var/cvs/e/e17/libs/esmart/src/lib/esmart_container/Esmart_Container.h,v retrieving revision 1.11 diff -u -r1.11 Esmart_Container.h --- src/lib/esmart_container/Esmart_Container.h 12 Jul 2008 06:40:36 - 1.11 +++ src/lib/esmart_container/Esmart_Container.h 18 Jul 2008 15:59:30 - @@ -147,6 +147,18 @@ EAPI int esmart_container_layout_plugin_set(Evas_Object *container, const char *name); +/*! \brief Set that container should clip elements + * @param container Object + * @param val Boolean value: 1 to clip elements (default), 0 to not + */ +EAPI void esmart_container_clip_elements_set(Evas_Object *container, + unsigned char val); + +/*! \brief Checks that container clips elements or not + * @param container Object + * @return Boolean value: 1 if clip elements, 0 if not + */ +EAPI unsigned char esmart_container_clip_elements_get(Evas_Object *container); #ifdef __cplusplus } Index: src/lib/esmart_container/esmart_container.c === RCS file: /var/cvs/e/e17/libs/esmart/src/lib/esmart_container/esmart_container.c,v retrieving revision 1.17 diff -u -r1.17 esmart_container.c --- src/lib/esmart_container/esmart_container.c 16 Jul 2008 21:37:49 - 1.17 +++ src/lib/esmart_container/esmart_container.c 18 Jul 2008 15:59:30 - @@ -419,6 +419,47 @@ return length; } +EAPI void +esmart_container_clip_elements_set(Evas_Object *container, unsigned char val) +{ + Container *cont; + Evas_List *l; + + cont = _container_fetch(container); + if (val) + evas_object_show(cont->clipper); + else + evas_object_hide(cont->clipper); + cont->clip_elements = val; + + if (val) + { /* Clip all elements */ + for (l = cont->elements; l; l = l->next) + { + Container_Element *el = l->data; + + evas_object_clip_set(el->obj, cont->clipper); + } + } + else + { /* Unclip all elements */ + for (l = cont->elements; l; l = l->next) + { + Container_Element *el = l->data; + + evas_object_clip_unset(el->obj); + } + } +} + +EAPI unsigned char +esmart_container_clip_elements_get(Evas_Object *container) +{ + Container *cont; + + cont = _container_fetch(container); + return cont->clip_elements; +} / internal functions ***/ @@ -435,7 +476,7 @@ el->obj = obj; evas_object_data_set(obj, "Container_Element", el); evas_object_show(obj); - + evas_object_geometry_get(obj, NULL, NULL, &w, &h); el->orig_w = w; el->orig_h = h; @@ -444,9 +485,12 @@ evas_object_repeat_events_set(el->grabber, 1); evas_object_color_set(el->grabber, 0, 0, 0, 0); evas_object_show(el->grabber); - + el->container = cont; - evas_object_clip_set(el->obj, cont->clipper); + + if (cont->clip_elements || !evas_object_visible_get(cont->obj)) + evas_object_clip_set(el->obj, cont->clipper); + evas_object_clip_set(el->grabber, cont->clipper); /* evas_object_layer_set(el->obj, evas_object_layer_get(cont->obj)); @@ -456,6 +500,7 @@ evas_object_stack_above(el->obj, cont->obj); */ evas_object_smart_member_add(el->obj, cont->obj); + evas_object_smart_member_add(el->grabber, cont->obj); evas_object_event_callback_add(el->grabber, EVAS_CALLBACK_MOUSE_DOWN, _cb_element_down, el); Index: src/lib/esmart_container/esmart_container_private.h === RCS file: /var/cvs/e/e17/libs/esmart/src/lib/esmart_container/esmart_container_private.h,v retrieving revision 1.7 diff -u -r1.7 esmart_container_private.h --- src/lib/esmart_container/esmart_container_private.h 12 Jul 2008 06:40:36 - 1.7 +++ src/lib/esmart_container/esmart_container_private.h 18 Jul 2008 1
Re: [E-devel] Esmart container clipping
On Fri, Jul 18, 2008 at 4:48 PM, Peter Wehrfritz <[EMAIL PROTECTED]> wrote: > Sevcsik András schrieb: > >> Thanks for the help guys, here's my second version, that deals with >> show/hide and applies clip_elements_set() to all elements. >> >> > @@ -444,9 +485,12 @@ > > 485 evas_object_repeat_events_set(el->grabber, 1); > 486 evas_object_color_set(el->grabber, 0, 0, 0, 0); > 487 evas_object_show(el->grabber); > -447 > +488 > 489 el->container = cont; > -449 evas_object_clip_set(el->obj, cont->clipper); > +490 > +491 if (cont->clip_elements) > +492 evas_object_clip_set(el->obj, cont->clipper); > +493 I think this should be: if (cont->clip_elemets || > !evas_object_visible_get(cont->obj)) evas_object_clip_set(el->obj, > cont->clipper); Besides that looks good to me. You've got a point. I attached the fixed version. -- Minden jót, Sevcsik András Index: src/lib/esmart_container/Esmart_Container.h === RCS file: /var/cvs/e/e17/libs/esmart/src/lib/esmart_container/Esmart_Container.h,v retrieving revision 1.11 diff -u -r1.11 Esmart_Container.h --- src/lib/esmart_container/Esmart_Container.h 12 Jul 2008 06:40:36 - 1.11 +++ src/lib/esmart_container/Esmart_Container.h 18 Jul 2008 15:01:15 - @@ -147,6 +147,18 @@ EAPI int esmart_container_layout_plugin_set(Evas_Object *container, const char *name); +/*! \brief Set that container should clip elements + * @param container Object + * @param val Boolean value: 1 to clip elements (default), 0 to not + */ +EAPI void esmart_container_clip_elements_set(Evas_Object *container, + unsigned char val); + +/*! \brief Checks that container clips elements or not + * @param container Object + * @return Boolean value: 1 if clip elements, 0 if not + */ +EAPI unsigned char esmart_container_clip_elements_get(Evas_Object *container); #ifdef __cplusplus } Index: src/lib/esmart_container/esmart_container.c === RCS file: /var/cvs/e/e17/libs/esmart/src/lib/esmart_container/esmart_container.c,v retrieving revision 1.16 diff -u -r1.16 esmart_container.c --- src/lib/esmart_container/esmart_container.c 12 Jul 2008 06:40:36 - 1.16 +++ src/lib/esmart_container/esmart_container.c 18 Jul 2008 15:01:16 - @@ -419,6 +419,47 @@ return length; } +EAPI void +esmart_container_clip_elements_set(Evas_Object *container, unsigned char val) +{ + Container *cont; + Evas_List *l; + + cont = _container_fetch(container); + if (val) + evas_object_show(cont->clipper); + else + evas_object_hide(cont->clipper); + cont->clip_elements = val; + + if (val) + { /* Clip all elements */ + for (l = cont->elements; l; l = l->next) + { + Container_Element *el = l->data; + + evas_object_clip_set(el->obj, cont->clipper); + } + } + else + { /* Unclip all elements */ + for (l = cont->elements; l; l = l->next) + { + Container_Element *el = l->data; + + evas_object_clip_unset(el->obj); + } + } +} + +EAPI unsigned char +esmart_container_clip_elements_get(Evas_Object *container) +{ + Container *cont; + + cont = _container_fetch(container); + return cont->clip_elements; +} / internal functions ***/ @@ -435,7 +476,7 @@ el->obj = obj; evas_object_data_set(obj, "Container_Element", el); evas_object_show(obj); - + evas_object_geometry_get(obj, NULL, NULL, &w, &h); el->orig_w = w; el->orig_h = h; @@ -444,9 +485,12 @@ evas_object_repeat_events_set(el->grabber, 1); evas_object_color_set(el->grabber, 0, 0, 0, 0); evas_object_show(el->grabber); - + el->container = cont; - evas_object_clip_set(el->obj, cont->clipper); + + if (cont->clip_elements || !evas_object_visible_get(cont->obj)) + evas_object_clip_set(el->obj, cont->clipper); + evas_object_clip_set(el->grabber, cont->clipper); /* evas_object_layer_set(el->obj, evas_object_layer_get(cont->obj)); @@ -456,6 +500,7 @@ evas_object_stack_above(el->obj, cont->obj); */ evas_object_smart_member_add(el->obj, cont->obj); + evas_object_smart_member_add(el->grabber, cont->obj); evas_object_event_callback_add(el->grabber, EVAS_CALLBACK_MOUSE_DOWN, _cb_element_down, el); Index: src/lib/esmart_container/esmart_container_private.h === RCS file: /var/cvs/e/e17/libs/esmart/src/lib/esmart_container/esmart_container_private.h,v retrieving revision 1.7 diff -u -r1.7 esmart_container_private.h --- src/lib/esmart_container/esmart_container_private.h 12 Jul 2008 06:40:36 - 1.7 +++ src/lib/esmart_container/esmart_container_private.h 18 Jul 2008 15:01:16 - @@ -48,6 +48,9 @@ void *data_order_change; unsigned char changed : 1; + + unsigned char clip_elements : 1; /* decide wether to clip elements to container +
Re: [E-devel] Esmart container clipping
Sevcsik András schrieb: > Thanks for the help guys, here's my second version, that deals with > show/hide and applies clip_elements_set() to all elements. > @@ -444,9 +485,12 @@ 485 evas_object_repeat_events_set(el->grabber, 1); 486 evas_object_color_set(el->grabber, 0, 0, 0, 0); 487 evas_object_show(el->grabber); -447 +488 489 el->container = cont; -449 evas_object_clip_set(el->obj, cont->clipper); +490 +491 if (cont->clip_elements) +492 evas_object_clip_set(el->obj, cont->clipper); +493 I think this should be: if (cont->clip_elemets || !evas_object_visible_get(cont->obj)) evas_object_clip_set(el->obj, cont->clipper); Besides that looks good to me. - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] Esmart container clipping
Thanks for the help guys, here's my second version, that deals with show/hide and applies clip_elements_set() to all elements. On Wed, Jul 16, 2008 at 11:53 PM, Peter Wehrfritz <[EMAIL PROTECTED]> wrote: > Sevcsik András schrieb: > >> I attached a patch for esmart that adds >> esmart_container_clip_elements_set() >> and esmart_container_clip_elements_get(). It's my first patch, so if >> you've >> got any suggestion about anything, don't hesitate to tell :) >> >> > Somethings need to be changed. As Hisham has said, you have of course to > unclip or to clip the children that are already in the container, if you > change the clipping state. Second, you have deal with the hide and show > callbacks. If the container is hidden its elements shouldn't be visible > either. There to ways to do this. 1. You hide the elements, too. 2. you clip > them on the hidden clipper. > I think the second way is better because the user can still hide and show > the element if he wants to, without esmart_container changing this state. > > Peter > > -- Minden jót, Sevcsik András Index: src/lib/esmart_container/Esmart_Container.h === RCS file: /var/cvs/e/e17/libs/esmart/src/lib/esmart_container/Esmart_Container.h,v retrieving revision 1.11 diff -u -r1.11 Esmart_Container.h --- src/lib/esmart_container/Esmart_Container.h 12 Jul 2008 06:40:36 - 1.11 +++ src/lib/esmart_container/Esmart_Container.h 17 Jul 2008 20:48:11 - @@ -147,6 +147,18 @@ EAPI int esmart_container_layout_plugin_set(Evas_Object *container, const char *name); +/*! \brief Set that container should clip elements + * @param container Object + * @param val Boolean value: 1 to clip elements (default), 0 to not + */ +EAPI void esmart_container_clip_elements_set(Evas_Object *container, + unsigned char val); + +/*! \brief Checks that container clips elements or not + * @param container Object + * @return Boolean value: 1 if clip elements, 0 if not + */ +EAPI unsigned char esmart_container_clip_elements_get(Evas_Object *container); #ifdef __cplusplus } Index: src/lib/esmart_container/esmart_container.c === RCS file: /var/cvs/e/e17/libs/esmart/src/lib/esmart_container/esmart_container.c,v retrieving revision 1.16 diff -u -r1.16 esmart_container.c --- src/lib/esmart_container/esmart_container.c 12 Jul 2008 06:40:36 - 1.16 +++ src/lib/esmart_container/esmart_container.c 17 Jul 2008 20:48:11 - @@ -419,6 +419,47 @@ return length; } +EAPI void +esmart_container_clip_elements_set(Evas_Object *container, unsigned char val) +{ + Container *cont; + Evas_List *l; + + cont = _container_fetch(container); + if (val) + evas_object_show(cont->clipper); + else + evas_object_hide(cont->clipper); + cont->clip_elements = val; + + if (val) + { /* Clip all elements */ + for (l = cont->elements; l; l = l->next) + { + Container_Element *el = l->data; + + evas_object_clip_set(el->obj, cont->clipper); + } + } + else + { /* Unclip all elements */ + for (l = cont->elements; l; l = l->next) + { + Container_Element *el = l->data; + + evas_object_clip_unset(el->obj); + } + } +} + +EAPI unsigned char +esmart_container_clip_elements_get(Evas_Object *container) +{ + Container *cont; + + cont = _container_fetch(container); + return cont->clip_elements; +} / internal functions ***/ @@ -435,7 +476,7 @@ el->obj = obj; evas_object_data_set(obj, "Container_Element", el); evas_object_show(obj); - + evas_object_geometry_get(obj, NULL, NULL, &w, &h); el->orig_w = w; el->orig_h = h; @@ -444,9 +485,12 @@ evas_object_repeat_events_set(el->grabber, 1); evas_object_color_set(el->grabber, 0, 0, 0, 0); evas_object_show(el->grabber); - + el->container = cont; - evas_object_clip_set(el->obj, cont->clipper); + + if (cont->clip_elements) + evas_object_clip_set(el->obj, cont->clipper); + evas_object_clip_set(el->grabber, cont->clipper); /* evas_object_layer_set(el->obj, evas_object_layer_get(cont->obj)); @@ -456,6 +500,7 @@ evas_object_stack_above(el->obj, cont->obj); */ evas_object_smart_member_add(el->obj, cont->obj); + evas_object_smart_member_add(el->grabber, cont->obj); evas_object_event_callback_add(el->grabber, EVAS_CALLBACK_MOUSE_DOWN, _cb_element_down, el); Index: src/lib/esmart_container/esmart_container_private.h === RCS file: /var/cvs/e/e17/libs/esmart/src/lib/esmart_container/esmart_container_private.h,v retrieving revision 1.7 diff -u -r1.7 esmart_container_private.h --- src/lib/esmart_container/esmart_container_private.h 12 Jul 2008 06:40:36 - 1.7 +++ src/lib/esmart_container/esmart_container_private.h 17 Jul 2008 20:48:11 - @@ -48,6 +48,9
Re: [E-devel] Esmart container clipping
On Wed, Jul 16, 2008 at 11:53 PM, Peter Wehrfritz <[EMAIL PROTECTED]> wrote: > Sevcsik András schrieb: > >> I attached a patch for esmart that adds >> esmart_container_clip_elements_set() >> and esmart_container_clip_elements_get(). It's my first patch, so if >> you've >> got any suggestion about anything, don't hesitate to tell :) >> >> > Somethings need to be changed. As Hisham has said, you have of course to > unclip or to clip the children that are already in the container, if you > change the clipping state. Second, you have deal with the hide and show > callbacks. If the container is hidden its elements shouldn't be visible > either. There to ways to do this. 1. You hide the elements, too. 2. you clip > them on the hidden clipper. > I think the second way is better because the user can still hide and show > the element if he wants to, without esmart_container changing this state. Thanks, I'll do the modifications you mentioned. > > > Peter > > -- Minden jót, Sevcsik András - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] Esmart container clipping
Sevcsik András schrieb: > I attached a patch for esmart that adds esmart_container_clip_elements_set() > and esmart_container_clip_elements_get(). It's my first patch, so if you've > got any suggestion about anything, don't hesitate to tell :) > Somethings need to be changed. As Hisham has said, you have of course to unclip or to clip the children that are already in the container, if you change the clipping state. Second, you have deal with the hide and show callbacks. If the container is hidden its elements shouldn't be visible either. There to ways to do this. 1. You hide the elements, too. 2. you clip them on the hidden clipper. I think the second way is better because the user can still hide and show the element if he wants to, without esmart_container changing this state. Peter - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] Esmart container clipping
On Wed, Jul 16, 2008 at 9:41 PM, Jose Gonzalez <[EMAIL PROTECTED]> wrote: > Sevcsik András wrote: > > On Wed, Jul 16, 2008 at 9:20 AM, Jose Gonzalez <[EMAIL PROTECTED]> wrote: >> >> >> >>> Sevcsik András wrote: >>> >>> > Hi list, > > What's the purpose of esmart_container.c:442 line? > > evas_object_clip_set(el->obj, cont->clipper); > > > It clips the elements with the container, but I don't see a reason to > do > so. My application needs elements to be able to drawn outside the > container > (toolbar icons wich are zoomed), so I commented out that line and it > works > fine now. Is it possible to modify esmart this way? If you prefer to > make > it > an option (with a function like esmart_container_clip_elements_set(con, > 0/1), i'll write a patch. > > > There are many different types of semantics that a given smart class can give to 'clipping' - the class has a function to define just that. However, for most 'common' applications of smart classes, one sees a standard kind of semantics wherein 'clipping' a smart object is implemented as clipping all of its member objects - either directly or indirectly. The 'indirectly' part comes since some smart classes use a secret clip rect that clips all other member objs to define all sorts of things, like coloring of the smart, visibility, and such. It's a somewhat overloaded function these internal clip rects provide (not sure if esmart container does it this way though). Hence, if one wants to further clip the smart, it'd be implemented by clipping the internal clip rect they have, if one wants to color the smart obj one sets the color of the clip rect, or if one wants to show/hide the smart obj one shows/hides the clip rect (if an object is 'shown' but clipped by a rect which is 'hidden' then that obj will also be hidden). >>> >>> >> Do you say that if clip_elements is set, evas_object_hide(container) won't >> hide elements? That shouldn't be hard to fix. >> >> >> > > I dunno, no idea what "clip_elements" does. Just mentioning how those > 'secret' > clippers are used by some smart classes - for things like that, for > coloring, etc. clip_elements_set() is my modification for esmart. If its set, elements doesn't clip with the container's clipper rectangle. > > > This is one common way that many smart classes define the semantics of "clipping", but you can certainly have others. I believe Gustavo was working on some extension of this that had more flexible such container smart classes. >>>One other very important aspect of the use of these 'secret' clip rect >>> objs used by some smart classes is of course when resizing their smart >>> objects - >>> ie. when the smart objs get resized, the clip rect gets resized to be of >>> the >>> same size, hence making all members be 'clipped' by the smart obj's size. >>> >>>It probably wouldn't be a good idea to change the semantics of esmart >>> containers as that may break a lot of stuff (unless you manage to keep >>> the >>> default >>> behavior as it currently is and just extend), and it really shouldn't be >>> necessary >>> for what you want. >>> >>> >> >> >> The default value of clip_elements is 1, therefore clip_element_set >> doesn't >> used, esmart container behave as usual. >> >> >> >>>You should be able to do what you want either by just letting your >>> container >>> be as large as you want to hold the zoomed-icons, or keep the container >>> the >>> size >>> of the un-zoomed-icons-region and when you do need to zoom them, remove >>> them from >>> the container... or implement your own specialty class to do what you >>> want..? >>> >>> >>> >> >> Of course, I can modify my app to conform, but I think this feature could >> be >> useful for other apps too, which uses toolbars in evas/edje applications >> >> > > > Click for FHA loan, $0 lender fees, low rates & approvals nationwide > > http://thirdpartyoffers.juno.com/TGL2141/fc/Ioyw6i3mItjsEFCu7dKtrc6BDHm0AajMJHBOYLZjrKdHQs4KPSqVmK/ > -- Minden jót, Sevcsik András -- Minden jót, Sevcsik András - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] Esmart container clipping
Sevcsik András wrote: > On Wed, Jul 16, 2008 at 9:20 AM, Jose Gonzalez <[EMAIL PROTECTED]> wrote: > > >>Sevcsik András wrote: >> >>> Hi list, What's the purpose of esmart_container.c:442 line? evas_object_clip_set(el->obj, cont->clipper); It clips the elements with the container, but I don't see a reason to do so. My application needs elements to be able to drawn outside the container (toolbar icons wich are zoomed), so I commented out that line and it works fine now. Is it possible to modify esmart this way? If you prefer to make it an option (with a function like esmart_container_clip_elements_set(con, 0/1), i'll write a patch. >>> There are many different types of semantics that a given smart class >>> can give to 'clipping' - the class has a function to define just that. >>> >>> However, for most 'common' applications of smart classes, one sees >>> a standard kind of semantics wherein 'clipping' a smart object is >>> implemented >>> as clipping all of its member objects - either directly or indirectly. >>> The 'indirectly' part comes since some smart classes use a secret >>> clip >>> rect that clips all other member objs to define all sorts of things, like >>> coloring of the smart, visibility, and such. It's a somewhat overloaded >>> function these internal clip rects provide (not sure if esmart container >>> does it this way though). >>> Hence, if one wants to further clip the smart, it'd be implemented by >>> clipping the internal clip rect they have, if one wants to color the smart >>> obj >>> one sets the color of the clip rect, or if one wants to show/hide the >>> smart obj >>> one shows/hides the clip rect (if an object is 'shown' but clipped by a >>> rect >>> which is 'hidden' then that obj will also be hidden). >>> >> > Do you say that if clip_elements is set, evas_object_hide(container) won't > hide elements? That shouldn't be hard to fix. > > I dunno, no idea what "clip_elements" does. Just mentioning how those 'secret' clippers are used by some smart classes - for things like that, for coloring, etc. >>> This is one common way that many smart classes define the semantics >>> of >>> "clipping", but you can certainly have others. I believe Gustavo was >>> working >>> on some extension of this that had more flexible such container smart >>> classes. >>> >>> >> One other very important aspect of the use of these 'secret' clip rect >> objs used by some smart classes is of course when resizing their smart >> objects - >> ie. when the smart objs get resized, the clip rect gets resized to be of >> the >> same size, hence making all members be 'clipped' by the smart obj's size. >> >> It probably wouldn't be a good idea to change the semantics of esmart >> containers as that may break a lot of stuff (unless you manage to keep the >> default >> behavior as it currently is and just extend), and it really shouldn't be >> necessary >> for what you want. >> > > > The default value of clip_elements is 1, therefore clip_element_set doesn't > used, esmart container behave as usual. > > >> You should be able to do what you want either by just letting your >> container >> be as large as you want to hold the zoomed-icons, or keep the container the >> size >> of the un-zoomed-icons-region and when you do need to zoom them, remove >> them from >> the container... or implement your own specialty class to do what you >> want..? >> >> > > Of course, I can modify my app to conform, but I think this feature could be > useful for other apps too, which uses toolbars in evas/edje applications > Click for FHA loan, $0 lender fees, low rates & approvals nationwide http://thirdpartyoffers.juno.com/TGL2141/fc/Ioyw6i3mItjsEFCu7dKtrc6BDHm0AajMJHBOYLZjrKdHQs4KPSqVmK/ - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] Esmart container clipping
On Wed, Jul 16, 2008 at 9:20 AM, Jose Gonzalez <[EMAIL PROTECTED]> wrote: > >Sevcsik András wrote: >> >> >>> Hi list, >>> >>> What's the purpose of esmart_container.c:442 line? >>> >>> evas_object_clip_set(el->obj, cont->clipper); >>> >>> >>> It clips the elements with the container, but I don't see a reason to do >>> so. My application needs elements to be able to drawn outside the >>> container >>> (toolbar icons wich are zoomed), so I commented out that line and it >>> works >>> fine now. Is it possible to modify esmart this way? If you prefer to make >>> it >>> an option (with a function like esmart_container_clip_elements_set(con, >>> 0/1), i'll write a patch. >>> >>> >> >> There are many different types of semantics that a given smart class >> can give to 'clipping' - the class has a function to define just that. >> >> However, for most 'common' applications of smart classes, one sees >> a standard kind of semantics wherein 'clipping' a smart object is >> implemented >> as clipping all of its member objects - either directly or indirectly. >> The 'indirectly' part comes since some smart classes use a secret >> clip >> rect that clips all other member objs to define all sorts of things, like >> coloring of the smart, visibility, and such. It's a somewhat overloaded >> function these internal clip rects provide (not sure if esmart container >> does it this way though). >> Hence, if one wants to further clip the smart, it'd be implemented by >> clipping the internal clip rect they have, if one wants to color the smart >> obj >> one sets the color of the clip rect, or if one wants to show/hide the >> smart obj >> one shows/hides the clip rect (if an object is 'shown' but clipped by a >> rect >> which is 'hidden' then that obj will also be hidden). > > Do you say that if clip_elements is set, evas_object_hide(container) won't hide elements? That shouldn't be hard to fix. > >> >> This is one common way that many smart classes define the semantics >> of >> "clipping", but you can certainly have others. I believe Gustavo was >> working >> on some extension of this that had more flexible such container smart >> classes. >> >> > One other very important aspect of the use of these 'secret' clip rect > objs used by some smart classes is of course when resizing their smart > objects - > ie. when the smart objs get resized, the clip rect gets resized to be of > the > same size, hence making all members be 'clipped' by the smart obj's size. > > It probably wouldn't be a good idea to change the semantics of esmart > containers as that may break a lot of stuff (unless you manage to keep the > default > behavior as it currently is and just extend), and it really shouldn't be > necessary > for what you want. The default value of clip_elements is 1, therefore clip_element_set doesn't used, esmart container behave as usual. > > You should be able to do what you want either by just letting your > container > be as large as you want to hold the zoomed-icons, or keep the container the > size > of the un-zoomed-icons-region and when you do need to zoom them, remove > them from > the container... or implement your own specialty class to do what you > want..? > Of course, I can modify my app to conform, but I think this feature could be useful for other apps too, which uses toolbars in evas/edje applications. > > > > Summer Spa Sweepstakes > Enter for your chance to WIN a Summer Spa Vacation! > > http://thirdpartyoffers.juno.com/TGL2141/fc/JKFkuJi7UbfNz8VIYtEkVCKFPBhd8IVHeJ0109LwaW4xGoJhtvjjCC/ > -- Minden jót, Sevcsik András - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] Esmart container clipping
>Sevcsik András wrote: > >> Hi list, >> >> What's the purpose of esmart_container.c:442 line? >> >> evas_object_clip_set(el->obj, cont->clipper); >> >> >> It clips the elements with the container, but I don't see a reason to do >> so. My application needs elements to be able to drawn outside the container >> (toolbar icons wich are zoomed), so I commented out that line and it works >> fine now. Is it possible to modify esmart this way? If you prefer to make it >> an option (with a function like esmart_container_clip_elements_set(con, >> 0/1), i'll write a patch. >> >> > > There are many different types of semantics that a given smart class > can give to 'clipping' - the class has a function to define just that. > > However, for most 'common' applications of smart classes, one sees > a standard kind of semantics wherein 'clipping' a smart object is implemented > as clipping all of its member objects - either directly or indirectly. > The 'indirectly' part comes since some smart classes use a secret clip > rect that clips all other member objs to define all sorts of things, like > coloring of the smart, visibility, and such. It's a somewhat overloaded > function these internal clip rects provide (not sure if esmart container > does it this way though). > Hence, if one wants to further clip the smart, it'd be implemented by > clipping the internal clip rect they have, if one wants to color the smart obj > one sets the color of the clip rect, or if one wants to show/hide the smart > obj > one shows/hides the clip rect (if an object is 'shown' but clipped by a rect > which is 'hidden' then that obj will also be hidden). > > This is one common way that many smart classes define the semantics of > "clipping", but you can certainly have others. I believe Gustavo was working > on some extension of this that had more flexible such container smart classes. > One other very important aspect of the use of these 'secret' clip rect objs used by some smart classes is of course when resizing their smart objects - ie. when the smart objs get resized, the clip rect gets resized to be of the same size, hence making all members be 'clipped' by the smart obj's size. It probably wouldn't be a good idea to change the semantics of esmart containers as that may break a lot of stuff (unless you manage to keep the default behavior as it currently is and just extend), and it really shouldn't be necessary for what you want. You should be able to do what you want either by just letting your container be as large as you want to hold the zoomed-icons, or keep the container the size of the un-zoomed-icons-region and when you do need to zoom them, remove them from the container... or implement your own specialty class to do what you want..? Summer Spa Sweepstakes Enter for your chance to WIN a Summer Spa Vacation! http://thirdpartyoffers.juno.com/TGL2141/fc/JKFkuJi7UbfNz8VIYtEkVCKFPBhd8IVHeJ0109LwaW4xGoJhtvjjCC/ - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] Esmart container clipping
Sevcsik András wrote: > Hi list, > > What's the purpose of esmart_container.c:442 line? > > evas_object_clip_set(el->obj, cont->clipper); > > > It clips the elements with the container, but I don't see a reason to do > so. My application needs elements to be able to drawn outside the container > (toolbar icons wich are zoomed), so I commented out that line and it works > fine now. Is it possible to modify esmart this way? If you prefer to make it > an option (with a function like esmart_container_clip_elements_set(con, > 0/1), i'll write a patch. > There are many different types of semantics that a given smart class can give to 'clipping' - the class has a function to define just that. However, for most 'common' applications of smart classes, one sees a standard kind of semantics wherein 'clipping' a smart object is implemented as clipping all of its member objects - either directly or indirectly. The 'indirectly' part comes since some smart classes use a secret clip rect that clips all other member objs to define all sorts of things, like coloring of the smart, visibility, and such. It's a somewhat overloaded function these internal clip rects provide (not sure if esmart container does it this way though). Hence, if one wants to further clip the smart, it'd be implemented by clipping the internal clip rect they have, if one wants to color the smart obj one sets the color of the clip rect, or if one wants to show/hide the smart obj one shows/hides the clip rect (if an object is 'shown' but clipped by a rect which is 'hidden' then that obj will also be hidden). This is one common way that many smart classes define the semantics of "clipping", but you can certainly have others. I believe Gustavo was working on some extension of this that had more flexible such container smart classes. Summer Spa Sweepstakes Enter for your chance to WIN a Summer Spa Vacation! http://thirdpartyoffers.juno.com/TGL2141/fc/JKFkuJi7UbfR3nhx4CkSfACwnfQE917Ckfx7QvL4deXaqXI9mJZQ7w/ - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] Esmart container clipping
On Tue, Jul 15, 2008 at 10:04 PM, Sevcsik András <[EMAIL PROTECTED]> wrote: > I attached a patch for esmart that adds esmart_container_clip_elements_set() > and esmart_container_clip_elements_get(). It's my first patch, so if you've > got any suggestion about anything, don't hesitate to tell :) Not sure if this applies as I didnt look at esmart's code thoroughly, but perhaps we want to clip child objects when we call esmart_container_clip_elements_set() as opposed to simply showing the clip? -- Hisham Mardam Bey http://hisham.cc/ - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
Re: [E-devel] Esmart container clipping
I attached a patch for esmart that adds esmart_container_clip_elements_set() and esmart_container_clip_elements_get(). It's my first patch, so if you've got any suggestion about anything, don't hesitate to tell :) On Wed, Jul 16, 2008 at 12:18 AM, Sevcsik András <[EMAIL PROTECTED]> wrote: > Forgot to cc the list again, sorry :( > > > On Tue, Jul 15, 2008 at 11:34 PM, Peter Wehrfritz <[EMAIL PROTECTED]> > wrote: > >> Sevcsik András schrieb: >> >> Hi list, >>> >>> What's the purpose of esmart_container.c:442 line? >>> >>> evas_object_clip_set(el->obj, cont->clipper); >>> >>> >>> It clips the elements with the container, but I don't see a reason to do >>> so. My application needs elements to be able to drawn outside the >>> container >>> (toolbar icons wich are zoomed), so I commented out that line and it >>> works >>> fine now. Is it possible to modify esmart this way? If you prefer to make >>> it >>> an option (with a function like esmart_container_clip_elements_set(con, >>> 0/1), i'll write a patch. >>> >>> >> esmart_container can be used as a scrollpane (it doesn't provide >> scrollbars that's up the app). So the size of the viewport, i.e. the size >> of the evas object can be smaller then the size needed to show the full >> content. Hence you need a clipper to only show the objects areas inside of >> the viewport. Making it optional is, imho, a good idea. Remember to also >> hide the clipper if you don't use it. > > > Thanks for the explanation. I'll try to make a patch, then. > > >> >> >> Peter >> >> > > > -- > Minden jót, > Sevcsik András > > > > -- > Minden jót, > Sevcsik András > -- Minden jót, Sevcsik András Index: src/lib/esmart_container/Esmart_Container.h === RCS file: /var/cvs/e/e17/libs/esmart/src/lib/esmart_container/Esmart_Container.h,v retrieving revision 1.11 diff -u -r1.11 Esmart_Container.h --- src/lib/esmart_container/Esmart_Container.h 12 Jul 2008 06:40:36 - 1.11 +++ src/lib/esmart_container/Esmart_Container.h 16 Jul 2008 02:00:36 - @@ -147,6 +147,18 @@ EAPI int esmart_container_layout_plugin_set(Evas_Object *container, const char *name); +/*! \brief Set that container should clip elements + * @param container Object + * @param val Boolean value: 1 to clip elements (default), 0 to not + */ +EAPI void esmart_container_clip_elements_set(Evas_Object *container, + unsigned char val); + +/*! \brief Checks that container clips elements or not + * @param container Object + * @return Boolean value: 1 if clip elements, 0 if not + */ +EAPI unsigned char esmart_container_clip_elements_get(Evas_Object *container); #ifdef __cplusplus } Index: src/lib/esmart_container/esmart_container.c === RCS file: /var/cvs/e/e17/libs/esmart/src/lib/esmart_container/esmart_container.c,v retrieving revision 1.16 diff -u -r1.16 esmart_container.c --- src/lib/esmart_container/esmart_container.c 12 Jul 2008 06:40:36 - 1.16 +++ src/lib/esmart_container/esmart_container.c 16 Jul 2008 02:00:36 - @@ -419,6 +419,27 @@ return length; } +EAPI void +esmart_container_clip_elements_set(Evas_Object *container, unsigned char val) +{ + Container *cont; + + cont = _container_fetch(container); + if (val) + evas_object_show(cont->clipper); + else + evas_object_hide(cont->clipper); + cont->clip_elements = val; +} + +EAPI unsigned char +esmart_container_clip_elements_get(Evas_Object *container) +{ + Container *cont; + + cont = _container_fetch(container); + return cont->clip_elements; +} / internal functions ***/ @@ -435,7 +456,7 @@ el->obj = obj; evas_object_data_set(obj, "Container_Element", el); evas_object_show(obj); - + evas_object_geometry_get(obj, NULL, NULL, &w, &h); el->orig_w = w; el->orig_h = h; @@ -444,9 +465,12 @@ evas_object_repeat_events_set(el->grabber, 1); evas_object_color_set(el->grabber, 0, 0, 0, 0); evas_object_show(el->grabber); - + el->container = cont; - evas_object_clip_set(el->obj, cont->clipper); + + if (cont->clip_elements) + evas_object_clip_set(el->obj, cont->clipper); + evas_object_clip_set(el->grabber, cont->clipper); /* evas_object_layer_set(el->obj, evas_object_layer_get(cont->obj)); @@ -456,6 +480,7 @@ evas_object_stack_above(el->obj, cont->obj); */ evas_object_smart_member_add(el->obj, cont->obj); + evas_object_smart_member_add(el->grabber, cont->obj); evas_object_event_callback_add(el->grabber, EVAS_CALLBACK_MOUSE_DOWN, _cb_element_down, el); Index: src/lib/esmart_container/esmart_container_private.h === RCS file: /var/cvs/e/e17/libs/esmart/src/lib/esmart_container/esmart_container_private.h,v retrieving revision 1.7 diff -u -r1.7 esmart_container_private.h --- src/lib/esmart_container/esmart_container_
Re: [E-devel] Esmart container clipping
Sevcsik András schrieb: > Hi list, > > What's the purpose of esmart_container.c:442 line? > > evas_object_clip_set(el->obj, cont->clipper); > > > It clips the elements with the container, but I don't see a reason to do > so. My application needs elements to be able to drawn outside the container > (toolbar icons wich are zoomed), so I commented out that line and it works > fine now. Is it possible to modify esmart this way? If you prefer to make it > an option (with a function like esmart_container_clip_elements_set(con, > 0/1), i'll write a patch. > esmart_container can be used as a scrollpane (it doesn't provide scrollbars that's up the app). So the size of the viewport, i.e. the size of the evas object can be smaller then the size needed to show the full content. Hence you need a clipper to only show the objects areas inside of the viewport. Making it optional is, imho, a good idea. Remember to also hide the clipper if you don't use it. Peter - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
[E-devel] Esmart container clipping
Hi list, What's the purpose of esmart_container.c:442 line? evas_object_clip_set(el->obj, cont->clipper); It clips the elements with the container, but I don't see a reason to do so. My application needs elements to be able to drawn outside the container (toolbar icons wich are zoomed), so I commented out that line and it works fine now. Is it possible to modify esmart this way? If you prefer to make it an option (with a function like esmart_container_clip_elements_set(con, 0/1), i'll write a patch. -- Minden jót, Sevcsik András - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel