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 -0000 1.11
+++ src/lib/esmart_container/Esmart_Container.h 16 Jul 2008 02:00:36 -0000
@@ -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 -0000 1.16
+++ src/lib/esmart_container/esmart_container.c 16 Jul 2008 02:00:36 -0000
@@ -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_private.h 12 Jul 2008 06:40:36 -0000 1.7
+++ src/lib/esmart_container/esmart_container_private.h 16 Jul 2008 02:00:36 -0000
@@ -48,6 +48,9 @@
void *data_order_change;
unsigned char changed : 1;
+
+ unsigned char clip_elements : 1; /* decide wether to clip elements to container
+ or not */
};
struct _Container_Element
-------------------------------------------------------------------------
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