Enlightenment CVS committal
Author : rbdpngn
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src
Modified Files:
ewl_notebook.c ewl_notebook.h ewl_misc.c
Log Message:
* Automatically cleanup after notebook tabs when the page is reparented.
* More aggressive freezing and thawing of the evas and edje events. Holler if
this breaks your app.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_notebook.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -3 -r1.51 -r1.52
--- ewl_notebook.c 23 Aug 2004 00:32:36 -0000 1.51
+++ ewl_notebook.c 1 Sep 2004 05:19:59 -0000 1.52
@@ -106,14 +106,17 @@
b = ewl_button_new(NULL);
if (t)
ewl_container_child_append(EWL_CONTAINER(b), t);
- ewl_callback_append(b, EWL_CALLBACK_CLICKED, ewl_notebook_tab_click_cb,
- p);
+ ewl_callback_append(b, EWL_CALLBACK_CLICKED,
+ ewl_notebook_tab_click_cb, p);
ewl_widget_show(b);
ewl_container_child_append(EWL_CONTAINER(n->tab_box), b);
ewl_container_child_append(EWL_CONTAINER(w), p);
ewl_widget_data_set(p, n, b);
+ ewl_callback_append(p, EWL_CALLBACK_REPARENT,
+ ewl_notebook_page_reparent_cb, n);
+
if (!n->visible_page)
n->visible_page = p;
@@ -143,14 +146,17 @@
b = ewl_button_new(NULL);
if (t)
ewl_container_child_append(EWL_CONTAINER(b), t);
- ewl_callback_append(b, EWL_CALLBACK_CLICKED, ewl_notebook_tab_click_cb,
- p);
+ ewl_callback_append(b, EWL_CALLBACK_CLICKED,
+ ewl_notebook_tab_click_cb, p);
ewl_widget_show(b);
ewl_container_child_prepend(EWL_CONTAINER(n->tab_box), b);
ewl_container_child_prepend(EWL_CONTAINER(w), p);
ewl_widget_data_set(p, n, b);
+ ewl_callback_append(p, EWL_CALLBACK_REPARENT,
+ ewl_notebook_page_reparent_cb, n);
+
if (!n->visible_page)
n->visible_page = p;
@@ -183,14 +189,17 @@
b = ewl_button_new(NULL);
if (t)
ewl_container_child_append(EWL_CONTAINER(b), t);
- ewl_callback_append(b, EWL_CALLBACK_CLICKED, ewl_notebook_tab_click_cb,
- p);
+ ewl_callback_append(b, EWL_CALLBACK_CLICKED,
+ ewl_notebook_tab_click_cb, p);
ewl_widget_show(b);
ewl_container_child_insert(EWL_CONTAINER(n->tab_box), b, pos);
ewl_container_child_insert(EWL_CONTAINER(w), p, pos);
ewl_widget_data_set(p, n, b);
+ ewl_callback_append(p, EWL_CALLBACK_REPARENT,
+ ewl_notebook_page_reparent_cb, n);
+
if (!n->visible_page)
n->visible_page = p;
@@ -576,7 +585,8 @@
c = EWL_CONTAINER(n);
- if (!ecore_list_nodes(c->children) || t > ecore_list_nodes(c->children))
+ if (!c->children || !ecore_list_nodes(c->children)
+ || t > ecore_list_nodes(c->children))
DRETURN(DLEVEL_STABLE);
i = 0;
@@ -860,3 +870,32 @@
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
+
+void
+ewl_notebook_page_reparent_cb(Ewl_Widget *w, void *ev_data, void *user_data)
+{
+ Ewl_Notebook *n = NULL;
+ Ewl_Widget *tab = NULL;
+
+ DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR("w", w);
+ DCHECK_PARAM_PTR("user_data", user_data);
+
+ n = EWL_NOTEBOOK(user_data);
+
+ if (EWL_WIDGET(ev_data) == EWL_WIDGET(n))
+ DRETURN(DLEVEL_STABLE);
+
+ tab = ewl_widget_data_get(w, n);
+ if (tab)
+ ewl_widget_destroy(tab);
+
+ if (n->visible_page == w) {
+ n->visible_page = NULL;
+ ewl_notebook_visible_page_set(n, 1);
+ }
+
+ DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_notebook.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- ewl_notebook.h 23 Aug 2004 00:32:36 -0000 1.21
+++ ewl_notebook.h 1 Sep 2004 05:20:06 -0000 1.22
@@ -61,6 +61,8 @@
void *user_data);
void ewl_notebook_configure_right_cb(Ewl_Widget * w, void *ev_data,
void *user_data);
+void ewl_notebook_page_reparent_cb(Ewl_Widget *w, void *ev_data,
+ void *user_data);
void ewl_notebook_child_show_cb(Ewl_Container *c, Ewl_Widget *w);
void ewl_notebook_child_resize_cb(Ewl_Container *c, Ewl_Widget *w,
int size, Ewl_Orientation o);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_misc.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -3 -r1.82 -r1.83
--- ewl_misc.c 25 Aug 2004 05:05:44 -0000 1.82
+++ ewl_misc.c 1 Sep 2004 05:20:06 -0000 1.83
@@ -272,8 +272,6 @@
evas_event_freeze(emb->evas);
}
- edje_freeze();
-
if (!ecore_list_is_empty(configure_list))
ewl_configure_queue();
@@ -287,9 +285,12 @@
if (REALIZED(emb) && emb->evas) {
evas_event_thaw(emb->evas);
evas_render(emb->evas);
+ evas_event_freeze(emb->evas);
}
}
+ edje_freeze();
+
DRETURN_INT(TRUE, DLEVEL_STABLE);
data = NULL;
}
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs